File tree Expand file tree Collapse file tree 2 files changed +9
-12
lines changed
Expand file tree Collapse file tree 2 files changed +9
-12
lines changed Original file line number Diff line number Diff line change 11#include " headers/database.h"
2+ #include < QDebug>
3+ #include < QDir>
24#include < QSqlDatabase>
35#include < QSql>
46#include < QSqlError>
57#include < QSqlRecord>
68#include < QSqlQuery>
7- #include < QVector>
8- #include < QVariant>
9- #include < QDir>
10- #include < QDateTime>
119#include < QStandardPaths>
1210#include < QString>
11+ #include < QVector>
12+ #include < QVariant>
1313#include < vector>
14- #include < QDebug>
1514
1615Database::Database () {
1716 if (!Database::createConnection ()) {
@@ -30,7 +29,8 @@ Database::Database() {
3029}
3130
3231bool Database::createConnection () {
33- // macos: ~/Library/Application Support/<QuickNote>/ linux: ~/.local/share/QuickNote
32+ // macos: ~/Library/Application Support/<QuickNote>/
33+ // linux: ~/.local/share/QuickNote
3434 QString dbPath = QStandardPaths::standardLocations (QStandardPaths::AppDataLocation).at (0 ) + " /note.db" ;
3535 #ifdef Q_OS_WIN
3636 dbPath = QDir::currentPath () + " \\ note.db" ; // windows: PWD
Original file line number Diff line number Diff line change @@ -107,7 +107,6 @@ void MainWindow::openFile(QString &filePath) {
107107 }
108108
109109 if (!db.recentNoteExists (filePath)) {
110- qDebug () << db.getRowId (filePath.toStdString ());
111110 db.insertRecentNote (db.getRowId (filePath.toStdString ()));
112111 } else {
113112 db.updateOpenedDate (filePath);
@@ -176,9 +175,8 @@ bool MainWindow::saveFile() {
176175 }
177176 } else {
178177 db.deleteTags (db.getRowId (fileName.toUtf8 ().constData ()));
179- if (tagArr.size () > 0 ) {
180- db.updateTags (fileName, tagArr);
181- }
178+ if (tagArr.size () > 0 )
179+ db.updateTags (fileName, tagArr);
182180 }
183181
184182 resetFileList ();
@@ -384,9 +382,8 @@ void MainWindow::on_noteText_textChanged() {
384382 changeCount += 1 ;
385383 fileSaved = (openedFile) ? (changeCount == 1 ) ? true : false : false ;
386384 #ifdef Q_OS_DARWIN
387- if (!fileSaved) {
385+ if (!fileSaved)
388386 setWindowModified (true );
389- }
390387 #endif
391388}
392389
You can’t perform that action at this time.
0 commit comments