1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2013-12-20
7  * Description : Settings for Showfoto
8  *
9  * Copyright (C) 2013-2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  * Copyright (C) 2013-2021 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #include "showfotosettings.h"
26 
27 // Qt includes
28 
29 #include <QStyle>
30 #include <QApplication>
31 #include <QFontDatabase>
32 
33 // KDE includes
34 
35 #include <ksharedconfig.h>
36 #include <kconfiggroup.h>
37 
38 // Local includes
39 
40 #include "digikam_config.h"
41 #include "digikam_debug.h"
42 #include "setupmisc.h"
43 #include "thememanager.h"
44 
45 namespace ShowFoto
46 {
47 
48 class Q_DECL_HIDDEN ShowfotoSettings::Private
49 {
50 
51 public:
52 
Private()53     explicit Private()
54       : deleteItem2Trash        (true),
55         showFormatOverThumbnail (false),
56         showCoordinates         (false),
57         showSplash              (true),
58         nativeFileDialog        (false),
59         itemCenter              (false),
60         reverseSort             (false),
61         showToolTip             (true),
62         showFileName            (true),
63         showFileDate            (false),
64         showFileSize            (false),
65         showFileType            (false),
66         showFileDim             (true),
67         showPhotoMake           (true),
68         showPhotoLens           (true),
69         showPhotoFocal          (true),
70         showPhotoExpo           (true),
71         showPhotoFlash          (false),
72         showPhotoWB             (false),
73         showPhotoDate           (true),
74         showPhotoMode           (false),
75         updateType              (0),
76         updateWithDebug         (false),
77         rightSideBarStyle       (0),
78         sortOrder               (0)
79     {
80     }
81 
82     static const QString configGroupDefault;
83 
84     static const QString configLastOpenedDir;
85     static const QString configDeleteItem2Trash;
86     static const QString configCurrentTheme;
87     static const QString configRightSideBarStyle;
88     static const QString configUpdateType;
89     static const QString configUpdateWithDebug;
90     static const QString configApplicationStyle;
91     static const QString configIconTheme;
92     static const QString configApplicationFont;
93     static const QString configShowFormatOverThumbnail;
94     static const QString configShowCoordinates;
95     static const QString configShowSplash;
96     static const QString configNativeFileDialog;
97     static const QString configItemCenter;
98     static const QString configSortOrder;
99     static const QString configReverseSort;
100 
101     static const QString configShowToolTip;
102 
103     static const QString configShowFileName;
104     static const QString configShowFileDate;
105     static const QString configShowFileSize;
106     static const QString configShowFileType;
107     static const QString configShowFileDim;
108 
109     static const QString configShowPhotoMake;
110     static const QString configShowPhotoLens;
111     static const QString configShowPhotoFocal;
112     static const QString configShowPhotoExpo;
113     static const QString configShowPhotoFlash;
114     static const QString configShowPhotoWB;
115     static const QString configShowPhotoDate;
116     static const QString configShowPhotoMode;
117 
118     static const QString configToolTipsFont;
119 
120     bool                 deleteItem2Trash;
121     bool                 showFormatOverThumbnail;
122     bool                 showCoordinates;
123     bool                 showSplash;
124     bool                 nativeFileDialog;
125     bool                 itemCenter;
126     bool                 reverseSort;
127 
128     bool                 showToolTip;
129 
130     bool                 showFileName;
131     bool                 showFileDate;
132     bool                 showFileSize;
133     bool                 showFileType;
134     bool                 showFileDim;
135 
136     bool                 showPhotoMake;
137     bool                 showPhotoLens;
138     bool                 showPhotoFocal;
139     bool                 showPhotoExpo;
140     bool                 showPhotoFlash;
141     bool                 showPhotoWB;
142     bool                 showPhotoDate;
143     bool                 showPhotoMode;
144 
145     int                  updateType;
146     bool                 updateWithDebug;
147     int                  rightSideBarStyle;
148     int                  sortOrder;
149 
150     QFont                toolTipsFont;
151 
152     QString              lastOpenedDir;
153     QString              theme;
154     QString              applicationStyle;
155     QString              applicationIcon;
156     QFont                applicationFont;
157 
158     KSharedConfigPtr     config;
159     KConfigGroup         group;
160 };
161 
162 /// Configuration Group
163 const QString ShowfotoSettings::Private::configGroupDefault(QLatin1String("ImageViewer Settings"));
164 
165 /// Misc. & Showfoto Generals Settings
166 const QString ShowfotoSettings::Private::configLastOpenedDir(QLatin1String("Last Opened Directory"));
167 const QString ShowfotoSettings::Private::configDeleteItem2Trash(QLatin1String("DeleteItem2Trash"));
168 const QString ShowfotoSettings::Private::configCurrentTheme(QLatin1String("Theme"));
169 const QString ShowfotoSettings::Private::configUpdateType(QLatin1String("Update Type"));
170 const QString ShowfotoSettings::Private::configUpdateWithDebug(QLatin1String("Update With Debug"));
171 const QString ShowfotoSettings::Private::configRightSideBarStyle(QLatin1String("Sidebar Title Style"));
172 const QString ShowfotoSettings::Private::configApplicationStyle(QLatin1String("Application Style"));
173 const QString ShowfotoSettings::Private::configIconTheme(QLatin1String("Icon Theme"));
174 const QString ShowfotoSettings::Private::configApplicationFont(QLatin1String("Application Font"));
175 const QString ShowfotoSettings::Private::configShowFormatOverThumbnail(QLatin1String("ShowMimeOverImage"));
176 const QString ShowfotoSettings::Private::configShowCoordinates(QLatin1String("Show Coordinates"));
177 const QString ShowfotoSettings::Private::configShowSplash(QLatin1String("ShowSplash"));
178 const QString ShowfotoSettings::Private::configNativeFileDialog(QLatin1String("Use Native File Dialog"));
179 const QString ShowfotoSettings::Private::configItemCenter(QLatin1String("Item To Center"));
180 const QString ShowfotoSettings::Private::configSortOrder(QLatin1String("SortOrder"));
181 const QString ShowfotoSettings::Private::configReverseSort(QLatin1String("ReverseSort"));
182 
183 /// Tool Tip Enable/Disable
184 const QString ShowfotoSettings::Private::configShowToolTip(QLatin1String("Show ToolTips"));
185 
186 /// Tool Tip File Properties
187 const QString ShowfotoSettings::Private::configShowFileName(QLatin1String("ToolTips Show File Name"));
188 const QString ShowfotoSettings::Private::configShowFileDate(QLatin1String("ToolTips Show File Date"));
189 const QString ShowfotoSettings::Private::configShowFileSize(QLatin1String("ToolTips Show File Size"));
190 const QString ShowfotoSettings::Private::configShowFileType(QLatin1String("ToolTips Show Image Type"));
191 const QString ShowfotoSettings::Private::configShowFileDim(QLatin1String("ToolTips Show Image Dim"));
192 
193 /// Tool Tip Photograph Info
194 const QString ShowfotoSettings::Private::configShowPhotoMake(QLatin1String("ToolTips Show Photo Make"));
195 const QString ShowfotoSettings::Private::configShowPhotoLens(QLatin1String("ToolTips Show Photo Lens"));
196 const QString ShowfotoSettings::Private::configShowPhotoFocal(QLatin1String("ToolTips Show Photo Focal"));
197 const QString ShowfotoSettings::Private::configShowPhotoExpo(QLatin1String("ToolTips Show Photo Expo"));
198 const QString ShowfotoSettings::Private::configShowPhotoFlash(QLatin1String("ToolTips Show Photo Flash"));
199 const QString ShowfotoSettings::Private::configShowPhotoWB(QLatin1String("ToolTips Show Photo WB"));
200 const QString ShowfotoSettings::Private::configShowPhotoDate(QLatin1String("ToolTips Show Photo Date"));
201 const QString ShowfotoSettings::Private::configShowPhotoMode(QLatin1String("ToolTips Show Photo Mode"));
202 
203 /// Tool Tips Font
204 const QString ShowfotoSettings::Private::configToolTipsFont(QLatin1String("ToolTips Font"));
205 
206 // -------------------------------------------------------------------------------------------------
207 
208 class Q_DECL_HIDDEN ShowfotoSettingsCreator
209 {
210 public:
211 
212     ShowfotoSettings object;
213 };
214 
Q_GLOBAL_STATIC(ShowfotoSettingsCreator,creator)215 Q_GLOBAL_STATIC(ShowfotoSettingsCreator, creator)
216 
217 // -------------------------------------------------------------------------------------------------
218 
219 ShowfotoSettings* ShowfotoSettings::instance()
220 {
221     return &creator->object;
222 }
223 
ShowfotoSettings()224 ShowfotoSettings::ShowfotoSettings()
225     : QObject(),
226       d      (new Private)
227 {
228     d->config = KSharedConfig::openConfig();
229     d->group  = d->config->group(d->configGroupDefault);
230     init();
231     readSettings();
232 }
233 
~ShowfotoSettings()234 ShowfotoSettings::~ShowfotoSettings()
235 {
236     delete d;
237 }
238 
init()239 void ShowfotoSettings::init()
240 {
241     d->updateType              = 0;
242     d->updateWithDebug         = false;
243     d->rightSideBarStyle       = 0;
244     d->sortOrder               = 0;
245     d->deleteItem2Trash        = true;
246     d->showSplash              = true;
247     d->reverseSort             = false;
248 
249     d->showFormatOverThumbnail = false;
250     d->showCoordinates         = false;
251     d->nativeFileDialog        = false;
252     d->itemCenter              = false;
253 
254     d->showToolTip             = true;
255 
256     d->showFileName            = true;
257     d->showFileDate            = false;
258     d->showFileSize            = false;
259     d->showFileType            = false;
260     d->showFileDim             = true;
261 
262     d->showPhotoMake           = true;
263     d->showPhotoLens           = true;
264     d->showPhotoFocal          = true;
265     d->showPhotoExpo           = true;
266     d->showPhotoFlash          = false;
267     d->showPhotoWB             = false;
268     d->showPhotoDate           = true;
269     d->showPhotoMode           = true;
270 
271     d->applicationStyle        = qApp->style()->objectName();
272     d->applicationIcon         = QString();
273     d->applicationFont         = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
274 }
275 
readSettings()276 void ShowfotoSettings::readSettings()
277 {
278     KConfigGroup group         = d->group;
279 
280     d->lastOpenedDir           = group.readEntry(d->configLastOpenedDir,           QString());
281     d->deleteItem2Trash        = group.readEntry(d->configDeleteItem2Trash,        true);
282     d->theme                   = group.readEntry(d->configCurrentTheme,            Digikam::ThemeManager::instance()->defaultThemeName());
283     d->updateType              = group.readEntry(d->configUpdateType,              0);
284     d->updateWithDebug         = group.readEntry(d->configUpdateWithDebug,         false);
285     d->rightSideBarStyle       = group.readEntry(d->configRightSideBarStyle,       0);
286 
287 #ifdef Q_OS_WIN
288 
289     QString defaultStyle       = QLatin1String("Fusion");
290 
291 #else
292 
293     QString defaultStyle       = qApp->style()->objectName();
294 
295 #endif
296 
297 #ifdef HAVE_APPSTYLE_SUPPORT
298 
299     setApplicationStyle(group.readEntry(d->configApplicationStyle, defaultStyle));
300 
301 #else
302 
303     setApplicationStyle(QLatin1String("Fusion"));
304 
305 #endif
306 
307     d->applicationIcon         = group.readEntry(d->configIconTheme,               QString());
308 
309     setApplicationFont(group.readEntry(d->configApplicationFont, QFontDatabase::systemFont(QFontDatabase::GeneralFont)));
310 
311     d->showSplash              = group.readEntry(d->configShowSplash,              true);
312 
313 #ifdef Q_OS_MACOS
314 
315     d->nativeFileDialog        = group.readEntry(d->configNativeFileDialog,        true);
316 
317 #else
318 
319     d->nativeFileDialog        = group.readEntry(d->configNativeFileDialog,        false);
320 
321 #endif
322 
323     d->itemCenter              = group.readEntry(d->configItemCenter,              false);
324     d->sortOrder               = group.readEntry(d->configSortOrder,               0);
325     d->reverseSort             = group.readEntry(d->configReverseSort,             false);
326     d->showFormatOverThumbnail = group.readEntry(d->configShowFormatOverThumbnail, false);
327     d->showCoordinates         = group.readEntry(d->configShowCoordinates,         false);
328 
329     d->showToolTip             = group.readEntry(d->configShowToolTip,             true);
330 
331     d->showFileName            = group.readEntry(d->configShowFileName,            true);
332     d->showFileDate            = group.readEntry(d->configShowFileDate,            false);
333     d->showFileSize            = group.readEntry(d->configShowFileSize,            false);
334     d->showFileType            = group.readEntry(d->configShowFileType,            false);
335     d->showFileDim             = group.readEntry(d->configShowFileDim,             true);
336 
337     d->showPhotoMake           = group.readEntry(d->configShowPhotoMake,           true);
338     d->showPhotoLens           = group.readEntry(d->configShowPhotoLens,           true);
339     d->showPhotoFocal          = group.readEntry(d->configShowPhotoFocal,          true);
340     d->showPhotoExpo           = group.readEntry(d->configShowPhotoExpo,           true);
341     d->showPhotoFlash          = group.readEntry(d->configShowPhotoFlash,          false);
342     d->showPhotoWB             = group.readEntry(d->configShowPhotoWB,             false);
343     d->showPhotoDate           = group.readEntry(d->configShowPhotoDate,           true);
344     d->showPhotoMode           = group.readEntry(d->configShowPhotoMode,           true);
345 
346     d->toolTipsFont            = group.readEntry(d->configToolTipsFont,            QFontDatabase::systemFont(QFontDatabase::GeneralFont));
347 }
348 
getLastOpenedDir() const349 QString ShowfotoSettings::getLastOpenedDir() const
350 {
351     return d->lastOpenedDir;
352 }
353 
getDeleteItem2Trash() const354 bool ShowfotoSettings::getDeleteItem2Trash() const
355 {
356     return d->deleteItem2Trash;
357 }
358 
getCurrentTheme() const359 QString ShowfotoSettings::getCurrentTheme() const
360 {
361     return d->theme;
362 }
363 
getUpdateType() const364 int ShowfotoSettings::getUpdateType() const
365 {
366     return d->updateType;
367 }
368 
getUpdateWithDebug() const369 bool ShowfotoSettings::getUpdateWithDebug() const
370 {
371     return d->updateWithDebug;
372 }
373 
getRightSideBarStyle() const374 int ShowfotoSettings::getRightSideBarStyle() const
375 {
376     return d->rightSideBarStyle;
377 }
378 
getShowFormatOverThumbnail() const379 bool ShowfotoSettings::getShowFormatOverThumbnail() const
380 {
381     return d->showFormatOverThumbnail;
382 }
383 
getShowCoordinates() const384 bool ShowfotoSettings::getShowCoordinates() const
385 {
386     return d->showCoordinates;
387 }
388 
getApplicationStyle() const389 QString ShowfotoSettings::getApplicationStyle() const
390 {
391     return d->applicationStyle;
392 }
393 
getIconTheme() const394 QString ShowfotoSettings::getIconTheme() const
395 {
396     return d->applicationIcon;
397 }
398 
getApplicationFont() const399 QFont ShowfotoSettings::getApplicationFont() const
400 {
401     return d->applicationFont;
402 }
403 
getShowSplash() const404 bool ShowfotoSettings::getShowSplash() const
405 {
406     return d->showSplash;
407 }
408 
getNativeFileDialog() const409 bool ShowfotoSettings::getNativeFileDialog() const
410 {
411     return d->nativeFileDialog;
412 }
413 
getItemCenter() const414 bool ShowfotoSettings::getItemCenter() const
415 {
416     return d->itemCenter;
417 }
418 
getSortRole() const419 int ShowfotoSettings::getSortRole() const
420 {
421     return d->sortOrder;
422 }
423 
getReverseSort() const424 bool ShowfotoSettings::getReverseSort() const
425 {
426     return d->reverseSort;
427 }
428 
getShowToolTip() const429 bool ShowfotoSettings::getShowToolTip() const
430 {
431     return d->showToolTip;
432 }
433 
getShowFileName() const434 bool ShowfotoSettings::getShowFileName() const
435 {
436     return d->showFileName;
437 }
438 
getShowFileDate() const439 bool ShowfotoSettings::getShowFileDate() const
440 {
441     return d->showFileDate;
442 }
443 
getShowFileSize() const444 bool ShowfotoSettings::getShowFileSize() const
445 {
446     return d->showFileSize;
447 }
448 
getShowFileType() const449 bool ShowfotoSettings::getShowFileType() const
450 {
451     return d->showFileType;
452 }
453 
getShowFileDim() const454 bool ShowfotoSettings::getShowFileDim() const
455 {
456     return d->showFileDim;
457 }
458 
getShowPhotoMake() const459 bool ShowfotoSettings::getShowPhotoMake() const
460 {
461     return d->showPhotoMake;
462 }
463 
getShowPhotoLens() const464 bool ShowfotoSettings::getShowPhotoLens() const
465 {
466     return d->showPhotoLens;
467 }
468 
getShowPhotoFocal() const469 bool ShowfotoSettings::getShowPhotoFocal() const
470 {
471     return d->showPhotoFocal;
472 }
473 
getShowPhotoExpo() const474 bool ShowfotoSettings::getShowPhotoExpo() const
475 {
476     return d->showPhotoExpo;
477 }
478 
getShowPhotoFlash() const479 bool ShowfotoSettings::getShowPhotoFlash() const
480 {
481     return d->showPhotoFlash;
482 }
483 
getShowPhotoWB() const484 bool ShowfotoSettings::getShowPhotoWB() const
485 {
486     return d->showPhotoWB;
487 }
488 
getShowPhotoDate() const489 bool ShowfotoSettings::getShowPhotoDate() const
490 {
491     return d->showPhotoDate;
492 }
493 
getShowPhotoMode() const494 bool ShowfotoSettings::getShowPhotoMode() const
495 {
496     return d->showPhotoMode;
497 }
498 
getToolTipFont() const499 QFont ShowfotoSettings::getToolTipFont() const
500 {
501     return d->toolTipsFont;
502 }
503 
setShowToolTip(bool show)504 void ShowfotoSettings::setShowToolTip(bool show)
505 {
506     d->group.writeEntry(d->configShowToolTip, show);
507 }
508 
setShowFileName(bool show)509 void ShowfotoSettings::setShowFileName(bool show)
510 {
511     d->group.writeEntry(d->configShowFileName, show);
512 }
513 
setShowFileDate(bool show)514 void ShowfotoSettings::setShowFileDate(bool show)
515 {
516     d->group.writeEntry(d->configShowFileDate, show);
517 }
518 
setShowFileSize(bool show)519 void ShowfotoSettings::setShowFileSize(bool show)
520 {
521     d->group.writeEntry(d->configShowFileSize, show);
522 }
523 
setShowFileType(bool show)524 void ShowfotoSettings::setShowFileType(bool show)
525 {
526     d->group.writeEntry(d->configShowFileType, show);
527 }
528 
setShowFileDim(bool show)529 void ShowfotoSettings::setShowFileDim(bool show)
530 {
531     d->group.writeEntry(d->configShowFileDim, show);
532 }
533 
setShowPhotoMake(bool show)534 void ShowfotoSettings::setShowPhotoMake(bool show)
535 {
536     d->group.writeEntry(d->configShowPhotoMake, show);
537 }
538 
setShowPhotoLens(bool show)539 void ShowfotoSettings::setShowPhotoLens(bool show)
540 {
541     d->group.writeEntry(d->configShowPhotoLens, show);
542 }
543 
setShowPhotoFocal(bool show)544 void ShowfotoSettings::setShowPhotoFocal(bool show)
545 {
546     d->group.writeEntry(d->configShowPhotoFocal, show);
547 }
548 
setShowPhotoExpo(bool show)549 void ShowfotoSettings::setShowPhotoExpo(bool show)
550 {
551     d->group.writeEntry(d->configShowPhotoExpo, show);
552 }
553 
setShowPhotoFlash(bool show)554 void ShowfotoSettings::setShowPhotoFlash(bool show)
555 {
556     d->group.writeEntry(d->configShowPhotoFlash, show);
557 }
558 
setShowPhotoWB(bool show)559 void ShowfotoSettings::setShowPhotoWB(bool show)
560 {
561     d->group.writeEntry(d->configShowPhotoWB, show);
562 }
563 
setShowPhotoDate(bool show)564 void ShowfotoSettings::setShowPhotoDate(bool show)
565 {
566     d->group.writeEntry(d->configShowPhotoDate, show);
567 }
568 
setShowPhotoMode(bool show)569 void ShowfotoSettings::setShowPhotoMode(bool show)
570 {
571     d->group.writeEntry(d->configShowPhotoMode, show);
572 }
573 
setToolTipFont(const QFont & font)574 void ShowfotoSettings::setToolTipFont(const QFont& font)
575 {
576     d->group.writeEntry(d->configToolTipsFont, font);
577 }
578 
setLastOpenedDir(const QString & dir)579 void ShowfotoSettings::setLastOpenedDir(const QString& dir)
580 {
581     d->group.writeEntry(d->configLastOpenedDir, dir);
582 }
583 
setDeleteItem2Trash(bool D2t)584 void ShowfotoSettings::setDeleteItem2Trash(bool D2t)
585 {
586     d->group.writeEntry(d->configDeleteItem2Trash, D2t);
587 }
588 
setCurrentTheme(const QString & theme)589 void ShowfotoSettings::setCurrentTheme(const QString& theme)
590 {
591     d->group.writeEntry(d->configCurrentTheme, theme);
592 }
593 
setUpdateType(int type)594 void ShowfotoSettings::setUpdateType(int type)
595 {
596     d->group.writeEntry(d->configUpdateType, type);
597 }
598 
setUpdateWithDebug(bool dbg)599 void ShowfotoSettings::setUpdateWithDebug(bool dbg)
600 {
601     d->group.writeEntry(d->configUpdateWithDebug, dbg);
602 }
603 
setRightSideBarStyle(int style)604 void ShowfotoSettings::setRightSideBarStyle(int style)
605 {
606     d->group.writeEntry(d->configRightSideBarStyle, style);
607 }
608 
setApplicationStyle(const QString & style)609 void ShowfotoSettings::setApplicationStyle(const QString& style)
610 {
611     if (d->applicationStyle.compare(style, Qt::CaseInsensitive) != 0)
612     {
613         d->applicationStyle = style;
614         qApp->setStyle(d->applicationStyle);
615         qApp->style()->polish(qApp);
616         qCDebug(DIGIKAM_SHOWFOTO_LOG) << "Switch to widget style: " << d->applicationStyle;
617         d->group.writeEntry(d->configApplicationStyle, d->applicationStyle);
618     }
619 }
620 
setIconTheme(const QString & theme)621 void ShowfotoSettings::setIconTheme(const QString& theme)
622 {
623     d->group.writeEntry(d->configIconTheme, theme);
624 }
625 
setApplicationFont(const QFont & font)626 void ShowfotoSettings::setApplicationFont(const QFont& font)
627 {
628     if (d->applicationFont != font)
629     {
630         d->applicationFont = font;
631         qApp->setFont(d->applicationFont);
632         qCDebug(DIGIKAM_SHOWFOTO_LOG) << "Switch to application font: " << d->applicationFont;
633         d->group.writeEntry(d->configApplicationFont, d->applicationFont);
634     }
635 }
636 
setShowFormatOverThumbnail(bool show)637 void ShowfotoSettings::setShowFormatOverThumbnail(bool show)
638 {
639     d->group.writeEntry(d->configShowFormatOverThumbnail, show);
640 }
641 
setShowCoordinates(bool show)642 void ShowfotoSettings::setShowCoordinates(bool show)
643 {
644     d->group.writeEntry(d->configShowCoordinates, show);
645 }
646 
setShowSplash(bool show)647 void ShowfotoSettings::setShowSplash(bool show)
648 {
649     d->group.writeEntry(d->configShowSplash, show);
650 }
651 
setNativeFileDialog(bool item)652 void ShowfotoSettings::setNativeFileDialog(bool item)
653 {
654     d->group.writeEntry(d->configNativeFileDialog, item);
655 }
656 
setItemCenter(bool item)657 void ShowfotoSettings::setItemCenter(bool item)
658 {
659     d->group.writeEntry(d->configItemCenter, item);
660 }
661 
setSortRole(int order)662 void ShowfotoSettings::setSortRole(int order)
663 {
664     d->group.writeEntry(d->configSortOrder, order);
665 }
666 
setReverseSort(bool reverse)667 void ShowfotoSettings::setReverseSort(bool reverse)
668 {
669     d->group.writeEntry(d->configReverseSort, reverse);
670 }
671 
syncConfig()672 void ShowfotoSettings::syncConfig()
673 {
674     d->config->sync();
675 }
676 
677 } // namespace Showfoto
678