154class Settings :
public QObject {
166 bool load(QString profile = QStringLiteral(
"default"));
167 bool save(QString profile = QString());
169 static QString xdgUserConfigDir();
170 static const QList<int> & iconSizes(IconType type);
171 static int wallpaperModeFromString(
const QString str);
173 QString profileDir(QString profile,
bool useFallback =
false);
176 QString profileName()
const {
180 bool supportTrash()
const {
181 return supportTrash_;
184 QString fallbackIconThemeName()
const {
185 return fallbackIconThemeName_;
188 bool useFallbackIconTheme()
const {
189 return useFallbackIconTheme_;
192 void setFallbackIconThemeName(QString iconThemeName) {
193 fallbackIconThemeName_ = iconThemeName;
196 bool singleWindowMode()
const {
197 return singleWindowMode_;
200 void setSingleWindowMode(
bool singleWindowMode) {
201 singleWindowMode_ = singleWindowMode;
204 OpenDirTargetType bookmarkOpenMethod() {
205 return bookmarkOpenMethod_;
208 void setBookmarkOpenMethod(OpenDirTargetType bookmarkOpenMethod) {
209 bookmarkOpenMethod_ = bookmarkOpenMethod;
212 QString suCommand()
const {
216 void setSuCommand(QString suCommand) {
217 suCommand_ = suCommand;
223 void setTerminal(QString terminalCommand);
225 QString archiver()
const {
229 void setArchiver(QString archiver) {
230 archiver_ = archiver;
231 Fm::Archiver::setDefaultArchiverByName(archiver_.toLocal8Bit().constData());
234 bool mountOnStartup()
const {
235 return mountOnStartup_;
238 void setMountOnStartup(
bool mountOnStartup) {
239 mountOnStartup_ = mountOnStartup;
242 bool mountRemovable() {
243 return mountRemovable_;
246 void setMountRemovable(
bool mountRemovable) {
247 mountRemovable_ = mountRemovable;
250 bool autoRun()
const {
254 void setAutoRun(
bool autoRun) {
258 bool closeOnUnmount()
const {
259 return closeOnUnmount_;
262 void setCloseOnUnmount(
bool value) {
263 closeOnUnmount_ = value;
266 DesktopWindow::WallpaperMode wallpaperMode()
const {
267 return DesktopWindow::WallpaperMode(wallpaperMode_);
270 void setWallpaperMode(
int wallpaperMode) {
271 wallpaperMode_ = wallpaperMode;
274 QString wallpaper()
const {
278 void setWallpaper(
const QString& wallpaper) {
279 wallpaper_ = wallpaper;
282 QSize wallpaperDialogSize()
const {
283 return wallpaperDialogSize_;
286 void setWallpaperDialogSize(
const QSize& size) {
287 wallpaperDialogSize_ = size;
290 int wallpaperDialogSplitterPos()
const {
291 return wallpaperDialogSplitterPos_;
294 void setWallpaperDialogSplitterPos(
int pos) {
295 wallpaperDialogSplitterPos_ = pos;
298 QString wallpaperDir()
const {
299 return wallpaperDir_;
302 void setLastSlide(QString wallpaper) {
303 lastSlide_ = wallpaper;
306 QString lastSlide()
const {
310 void setWallpaperDir(QString dir) {
314 int slideShowInterval()
const {
315 return slideShowInterval_;
318 void setSlideShowInterval(
int interval) {
319 slideShowInterval_ = interval;
322 bool wallpaperRandomize()
const {
323 return wallpaperRandomize_;
326 void setWallpaperRandomize(
bool randomize) {
327 wallpaperRandomize_ = randomize;
330 bool transformWallpaper()
const {
331 return transformWallpaper_;
334 void setTransformWallpaper(
bool tr) {
335 transformWallpaper_ = tr;
338 bool perScreenWallpaper()
const {
339 return perScreenWallpaper_;
342 void setPerScreenWallpaper(
bool tr) {
343 perScreenWallpaper_ = tr;
346 const QColor& desktopBgColor()
const {
347 return desktopBgColor_;
350 void setDesktopBgColor(QColor desktopBgColor) {
351 desktopBgColor_ = desktopBgColor;
354 const QColor& desktopFgColor()
const {
355 return desktopFgColor_;
358 void setDesktopFgColor(QColor desktopFgColor) {
359 desktopFgColor_ = desktopFgColor;
362 const QColor& desktopShadowColor()
const {
363 return desktopShadowColor_;
366 void setDesktopShadowColor(QColor desktopShadowColor) {
367 desktopShadowColor_ = desktopShadowColor;
370 QFont desktopFont()
const {
374 void setDesktopFont(QFont font) {
378 int desktopIconSize()
const {
379 return desktopIconSize_;
382 void setDesktopIconSize(
int desktopIconSize) {
383 desktopIconSize_ = desktopIconSize;
386 QStringList desktopShortcuts()
const {
387 return desktopShortcuts_;
390 void setDesktopShortcuts(
const QStringList& list) {
391 desktopShortcuts_ = list;
394 bool desktopShowHidden()
const {
395 return desktopShowHidden_;
398 void setDesktopShowHidden(
bool desktopShowHidden) {
399 desktopShowHidden_ = desktopShowHidden;
402 bool desktopHideItems(
const QString& screenName = QString())
const {
403 if(screenName.isEmpty()) {
404 return desktopHideItems_;
406 return desktopHideItemsOnScreens_.value(screenName,
false);
409 void setDesktopHideItems(
bool hide,
const QString& screenName = QString()) {
410 if(screenName.isEmpty()) {
411 desktopHideItems_ = hide;
414 if(!screenNames_.contains(screenName)) {
415 screenNames_ << screenName;
417 desktopHideItemsOnScreens_.insert(screenName, hide);
421 Qt::SortOrder desktopSortOrder()
const {
422 return desktopSortOrder_;
425 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
426 desktopSortOrder_ = desktopSortOrder;
429 Fm::FolderModel::ColumnId desktopSortColumn()
const {
430 return desktopSortColumn_;
433 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
434 desktopSortColumn_ = desktopSortColumn;
437 bool desktopSortFolderFirst()
const {
438 return desktopSortFolderFirst_;
441 void setDesktopSortFolderFirst(
bool desktopFolderFirst) {
442 desktopSortFolderFirst_ = desktopFolderFirst;
445 bool desktopSortHiddenLast()
const {
446 return desktopSortHiddenLast_;
449 void setDesktopSortHiddenLast(
bool desktopHiddenLast) {
450 desktopSortHiddenLast_ = desktopHiddenLast;
453 bool desktopNoTooltip()
const {
454 return desktopNoTooltip_;
457 void setDesktopNoTooltip(
bool noTooltip) {
458 desktopNoTooltip_ = noTooltip;
461 bool alwaysShowTabs()
const {
462 return alwaysShowTabs_;
465 void setAlwaysShowTabs(
bool alwaysShowTabs) {
466 alwaysShowTabs_ = alwaysShowTabs;
469 bool showTabClose()
const {
470 return showTabClose_;
473 void setShowTabClose(
bool showTabClose) {
474 showTabClose_ = showTabClose;
477 bool switchToNewTab()
const {
478 return switchToNewTab_;
481 void setSwitchToNewTab(
bool showTabClose) {
482 switchToNewTab_ = showTabClose;
485 bool reopenLastTabs()
const {
486 return reopenLastTabs_;
489 void setReopenLastTabs(
bool reopenLastTabs) {
490 reopenLastTabs_ = reopenLastTabs;
493 int splitViewTabsNum()
const {
494 return splitViewTabsNum_;
497 void setSplitViewTabsNum(
int n) {
498 splitViewTabsNum_ = n;
501 QStringList tabPaths()
const {
505 void setTabPaths(
const QStringList& tabPaths) {
506 tabPaths_ = tabPaths;
509 bool rememberWindowSize()
const {
510 return rememberWindowSize_;
513 void setRememberWindowSize(
bool rememberWindowSize) {
514 rememberWindowSize_ = rememberWindowSize;
517 int windowWidth()
const {
518 if(rememberWindowSize_) {
519 return lastWindowWidth_;
522 return fixedWindowWidth_;
526 int windowHeight()
const {
527 if(rememberWindowSize_) {
528 return lastWindowHeight_;
531 return fixedWindowHeight_;
535 bool windowMaximized()
const {
536 if(rememberWindowSize_) {
537 return lastWindowMaximized_;
544 int fixedWindowWidth()
const {
545 return fixedWindowWidth_;
548 void setFixedWindowWidth(
int fixedWindowWidth) {
549 fixedWindowWidth_ = fixedWindowWidth;
552 int fixedWindowHeight()
const {
553 return fixedWindowHeight_;
556 void setFixedWindowHeight(
int fixedWindowHeight) {
557 fixedWindowHeight_ = fixedWindowHeight;
560 void setLastWindowWidth(
int lastWindowWidth) {
561 lastWindowWidth_ = lastWindowWidth;
564 void setLastWindowHeight(
int lastWindowHeight) {
565 lastWindowHeight_ = lastWindowHeight;
568 void setLastWindowMaximized(
bool lastWindowMaximized) {
569 lastWindowMaximized_ = lastWindowMaximized;
572 int splitterPos()
const {
576 void setSplitterPos(
int splitterPos) {
577 splitterPos_ = splitterPos;
580 bool isSidePaneVisible()
const {
581 return sidePaneVisible_;
584 void showSidePane(
bool show) {
585 sidePaneVisible_ = show;
588 Fm::SidePane::Mode sidePaneMode()
const {
589 return sidePaneMode_;
592 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
593 sidePaneMode_ = sidePaneMode;
596 bool showMenuBar()
const {
600 void setShowMenuBar(
bool showMenuBar) {
601 showMenuBar_ = showMenuBar;
604 bool splitView()
const {
608 void setSplitView(
bool split) {
612 Fm::FolderView::ViewMode viewMode()
const {
616 void setViewMode(Fm::FolderView::ViewMode viewMode) {
617 viewMode_ = viewMode;
620 bool showHidden()
const {
624 void setShowHidden(
bool showHidden) {
625 showHidden_ = showHidden;
628 bool sortCaseSensitive()
const {
629 return sortCaseSensitive_;
632 void setSortCaseSensitive(
bool value) {
633 sortCaseSensitive_ = value;
636 QSet<QString> getHiddenPlaces()
const {
637 return hiddenPlaces_;
640 void setHiddenPlace(
const QString& str,
bool hide) {
642 hiddenPlaces_ << str;
645 hiddenPlaces_.remove(str);
649 Qt::SortOrder sortOrder()
const {
653 void setSortOrder(Qt::SortOrder sortOrder) {
654 sortOrder_ = sortOrder;
657 Fm::FolderModel::ColumnId sortColumn()
const {
661 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
662 sortColumn_ = sortColumn;
665 bool sortFolderFirst()
const {
666 return sortFolderFirst_;
669 void setSortFolderFirst(
bool folderFirst) {
670 sortFolderFirst_ = folderFirst;
673 bool sortHiddenLast()
const {
674 return sortHiddenLast_;
677 void setSortHiddenLast(
bool hiddenLast) {
678 sortHiddenLast_ = hiddenLast;
681 bool showFilter()
const {
685 void setShowFilter(
bool value) {
689 bool pathBarButtons()
const {
690 return pathBarButtons_;
693 void setPathBarButtons(
bool value) {
694 pathBarButtons_ = value;
698 bool singleClick()
const {
702 void setSingleClick(
bool singleClick) {
703 singleClick_ = singleClick;
706 int autoSelectionDelay()
const {
707 return autoSelectionDelay_;
710 void setAutoSelectionDelay(
int value) {
711 autoSelectionDelay_ = value;
714 bool ctrlRightClick()
const {
715 return ctrlRightClick_;
718 void setCtrlRightClick(
bool value) {
719 ctrlRightClick_ = value;
722 bool useTrash()
const {
729 void setUseTrash(
bool useTrash) {
730 useTrash_ = useTrash;
733 bool confirmDelete()
const {
734 return confirmDelete_;
737 void setConfirmDelete(
bool confirmDelete) {
738 confirmDelete_ = confirmDelete;
741 bool noUsbTrash()
const {
745 void setNoUsbTrash(
bool noUsbTrash) {
746 noUsbTrash_ = noUsbTrash;
747 fm_config->no_usb_trash = noUsbTrash_;
750 bool confirmTrash()
const {
751 return confirmTrash_;
754 void setConfirmTrash(
bool value) {
755 confirmTrash_ = value;
758 bool quickExec()
const {
762 void setQuickExec(
bool value) {
764 fm_config->quick_exec = quickExec_;
767 bool selectNewFiles()
const {
768 return selectNewFiles_;
771 void setSelectNewFiles(
bool value) {
772 selectNewFiles_ = value;
775 int bigIconSize()
const {
779 void setBigIconSize(
int bigIconSize) {
780 bigIconSize_ = bigIconSize;
783 int smallIconSize()
const {
784 return smallIconSize_;
787 void setSmallIconSize(
int smallIconSize) {
788 smallIconSize_ = smallIconSize;
791 int sidePaneIconSize()
const {
792 return sidePaneIconSize_;
795 void setSidePaneIconSize(
int sidePaneIconSize) {
796 sidePaneIconSize_ = sidePaneIconSize;
799 int thumbnailIconSize()
const {
800 return thumbnailIconSize_;
803 QSize folderViewCellMargins()
const {
804 return folderViewCellMargins_;
807 void setFolderViewCellMargins(QSize size) {
808 folderViewCellMargins_ = size;
811 QSize desktopCellMargins()
const {
812 return desktopCellMargins_;
815 void setDesktopCellMargins(QSize size) {
816 desktopCellMargins_ = size;
819 QMargins workAreaMargins()
const {
820 return workAreaMargins_;
823 void setWorkAreaMargins(QMargins margins) {
824 workAreaMargins_ = margins;
827 bool openWithDefaultFileManager()
const {
828 return openWithDefaultFileManager_;
831 void setOpenWithDefaultFileManager(
bool open) {
832 openWithDefaultFileManager_ = open;
835 bool allSticky()
const {
839 void setAllSticky(
bool sticky) {
843 bool showThumbnails() {
844 return showThumbnails_;
847 void setShowThumbnails(
bool show) {
848 showThumbnails_ = show;
851 void setThumbnailLocalFilesOnly(
bool value) {
852 Fm::ThumbnailJob::setLocalFilesOnly(value);
855 bool thumbnailLocalFilesOnly()
const {
856 return Fm::ThumbnailJob::localFilesOnly();
859 int maxThumbnailFileSize()
const {
860 return Fm::ThumbnailJob::maxThumbnailFileSize();
863 void setMaxThumbnailFileSize(
int size) {
864 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
867 int maxExternalThumbnailFileSize()
const {
868 return Fm::ThumbnailJob::maxExternalThumbnailFileSize();
871 void setMaxExternalThumbnailFileSize(
int size) {
872 Fm::ThumbnailJob::setMaxExternalThumbnailFileSize(size);
875 void setThumbnailIconSize(
int thumbnailIconSize) {
876 thumbnailIconSize_ = thumbnailIconSize;
883 void setSiUnit(
bool siUnit) {
886 fm_config->si_unit = (gboolean)siUnit_;
889 bool backupAsHidden()
const {
890 return backupAsHidden_;
893 void setBackupAsHidden(
bool value) {
894 backupAsHidden_ = value;
895 fm_config->backup_as_hidden = backupAsHidden_;
898 bool showFullNames()
const {
899 return showFullNames_;
902 void setShowFullNames(
bool value) {
903 showFullNames_ = value;
906 bool shadowHidden()
const {
907 return shadowHidden_;
910 void setShadowHidden(
bool value) {
911 shadowHidden_ = value;
914 bool noItemTooltip()
const {
915 return noItemTooltip_;
918 void setNoItemTooltip(
bool noTooltip) {
919 noItemTooltip_ = noTooltip;
922 bool scrollPerPixel()
const {
923 return scrollPerPixel_;
926 void setScrollPerPixel(
bool perPixel) {
927 scrollPerPixel_ = perPixel;
930 bool onlyUserTemplates()
const {
931 return onlyUserTemplates_;
934 void setOnlyUserTemplates(
bool value) {
935 onlyUserTemplates_ = value;
936 fm_config->only_user_templates = onlyUserTemplates_;
939 bool templateTypeOnce()
const {
940 return templateTypeOnce_;
943 void setTemplateTypeOnce(
bool value) {
944 templateTypeOnce_ = value;
945 fm_config->template_type_once = templateTypeOnce_;
948 bool templateRunApp()
const {
949 return templateRunApp_;
952 void setTemplateRunApp(
bool value) {
953 templateRunApp_ = value;
954 fm_config->template_run_app = templateRunApp_;
958 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
960 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
962 void clearFolderSettings(
const Fm::FilePath& path)
const;
964 bool searchNameCaseInsensitive()
const {
965 return searchNameCaseInsensitive_;
968 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
969 searchNameCaseInsensitive_ = caseInsensitive;
972 bool searchContentCaseInsensitive()
const {
973 return searchContentCaseInsensitive_;
976 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
977 searchContentCaseInsensitive_ = caseInsensitive;
980 bool searchNameRegexp()
const {
981 return searchNameRegexp_;
984 void setSearchNameRegexp(
bool reg) {
985 searchNameRegexp_ = reg;
988 bool searchContentRegexp()
const {
989 return searchContentRegexp_;
992 void setSearchContentRegexp(
bool reg) {
993 searchContentRegexp_ = reg;
996 bool searchRecursive()
const {
997 return searchRecursive_;
1000 void setSearchRecursive(
bool rec) {
1001 searchRecursive_ = rec;
1004 bool searchhHidden()
const {
1005 return searchhHidden_;
1008 void setSearchhHidden(
bool hidden) {
1009 searchhHidden_ = hidden;
1012 int maxSearchHistory()
const {
1013 return maxSearchHistory_;
1016 void setMaxSearchHistory(
int max);
1018 void clearSearchHistory();
1020 QStringList namePatterns()
const {
1021 return namePatterns_;
1024 void addNamePattern(
const QString& pattern);
1026 QStringList contentPatterns()
const {
1027 return contentPatterns_;
1030 void addContentPattern(
const QString& pattern);
1032 QList<int> getCustomColumnWidths()
const {
1034 for(
auto width : std::as_const(customColumnWidths_)) {
1040 void setCustomColumnWidths(
const QList<int> &widths) {
1041 customColumnWidths_.clear();
1042 for(
auto width : widths) {
1043 customColumnWidths_ << QVariant(width);
1047 QList<int> getHiddenColumns()
const {
1049 for(
auto width : std::as_const(hiddenColumns_)) {
1055 void setHiddenColumns(
const QList<int> &columns) {
1056 hiddenColumns_.clear();
1057 for(
auto column : columns) {
1058 hiddenColumns_ << QVariant(column);
1062 int getRecentFilesNumber()
const {
1063 return recentFilesNumber_;
1065 void setRecentFilesNumber(
int n);
1067 QStringList getRecentFiles()
const {
1068 return recentFiles_;
1070 void clearRecentFiles();
1071 void addRecentFile(
const QString& file);
1073 void loadRecentFiles();
1074 void saveRecentFiles();
1077 bool loadFile(QString filePath);
1078 bool saveFile(QString filePath);
1080 int toIconSize(
int size, IconType type)
const;
1083 QString profileName_;
1087 QString fallbackIconThemeName_;
1088 bool useFallbackIconTheme_;
1090 bool singleWindowMode_;
1091 OpenDirTargetType bookmarkOpenMethod_;
1094 bool mountOnStartup_;
1095 bool mountRemovable_;
1097 bool closeOnUnmount_;
1101 QSize wallpaperDialogSize_;
1102 int wallpaperDialogSplitterPos_;
1104 QString wallpaperDir_;
1105 int slideShowInterval_;
1106 bool wallpaperRandomize_;
1107 bool transformWallpaper_;
1108 bool perScreenWallpaper_;
1109 QColor desktopBgColor_;
1110 QColor desktopFgColor_;
1111 QColor desktopShadowColor_;
1113 int desktopIconSize_;
1114 QStringList desktopShortcuts_;
1116 bool desktopShowHidden_;
1117 bool desktopHideItems_;
1118 QHash<QString, bool> desktopHideItemsOnScreens_;
1119 Qt::SortOrder desktopSortOrder_;
1120 Fm::FolderModel::ColumnId desktopSortColumn_;
1121 bool desktopSortFolderFirst_;
1122 bool desktopSortHiddenLast_;
1123 bool desktopNoTooltip_;
1125 bool alwaysShowTabs_;
1127 bool switchToNewTab_;
1128 bool reopenLastTabs_;
1129 int splitViewTabsNum_;
1130 QStringList tabPaths_;
1131 bool rememberWindowSize_;
1132 int fixedWindowWidth_;
1133 int fixedWindowHeight_;
1134 int lastWindowWidth_;
1135 int lastWindowHeight_;
1136 bool lastWindowMaximized_;
1138 bool sidePaneVisible_;
1139 Fm::SidePane::Mode sidePaneMode_;
1143 Fm::FolderView::ViewMode viewMode_;
1145 Qt::SortOrder sortOrder_;
1146 Fm::FolderModel::ColumnId sortColumn_;
1147 bool sortFolderFirst_;
1148 bool sortHiddenLast_;
1149 bool sortCaseSensitive_;
1151 bool pathBarButtons_;
1155 int autoSelectionDelay_;
1156 bool ctrlRightClick_;
1158 bool confirmDelete_;
1162 bool selectNewFiles_;
1164 bool showThumbnails_;
1168 bool backupAsHidden_;
1169 bool showFullNames_;
1171 bool noItemTooltip_;
1172 bool scrollPerPixel_;
1174 QSet<QString> hiddenPlaces_;
1178 int sidePaneIconSize_;
1179 int thumbnailIconSize_;
1181 bool onlyUserTemplates_;
1182 bool templateTypeOnce_;
1183 bool templateRunApp_;
1185 QSize folderViewCellMargins_;
1186 QSize desktopCellMargins_;
1187 QMargins workAreaMargins_;
1189 bool openWithDefaultFileManager_;
1194 bool searchNameCaseInsensitive_;
1195 bool searchContentCaseInsensitive_;
1196 bool searchNameRegexp_;
1197 bool searchContentRegexp_;
1198 bool searchRecursive_;
1199 bool searchhHidden_;
1200 int maxSearchHistory_;
1201 QStringList namePatterns_;
1202 QStringList contentPatterns_;
1205 QList<QVariant> customColumnWidths_;
1206 QList<QVariant> hiddenColumns_;
1209 int recentFilesNumber_;
1210 QStringList recentFiles_;
1212 QStringList screenNames_;