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 1
1
#include " headers/database.h"
2
+ #include < QDebug>
3
+ #include < QDir>
2
4
#include < QSqlDatabase>
3
5
#include < QSql>
4
6
#include < QSqlError>
5
7
#include < QSqlRecord>
6
8
#include < QSqlQuery>
7
- #include < QVector>
8
- #include < QVariant>
9
- #include < QDir>
10
- #include < QDateTime>
11
9
#include < QStandardPaths>
12
10
#include < QString>
11
+ #include < QVector>
12
+ #include < QVariant>
13
13
#include < vector>
14
- #include < QDebug>
15
14
16
15
Database::Database () {
17
16
if (!Database::createConnection ()) {
@@ -30,7 +29,8 @@ Database::Database() {
30
29
}
31
30
32
31
bool Database::createConnection () {
33
- // macos: ~/Library/Application Support/<QuickNote>/ linux: ~/.local/share/QuickNote
32
+ // macos: ~/Library/Application Support/<QuickNote>/
33
+ // linux: ~/.local/share/QuickNote
34
34
QString dbPath = QStandardPaths::standardLocations (QStandardPaths::AppDataLocation).at (0 ) + " /note.db" ;
35
35
#ifdef Q_OS_WIN
36
36
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) {
107
107
}
108
108
109
109
if (!db.recentNoteExists (filePath)) {
110
- qDebug () << db.getRowId (filePath.toStdString ());
111
110
db.insertRecentNote (db.getRowId (filePath.toStdString ()));
112
111
} else {
113
112
db.updateOpenedDate (filePath);
@@ -176,9 +175,8 @@ bool MainWindow::saveFile() {
176
175
}
177
176
} else {
178
177
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);
182
180
}
183
181
184
182
resetFileList ();
@@ -384,9 +382,8 @@ void MainWindow::on_noteText_textChanged() {
384
382
changeCount += 1 ;
385
383
fileSaved = (openedFile) ? (changeCount == 1 ) ? true : false : false ;
386
384
#ifdef Q_OS_DARWIN
387
- if (!fileSaved) {
385
+ if (!fileSaved)
388
386
setWindowModified (true );
389
- }
390
387
#endif
391
388
}
392
389
You can’t perform that action at this time.
0 commit comments