#include #include #include #include #include #include #include "DatabaseManager.h" #include "MainWindow.h" #include "MasterPasswordDialog.h" #include "VaultManager.h" int main(int argc, char *argv[]) { // Must be set before QApplication to ensure QtWebEngineProcess inherits it // Qt WebEngine searches: 1) QTWEBENGINE_DICTIONARIES_PATH 2) // /qtwebengine_dictionaries/ QByteArray dictPath = (QDir::homePath() + "/.local/share/qtwebengine_dictionaries").toUtf8(); setenv("QTWEBENGINE_DICTIONARIES_PATH", dictPath.constData(), 1); setenv("QTWEBENGINE_CHROMIUM_FLAGS", "--enable-spell-checking", 1); QApplication app(argc, argv); QGuiApplication::styleHints()->setColorScheme(Qt::ColorScheme::Dark); if (!DatabaseManager::instance().init()) { return 1; } VaultManager::instance().init(); auto *profile = QWebEngineProfile::defaultProfile(); profile->setSpellCheckLanguages({"en_US"}); profile->setSpellCheckEnabled(true); // Check if vault needs setup or unlock if (!VaultManager::instance().isUnlocked()) { bool setupMode = !VaultManager::instance().isInitialized(); MasterPasswordDialog dlg(setupMode); if (dlg.exec() != QDialog::Accepted) { return 0; // User cancelled } } auto *browser = new MainWindow(); browser->show(); return app.exec(); }