diff --git a/Settings/GeneralPage.cpp b/Settings/GeneralPage.cpp index 21b1f2f4..8836c0e9 100644 --- a/Settings/GeneralPage.cpp +++ b/Settings/GeneralPage.cpp @@ -1,326 +1,287 @@ /* Copyright (C) 2003-2020 The KPhotoAlbum Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "GeneralPage.h" #include "SettingsData.h" #include #include #include #include #include #include #include #include #include #include #include #include #include Settings::GeneralPage::GeneralPage(QWidget *parent) : QWidget(parent) { QVBoxLayout *lay1 = new QVBoxLayout(this); QGroupBox *box = new QGroupBox(i18n("Loading New Images"), this); lay1->addWidget(box); QGridLayout *lay = new QGridLayout(box); lay->setSpacing(6); int row = 0; // Thrust time stamps QLabel *timeStampLabel = new QLabel(i18n("Trust image dates:"), box); m_trustTimeStamps = new KComboBox(box); m_trustTimeStamps->addItems(QStringList() << i18nc("As in 'always trust image dates'", "Always") << i18nc("As in 'ask whether to trust image dates'", "Ask") << i18nc("As in 'never trust image dates'", "Never")); timeStampLabel->setBuddy(m_trustTimeStamps); lay->addWidget(timeStampLabel, row, 0); lay->addWidget(m_trustTimeStamps, row, 1, 1, 3); // Do Exif rotate row++; m_useEXIFRotate = new QCheckBox(i18n("Use Exif orientation information"), box); lay->addWidget(m_useEXIFRotate, row, 0, 1, 4); // Use Exif description row++; m_useEXIFComments = new QCheckBox(i18n("Use Exif description"), box); lay->addWidget(m_useEXIFComments, row, 0, 1, 4); connect(m_useEXIFComments, &QCheckBox::stateChanged, this, &GeneralPage::useEXIFCommentsChanged); m_stripEXIFComments = new QCheckBox(i18n("Strip out camera generated default descriptions"), box); connect(m_stripEXIFComments, &QCheckBox::stateChanged, this, &GeneralPage::stripEXIFCommentsChanged); lay->addWidget(m_stripEXIFComments, row, 1, 1, 4); row++; m_commentsToStrip = new QTextEdit(); m_commentsToStrip->setMaximumHeight(60); m_commentsToStrip->setEnabled(false); lay->addWidget(m_commentsToStrip, row, 1, 1, 4); // Use embedded thumbnail row++; m_useRawThumbnail = new QCheckBox(i18n("Use the embedded thumbnail in RAW file or halfsized RAW"), box); lay->addWidget(m_useRawThumbnail, row, 0); row++; QLabel *label = new QLabel(i18n("Required size for the thumbnail:"), box); m_useRawThumbnailWidth = new QSpinBox(box); m_useRawThumbnailWidth->setRange(100, 5000); m_useRawThumbnailWidth->setSingleStep(64); lay->addWidget(label, row, 0); lay->addWidget(m_useRawThumbnailWidth, row, 1); label = new QLabel(QString::fromLatin1("x"), box); m_useRawThumbnailHeight = new QSpinBox(box); m_useRawThumbnailHeight->setRange(100, 5000); m_useRawThumbnailHeight->setSingleStep(64); lay->addWidget(label, row, 2); lay->addWidget(m_useRawThumbnailHeight, row, 3); box = new QGroupBox(i18n("Histogram"), this); lay1->addWidget(box); lay = new QGridLayout(box); lay->setSpacing(6); row = 0; m_showHistogram = new QCheckBox(i18n("Show histogram"), box); lay->addWidget(m_showHistogram, row, 0); row++; connect(m_showHistogram, &QCheckBox::stateChanged, this, &GeneralPage::showHistogramChanged); m_histogramUseLinearScale = new QCheckBox(i18n("Use linear scale for histogram")); lay->addWidget(m_histogramUseLinearScale, row, 0); row++; label = new QLabel(i18n("Size of histogram columns in date bar:"), box); m_barWidth = new QSpinBox; m_barWidth->setRange(1, 100); m_barWidth->setSingleStep(1); lay->addWidget(label, row, 0); lay->addWidget(m_barWidth, row, 1); label = new QLabel(QString::fromLatin1("x"), box); m_barHeight = new QSpinBox; m_barHeight->setRange(15, 100); lay->addWidget(label, row, 2); lay->addWidget(m_barHeight, row, 3); box = new QGroupBox(i18n("Miscellaneous"), this); lay1->addWidget(box); lay = new QGridLayout(box); lay->setSpacing(6); row = 0; // Show splash screen m_showSplashScreen = new QCheckBox(i18n("Show splash screen"), box); lay->addWidget(m_showSplashScreen, row, 0); - // Album Category - row++; - QLabel *albumCategoryLabel = new QLabel(i18n("Category for virtual albums:"), box); - m_albumCategory = new QComboBox; - lay->addWidget(albumCategoryLabel, row, 0); - lay->addWidget(m_albumCategory, row, 1); - - const QList categories = DB::ImageDB::instance()->categoryCollection()->categories(); - for (const DB::CategoryPtr &category : categories) { - m_albumCategory->addItem(category->name()); - } - #ifdef KPA_ENABLE_REMOTECONTROL m_listenForAndroidDevicesOnStartup = new QCheckBox(i18n("Listen for Android devices on startup")); lay->addWidget(m_listenForAndroidDevicesOnStartup); #endif lay1->addStretch(1); // Whats This QString txt; txt = i18n("

KPhotoAlbum will try to read the image date from Exif information in the image. " "If that fails it will try to get the date from the file's time stamp.

" "

However, this information will be wrong if the image was scanned in (you want the date the image " "was taken, not the date of the scan).

" "

If you only scan images, in contrast to sometimes using " "a digital camera, you should reply no. If you never scan images, you should reply yes, " "otherwise reply ask. This will allow you to decide whether the images are from " "the scanner or the camera, from session to session.

"); timeStampLabel->setWhatsThis(txt); m_trustTimeStamps->setWhatsThis(txt); txt = i18n("

JPEG images may contain information about rotation. " "If you have a reason for not using this information to get a default rotation of " "your images, uncheck this check box.

" "

Note: Your digital camera may not write this information into the images at all.

"); m_useEXIFRotate->setWhatsThis(txt); txt = i18n("

JPEG images may contain a description. " "Check this checkbox to specify if you want to use this as a " "default description for your images.

"); m_useEXIFComments->setWhatsThis(txt); - txt = i18n("

KPhotoAlbum shares plugins with other imaging applications, some of which have the concept of albums. " - "KPhotoAlbum does not have this concept; nevertheless, for certain plugins to function, KPhotoAlbum behaves " - "to the plugin system as if it did.

" - "

KPhotoAlbum does this by defining the current album to be the current view - that is, all the images the " - "browser offers to display.

" - "

In addition to the current album, KPhotoAlbum must also be able to give a list of all albums; " - "the list of all albums is defined in the following way:" - "

  • When KPhotoAlbum's browser displays the content of a category, say all People, then each item in this category " - "will look like an album to the plugin.
  • " - "
  • Otherwise, the category you specify using this option will be used; e.g. if you specify People " - "with this option, then KPhotoAlbum will act as if you had just chosen to display people and then invoke " - "the plugin which needs to know about all albums.

" - "

Most users would probably want to specify Events here.

"); - albumCategoryLabel->setWhatsThis(txt); - m_albumCategory->setWhatsThis(txt); - txt = i18n("Show the KPhotoAlbum splash screen on start up"); m_showSplashScreen->setWhatsThis(txt); #ifdef KPA_ENABLE_REMOTECONTROL txt = i18n("

KPhotoAlbum is capable of showing your images on android devices. KPhotoAlbum will automatically pair with the app from " "android. This, however, requires that KPhotoAlbum on your desktop is listening for multicast messages. " "Checking this checkbox will make KPhotoAlbum do so automatically on start up. " "Alternatively, you can click the connection icon in the status bar to start listening."); m_listenForAndroidDevicesOnStartup->setWhatsThis(txt); #endif txt = i18n("

Some cameras automatically store generic comments in each image. " "These comments can be ignored automatically.

" "

Enter the comments that you want to ignore in the input field, one per line. " "Be sure to add the exact comment, including all whitespace.

"); m_stripEXIFComments->setWhatsThis(txt); m_commentsToStrip->setWhatsThis(txt); } void Settings::GeneralPage::loadSettings(Settings::SettingsData *opt) { m_trustTimeStamps->setCurrentIndex(opt->tTimeStamps()); m_useEXIFRotate->setChecked(opt->useEXIFRotate()); m_useEXIFComments->setChecked(opt->useEXIFComments()); m_stripEXIFComments->setChecked(opt->stripEXIFComments()); m_stripEXIFComments->setEnabled(opt->useEXIFComments()); QStringList commentsToStrip = opt->EXIFCommentsToStrip(); QString commentsToStripStr; for (int i = 0; i < commentsToStrip.size(); ++i) { if (commentsToStripStr.size() > 0) { commentsToStripStr += QString::fromLatin1("\n"); } commentsToStripStr += commentsToStrip.at(i); } m_commentsToStrip->setPlainText(commentsToStripStr); m_commentsToStrip->setEnabled(opt->stripEXIFComments()); m_useRawThumbnail->setChecked(opt->useRawThumbnail()); setUseRawThumbnailSize(QSize(opt->useRawThumbnailSize().width(), opt->useRawThumbnailSize().height())); m_barWidth->setValue(opt->histogramSize().width()); m_barHeight->setValue(opt->histogramSize().height()); m_showHistogram->setChecked(opt->showHistogram()); m_histogramUseLinearScale->setChecked(opt->histogramUseLinearScale()); m_showSplashScreen->setChecked(opt->showSplashScreen()); #ifdef KPA_ENABLE_REMOTECONTROL m_listenForAndroidDevicesOnStartup->setChecked(opt->listenForAndroidDevicesOnStartup()); #endif - DB::CategoryPtr cat = DB::ImageDB::instance()->categoryCollection()->categoryForName(opt->albumCategory()); - if (!cat) - cat = DB::ImageDB::instance()->categoryCollection()->categories()[0]; - - m_albumCategory->setEditText(cat->name()); } void Settings::GeneralPage::saveSettings(Settings::SettingsData *opt) { opt->setTTimeStamps((TimeStampTrust)m_trustTimeStamps->currentIndex()); opt->setUseEXIFRotate(m_useEXIFRotate->isChecked()); opt->setUseEXIFComments(m_useEXIFComments->isChecked()); opt->setStripEXIFComments(m_stripEXIFComments->isChecked()); QStringList commentsToStrip = m_commentsToStrip->toPlainText().split(QString::fromLatin1("\n")); // Put the processable list to opt opt->setEXIFCommentsToStrip(commentsToStrip); QString commentsToStripString; for (QString comment : commentsToStrip) { // separate comments with "-,-" and escape existing commas by doubling if (!comment.isEmpty()) commentsToStripString += comment.replace(QString::fromLatin1(","), QString::fromLatin1(",,")) + QString::fromLatin1("-,-"); } // Put the storable list to opt opt->setCommentsToStrip(commentsToStripString); opt->setUseRawThumbnail(m_useRawThumbnail->isChecked()); opt->setUseRawThumbnailSize(QSize(useRawThumbnailSize())); opt->setShowHistogram(m_showHistogram->isChecked()); opt->setHistogramUseLinearScale(m_histogramUseLinearScale->isChecked()); opt->setShowSplashScreen(m_showSplashScreen->isChecked()); #ifdef KPA_ENABLE_REMOTECONTROL opt->setListenForAndroidDevicesOnStartup(m_listenForAndroidDevicesOnStartup->isChecked()); #endif - QString name = m_albumCategory->currentText(); - if (name.isNull()) { - name = DB::ImageDB::instance()->categoryCollection()->categoryNames()[0]; - } - opt->setAlbumCategory(name); - opt->setHistogramSize(QSize(m_barWidth->value(), m_barHeight->value())); } void Settings::GeneralPage::setUseRawThumbnailSize(const QSize &size) { m_useRawThumbnailWidth->setValue(size.width()); m_useRawThumbnailHeight->setValue(size.height()); } QSize Settings::GeneralPage::useRawThumbnailSize() { return QSize(m_useRawThumbnailWidth->value(), m_useRawThumbnailHeight->value()); } void Settings::GeneralPage::showHistogramChanged(int state) const { const bool checked = state == Qt::Checked; m_histogramUseLinearScale->setChecked(checked); m_barHeight->setEnabled(checked); m_barWidth->setEnabled(checked); MainWindow::Window::theMainWindow()->setHistogramVisibilty(checked); } void Settings::GeneralPage::useEXIFCommentsChanged(int state) { m_stripEXIFComments->setEnabled(state); m_commentsToStrip->setEnabled(state && m_stripEXIFComments->isChecked()); } void Settings::GeneralPage::stripEXIFCommentsChanged(int state) { m_commentsToStrip->setEnabled(state); } // vi:expandtab:tabstop=4 shiftwidth=4: diff --git a/Settings/GeneralPage.h b/Settings/GeneralPage.h index a043ef09..82c1016f 100644 --- a/Settings/GeneralPage.h +++ b/Settings/GeneralPage.h @@ -1,69 +1,68 @@ -/* Copyright (C) 2003-2019 The KPhotoAlbum Development Team +/* Copyright (C) 2003-2020 The KPhotoAlbum Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GENERALPAGE_H #define GENERALPAGE_H #include class QComboBox; class QSpinBox; class QCheckBox; class KComboBox; class QTextEdit; namespace Settings { class SettingsData; class GeneralPage : public QWidget { Q_OBJECT public: explicit GeneralPage(QWidget *parent); void loadSettings(Settings::SettingsData *); void saveSettings(Settings::SettingsData *); void setUseRawThumbnailSize(const QSize &size); QSize useRawThumbnailSize(); private slots: void showHistogramChanged(int state) const; void useEXIFCommentsChanged(int state); void stripEXIFCommentsChanged(int state); private: KComboBox *m_trustTimeStamps; QCheckBox *m_useEXIFRotate; QCheckBox *m_useEXIFComments; QTextEdit *m_commentsToStrip; QCheckBox *m_stripEXIFComments; QCheckBox *m_useRawThumbnail; QSpinBox *m_useRawThumbnailWidth; QSpinBox *m_useRawThumbnailHeight; QCheckBox *m_showHistogram; QCheckBox *m_histogramUseLinearScale; QSpinBox *m_barWidth; QSpinBox *m_barHeight; QCheckBox *m_showSplashScreen; - QComboBox *m_albumCategory; #ifdef KPA_ENABLE_REMOTECONTROL QCheckBox *m_listenForAndroidDevicesOnStartup; #endif }; } #endif /* GENERALPAGE_H */ // vi:expandtab:tabstop=4 shiftwidth=4: diff --git a/Settings/SettingsData.cpp b/Settings/SettingsData.cpp index 765dbfa2..a40b6292 100644 --- a/Settings/SettingsData.cpp +++ b/Settings/SettingsData.cpp @@ -1,619 +1,605 @@ /* Copyright (C) 2003-2020 The KPhotoAlbum Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License or (at your option) version 3 or any later version accepted by the membership of KDE e. V. (or its successor approved by the membership of KDE e. V.), which shall act as a proxy defined in Section 14 of version 3 of the license. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "SettingsData.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #define STR(x) QString::fromLatin1(x) #define value(GROUP, OPTION, DEFAULT) \ KSharedConfig::openConfig()->group(GROUP).readEntry(OPTION, DEFAULT) #define setValue(GROUP, OPTION, VALUE) \ { \ KConfigGroup group = KSharedConfig::openConfig()->group(GROUP); \ group.writeEntry(OPTION, VALUE); \ group.sync(); \ } #define getValueFunc_(TYPE, FUNC, GROUP, OPTION, DEFAULT) \ TYPE SettingsData::FUNC() const \ { \ return (TYPE)value(GROUP, OPTION, DEFAULT); \ } #define setValueFunc_(FUNC, TYPE, GROUP, OPTION, VALUE) \ void SettingsData::FUNC(const TYPE v) \ { \ setValue(GROUP, OPTION, VALUE); \ } #define getValueFunc(TYPE, FUNC, GROUP, DEFAULT) getValueFunc_(TYPE, FUNC, #GROUP, #FUNC, DEFAULT) #define setValueFunc(FUNC, TYPE, GROUP, OPTION) setValueFunc_(FUNC, TYPE, #GROUP, #OPTION, v) // TODO(mfwitten): document parameters. #define property_(GET_TYPE, GET_FUNC, GET_VALUE, SET_FUNC, SET_TYPE, SET_VALUE, GROUP, OPTION, GET_DEFAULT_1, GET_DEFAULT_2, GET_DEFAULT_2_TYPE) \ GET_TYPE SettingsData::GET_FUNC() const \ { \ KConfigGroup g = KSharedConfig::openConfig()->group(GROUP); \ \ if (!g.hasKey(OPTION)) \ return GET_DEFAULT_1; \ \ GET_DEFAULT_2_TYPE v = g.readEntry(OPTION, (GET_DEFAULT_2_TYPE)GET_DEFAULT_2); \ return (GET_TYPE)GET_VALUE; \ } \ setValueFunc_(SET_FUNC, SET_TYPE, GROUP, OPTION, SET_VALUE) #define property(GET_TYPE, GET_FUNC, SET_FUNC, SET_TYPE, SET_VALUE, GROUP, OPTION, GET_DEFAULT) \ getValueFunc_(GET_TYPE, GET_FUNC, GROUP, OPTION, GET_DEFAULT) \ setValueFunc_(SET_FUNC, SET_TYPE, GROUP, OPTION, SET_VALUE) #define property_copy(GET_FUNC, SET_FUNC, TYPE, GROUP, GET_DEFAULT) \ property(TYPE, GET_FUNC, SET_FUNC, TYPE, v, #GROUP, #GET_FUNC, GET_DEFAULT) #define property_ref_(GET_FUNC, SET_FUNC, TYPE, GROUP, GET_DEFAULT) \ property(TYPE, GET_FUNC, SET_FUNC, TYPE &, v, GROUP, #GET_FUNC, GET_DEFAULT) #define property_ref(GET_FUNC, SET_FUNC, TYPE, GROUP, GET_DEFAULT) \ property(TYPE, GET_FUNC, SET_FUNC, TYPE &, v, #GROUP, #GET_FUNC, GET_DEFAULT) #define property_enum(GET_FUNC, SET_FUNC, TYPE, GROUP, GET_DEFAULT) \ property(TYPE, GET_FUNC, SET_FUNC, TYPE, (int)v, #GROUP, #GET_FUNC, (int)GET_DEFAULT) #define property_sset(GET_FUNC, SET_FUNC, GROUP, GET_DEFAULT) \ property_(StringSet, GET_FUNC, v.toSet(), SET_FUNC, StringSet &, v.toList(), #GROUP, #GET_FUNC, GET_DEFAULT, QStringList(), QStringList) /** * smoothScale() is called from the image loading thread, therefore we need * to cache it this way, rather than going to KConfig. */ static bool _smoothScale = true; using namespace Settings; const WindowType Settings::MainWindow = "MainWindow"; const WindowType Settings::AnnotationDialog = "AnnotationDialog"; SettingsData *SettingsData::s_instance = nullptr; SettingsData *SettingsData::instance() { if (!s_instance) qFatal("instance called before loading a setup!"); return s_instance; } bool SettingsData::ready() { return s_instance; } void SettingsData::setup(const QString &imageDirectory) { if (!s_instance) s_instance = new SettingsData(imageDirectory); } SettingsData::SettingsData(const QString &imageDirectory) { m_hasAskedAboutTimeStamps = false; QString s = STR("/"); m_imageDirectory = imageDirectory.endsWith(s) ? imageDirectory : imageDirectory + s; _smoothScale = value("Viewer", "smoothScale", true); // Split the list of Exif comments that should be stripped automatically to a list QStringList commentsToStrip = value("General", "commentsToStrip", QString::fromLatin1("Exif_JPEG_PICTURE-,-OLYMPUS DIGITAL CAMERA-,-JENOPTIK DIGITAL CAMERA-,-")).split(QString::fromLatin1("-,-"), QString::SkipEmptyParts); for (QString &comment : commentsToStrip) comment.replace(QString::fromLatin1(",,"), QString::fromLatin1(",")); m_EXIFCommentsToStrip = commentsToStrip; } ///////////////// //// General //// ///////////////// // clang-format off property_copy(useEXIFRotate, setUseEXIFRotate, bool, General, true) property_copy(useEXIFComments, setUseEXIFComments, bool, General, true) property_copy(stripEXIFComments, setStripEXIFComments, bool, General, true) property_copy(commentsToStrip, setCommentsToStrip, QString, General, "" /* see constructor */) property_copy(searchForImagesOnStart, setSearchForImagesOnStart, bool, General, true) property_copy(ignoreFileExtension, setIgnoreFileExtension, bool, General, false) property_copy(skipSymlinks, setSkipSymlinks, bool, General, false) property_copy(skipRawIfOtherMatches, setSkipRawIfOtherMatches, bool, General, false) property_copy(useRawThumbnail, setUseRawThumbnail, bool, General, true) property_copy(useRawThumbnailSize, setUseRawThumbnailSize, QSize, General, QSize(1024, 768)) property_copy(useCompressedIndexXML, setUseCompressedIndexXML, bool, General, true) property_copy(compressBackup, setCompressBackup, bool, General, true) property_copy(showSplashScreen, setShowSplashScreen, bool, General, true) property_copy(showHistogram, setShowHistogram, bool, General, true) property_copy(autoSave, setAutoSave, int, General, 5) property_copy(backupCount, setBackupCount, int, General, 5) property_enum(tTimeStamps, setTTimeStamps, TimeStampTrust, General, Always) property_copy(excludeDirectories, setExcludeDirectories, QString, General, QString::fromLatin1("xml,ThumbNails,.thumbs")) #ifdef KPA_ENABLE_REMOTECONTROL property_copy(recentAndroidAddress, setRecentAndroidAddress, QString, General, QString()) property_copy(listenForAndroidDevicesOnStartup, setListenForAndroidDevicesOnStartup, bool, General, false) #endif getValueFunc(QString, colorScheme, General, QString()) void SettingsData::setColorScheme(const QString &path) { if (path != colorScheme()) { setValue("General", "colorScheme", path); emit colorSchemeChanged(); } } getValueFunc(QSize, histogramSize, General, QSize(15, 30)) getValueFunc(ViewSortType, viewSortType, General, (int)SortLastUse) getValueFunc(AnnotationDialog::MatchType, matchType, General, (int)AnnotationDialog::MatchFromWordStart) getValueFunc(bool, histogramUseLinearScale, General, false) // clang-format on void SettingsData::setHistogramUseLinearScale(const bool useLinearScale) { if (useLinearScale == histogramUseLinearScale()) return; setValue("General", "histogramUseLinearScale", useLinearScale); emit histogramScaleChanged(); } void SettingsData::setHistogramSize(const QSize &size) { if (size == histogramSize()) return; setValue("General", "histogramSize", size); emit histogramSizeChanged(size); } void SettingsData::setViewSortType(const ViewSortType tp) { if (tp == viewSortType()) return; setValue("General", "viewSortType", (int)tp); emit viewSortTypeChanged(tp); } void SettingsData::setMatchType(const AnnotationDialog::MatchType mt) { if (mt == matchType()) return; setValue("General", "matchType", (int)mt); emit matchTypeChanged(mt); } bool SettingsData::trustTimeStamps() { if (tTimeStamps() == Always) return true; else if (tTimeStamps() == Never) return false; else { if (!m_hasAskedAboutTimeStamps) { QApplication::setOverrideCursor(Qt::ArrowCursor); QString txt = i18n("When reading time information of images, their Exif info is used. " "Exif info may, however, not be supported by your KPhotoAlbum installation, " "or no valid information may be in the file. " "As a backup, KPhotoAlbum may use the timestamp of the image - this may, " "however, not be valid in case the image is scanned in. " "So the question is, should KPhotoAlbum trust the time stamp on your images?"); int answer = KMessageBox::questionYesNo(nullptr, txt, i18n("Trust Time Stamps?")); QApplication::restoreOverrideCursor(); if (answer == KMessageBox::Yes) m_trustTimeStamps = true; else m_trustTimeStamps = false; m_hasAskedAboutTimeStamps = true; } return m_trustTimeStamps; } } //////////////////////////////// //// File Version Detection //// //////////////////////////////// // clang-format off property_copy(detectModifiedFiles, setDetectModifiedFiles, bool, FileVersionDetection, true) property_copy(modifiedFileComponent, setModifiedFileComponent, QString, FileVersionDetection, "^(.*)-edited.([^.]+)$") property_copy(originalFileComponent, setOriginalFileComponent, QString, FileVersionDetection, "\\1.\\2") property_copy(moveOriginalContents, setMoveOriginalContents, bool, FileVersionDetection, false) property_copy(autoStackNewFiles, setAutoStackNewFiles, bool, FileVersionDetection, true) property_copy(copyFileComponent, setCopyFileComponent, QString, FileVersionDetection, "(.[^.]+)$") property_copy(copyFileReplacementComponent, setCopyFileReplacementComponent, QString, FileVersionDetection, "-edited\\1") property_copy(loadOptimizationPreset, setLoadOptimizationPreset, int, FileVersionDetection, 0) property_copy(overlapLoadMD5, setOverlapLoadMD5, bool, FileVersionDetection, false) property_copy(preloadThreadCount, setPreloadThreadCount, int, FileVersionDetection, 1) property_copy(thumbnailPreloadThreadCount, setThumbnailPreloadThreadCount, int, FileVersionDetection, 1) property_copy(thumbnailBuilderThreadCount, setThumbnailBuilderThreadCount, int, FileVersionDetection, 0) // clang-format on //////////////////// //// Thumbnails //// //////////////////// // clang-format off property_copy(displayLabels, setDisplayLabels, bool, Thumbnails, true) property_copy(displayCategories, setDisplayCategories, bool, Thumbnails, false) property_copy(autoShowThumbnailView, setAutoShowThumbnailView, int, Thumbnails, 20) property_copy(showNewestThumbnailFirst, setShowNewestFirst, bool, Thumbnails, false) property_copy(thumbnailDisplayGrid, setThumbnailDisplayGrid, bool, Thumbnails, false) property_copy(previewSize, setPreviewSize, int, Thumbnails, 256) property_copy(thumbnailSpace, setThumbnailSpace, int, Thumbnails, 4) // not available via GUI, but should be consistent (and maybe confgurable for powerusers): property_copy(minimumThumbnailSize, setMinimumThumbnailSize, int, Thumbnails, 32) property_copy(maximumThumbnailSize, setMaximumThumbnailSize, int, Thumbnails, 4096) property_enum(thumbnailAspectRatio, setThumbnailAspectRatio, ThumbnailAspectRatio, Thumbnails, Aspect_3_2) property_copy(incrementalThumbnails, setIncrementalThumbnails, bool, Thumbnails, true) // database specific so that changing it doesn't invalidate the thumbnail cache for other databases: getValueFunc_(int, thumbnailSize, groupForDatabase("Thumbnails"), "thumbSize", 256) // clang-format on void SettingsData::setThumbnailSize(int value) { // enforce limits: value = qBound(minimumThumbnailSize(), value, maximumThumbnailSize()); if (value != thumbnailSize()) emit thumbnailSizeChanged(value); setValue(groupForDatabase("Thumbnails"), "thumbSize", value); } int SettingsData::actualThumbnailSize() const { // this is database specific since it's a derived value of thumbnailSize int retval = value(groupForDatabase("Thumbnails"), "actualThumbSize", 0); // if no value has been set, use thumbnailSize if (retval == 0) retval = thumbnailSize(); return retval; } void SettingsData::setActualThumbnailSize(int value) { QPixmapCache::clear(); // enforce limits: value = qBound(minimumThumbnailSize(), value, thumbnailSize()); if (value != actualThumbnailSize()) { setValue(groupForDatabase("Thumbnails"), "actualThumbSize", value); emit actualThumbnailSizeChanged(value); } } //////////////// //// Viewer //// //////////////// // clang-format off property_ref(viewerSize, setViewerSize, QSize, Viewer, QSize(1024, 768)) property_ref(slideShowSize, setSlideShowSize, QSize, Viewer, QSize(1024, 768)) property_copy(launchViewerFullScreen, setLaunchViewerFullScreen, bool, Viewer, false) property_copy(launchSlideShowFullScreen, setLaunchSlideShowFullScreen, bool, Viewer, true) property_copy(showInfoBox, setShowInfoBox, bool, Viewer, true) property_copy(showLabel, setShowLabel, bool, Viewer, true) property_copy(showDescription, setShowDescription, bool, Viewer, true) property_copy(showDate, setShowDate, bool, Viewer, true) property_copy(showImageSize, setShowImageSize, bool, Viewer, true) property_copy(showRating, setShowRating, bool, Viewer, true) property_copy(showTime, setShowTime, bool, Viewer, true) property_copy(showFilename, setShowFilename, bool, Viewer, false) property_copy(showEXIF, setShowEXIF, bool, Viewer, true) property_copy(slideShowInterval, setSlideShowInterval, int, Viewer, 5) property_copy(viewerCacheSize, setViewerCacheSize, int, Viewer, 195) property_copy(infoBoxWidth, setInfoBoxWidth, int, Viewer, 400) property_copy(infoBoxHeight, setInfoBoxHeight, int, Viewer, 300) property_enum(infoBoxPosition, setInfoBoxPosition, Position, Viewer, Bottom) property_enum(viewerStandardSize, setViewerStandardSize, StandardViewSize, Viewer, FullSize) // clang-format on bool SettingsData::smoothScale() const { return _smoothScale; } void SettingsData::setSmoothScale(bool b) { _smoothScale = b; setValue("Viewer", "smoothScale", b); } //////////////////// //// Categories //// //////////////////// -setValueFunc(setAlbumCategory, QString &, General, albumCategory) - - QString SettingsData::albumCategory() const -{ - QString category = value("General", "albumCategory", STR("")); - - if (!DB::ImageDB::instance()->categoryCollection()->categoryNames().contains(category)) { - category = DB::ImageDB::instance()->categoryCollection()->categoryNames()[0]; - const_cast(this)->setAlbumCategory(category); - } - - return category; -} - // clang-format off property_ref(untaggedCategory, setUntaggedCategory, QString, General, i18n("Events")) property_ref(untaggedTag, setUntaggedTag, QString, General, i18n("untagged")) property_copy(untaggedImagesTagVisible, setUntaggedImagesTagVisible, bool, General, false) // clang-format on ////////////// //// Exif //// ////////////// // clang-format off property_sset(exifForViewer, setExifForViewer, Exif, StringSet()) property_sset(exifForDialog, setExifForDialog, Exif, Exif::Info::instance()->standardKeys()) property_ref(iptcCharset, setIptcCharset, QString, Exif, QString()) // clang-format on ///////////////////// //// Exif Import //// ///////////////////// // clang-format off property_copy(updateExifData, setUpdateExifData, bool, ExifImport, true) property_copy(updateImageDate, setUpdateImageDate, bool, ExifImport, false) property_copy(useModDateIfNoExif, setUseModDateIfNoExif, bool, ExifImport, true) property_copy(updateOrientation, setUpdateOrientation, bool, ExifImport, false) property_copy(updateDescription, setUpdateDescription, bool, ExifImport, false) // clang-format on /////////////////////// //// Miscellaneous //// /////////////////////// // clang-format off property_ref_(HTMLBaseDir, setHTMLBaseDir, QString, groupForDatabase("HTML Settings"), QString::fromLocal8Bit(qgetenv("HOME")) + STR("/public_html")) property_ref_(HTMLBaseURL, setHTMLBaseURL, QString, groupForDatabase("HTML Settings"), STR("file://") + HTMLBaseDir()) property_ref_(HTMLDestURL, setHTMLDestURL, QString, groupForDatabase("HTML Settings"), STR("file://") + HTMLBaseDir()) property_ref_(HTMLCopyright, setHTMLCopyright, QString, groupForDatabase("HTML Settings"), STR("")) property_ref_(HTMLDate, setHTMLDate, int, groupForDatabase("HTML Settings"), true) property_ref_(HTMLTheme, setHTMLTheme, int, groupForDatabase("HTML Settings"), -1) property_ref_(HTMLKimFile, setHTMLKimFile, int, groupForDatabase("HTML Settings"), true) property_ref_(HTMLInlineMovies, setHTMLInlineMovies, int, groupForDatabase("HTML Settings"), true) property_ref_(HTML5Video, setHTML5Video, int, groupForDatabase("HTML Settings"), true) property_ref_(HTML5VideoGenerate, setHTML5VideoGenerate, int, groupForDatabase("HTML Settings"), true) property_ref_(HTMLThumbSize, setHTMLThumbSize, int, groupForDatabase("HTML Settings"), 128) property_ref_(HTMLNumOfCols, setHTMLNumOfCols, int, groupForDatabase("HTML Settings"), 5) property_ref_(HTMLSizes, setHTMLSizes, QString, groupForDatabase("HTML Settings"), STR("")) property_ref_(HTMLIncludeSelections, setHTMLIncludeSelections, QString, groupForDatabase("HTML Settings"), STR("")) // clang-format on QDate SettingsData::fromDate() const { QString date = value("Miscellaneous", "fromDate", STR("")); return date.isEmpty() ? QDate(QDate::currentDate().year(), 1, 1) : QDate::fromString(date, Qt::ISODate); } void SettingsData::setFromDate(const QDate &date) { if (date.isValid()) setValue("Miscellaneous", "fromDate", date.toString(Qt::ISODate)); } QDate SettingsData::toDate() const { QString date = value("Miscellaneous", "toDate", STR("")); return date.isEmpty() ? QDate(QDate::currentDate().year() + 1, 1, 1) : QDate::fromString(date, Qt::ISODate); } void SettingsData::setToDate(const QDate &date) { if (date.isValid()) setValue("Miscellaneous", "toDate", date.toString(Qt::ISODate)); } QString SettingsData::imageDirectory() const { return m_imageDirectory; } QString SettingsData::groupForDatabase(const char *setting) const { return STR("%1 - %2").arg(STR(setting)).arg(imageDirectory()); } DB::ImageSearchInfo SettingsData::currentLock() const { return DB::ImageSearchInfo::loadLock(); } void SettingsData::setCurrentLock(const DB::ImageSearchInfo &info, bool exclude) { info.saveLock(); setValue(groupForDatabase("Privacy Settings"), "exclude", exclude); } bool SettingsData::lockExcludes() const { return value(groupForDatabase("Privacy Settings"), "exclude", false); } getValueFunc_(bool, locked, groupForDatabase("Privacy Settings"), "locked", false) void SettingsData::setLocked(bool lock, bool force) { if (lock == locked() && !force) return; setValue(groupForDatabase("Privacy Settings"), "locked", lock); emit locked(lock, lockExcludes()); } void SettingsData::setWindowGeometry(WindowType win, const QRect &geometry) { setValue("Window Geometry", win, geometry); } QRect SettingsData::windowGeometry(WindowType win) const { return value("Window Geometry", win, QRect(0, 0, 800, 600)); } bool Settings::SettingsData::hasUntaggedCategoryFeatureConfigured() const { return DB::ImageDB::instance()->categoryCollection()->categoryNames().contains(untaggedCategory()) && DB::ImageDB::instance()->categoryCollection()->categoryForName(untaggedCategory())->items().contains(untaggedTag()); } double Settings::SettingsData::getThumbnailAspectRatio() const { double ratio = 1.0; switch (Settings::SettingsData::instance()->thumbnailAspectRatio()) { case Settings::Aspect_16_9: ratio = 9.0 / 16; break; case Settings::Aspect_4_3: ratio = 3.0 / 4; break; case Settings::Aspect_3_2: ratio = 2.0 / 3; break; case Settings::Aspect_9_16: ratio = 16 / 9.0; break; case Settings::Aspect_3_4: ratio = 4 / 3.0; break; case Settings::Aspect_2_3: ratio = 3 / 2.0; break; case Settings::Aspect_1_1: ratio = 1.0; break; } return ratio; } QStringList Settings::SettingsData::EXIFCommentsToStrip() { return m_EXIFCommentsToStrip; } void Settings::SettingsData::setEXIFCommentsToStrip(QStringList EXIFCommentsToStrip) { m_EXIFCommentsToStrip = EXIFCommentsToStrip; } bool Settings::SettingsData::getOverlapLoadMD5() const { switch (Settings::SettingsData::instance()->loadOptimizationPreset()) { case Settings::LoadOptimizationSlowNVME: case Settings::LoadOptimizationFastNVME: return true; break; case Settings::LoadOptimizationManual: return Settings::SettingsData::instance()->overlapLoadMD5(); break; case Settings::LoadOptimizationHardDisk: case Settings::LoadOptimizationNetwork: case Settings::LoadOptimizationSataSSD: default: return false; break; } } int Settings::SettingsData::getPreloadThreadCount() const { switch (Settings::SettingsData::instance()->loadOptimizationPreset()) { case Settings::LoadOptimizationManual: return Settings::SettingsData::instance()->preloadThreadCount(); break; case Settings::LoadOptimizationSlowNVME: case Settings::LoadOptimizationFastNVME: case Settings::LoadOptimizationSataSSD: return qMax(1, qMin(16, QThread::idealThreadCount())); break; case Settings::LoadOptimizationHardDisk: case Settings::LoadOptimizationNetwork: default: return 1; break; } } int Settings::SettingsData::getThumbnailPreloadThreadCount() const { switch (Settings::SettingsData::instance()->loadOptimizationPreset()) { case Settings::LoadOptimizationManual: return Settings::SettingsData::instance()->thumbnailPreloadThreadCount(); break; case Settings::LoadOptimizationSlowNVME: case Settings::LoadOptimizationFastNVME: case Settings::LoadOptimizationSataSSD: return qMax(1, qMin(16, QThread::idealThreadCount() / 2)); break; case Settings::LoadOptimizationHardDisk: case Settings::LoadOptimizationNetwork: default: return 1; break; } } int Settings::SettingsData::getThumbnailBuilderThreadCount() const { switch (Settings::SettingsData::instance()->loadOptimizationPreset()) { case Settings::LoadOptimizationManual: return Settings::SettingsData::instance()->thumbnailBuilderThreadCount(); break; case Settings::LoadOptimizationSlowNVME: case Settings::LoadOptimizationFastNVME: case Settings::LoadOptimizationSataSSD: case Settings::LoadOptimizationHardDisk: case Settings::LoadOptimizationNetwork: default: return qMax(1, qMin(16, QThread::idealThreadCount() - 1)); break; } } // vi:expandtab:tabstop=4 shiftwidth=4: diff --git a/Settings/SettingsData.h b/Settings/SettingsData.h index 83f5ec63..55fb7372 100644 --- a/Settings/SettingsData.h +++ b/Settings/SettingsData.h @@ -1,285 +1,284 @@ /* Copyright (C) 2003-2020 The KPhotoAlbum Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef SETTINGS_SETTINGSDATA_H #define SETTINGS_SETTINGSDATA_H #include #include #include #include #define property(GET_TYPE, GET_FUNC, SET_FUNC, SET_TYPE) \ GET_TYPE GET_FUNC() const; \ void SET_FUNC(const SET_TYPE) #define property_copy(GET_FUNC, SET_FUNC, TYPE) property(TYPE, GET_FUNC, SET_FUNC, TYPE) #define property_ref(GET_FUNC, SET_FUNC, TYPE) property(TYPE, GET_FUNC, SET_FUNC, TYPE &) namespace DB { class CategoryCollection; } namespace Settings { using Utilities::StringSet; enum Position { Bottom, Top, Left, Right, TopLeft, TopRight, BottomLeft, BottomRight }; enum ViewSortType { SortLastUse, SortAlphaTree, SortAlphaFlat }; enum TimeStampTrust { Always, Ask, Never }; enum StandardViewSize { FullSize, NaturalSize, NaturalSizeIfFits }; enum ThumbnailAspectRatio { Aspect_1_1, Aspect_4_3, Aspect_3_2, Aspect_16_9, Aspect_3_4, Aspect_2_3, Aspect_9_16 }; enum LoadOptimizationPreset { LoadOptimizationHardDisk, LoadOptimizationNetwork, LoadOptimizationSataSSD, LoadOptimizationSlowNVME, LoadOptimizationFastNVME, LoadOptimizationManual }; typedef const char *WindowType; extern const WindowType MainWindow, AnnotationDialog; class SettingsData : public QObject { Q_OBJECT public: static SettingsData *instance(); static bool ready(); static void setup(const QString &imageDirectory); ///////////////// //// General //// ///////////////// property_ref(histogramSize, setHistogramSize, QSize); property_copy(useEXIFRotate, setUseEXIFRotate, bool); property_copy(useEXIFComments, setUseEXIFComments, bool); property_copy(stripEXIFComments, setStripEXIFComments, bool); property_copy(commentsToStrip, setCommentsToStrip, QString); property_copy(searchForImagesOnStart, setSearchForImagesOnStart, bool); property_copy(ignoreFileExtension, setIgnoreFileExtension, bool); property_copy(skipSymlinks, setSkipSymlinks, bool); property_copy(skipRawIfOtherMatches, setSkipRawIfOtherMatches, bool); property_copy(useRawThumbnail, setUseRawThumbnail, bool); property_copy(useRawThumbnailSize, setUseRawThumbnailSize, QSize); property_copy(useCompressedIndexXML, setUseCompressedIndexXML, bool); property_copy(compressBackup, setCompressBackup, bool); property_copy(showSplashScreen, setShowSplashScreen, bool); property_copy(showHistogram, setShowHistogram, bool); property_copy(histogramUseLinearScale, setHistogramUseLinearScale, bool); property_copy(autoSave, setAutoSave, int); property_copy(backupCount, setBackupCount, int); property_copy(viewSortType, setViewSortType, ViewSortType); property_copy(matchType, setMatchType, AnnotationDialog::MatchType); property_copy(tTimeStamps, setTTimeStamps, TimeStampTrust); property_copy(excludeDirectories, setExcludeDirectories, QString); #ifdef KPA_ENABLE_REMOTECONTROL property_copy(recentAndroidAddress, setRecentAndroidAddress, QString); property_copy(listenForAndroidDevicesOnStartup, setListenForAndroidDevicesOnStartup, bool); #endif //////////////////////////////// //// File Version Detection //// //////////////////////////////// property_copy(detectModifiedFiles, setDetectModifiedFiles, bool); property_copy(modifiedFileComponent, setModifiedFileComponent, QString); property_copy(originalFileComponent, setOriginalFileComponent, QString); property_copy(moveOriginalContents, setMoveOriginalContents, bool); property_copy(autoStackNewFiles, setAutoStackNewFiles, bool); property_copy(copyFileComponent, setCopyFileComponent, QString); property_copy(copyFileReplacementComponent, setCopyFileReplacementComponent, QString); property_copy(loadOptimizationPreset, setLoadOptimizationPreset, int); property_copy(overlapLoadMD5, setOverlapLoadMD5, bool); property_copy(preloadThreadCount, setPreloadThreadCount, int); property_copy(thumbnailPreloadThreadCount, setThumbnailPreloadThreadCount, int); property_copy(thumbnailBuilderThreadCount, setThumbnailBuilderThreadCount, int); bool trustTimeStamps(); //////////////////// //// Thumbnails //// //////////////////// property_copy(displayLabels, setDisplayLabels, bool); property_copy(displayCategories, setDisplayCategories, bool); property_copy(autoShowThumbnailView, setAutoShowThumbnailView, int); property_copy(showNewestThumbnailFirst, setShowNewestFirst, bool); property_copy(thumbnailDisplayGrid, setThumbnailDisplayGrid, bool); property_copy(previewSize, setPreviewSize, int); property_ref(colorScheme, setColorScheme, QString); property_copy(incrementalThumbnails, setIncrementalThumbnails, bool); // Border space around thumbnails. property_copy(thumbnailSpace, setThumbnailSpace, int); property_copy(thumbnailSize, setThumbnailSize, int); property_copy(minimumThumbnailSize, setMinimumThumbnailSize, int); property_copy(maximumThumbnailSize, setMaximumThumbnailSize, int); property_copy(actualThumbnailSize, setActualThumbnailSize, int); property_copy(thumbnailAspectRatio, setThumbnailAspectRatio, ThumbnailAspectRatio); //////////////// //// Viewer //// //////////////// property_ref(viewerSize, setViewerSize, QSize); property_ref(slideShowSize, setSlideShowSize, QSize); property_copy(launchViewerFullScreen, setLaunchViewerFullScreen, bool); property_copy(launchSlideShowFullScreen, setLaunchSlideShowFullScreen, bool); property_copy(showInfoBox, setShowInfoBox, bool); property_copy(showLabel, setShowLabel, bool); property_copy(showDescription, setShowDescription, bool); property_copy(showDate, setShowDate, bool); property_copy(showImageSize, setShowImageSize, bool); property_copy(showRating, setShowRating, bool); property_copy(showTime, setShowTime, bool); property_copy(showFilename, setShowFilename, bool); property_copy(showEXIF, setShowEXIF, bool); property_copy(smoothScale, setSmoothScale, bool); property_copy(slideShowInterval, setSlideShowInterval, int); property_copy(viewerCacheSize, setViewerCacheSize, int); property_copy(infoBoxWidth, setInfoBoxWidth, int); property_copy(infoBoxHeight, setInfoBoxHeight, int); property_copy(infoBoxPosition, setInfoBoxPosition, Position); property_copy(viewerStandardSize, setViewerStandardSize, StandardViewSize); //////////////////// //// Categories //// //////////////////// - property_ref(albumCategory, setAlbumCategory, QString); property_ref(untaggedCategory, setUntaggedCategory, QString); property_ref(untaggedTag, setUntaggedTag, QString); bool hasUntaggedCategoryFeatureConfigured() const; property_copy(untaggedImagesTagVisible, setUntaggedImagesTagVisible, bool); ////////////// //// Exif //// ////////////// property_ref(exifForViewer, setExifForViewer, StringSet); property_ref(exifForDialog, setExifForDialog, StringSet); property_ref(iptcCharset, setIptcCharset, QString); ///////////////////// //// Exif Import //// ///////////////////// property_copy(updateExifData, setUpdateExifData, bool); property_copy(updateImageDate, setUpdateImageDate, bool); property_copy(useModDateIfNoExif, setUseModDateIfNoExif, bool); property_copy(updateOrientation, setUpdateOrientation, bool); property_copy(updateDescription, setUpdateDescription, bool); /////////////////////// //// Miscellaneous //// /////////////////////// property_ref(HTMLBaseDir, setHTMLBaseDir, QString); property_ref(HTMLBaseURL, setHTMLBaseURL, QString); property_ref(HTMLDestURL, setHTMLDestURL, QString); property_ref(HTMLCopyright, setHTMLCopyright, QString); property_ref(HTMLDate, setHTMLDate, int); property_ref(HTMLTheme, setHTMLTheme, int); property_ref(HTMLKimFile, setHTMLKimFile, int); property_ref(HTMLInlineMovies, setHTMLInlineMovies, int); property_ref(HTML5Video, setHTML5Video, int); property_ref(HTML5VideoGenerate, setHTML5VideoGenerate, int); property_ref(HTMLThumbSize, setHTMLThumbSize, int); property_ref(HTMLNumOfCols, setHTMLNumOfCols, int); property_ref(HTMLSizes, setHTMLSizes, QString); property_ref(HTMLIncludeSelections, setHTMLIncludeSelections, QString); property_ref(fromDate, setFromDate, QDate); property_ref(toDate, setToDate, QDate); QString imageDirectory() const; QString groupForDatabase(const char *setting) const; DB::ImageSearchInfo currentLock() const; void setCurrentLock(const DB::ImageSearchInfo &, bool exclude); bool lockExcludes() const; bool locked() const; void setLocked(bool locked, bool force); void setWindowGeometry(WindowType, const QRect &geometry); QRect windowGeometry(WindowType) const; double getThumbnailAspectRatio() const; QStringList EXIFCommentsToStrip(); void setEXIFCommentsToStrip(QStringList EXIFCommentsToStrip); bool getOverlapLoadMD5() const; int getPreloadThreadCount() const; int getThumbnailPreloadThreadCount() const; int getThumbnailBuilderThreadCount() const; signals: void locked(bool lock, bool exclude); void viewSortTypeChanged(Settings::ViewSortType); void matchTypeChanged(AnnotationDialog::MatchType); void histogramSizeChanged(const QSize &); void thumbnailSizeChanged(int); void actualThumbnailSizeChanged(int); void histogramScaleChanged(); void colorSchemeChanged(); private: SettingsData(const QString &imageDirectory); bool m_trustTimeStamps; bool m_hasAskedAboutTimeStamps; QString m_imageDirectory; static SettingsData *s_instance; friend class DB::CategoryCollection; QStringList m_EXIFCommentsToStrip; }; } // end of namespace #undef property #undef property_copy #undef property_ref #endif /* SETTINGS_SETTINGSDATA_H */ // vi:expandtab:tabstop=4 shiftwidth=4: