Skip to content

Commit 50dcaa4

Browse files
use config for db_file
1 parent d2f7d83 commit 50dcaa4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
database_file: './db/matrix.db'
12
#menu_program: 'rofi -show drun'
23
menu_program: dmenu_run

src/entity.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#include "entity.h"
22
#include "SQLiteCpp/Database.h"
33
#include "persister.h"
4+
#include "Config.h"
45
#include <iostream>
56

67
EntityRegistry::EntityRegistry() {
7-
db = std::make_shared<SQLite::Database>("./db/matrix.db",
8+
9+
auto dbFile = Config::singleton()->get<std::string>("database_file");
10+
db = std::make_shared<SQLite::Database>(dbFile,
811
SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE);
912
}
1013

0 commit comments

Comments
 (0)