chatgui: invite link dialogs, zxing-cpp QR code, crypto transport, channel improvements; msg_transport: chat protocol support
This commit is contained in:
1 parent
d8c8c1c5b0
commit
22c24d135e
2206 files changed
+33191
-257
No files matched your search
@@ -1,12 +1,32 @@
|
||||
#include <QApplication>
|
||||
#include <QFile>
|
||||
#include <QDir>
|
||||
#include <QSettings>
|
||||
#include "mainwindow.h"
|
||||
#include "../db/db_manager.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("Chat");
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
MainWindow w;
|
||||
QString cfgPath = QCoreApplication::applicationDirPath() + "/chatgui.cfg";
|
||||
QString dbPath = "chats.db";
|
||||
|
||||
if (QFile::exists(cfgPath)) {
|
||||
QSettings cfg(cfgPath, QSettings::IniFormat);
|
||||
dbPath = cfg.value("db_path", "chats.db").toString();
|
||||
} else {
|
||||
QSettings cfg(cfgPath, QSettings::IniFormat);
|
||||
cfg.setValue("db_path", "chats.db");
|
||||
cfg.sync();
|
||||
}
|
||||
|
||||
if (!QDir::isAbsolutePath(dbPath))
|
||||
dbPath = QCoreApplication::applicationDirPath() + "/" + dbPath;
|
||||
|
||||
DbManager db(dbPath);
|
||||
MainWindow w(nullptr, &db);
|
||||
w.show();
|
||||
|
||||
return app.exec();
|
||||
|
||||
Reference in new issue
Block a user