diff --git a/CHANGELOG.md b/CHANGELOG.md
index aac8d0ab99..161f7290ba 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,9 @@
# QOwnNotes Changelog
## 22.9.0
-- the settings dialog opening time was improved a bit (for [#2574](https://github.com/pbek/QOwnNotes/issues/2574), thank you, @Waqar144)
+- the settings dialog opening time was improved a lot (for [#2574](https://github.com/pbek/QOwnNotes/issues/2574), thank you, @Waqar144)
+- you can now specify file patterns of note files to ignore as regular expressions
+ in the *Panels settings* (for [#2580](https://github.com/pbek/QOwnNotes/issues/2580))
## 22.8.4
- there now is a new scripting command `mainWindow.removeNoteTab(index)` to
diff --git a/src/dialogs/settingsdialog.cpp b/src/dialogs/settingsdialog.cpp
index a48d71fff4..c6bf403325 100644
--- a/src/dialogs/settingsdialog.cpp
+++ b/src/dialogs/settingsdialog.cpp
@@ -1033,6 +1033,10 @@ void SettingsDialog::storePanelSettings() {
settings.setValue(QStringLiteral("ignoreNoteSubFolders"),
ui->ignoreNoteSubFoldersLineEdit->text());
+ const QSignalBlocker blocker2(ui->ignoredNoteFilesLineEdit);
+ settings.setValue(QStringLiteral("ignoredNoteFiles"),
+ ui->ignoredNoteFilesLineEdit->text());
+
// Tags Panel Options
settings.setValue(QStringLiteral("tagsPanelHideSearch"),
ui->tagsPanelHideSearchCheckBox->isChecked());
@@ -1653,6 +1657,9 @@ void SettingsDialog::readPanelSettings() {
IGNORED_NOTE_SUBFOLDERS_DEFAULT)
.toString());
+ ui->ignoredNoteFilesLineEdit->setText(
+ settings.value(QStringLiteral("ignoredNoteFiles")).toString());
+
// Navigation Panel Options
ui->navigationPanelHideSearchCheckBox->setChecked(
settings.value(QStringLiteral("navigationPanelHideSearch")).toBool());
diff --git a/src/dialogs/settingsdialog.ui b/src/dialogs/settingsdialog.ui
index 14ab524c64..35f77b3b1e 100644
--- a/src/dialogs/settingsdialog.ui
+++ b/src/dialogs/settingsdialog.ui
@@ -5632,13 +5632,6 @@ git config --global user.name "Your name"
Note list panel
-
-
-
- Show notes in the note list with preview
-
-
-
@@ -5653,7 +5646,14 @@ git config --global user.name "Your name"
-
+
+
+
+ Show notes in the note list with preview
+
+
+
+ Sort
@@ -5676,7 +5676,14 @@ git config --global user.name "Your name"
-
+
+
+
+ Instead of a note list use a note tree with all the subfolders (if they are turned on for the note folder)
+
+
+
+ true
@@ -5705,11 +5712,26 @@ git config --global user.name "Your name"
-
-
-
- Instead of a note list use a note tree with all the subfolders (if they are turned on for the note folder)
+
+
+
+ Regular expressions of note subfolders to ignore, separated by ";"
+
+ Ignored note files
+
+
+
+
+
+ Regular expressions of note files to ignore, separated by ";"
+
+
+ true
+
+
+
+
@@ -6904,8 +6926,8 @@ Just test yourself if you get sync conflicts and set a higher value if so.enableSocketServerCheckBox
-
+
diff --git a/src/entities/note.cpp b/src/entities/note.cpp
index 6a3533a776..bc41966e23 100644
--- a/src/entities/note.cpp
+++ b/src/entities/note.cpp
@@ -4156,6 +4156,30 @@ QStringList Note::getHeadingList() {
return headingList;
}
+bool Note::applyIgnoredNotesSetting(QStringList& fileNames) {
+ const QSettings settings;
+ const QStringList ignoredFileRegExpList =
+ settings.value(QStringLiteral("ignoredNoteFiles")).toString()
+ .split(QLatin1Char(';'));
+
+ if (ignoredFileRegExpList.isEmpty()) {
+ return false;
+ }
+
+ auto newFileNames = QStringList();
+
+ for (const QString &fileName : fileNames) {
+ if (!Utils::Misc::regExpInListMatches(fileName,
+ ignoredFileRegExpList)) {
+ newFileNames.append(fileName);
+ }
+ }
+
+ fileNames = newFileNames;
+
+ return true;
+}
+
/**
* Fetches all tags of the note
*/
diff --git a/src/entities/note.h b/src/entities/note.h
index adcdbab127..ce0d4810d5 100644
--- a/src/entities/note.h
+++ b/src/entities/note.h
@@ -378,6 +378,8 @@ class Note {
QStringList getHeadingList();
+ static bool applyIgnoredNotesSetting(QStringList& fileNames);
+
protected:
int _id;
int _noteSubFolderId;
diff --git a/src/languages/QOwnNotes_en.ts b/src/languages/QOwnNotes_en.ts
index 7a2c58f194..df79ff4207 100644
--- a/src/languages/QOwnNotes_en.ts
+++ b/src/languages/QOwnNotes_en.ts
@@ -2049,7 +2049,7 @@
-
+
@@ -2165,7 +2165,7 @@
-
+
@@ -2215,7 +2215,7 @@
-
+
@@ -2604,7 +2604,7 @@
-
+
@@ -2672,7 +2672,7 @@
-
+
@@ -2693,7 +2693,7 @@
-
+
@@ -2776,7 +2776,7 @@
-
+
@@ -3005,10 +3005,10 @@ Restore current note?
-
-
-
-
+
+
+
+
@@ -3151,7 +3151,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3165,7 +3165,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3205,37 +3205,37 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -3243,79 +3243,79 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
@@ -3323,7 +3323,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3331,7 +3331,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3339,209 +3339,209 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
-
+
+
-
+
-
+ Will be shown after the font size is reset by 'Reset note text size'
-
+
-
+
-
+
-
+
-
+
-
+
-
+ to move a tag to the current tag in the tag context menu
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+ full workspace
-
+ minimal workspace
-
+
-
+
-
+ characters
@@ -3550,42 +3550,42 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -3594,7 +3594,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3635,74 +3635,74 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
-
+
-
+
-
+
-
+
@@ -3714,31 +3714,31 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
@@ -3746,13 +3746,13 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
-
+
+
-
+
@@ -3760,7 +3760,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3768,7 +3768,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3776,47 +3776,47 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -3826,22 +3826,22 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
@@ -3857,7 +3857,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -3880,47 +3880,47 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -4046,7 +4046,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -4087,7 +4087,7 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
@@ -4095,61 +4095,61 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
-
+
-
-
-
-
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -4678,17 +4678,17 @@ If the trash is enabled on your ownCloud server you should be able to restore th
-
+
-
+
-
+
@@ -5764,7 +5764,7 @@ Do you want to install it anyway?
-
+
@@ -5786,10 +5786,10 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
-
-
+
+
+
@@ -5810,7 +5810,7 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
+
@@ -6403,20 +6403,20 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
+
-
-
+
+
-
+
@@ -6731,138 +6731,149 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
-
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -6872,176 +6883,176 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+ seconds
-
+
-
+
-
+
-
+
@@ -7068,12 +7079,12 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
+
-
+
@@ -7088,35 +7099,35 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
-
+
+
+
-
-
+
+
@@ -7127,54 +7138,54 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -7600,8 +7611,8 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
-
+
+
@@ -7641,24 +7652,24 @@ Just test yourself if you get sync conflicts and set a higher value if so.
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -7817,132 +7828,132 @@ Connection error message:
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
@@ -7997,26 +8008,26 @@ Connection error message:
-
+
-
+
-
+
-
-
-
+
+
+
@@ -8026,17 +8037,17 @@ Your notes will stay intact!
-
+
-
+
-
+
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 35c8b682cb..89db8de87e 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -3227,6 +3227,7 @@ bool MainWindow::buildNotesIndex(int noteSubFolderId, bool forceRebuild) {
// show the newest entry first
QStringList files = notesDir.entryList(filters, QDir::Files, QDir::Time);
+ Note::applyIgnoredNotesSetting(files);
// qDebug() << __func__ << " - 'files': " << files;
bool createDemoNotes = (files.count() == 0) && !hasNoteSubFolder;