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;
331 bool noWallpaperCache()
const {
332 return noWallpaperCache_;
335 void setNoWallpaperCache(
bool nwc) {
336 noWallpaperCache_ = nwc;
339 bool transformWallpaper()
const {
340 return transformWallpaper_;
343 void setTransformWallpaper(
bool tr) {
344 transformWallpaper_ = tr;
347 bool perScreenWallpaper()
const {
348 return perScreenWallpaper_;
351 void setPerScreenWallpaper(
bool psw) {
352 perScreenWallpaper_ = psw;
355 const QColor& desktopBgColor()
const {
356 return desktopBgColor_;
359 void setDesktopBgColor(QColor desktopBgColor) {
360 desktopBgColor_ = desktopBgColor;
363 const QColor& desktopFgColor()
const {
364 return desktopFgColor_;
367 void setDesktopFgColor(QColor desktopFgColor) {
368 desktopFgColor_ = desktopFgColor;
371 const QColor& desktopShadowColor()
const {
372 return desktopShadowColor_;
375 void setDesktopShadowColor(QColor desktopShadowColor) {
376 desktopShadowColor_ = desktopShadowColor;
379 QFont desktopFont()
const {
383 void setDesktopFont(QFont font) {
387 int desktopIconSize()
const {
388 return desktopIconSize_;
391 void setDesktopIconSize(
int desktopIconSize) {
392 desktopIconSize_ = desktopIconSize;
395 QStringList desktopShortcuts()
const {
396 return desktopShortcuts_;
399 void setDesktopShortcuts(
const QStringList& list) {
400 desktopShortcuts_ = list;
403 bool desktopShowHidden()
const {
404 return desktopShowHidden_;
407 void setDesktopShowHidden(
bool desktopShowHidden) {
408 desktopShowHidden_ = desktopShowHidden;
411 bool desktopHideItems(
const QString& screenName = QString())
const {
412 if(screenName.isEmpty()) {
413 return desktopHideItems_;
415 return desktopHideItemsOnScreens_.value(screenName,
false);
418 void setDesktopHideItems(
bool hide,
const QString& screenName = QString()) {
419 if(screenName.isEmpty()) {
420 desktopHideItems_ = hide;
423 if(!screenNames_.contains(screenName)) {
424 screenNames_ << screenName;
426 desktopHideItemsOnScreens_.insert(screenName, hide);
430 Qt::SortOrder desktopSortOrder()
const {
431 return desktopSortOrder_;
434 void setDesktopSortOrder(Qt::SortOrder desktopSortOrder) {
435 desktopSortOrder_ = desktopSortOrder;
438 Fm::FolderModel::ColumnId desktopSortColumn()
const {
439 return desktopSortColumn_;
442 void setDesktopSortColumn(Fm::FolderModel::ColumnId desktopSortColumn) {
443 desktopSortColumn_ = desktopSortColumn;
446 bool desktopSortFolderFirst()
const {
447 return desktopSortFolderFirst_;
450 void setDesktopSortFolderFirst(
bool desktopFolderFirst) {
451 desktopSortFolderFirst_ = desktopFolderFirst;
454 bool desktopSortHiddenLast()
const {
455 return desktopSortHiddenLast_;
458 void setDesktopSortHiddenLast(
bool desktopHiddenLast) {
459 desktopSortHiddenLast_ = desktopHiddenLast;
462 bool desktopNoTooltip()
const {
463 return desktopNoTooltip_;
466 void setDesktopNoTooltip(
bool noTooltip) {
467 desktopNoTooltip_ = noTooltip;
470 bool alwaysShowTabs()
const {
471 return alwaysShowTabs_;
474 void setAlwaysShowTabs(
bool alwaysShowTabs) {
475 alwaysShowTabs_ = alwaysShowTabs;
478 bool showTabClose()
const {
479 return showTabClose_;
482 void setShowTabClose(
bool showTabClose) {
483 showTabClose_ = showTabClose;
486 bool switchToNewTab()
const {
487 return switchToNewTab_;
490 void setSwitchToNewTab(
bool showTabClose) {
491 switchToNewTab_ = showTabClose;
494 bool reopenLastTabs()
const {
495 return reopenLastTabs_;
498 void setReopenLastTabs(
bool reopenLastTabs) {
499 reopenLastTabs_ = reopenLastTabs;
502 int splitViewTabsNum()
const {
503 return splitViewTabsNum_;
506 void setSplitViewTabsNum(
int n) {
507 splitViewTabsNum_ = n;
510 QStringList tabPaths()
const {
514 void setTabPaths(
const QStringList& tabPaths) {
515 tabPaths_ = tabPaths;
518 bool rememberWindowSize()
const {
519 return rememberWindowSize_;
522 void setRememberWindowSize(
bool rememberWindowSize) {
523 rememberWindowSize_ = rememberWindowSize;
526 int windowWidth()
const {
527 if(rememberWindowSize_) {
528 return lastWindowWidth_;
531 return fixedWindowWidth_;
535 int windowHeight()
const {
536 if(rememberWindowSize_) {
537 return lastWindowHeight_;
540 return fixedWindowHeight_;
544 bool windowMaximized()
const {
545 if(rememberWindowSize_) {
546 return lastWindowMaximized_;
553 int fixedWindowWidth()
const {
554 return fixedWindowWidth_;
557 void setFixedWindowWidth(
int fixedWindowWidth) {
558 fixedWindowWidth_ = fixedWindowWidth;
561 int fixedWindowHeight()
const {
562 return fixedWindowHeight_;
565 void setFixedWindowHeight(
int fixedWindowHeight) {
566 fixedWindowHeight_ = fixedWindowHeight;
569 void setLastWindowWidth(
int lastWindowWidth) {
570 lastWindowWidth_ = lastWindowWidth;
573 void setLastWindowHeight(
int lastWindowHeight) {
574 lastWindowHeight_ = lastWindowHeight;
577 void setLastWindowMaximized(
bool lastWindowMaximized) {
578 lastWindowMaximized_ = lastWindowMaximized;
581 int splitterPos()
const {
585 void setSplitterPos(
int splitterPos) {
586 splitterPos_ = splitterPos;
589 bool isSidePaneVisible()
const {
590 return sidePaneVisible_;
593 void showSidePane(
bool show) {
594 sidePaneVisible_ = show;
597 Fm::SidePane::Mode sidePaneMode()
const {
598 return sidePaneMode_;
601 void setSidePaneMode(Fm::SidePane::Mode sidePaneMode) {
602 sidePaneMode_ = sidePaneMode;
605 bool showMenuBar()
const {
609 void setShowMenuBar(
bool showMenuBar) {
610 showMenuBar_ = showMenuBar;
613 bool splitView()
const {
617 void setSplitView(
bool split) {
621 Fm::FolderView::ViewMode viewMode()
const {
625 void setViewMode(Fm::FolderView::ViewMode viewMode) {
626 viewMode_ = viewMode;
629 bool showHidden()
const {
633 void setShowHidden(
bool showHidden) {
634 showHidden_ = showHidden;
637 bool sortCaseSensitive()
const {
638 return sortCaseSensitive_;
641 void setSortCaseSensitive(
bool value) {
642 sortCaseSensitive_ = value;
645 QSet<QString> getHiddenPlaces()
const {
646 return hiddenPlaces_;
649 void setHiddenPlace(
const QString& str,
bool hide) {
651 hiddenPlaces_ << str;
654 hiddenPlaces_.remove(str);
658 Qt::SortOrder sortOrder()
const {
662 void setSortOrder(Qt::SortOrder sortOrder) {
663 sortOrder_ = sortOrder;
666 Fm::FolderModel::ColumnId sortColumn()
const {
670 void setSortColumn(Fm::FolderModel::ColumnId sortColumn) {
671 sortColumn_ = sortColumn;
674 bool sortFolderFirst()
const {
675 return sortFolderFirst_;
678 void setSortFolderFirst(
bool folderFirst) {
679 sortFolderFirst_ = folderFirst;
682 bool sortHiddenLast()
const {
683 return sortHiddenLast_;
686 void setSortHiddenLast(
bool hiddenLast) {
687 sortHiddenLast_ = hiddenLast;
690 bool showFilter()
const {
694 void setShowFilter(
bool value) {
698 bool pathBarButtons()
const {
699 return pathBarButtons_;
702 void setPathBarButtons(
bool value) {
703 pathBarButtons_ = value;
707 bool singleClick()
const {
711 void setSingleClick(
bool singleClick) {
712 singleClick_ = singleClick;
715 int autoSelectionDelay()
const {
716 return autoSelectionDelay_;
719 void setAutoSelectionDelay(
int value) {
720 autoSelectionDelay_ = value;
723 bool ctrlRightClick()
const {
724 return ctrlRightClick_;
727 void setCtrlRightClick(
bool value) {
728 ctrlRightClick_ = value;
731 bool useTrash()
const {
738 void setUseTrash(
bool useTrash) {
739 useTrash_ = useTrash;
742 bool confirmDelete()
const {
743 return confirmDelete_;
746 void setConfirmDelete(
bool confirmDelete) {
747 confirmDelete_ = confirmDelete;
750 bool noUsbTrash()
const {
754 void setNoUsbTrash(
bool noUsbTrash) {
755 noUsbTrash_ = noUsbTrash;
756 fm_config->no_usb_trash = noUsbTrash_;
759 bool confirmTrash()
const {
760 return confirmTrash_;
763 void setConfirmTrash(
bool value) {
764 confirmTrash_ = value;
767 bool quickExec()
const {
771 void setQuickExec(
bool value) {
773 fm_config->quick_exec = quickExec_;
776 bool selectNewFiles()
const {
777 return selectNewFiles_;
780 void setSelectNewFiles(
bool value) {
781 selectNewFiles_ = value;
784 int bigIconSize()
const {
788 void setBigIconSize(
int bigIconSize) {
789 bigIconSize_ = bigIconSize;
792 int smallIconSize()
const {
793 return smallIconSize_;
796 void setSmallIconSize(
int smallIconSize) {
797 smallIconSize_ = smallIconSize;
800 int sidePaneIconSize()
const {
801 return sidePaneIconSize_;
804 void setSidePaneIconSize(
int sidePaneIconSize) {
805 sidePaneIconSize_ = sidePaneIconSize;
808 int thumbnailIconSize()
const {
809 return thumbnailIconSize_;
812 QSize folderViewCellMargins()
const {
813 return folderViewCellMargins_;
816 void setFolderViewCellMargins(QSize size) {
817 folderViewCellMargins_ = size;
820 QSize desktopCellMargins()
const {
821 return desktopCellMargins_;
824 void setDesktopCellMargins(QSize size) {
825 desktopCellMargins_ = size;
828 QMargins workAreaMargins()
const {
829 return workAreaMargins_;
832 void setWorkAreaMargins(QMargins margins) {
833 workAreaMargins_ = margins;
836 bool openWithDefaultFileManager()
const {
837 return openWithDefaultFileManager_;
840 void setOpenWithDefaultFileManager(
bool open) {
841 openWithDefaultFileManager_ = open;
844 bool allSticky()
const {
848 void setAllSticky(
bool sticky) {
852 bool showThumbnails() {
853 return showThumbnails_;
856 void setShowThumbnails(
bool show) {
857 showThumbnails_ = show;
860 void setThumbnailLocalFilesOnly(
bool value) {
861 Fm::ThumbnailJob::setLocalFilesOnly(value);
864 bool thumbnailLocalFilesOnly()
const {
865 return Fm::ThumbnailJob::localFilesOnly();
868 int maxThumbnailFileSize()
const {
869 return Fm::ThumbnailJob::maxThumbnailFileSize();
872 void setMaxThumbnailFileSize(
int size) {
873 Fm::ThumbnailJob::setMaxThumbnailFileSize(size);
876 int maxExternalThumbnailFileSize()
const {
877 return Fm::ThumbnailJob::maxExternalThumbnailFileSize();
880 void setMaxExternalThumbnailFileSize(
int size) {
881 Fm::ThumbnailJob::setMaxExternalThumbnailFileSize(size);
884 void setThumbnailIconSize(
int thumbnailIconSize) {
885 thumbnailIconSize_ = thumbnailIconSize;
892 void setSiUnit(
bool siUnit) {
895 fm_config->si_unit = (gboolean)siUnit_;
898 bool backupAsHidden()
const {
899 return backupAsHidden_;
902 void setBackupAsHidden(
bool value) {
903 backupAsHidden_ = value;
904 fm_config->backup_as_hidden = backupAsHidden_;
907 bool showFullNames()
const {
908 return showFullNames_;
911 void setShowFullNames(
bool value) {
912 showFullNames_ = value;
915 bool shadowHidden()
const {
916 return shadowHidden_;
919 void setShadowHidden(
bool value) {
920 shadowHidden_ = value;
923 bool noItemTooltip()
const {
924 return noItemTooltip_;
927 void setNoItemTooltip(
bool noTooltip) {
928 noItemTooltip_ = noTooltip;
931 bool scrollPerPixel()
const {
932 return scrollPerPixel_;
935 void setScrollPerPixel(
bool perPixel) {
936 scrollPerPixel_ = perPixel;
939 bool onlyUserTemplates()
const {
940 return onlyUserTemplates_;
943 void setOnlyUserTemplates(
bool value) {
944 onlyUserTemplates_ = value;
945 fm_config->only_user_templates = onlyUserTemplates_;
948 bool templateTypeOnce()
const {
949 return templateTypeOnce_;
952 void setTemplateTypeOnce(
bool value) {
953 templateTypeOnce_ = value;
954 fm_config->template_type_once = templateTypeOnce_;
957 bool templateRunApp()
const {
958 return templateRunApp_;
961 void setTemplateRunApp(
bool value) {
962 templateRunApp_ = value;
963 fm_config->template_run_app = templateRunApp_;
967 FolderSettings loadFolderSettings(
const Fm::FilePath& path)
const;
969 void saveFolderSettings(
const Fm::FilePath& path,
const FolderSettings& settings);
971 void clearFolderSettings(
const Fm::FilePath& path)
const;
973 bool searchNameCaseInsensitive()
const {
974 return searchNameCaseInsensitive_;
977 void setSearchNameCaseInsensitive(
bool caseInsensitive) {
978 searchNameCaseInsensitive_ = caseInsensitive;
981 bool searchContentCaseInsensitive()
const {
982 return searchContentCaseInsensitive_;
985 void setsearchContentCaseInsensitive(
bool caseInsensitive) {
986 searchContentCaseInsensitive_ = caseInsensitive;
989 bool searchNameRegexp()
const {
990 return searchNameRegexp_;
993 void setSearchNameRegexp(
bool reg) {
994 searchNameRegexp_ = reg;
997 bool searchContentRegexp()
const {
998 return searchContentRegexp_;
1001 void setSearchContentRegexp(
bool reg) {
1002 searchContentRegexp_ = reg;
1005 bool searchRecursive()
const {
1006 return searchRecursive_;
1009 void setSearchRecursive(
bool rec) {
1010 searchRecursive_ = rec;
1013 bool searchhHidden()
const {
1014 return searchhHidden_;
1017 void setSearchhHidden(
bool hidden) {
1018 searchhHidden_ = hidden;
1023 bool incrementalSearch()
const {
1024 return incrementalSearch_;
1027 void setIncrementalSearch(
bool incremental) {
1028 incrementalSearch_ = incremental;
1031 int maxSearchHistory()
const {
1032 return maxSearchHistory_;
1035 void setMaxSearchHistory(
int max);
1037 void clearSearchHistory();
1039 QStringList namePatterns()
const {
1040 return namePatterns_;
1043 void addNamePattern(
const QString& pattern);
1045 QStringList contentPatterns()
const {
1046 return contentPatterns_;
1049 void addContentPattern(
const QString& pattern);
1051 QList<int> getCustomColumnWidths()
const {
1053 for(
auto width : std::as_const(customColumnWidths_)) {
1059 void setCustomColumnWidths(
const QList<int> &widths) {
1060 customColumnWidths_.clear();
1061 for(
auto width : widths) {
1062 customColumnWidths_ << QVariant(width);
1066 QList<int> getHiddenColumns()
const {
1068 for(
auto width : std::as_const(hiddenColumns_)) {
1074 void setHiddenColumns(
const QList<int> &columns) {
1075 hiddenColumns_.clear();
1076 for(
auto column : columns) {
1077 hiddenColumns_ << QVariant(column);
1081 int getRecentFilesNumber()
const {
1082 return recentFilesNumber_;
1084 void setRecentFilesNumber(
int n);
1086 QStringList getRecentFiles()
const {
1087 return recentFiles_;
1089 void clearRecentFiles();
1090 void addRecentFile(
const QString& file);
1092 void loadRecentFiles();
1093 void saveRecentFiles();
1096 bool loadFile(QString filePath);
1097 bool saveFile(QString filePath);
1099 int toIconSize(
int size, IconType type)
const;
1102 QString profileName_;
1106 QString fallbackIconThemeName_;
1107 bool useFallbackIconTheme_;
1109 bool singleWindowMode_;
1110 OpenDirTargetType bookmarkOpenMethod_;
1113 bool mountOnStartup_;
1114 bool mountRemovable_;
1116 bool closeOnUnmount_;
1120 QSize wallpaperDialogSize_;
1121 int wallpaperDialogSplitterPos_;
1123 QString wallpaperDir_;
1124 int slideShowInterval_;
1125 bool wallpaperRandomize_;
1126 bool noWallpaperCache_;
1127 bool transformWallpaper_;
1128 bool perScreenWallpaper_;
1129 QColor desktopBgColor_;
1130 QColor desktopFgColor_;
1131 QColor desktopShadowColor_;
1133 int desktopIconSize_;
1134 QStringList desktopShortcuts_;
1136 bool desktopShowHidden_;
1137 bool desktopHideItems_;
1138 QHash<QString, bool> desktopHideItemsOnScreens_;
1139 Qt::SortOrder desktopSortOrder_;
1140 Fm::FolderModel::ColumnId desktopSortColumn_;
1141 bool desktopSortFolderFirst_;
1142 bool desktopSortHiddenLast_;
1143 bool desktopNoTooltip_;
1145 bool alwaysShowTabs_;
1147 bool switchToNewTab_;
1148 bool reopenLastTabs_;
1149 int splitViewTabsNum_;
1150 QStringList tabPaths_;
1151 bool rememberWindowSize_;
1152 int fixedWindowWidth_;
1153 int fixedWindowHeight_;
1154 int lastWindowWidth_;
1155 int lastWindowHeight_;
1156 bool lastWindowMaximized_;
1158 bool sidePaneVisible_;
1159 Fm::SidePane::Mode sidePaneMode_;
1163 Fm::FolderView::ViewMode viewMode_;
1165 Qt::SortOrder sortOrder_;
1166 Fm::FolderModel::ColumnId sortColumn_;
1167 bool sortFolderFirst_;
1168 bool sortHiddenLast_;
1169 bool sortCaseSensitive_;
1171 bool pathBarButtons_;
1175 int autoSelectionDelay_;
1176 bool ctrlRightClick_;
1178 bool confirmDelete_;
1182 bool selectNewFiles_;
1184 bool showThumbnails_;
1188 bool backupAsHidden_;
1189 bool showFullNames_;
1191 bool noItemTooltip_;
1192 bool scrollPerPixel_;
1194 QSet<QString> hiddenPlaces_;
1198 int sidePaneIconSize_;
1199 int thumbnailIconSize_;
1201 bool onlyUserTemplates_;
1202 bool templateTypeOnce_;
1203 bool templateRunApp_;
1205 QSize folderViewCellMargins_;
1206 QSize desktopCellMargins_;
1207 QMargins workAreaMargins_;
1209 bool openWithDefaultFileManager_;
1214 bool searchNameCaseInsensitive_;
1215 bool searchContentCaseInsensitive_;
1216 bool searchNameRegexp_;
1217 bool searchContentRegexp_;
1218 bool searchRecursive_;
1219 bool searchhHidden_;
1220 bool incrementalSearch_;
1221 int maxSearchHistory_;
1222 QStringList namePatterns_;
1223 QStringList contentPatterns_;
1226 QList<QVariant> customColumnWidths_;
1227 QList<QVariant> hiddenColumns_;
1230 int recentFilesNumber_;
1231 QStringList recentFiles_;
1233 QStringList screenNames_;