forked from qt-creator/qt-creator
File System view: Fix persistence of Show Folders on Top
Fixes: QTCREATORBUG-27131 Change-Id: I0252cc2d9f026873c7a6a8e70e457a8d150ca1c5 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -85,6 +85,7 @@ const char kHiddenFilesKey[] = ".HiddenFilesFilter";
|
|||||||
const char kSyncKey[] = ".SyncWithEditor";
|
const char kSyncKey[] = ".SyncWithEditor";
|
||||||
const char kShowBreadCrumbs[] = ".ShowBreadCrumbs";
|
const char kShowBreadCrumbs[] = ".ShowBreadCrumbs";
|
||||||
const char kSyncRootWithEditor[] = ".SyncRootWithEditor";
|
const char kSyncRootWithEditor[] = ".SyncRootWithEditor";
|
||||||
|
const char kShowFoldersOnTop[] = ".ShowFoldersOnTop";
|
||||||
|
|
||||||
const char ADDNEWFILE[] = "QtCreator.FileSystem.AddNewFile";
|
const char ADDNEWFILE[] = "QtCreator.FileSystem.AddNewFile";
|
||||||
const char RENAMEFILE[] = "QtCreator.FileSystem.RenameFile";
|
const char RENAMEFILE[] = "QtCreator.FileSystem.RenameFile";
|
||||||
@@ -834,6 +835,7 @@ const bool kHiddenFilesDefault = false;
|
|||||||
const bool kAutoSyncDefault = true;
|
const bool kAutoSyncDefault = true;
|
||||||
const bool kShowBreadCrumbsDefault = true;
|
const bool kShowBreadCrumbsDefault = true;
|
||||||
const bool kRootAutoSyncDefault = true;
|
const bool kRootAutoSyncDefault = true;
|
||||||
|
const bool kShowFoldersOnTopDefault = true;
|
||||||
|
|
||||||
void FolderNavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings,
|
void FolderNavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings,
|
||||||
int position,
|
int position,
|
||||||
@@ -852,6 +854,9 @@ void FolderNavigationWidgetFactory::saveSettings(Utils::QtcSettings *settings,
|
|||||||
settings->setValueWithDefault(base + kSyncRootWithEditor,
|
settings->setValueWithDefault(base + kSyncRootWithEditor,
|
||||||
fnw->rootAutoSynchronization(),
|
fnw->rootAutoSynchronization(),
|
||||||
kRootAutoSyncDefault);
|
kRootAutoSyncDefault);
|
||||||
|
settings->setValueWithDefault(base + kShowFoldersOnTop,
|
||||||
|
fnw->isShowingFoldersOnTop(),
|
||||||
|
kShowFoldersOnTopDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FolderNavigationWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget)
|
void FolderNavigationWidgetFactory::restoreSettings(QSettings *settings, int position, QWidget *widget)
|
||||||
@@ -865,6 +870,8 @@ void FolderNavigationWidgetFactory::restoreSettings(QSettings *settings, int pos
|
|||||||
settings->value(base + kShowBreadCrumbs, kShowBreadCrumbsDefault).toBool());
|
settings->value(base + kShowBreadCrumbs, kShowBreadCrumbsDefault).toBool());
|
||||||
fnw->setRootAutoSynchronization(
|
fnw->setRootAutoSynchronization(
|
||||||
settings->value(base + kSyncRootWithEditor, kRootAutoSyncDefault).toBool());
|
settings->value(base + kSyncRootWithEditor, kRootAutoSyncDefault).toBool());
|
||||||
|
fnw->setShowFoldersOnTop(
|
||||||
|
settings->value(base + kShowFoldersOnTop, kShowFoldersOnTopDefault).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FolderNavigationWidgetFactory::insertRootDirectory(const RootDirectory &directory)
|
void FolderNavigationWidgetFactory::insertRootDirectory(const RootDirectory &directory)
|
||||||
|
Reference in New Issue
Block a user