]> Nutra Git (v2) - nutratech/gui.git/commitdiff
cubic: handle database init/open logic
authorShane Jaroch <chown_tee@proton.me>
Wed, 21 Jan 2026 19:33:02 +0000 (14:33 -0500)
committerShane Jaroch <chown_tee@proton.me>
Wed, 21 Jan 2026 19:33:09 +0000 (14:33 -0500)
src/db/databasemanager.cpp

index 3d27bed72aae966139262602bb16c834d706354c..95b8ead5fcc71daf9f2423350a45e465a8a0545a 100644 (file)
@@ -73,7 +73,9 @@ QSqlDatabase DatabaseManager::userDatabase() const {
 }
 
 void DatabaseManager::initUserDatabase() {
-    QString path = QDir::homePath() + "/.nutra/nt.sqlite3";
+    QString dirPath = QDir::homePath() + "/.nutra";
+    QDir().mkpath(dirPath);
+    QString path = dirPath + "/nt.sqlite3";
     m_userDb.setDatabaseName(path);
 
     if (!m_userDb.open()) {