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 {
403 return desktopHideItems_;
406 void setDesktopHideItems(
bool hide) {
407 desktopHideItems_ = hide;
410 Qt::SortOrder desktopSortOrder()
const {
411 return desktopSortOrder_;
414 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
415 desktopSortOrder_ = desktopSortOrder;
418 Fm::FolderModel::ColumnId desktopSortColumn()
const {
419 return desktopSortColumn_;
422 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
423 desktopSortColumn_ = desktopSortColumn;
426 bool desktopSortFolderFirst()
const {
427 return desktopSortFolderFirst_;
430 void setDesktopSortFolderFirst(
bool desktopFolderFirst) {
431 desktopSortFolderFirst_ = desktopFolderFirst;
434 bool desktopSortHiddenLast()
const {
435 return desktopSortHiddenLast_;
438 void setDesktopSortHiddenLast(
bool desktopHiddenLast) {
439 desktopSortHiddenLast_ = desktopHiddenLast;
442 bool desktopNoTooltip()
const {
443 return desktopNoTooltip_;
446 void setDesktopNoTooltip(
bool noTooltip) {
447 desktopNoTooltip_ = noTooltip;
450 bool alwaysShowTabs()
const {
451 return alwaysShowTabs_;
454 void setAlwaysShowTabs(
bool alwaysShowTabs) {
455 alwaysShowTabs_ = alwaysShowTabs;
458 bool showTabClose()
const {
459 return showTabClose_;
462 void setShowTabClose(
bool showTabClose) {
463 showTabClose_ = showTabClose;
466 bool switchToNewTab()
const {
467 return switchToNewTab_;
470 void setSwitchToNewTab(
bool showTabClose) {
471 switchToNewTab_ = showTabClose;
474 bool reopenLastTabs()
const {
475 return reopenLastTabs_;
478 void setReopenLastTabs(
bool reopenLastTabs) {
479 reopenLastTabs_ = reopenLastTabs;
482 int splitViewTabsNum()
const {
483 return splitViewTabsNum_;
486 void setSplitViewTabsNum(
int n) {
487 splitViewTabsNum_ = n;
490 QStringList tabPaths()
const {
494 void setTabPaths(
const QStringList& tabPaths) {
495 tabPaths_ = tabPaths;
498 bool rememberWindowSize()
const {
499 return rememberWindowSize_;
502 void setRememberWindowSize(
bool rememberWindowSize) {
503 rememberWindowSize_ = rememberWindowSize;
506 int windowWidth()
const {
507 if(rememberWindowSize_) {
508 return lastWindowWidth_;
511 return fixedWindowWidth_;
515 int windowHeight()
const {
516 if(rememberWindowSize_) {
517 return lastWindowHeight_;
520 return fixedWindowHeight_;
524 bool windowMaximized()
const {
525 if(rememberWindowSize_) {
526 return lastWindowMaximized_;
533 int fixedWindowWidth()
const {
534 return fixedWindowWidth_;
537 void setFixedWindowWidth(
int fixedWindowWidth) {
538 fixedWindowWidth_ = fixedWindowWidth;
541 int fixedWindowHeight()
const {
542 return fixedWindowHeight_;
545 void setFixedWindowHeight(
int fixedWindowHeight) {
546 fixedWindowHeight_ = fixedWindowHeight;
549 void setLastWindowWidth(
int lastWindowWidth) {
550 lastWindowWidth_ = lastWindowWidth;
553 void setLastWindowHeight(
int lastWindowHeight) {
554 lastWindowHeight_ = lastWindowHeight;
557 void setLastWindowMaximized(
bool lastWindowMaximized) {
558 lastWindowMaximized_ = lastWindowMaximized;
561 int splitterPos()
const {
565 void setSplitterPos(
int splitterPos) {
566 splitterPos_ = splitterPos;
569 bool isSidePaneVisible()
const {
570 return sidePaneVisible_;
573 void showSidePane(
bool show) {
574 sidePaneVisible_ = show;
577 Fm::SidePane::Mode sidePaneMode()
const {
578 return sidePaneMode_;
581 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
582 sidePaneMode_ = sidePaneMode;
585 bool showMenuBar()
const {
589 void setShowMenuBar(
bool showMenuBar) {
590 showMenuBar_ = showMenuBar;
593 bool splitView()
const {
597 void setSplitView(
bool split) {
601 Fm::FolderView::ViewMode viewMode()
const {
605 void setViewMode(Fm::FolderView::ViewMode viewMode) {
606 viewMode_ = viewMode;
609 bool showHidden()
const {
613 void setShowHidden(
bool showHidden) {
614 showHidden_ = showHidden;
617 bool sortCaseSensitive()
const {
618 return sortCaseSensitive_;
621 void setSortCaseSensitive(
bool value) {
622 sortCaseSensitive_ = value;
625 QSet<QString> getHiddenPlaces()
const {
626 return hiddenPlaces_;
629 void setHiddenPlace(
const QString& str,
bool hide) {
631 hiddenPlaces_ << str;
634 hiddenPlaces_.remove(str);
638 Qt::SortOrder sortOrder()
const {
642 void setSortOrder(Qt::SortOrder sortOrder) {
643 sortOrder_ = sortOrder;
646 Fm::FolderModel::ColumnId sortColumn()
const {
650 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
651 sortColumn_ = sortColumn;
654 bool sortFolderFirst()
const {
655 return sortFolderFirst_;
658 void setSortFolderFirst(
bool folderFirst) {
659 sortFolderFirst_ = folderFirst;
662 bool sortHiddenLast()
const {
663 return sortHiddenLast_;
666 void setSortHiddenLast(
bool hiddenLast) {
667 sortHiddenLast_ = hiddenLast;
670 bool showFilter()
const {
674 void setShowFilter(
bool value) {
678 bool pathBarButtons()
const {
679 return pathBarButtons_;
682 void setPathBarButtons(
bool value) {
683 pathBarButtons_ = value;
687 bool singleClick()
const {
691 void setSingleClick(
bool singleClick) {
692 singleClick_ = singleClick;
695 int autoSelectionDelay()
const {
696 return autoSelectionDelay_;
699 void setAutoSelectionDelay(
int value) {
700 autoSelectionDelay_ = value;
703 bool ctrlRightClick()
const {
704 return ctrlRightClick_;
707 void setCtrlRightClick(
bool value) {
708 ctrlRightClick_ = value;
711 bool useTrash()
const {
718 void setUseTrash(
bool useTrash) {
719 useTrash_ = useTrash;
722 bool confirmDelete()
const {
723 return confirmDelete_;
726 void setConfirmDelete(
bool confirmDelete) {
727 confirmDelete_ = confirmDelete;
730 bool noUsbTrash()
const {
734 void setNoUsbTrash(
bool noUsbTrash) {
735 noUsbTrash_ = noUsbTrash;
736 fm_config->no_usb_trash = noUsbTrash_;
739 bool confirmTrash()
const {
740 return confirmTrash_;
743 void setConfirmTrash(
bool value) {
744 confirmTrash_ = value;
747 bool quickExec()
const {
751 void setQuickExec(
bool value) {
753 fm_config->quick_exec = quickExec_;
756 bool selectNewFiles()
const {
757 return selectNewFiles_;
760 void setSelectNewFiles(
bool value) {
761 selectNewFiles_ = value;
764 int bigIconSize()
const {
768 void setBigIconSize(
int bigIconSize) {
769 bigIconSize_ = bigIconSize;
772 int smallIconSize()
const {
773 return smallIconSize_;
776 void setSmallIconSize(
int smallIconSize) {
777 smallIconSize_ = smallIconSize;
780 int sidePaneIconSize()
const {
781 return sidePaneIconSize_;
784 void setSidePaneIconSize(
int sidePaneIconSize) {
785 sidePaneIconSize_ = sidePaneIconSize;
788 int thumbnailIconSize()
const {
789 return thumbnailIconSize_;
792 QSize folderViewCellMargins()
const {
793 return folderViewCellMargins_;
796 void setFolderViewCellMargins(QSize size) {
797 folderViewCellMargins_ = size;
800 QSize desktopCellMargins()
const {
801 return desktopCellMargins_;
804 void setDesktopCellMargins(QSize size) {
805 desktopCellMargins_ = size;
808 QMargins workAreaMargins()
const {
809 return workAreaMargins_;
812 void setWorkAreaMargins(QMargins margins) {
813 workAreaMargins_ = margins;
816 bool openWithDefaultFileManager()
const {
817 return openWithDefaultFileManager_;
820 void setOpenWithDefaultFileManager(
bool open) {
821 openWithDefaultFileManager_ = open;
824 bool allSticky()
const {
828 void setAllSticky(
bool sticky) {
832 bool showThumbnails() {
833 return showThumbnails_;
836 void setShowThumbnails(
bool show) {
837 showThumbnails_ = show;
840 void setThumbnailLocalFilesOnly(
bool value) {
841 Fm::ThumbnailJob::setLocalFilesOnly(value);
844 bool thumbnailLocalFilesOnly()
const {
845 return Fm::ThumbnailJob::localFilesOnly();
848 int maxThumbnailFileSize()
const {
849 return Fm::ThumbnailJob::maxThumbnailFileSize();
852 void setMaxThumbnailFileSize(
int size) {
853 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
856 int maxExternalThumbnailFileSize()
const {
857 return Fm::ThumbnailJob::maxExternalThumbnailFileSize();
860 void setMaxExternalThumbnailFileSize(
int size) {
861 Fm::ThumbnailJob::setMaxExternalThumbnailFileSize(size);
864 void setThumbnailIconSize(
int thumbnailIconSize) {
865 thumbnailIconSize_ = thumbnailIconSize;
872 void setSiUnit(
bool siUnit) {
875 fm_config->si_unit = (gboolean)siUnit_;
878 bool backupAsHidden()
const {
879 return backupAsHidden_;
882 void setBackupAsHidden(
bool value) {
883 backupAsHidden_ = value;
884 fm_config->backup_as_hidden = backupAsHidden_;
887 bool showFullNames()
const {
888 return showFullNames_;
891 void setShowFullNames(
bool value) {
892 showFullNames_ = value;
895 bool shadowHidden()
const {
896 return shadowHidden_;
899 void setShadowHidden(
bool value) {
900 shadowHidden_ = value;
903 bool noItemTooltip()
const {
904 return noItemTooltip_;
907 void setNoItemTooltip(
bool noTooltip) {
908 noItemTooltip_ = noTooltip;
911 bool scrollPerPixel()
const {
912 return scrollPerPixel_;
915 void setScrollPerPixel(
bool perPixel) {
916 scrollPerPixel_ = perPixel;
919 bool onlyUserTemplates()
const {
920 return onlyUserTemplates_;
923 void setOnlyUserTemplates(
bool value) {
924 onlyUserTemplates_ = value;
925 fm_config->only_user_templates = onlyUserTemplates_;
928 bool templateTypeOnce()
const {
929 return templateTypeOnce_;
932 void setTemplateTypeOnce(
bool value) {
933 templateTypeOnce_ = value;
934 fm_config->template_type_once = templateTypeOnce_;
937 bool templateRunApp()
const {
938 return templateRunApp_;
941 void setTemplateRunApp(
bool value) {
942 templateRunApp_ = value;
943 fm_config->template_run_app = templateRunApp_;
947 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
949 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
951 void clearFolderSettings(
const Fm::FilePath& path)
const;
953 bool searchNameCaseInsensitive()
const {
954 return searchNameCaseInsensitive_;
957 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
958 searchNameCaseInsensitive_ = caseInsensitive;
961 bool searchContentCaseInsensitive()
const {
962 return searchContentCaseInsensitive_;
965 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
966 searchContentCaseInsensitive_ = caseInsensitive;
969 bool searchNameRegexp()
const {
970 return searchNameRegexp_;
973 void setSearchNameRegexp(
bool reg) {
974 searchNameRegexp_ = reg;
977 bool searchContentRegexp()
const {
978 return searchContentRegexp_;
981 void setSearchContentRegexp(
bool reg) {
982 searchContentRegexp_ = reg;
985 bool searchRecursive()
const {
986 return searchRecursive_;
989 void setSearchRecursive(
bool rec) {
990 searchRecursive_ = rec;
993 bool searchhHidden()
const {
994 return searchhHidden_;
997 void setSearchhHidden(
bool hidden) {
998 searchhHidden_ = hidden;
1001 int maxSearchHistory()
const {
1002 return maxSearchHistory_;
1005 void setMaxSearchHistory(
int max);
1007 void clearSearchHistory();
1009 QStringList namePatterns()
const {
1010 return namePatterns_;
1013 void addNamePattern(
const QString& pattern);
1015 QStringList contentPatterns()
const {
1016 return contentPatterns_;
1019 void addContentPattern(
const QString& pattern);
1021 QList<int> getCustomColumnWidths()
const {
1023 for(
auto width : std::as_const(customColumnWidths_)) {
1029 void setCustomColumnWidths(
const QList<int> &widths) {
1030 customColumnWidths_.clear();
1031 for(
auto width : widths) {
1032 customColumnWidths_ << QVariant(width);
1036 QList<int> getHiddenColumns()
const {
1038 for(
auto width : std::as_const(hiddenColumns_)) {
1044 void setHiddenColumns(
const QList<int> &columns) {
1045 hiddenColumns_.clear();
1046 for(
auto column : columns) {
1047 hiddenColumns_ << QVariant(column);
1051 int getRecentFilesNumber()
const {
1052 return recentFilesNumber_;
1054 void setRecentFilesNumber(
int n);
1056 QStringList getRecentFiles()
const {
1057 return recentFiles_;
1059 void clearRecentFiles();
1060 void addRecentFile(
const QString& file);
1062 void loadRecentFiles();
1063 void saveRecentFiles();
1066 bool loadFile(QString filePath);
1067 bool saveFile(QString filePath);
1069 int toIconSize(
int size, IconType type)
const;
1072 QString profileName_;
1076 QString fallbackIconThemeName_;
1077 bool useFallbackIconTheme_;
1079 bool singleWindowMode_;
1080 OpenDirTargetType bookmarkOpenMethod_;
1083 bool mountOnStartup_;
1084 bool mountRemovable_;
1086 bool closeOnUnmount_;
1090 QSize wallpaperDialogSize_;
1091 int wallpaperDialogSplitterPos_;
1093 QString wallpaperDir_;
1094 int slideShowInterval_;
1095 bool wallpaperRandomize_;
1096 bool transformWallpaper_;
1097 bool perScreenWallpaper_;
1098 QColor desktopBgColor_;
1099 QColor desktopFgColor_;
1100 QColor desktopShadowColor_;
1102 int desktopIconSize_;
1103 QStringList desktopShortcuts_;
1105 bool desktopShowHidden_;
1106 bool desktopHideItems_;
1107 Qt::SortOrder desktopSortOrder_;
1108 Fm::FolderModel::ColumnId desktopSortColumn_;
1109 bool desktopSortFolderFirst_;
1110 bool desktopSortHiddenLast_;
1111 bool desktopNoTooltip_;
1113 bool alwaysShowTabs_;
1115 bool switchToNewTab_;
1116 bool reopenLastTabs_;
1117 int splitViewTabsNum_;
1118 QStringList tabPaths_;
1119 bool rememberWindowSize_;
1120 int fixedWindowWidth_;
1121 int fixedWindowHeight_;
1122 int lastWindowWidth_;
1123 int lastWindowHeight_;
1124 bool lastWindowMaximized_;
1126 bool sidePaneVisible_;
1127 Fm::SidePane::Mode sidePaneMode_;
1131 Fm::FolderView::ViewMode viewMode_;
1133 Qt::SortOrder sortOrder_;
1134 Fm::FolderModel::ColumnId sortColumn_;
1135 bool sortFolderFirst_;
1136 bool sortHiddenLast_;
1137 bool sortCaseSensitive_;
1139 bool pathBarButtons_;
1143 int autoSelectionDelay_;
1144 bool ctrlRightClick_;
1146 bool confirmDelete_;
1150 bool selectNewFiles_;
1152 bool showThumbnails_;
1156 bool backupAsHidden_;
1157 bool showFullNames_;
1159 bool noItemTooltip_;
1160 bool scrollPerPixel_;
1162 QSet<QString> hiddenPlaces_;
1166 int sidePaneIconSize_;
1167 int thumbnailIconSize_;
1169 bool onlyUserTemplates_;
1170 bool templateTypeOnce_;
1171 bool templateRunApp_;
1173 QSize folderViewCellMargins_;
1174 QSize desktopCellMargins_;
1175 QMargins workAreaMargins_;
1177 bool openWithDefaultFileManager_;
1182 bool searchNameCaseInsensitive_;
1183 bool searchContentCaseInsensitive_;
1184 bool searchNameRegexp_;
1185 bool searchContentRegexp_;
1186 bool searchRecursive_;
1187 bool searchhHidden_;
1188 int maxSearchHistory_;
1189 QStringList namePatterns_;
1190 QStringList contentPatterns_;
1193 QList<QVariant> customColumnWidths_;
1194 QList<QVariant> hiddenColumns_;
1197 int recentFilesNumber_;
1198 QStringList recentFiles_;