Skip to content

Commit

Permalink
#3179 fix: welcome dialog will be shown again
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Dec 20, 2024
1 parent 2a35d13 commit d2f4b09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# QOwnNotes Changelog

## 24.12.4
- The welcome wizard will now be shown again when the application runs for the first time,
this was a regression from 24.12.3 (for [#3179](https://github.com/pbek/QOwnNotes/issues/3179))

## 24.12.3
- If the current note folder doesn't exist anymore during the start of the
application, now the first existing one will be selected (for [#3179](https://github.com/pbek/QOwnNotes/issues/3179))
Expand Down
8 changes: 5 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,10 @@ int mainStartupMisc(const QStringList &arguments) {
DatabaseService::createConnection();
DatabaseService::setupTables();
QDir dir(notesPath);
bool existingNotesPathNotFound = !notesPath.isEmpty() && !dir.exists();

// If this isn't the first run and the note folder doesn't exist anymore look for another one
if (!notesPath.isEmpty() && !dir.exists()) {
if (existingNotesPathNotFound) {
notesPath = QString();

// Loop through all note folders and select the first existing one
Expand All @@ -301,13 +302,14 @@ int mainStartupMisc(const QStringList &arguments) {
if (dir.exists()) {
notesPath = noteFolder.getLocalPath();
noteFolder.setAsCurrent();
existingNotesPathNotFound = false;
break;
}
}
}

// If there was no existing note folder found let the user select another one
if (notesPath.isEmpty()) {
// If there still was no existing note folder found let the user select another one
if (existingNotesPathNotFound) {
if (QMessageBox::question(nullptr, QObject::tr("Note folder not found!"),
QObject::tr("Your note folder <b>%1</b> was not found any more! "
"Do you want to select a new one?")
Expand Down

0 comments on commit d2f4b09

Please sign in to comment.