mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Do not search for folder twice
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
6c548145a2
commit
89d3022649
1 changed files with 4 additions and 6 deletions
|
@ -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();
|
||||
}
|
||||
} 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.
|
||||
|
|
Loading…
Reference in a new issue