File indexing completed on 2025-01-19 03:59:31

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2012-01-31
0007  * Description : maintenance manager settings
0008  *
0009  * SPDX-FileCopyrightText: 2012-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  *
0011  * SPDX-License-Identifier: GPL-2.0-or-later
0012  *
0013  * ============================================================ */
0014 
0015 #include "maintenancesettings.h"
0016 
0017 // Local includes
0018 
0019 #include "digikam_globals.h"
0020 #include "autotagsassign.h"
0021 #include "autotagsassignment.h"
0022 #include "imagequalityconfselector.h"
0023 
0024 namespace Digikam
0025 {
0026 
0027 MaintenanceSettings::MaintenanceSettings()
0028     : wholeAlbums            (true),
0029       wholeTags              (true),
0030       useMutiCoreCPU         (false),
0031       newItems               (false),
0032       thumbnails             (false),
0033       scanThumbs             (false),
0034       fingerPrints           (false),
0035       scanFingerPrints       (false),
0036       duplicates             (false),
0037       minSimilarity          (90),
0038       maxSimilarity          (100),
0039       duplicatesRestriction  (HaarIface::DuplicatesSearchRestrictions::None),
0040       faceManagement         (false),
0041       autotagsAssignment     (false),
0042       autotaggingScanMode    (AutotagsAssignment::AllItems),
0043       modelSelectionMode     (DetectorModel::YOLOV5NANO),
0044       qualitySort            (false),
0045       qualityScanMode        (true),   // NOTE: turn on by default to prevent clearing whole Pick Labels from Collection
0046       qualitySettingsSelected(ImageQualityConfSelector::GlobalSettings),
0047       metadataSync           (false),
0048       syncDirection          (MetadataSynchronizer::WriteFromDatabaseToFile),
0049       databaseCleanup        (false),
0050       cleanThumbDb           (false),
0051       cleanFacesDb           (false),
0052       cleanSimilarityDb      (false),
0053       shrinkDatabases        (false)
0054 {
0055 }
0056 
0057 MaintenanceSettings::~MaintenanceSettings()
0058 {
0059 }
0060 
0061 //! qCDebug(DIGIKAM_GENERAL_LOG) stream operator. Writes property @a s to the debug output in a nicely formatted way.
0062 QDebug operator<<(QDebug dbg, const MaintenanceSettings& s)
0063 {
0064     dbg.nospace() << QT_ENDL;
0065     dbg.nospace() << "wholeAlbums            : " << s.wholeAlbums                         << QT_ENDL;
0066     dbg.nospace() << "wholeTags              : " << s.wholeTags                           << QT_ENDL;
0067     dbg.nospace() << "Albums                 : " << s.albums.count()                      << QT_ENDL;
0068     dbg.nospace() << "Tags                   : " << s.tags.count()                        << QT_ENDL;
0069     dbg.nospace() << "useMutiCoreCPU         : " << s.useMutiCoreCPU                      << QT_ENDL;
0070     dbg.nospace() << "newItems               : " << s.newItems                            << QT_ENDL;
0071     dbg.nospace() << "thumbnails             : " << s.thumbnails                          << QT_ENDL;
0072     dbg.nospace() << "scanThumbs             : " << s.scanThumbs                          << QT_ENDL;
0073     dbg.nospace() << "fingerPrints           : " << s.fingerPrints                        << QT_ENDL;
0074     dbg.nospace() << "scanFingerPrints       : " << s.scanFingerPrints                    << QT_ENDL;
0075     dbg.nospace() << "duplicates             : " << s.duplicates                          << QT_ENDL;
0076     dbg.nospace() << "minSimilarity          : " << s.minSimilarity                       << QT_ENDL;
0077     dbg.nospace() << "maxSimilarity          : " << s.maxSimilarity                       << QT_ENDL;
0078     dbg.nospace() << "duplicatesRestriction  : " << s.duplicatesRestriction               << QT_ENDL;
0079     dbg.nospace() << "faceManagement         : " << s.faceManagement                      << QT_ENDL;
0080     dbg.nospace() << "faceScannedHandling    : " << s.faceSettings.alreadyScannedHandling << QT_ENDL;
0081     dbg.nospace() << "AutotagsAssignment     : " << s.autotagsAssignment                  << QT_ENDL;
0082     dbg.nospace() << "qualitySort            : " << s.qualitySort                         << QT_ENDL;
0083     dbg.nospace() << "quality                : " << s.quality                             << QT_ENDL;
0084     dbg.nospace() << "qualityScanMode        : " << s.qualityScanMode                     << QT_ENDL;
0085     dbg.nospace() << "qualitySettingsSelected: " << s.qualitySettingsSelected             << QT_ENDL;
0086     dbg.nospace() << "metadataSync           : " << s.metadataSync                        << QT_ENDL;
0087     dbg.nospace() << "syncDirection          : " << s.syncDirection                       << QT_ENDL;
0088     dbg.nospace() << "databaseCleanup        : " << s.databaseCleanup                     << QT_ENDL;
0089     dbg.nospace() << "cleanThumbDb           : " << s.cleanThumbDb                        << QT_ENDL;
0090     dbg.nospace() << "cleanFacesDb           : " << s.cleanFacesDb                        << QT_ENDL;
0091     dbg.nospace() << "cleanSimilarityDb      : " << s.cleanSimilarityDb                   << QT_ENDL;
0092     dbg.nospace() << "shrinkDatabases        : " << s.shrinkDatabases                     << QT_ENDL;
0093 
0094     return dbg.space();
0095 }
0096 
0097 } // namespace Digikam