File indexing completed on 2025-01-19 03:57:01
0001 /* ============================================================ 0002 * 0003 * This file is a part of digiKam project 0004 * https://www.digikam.org 0005 * 0006 * Date : 2021-07-24 0007 * Description : on screen display settings container. 0008 * 0009 * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com> 0010 * SPDX-FileCopyrightText: 2021 by Quoc Hưng Tran <quochungtran1999 at gmail dot com> 0011 * 0012 * SPDX-License-Identifier: GPL-2.0-or-later 0013 * 0014 * ============================================================ */ 0015 0016 #include "frameosdsettings.h" 0017 0018 // Qt includes 0019 0020 #include <QFontDatabase> 0021 0022 // KDE includes 0023 0024 #include <kconfiggroup.h> 0025 0026 namespace Digikam 0027 { 0028 0029 FrameOsdSettings::FrameOsdSettings() 0030 : osdFont(QFontDatabase::systemFont(QFontDatabase::GeneralFont)) 0031 { 0032 } 0033 0034 FrameOsdSettings::~FrameOsdSettings() 0035 { 0036 } 0037 0038 void FrameOsdSettings::readSettings(KConfigGroup& group) 0039 { 0040 printName = group.readEntry("FrameOsdPrintNameEntry", true); 0041 printDate = group.readEntry("FrameOsdPrintDateEntry", true); 0042 printApertureFocal = group.readEntry("FrameOsdPrintApertureFocalEntry", false); 0043 printExpoSensitivity = group.readEntry("FrameOsdPrintExpoSensitivityEntry", false); 0044 printMakeModel = group.readEntry("FrameOsdPrintMakeModelEntry", false); 0045 printLensModel = group.readEntry("FrameOsdPrintLensModelEntry", false); 0046 printComment = group.readEntry("FrameOsdPrintCommentEntry", false); 0047 printTitle = group.readEntry("FrameOsdPrintTitleEntry", false); 0048 printCapIfNoTitle = group.readEntry("FrameOsdPrintCapIfNoTitleEntry", false); 0049 printTags = group.readEntry("FrameOsdPrintTagsEntry", false); 0050 printRating = group.readEntry("FrameOsdPrintRatingEntry", false); 0051 osdFont = group.readEntry("FrameOsdCaptionFontEntry", QFontDatabase::systemFont(QFontDatabase::GeneralFont)); 0052 } 0053 0054 void FrameOsdSettings::writeSettings(KConfigGroup& group) 0055 { 0056 group.writeEntry("FrameOsdPrintNameEntry", printName); 0057 group.writeEntry("FrameOsdPrintDateEntry", printDate); 0058 group.writeEntry("FrameOsdPrintApertureFocalEntry", printApertureFocal); 0059 group.writeEntry("FrameOsdPrintExpoSensitivityEntry", printExpoSensitivity); 0060 group.writeEntry("FrameOsdPrintMakeModelEntry", printMakeModel); 0061 group.writeEntry("FrameOsdPrintLensModelEntry", printLensModel); 0062 group.writeEntry("FrameOsdPrintCommentEntry", printComment); 0063 group.writeEntry("FrameOsdPrintTitleEntry", printTitle); 0064 group.writeEntry("FrameOsdPrintCapIfNoTitleEntry", printCapIfNoTitle); 0065 group.writeEntry("FrameOsdPrintTagsEntry", printTags); 0066 group.writeEntry("FrameOsdPrintRatingEntry", printRating); 0067 group.writeEntry("FrameOsdCaptionFontEntry", osdFont); 0068 } 0069 0070 } // namespace Digikam