chatgui: пути db и лога относительные в конфиге, резолв к бинарнику в рантайме
This commit is contained in:
1 parent
654202b0cb
commit
d092f649ac
2 files changed
+1
-11
No files matched your search
@@ -130,22 +130,14 @@ int main(int argc, char *argv[]) {
|
||||
if (!QDir::isAbsolutePath(dbPath))
|
||||
dbPath = QCoreApplication::applicationDirPath() + "/" + dbPath;
|
||||
QDir(dbPath).mkpath(".");
|
||||
if (cfg.dbPath() != dbPath) {
|
||||
cfg.setDbPath(dbPath);
|
||||
cfg.save();
|
||||
}
|
||||
|
||||
QString debugFile = cfg.debugFile();
|
||||
if (debugFile.isEmpty()) debugFile = "chatgui.log";
|
||||
if (!QDir::isAbsolutePath(debugFile))
|
||||
debugFile = QCoreApplication::applicationDirPath() + "/" + debugFile;
|
||||
if (cfg.debugFile() != debugFile) {
|
||||
cfg.setDebugFile(debugFile);
|
||||
cfg.save();
|
||||
}
|
||||
|
||||
DbManager db;
|
||||
MainWindow w(nullptr, &db, cfgPath, dbPath, cfg.debugFile(),
|
||||
MainWindow w(nullptr, &db, cfgPath, dbPath, debugFile,
|
||||
cfg.debugLevel(), cfg.debugCategories());
|
||||
w.show();
|
||||
|
||||
|
||||
Reference in new issue
Block a user