diff --git a/src/gui/accountsettings.cpp b/src/gui/accountsettings.cpp index 9400cbb88..77aba9dd0 100644 --- a/src/gui/accountsettings.cpp +++ b/src/gui/accountsettings.cpp @@ -433,13 +433,12 @@ void AccountSettings::slotOpenMakeFolderDialog() return; } - const auto fileName = [this, &selected, &classification] { + const auto folder = _model->infoForIndex(selected)->_folder; + Q_ASSERT(folder); + const auto fileName = [selected, classification, folder, this] { QString result; if (classification == FolderStatusModel::RootFolder) { - const auto alias = _model->data(selected, FolderStatusDelegate::FolderAliasRole).toString(); - if (const auto folder = FolderMan::instance()->folder(alias)) { - result = folder->path(); - } + result = folder->path(); } else { result = _model->data(selected, FolderStatusDelegate::FolderPathRole).toString(); } @@ -456,7 +455,6 @@ void AccountSettings::slotOpenMakeFolderDialog() folderCreationDialog->setAttribute(Qt::WA_DeleteOnClose); folderCreationDialog->open(); - const auto folder = _model->infoForIndex(selected)->_folder; #ifdef Q_OS_MAC // The macOS FolderWatcher cannot detect file and folder changes made by the watching process -- us. // So we need to manually invoke the slot that is called by watched folder changes.