digiKam
metadatasynchronizer.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2007-22-01
7  * Description : batch sync pictures metadata with database
8  *
9  * Copyright (C) 2007-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_METADATA_SYNCHRONIZER_H
25 #define DIGIKAM_METADATA_SYNCHRONIZER_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 
31 // Local includes
32 
33 #include "album.h"
34 #include "iteminfo.h"
35 #include "maintenancetool.h"
36 
37 namespace Digikam
38 {
39 
41 {
42  Q_OBJECT
43 
44 public:
45 
47  {
50  };
51 
52 public:
53 
56  explicit MetadataSynchronizer(const AlbumList& list = AlbumList(), SyncDirection direction = WriteFromDatabaseToFile, ProgressItem* const parent = nullptr);
57 
61 
62  void setTagsOnly(bool value);
63 
64  ~MetadataSynchronizer() override;
65 
66  void setUseMultiCoreCPU(bool b) override;
67 
68 private Q_SLOTS:
69 
70  void slotStart() override;
71  void slotParseAlbums();
72  void slotAlbumParsed(const ItemInfoList&);
73  void slotAdvance();
74  void slotOneAlbumIsComplete();
75  void slotCancel() override;
76 
77 private:
78 
79  void init(SyncDirection direction);
80  void parseList();
81  void parsePicture();
82  void processOneAlbum();
83 
84 private:
85 
86  class Private;
87  Private* const d;
88 };
89 
90 } // namespace Digikam
91 
92 #endif // DIGIKAM_METADATA_SYNCHRONIZER_H
Definition: iteminfolist.h:47
Definition: maintenancetool.h:41
Definition: metadatasynchronizer.h:41
~MetadataSynchronizer() override
Definition: metadatasynchronizer.cpp:135
SyncDirection
Definition: metadatasynchronizer.h:47
@ ReadFromFileToDatabase
Definition: metadatasynchronizer.h:49
@ WriteFromDatabaseToFile
Definition: metadatasynchronizer.h:48
void setUseMultiCoreCPU(bool b) override
Definition: metadatasynchronizer.cpp:110
void setTagsOnly(bool value)
Definition: metadatasynchronizer.cpp:93
MetadataSynchronizer(const AlbumList &list=AlbumList(), SyncDirection direction=WriteFromDatabaseToFile, ProgressItem *const parent=nullptr)
Definition: metadatasynchronizer.cpp:71
Definition: progressmanager.h:45
ProgressItem * parent() const
Definition: progressmanager.cpp:299
qulonglong value
Definition: itemviewutilities.cpp:592
Definition: datefolderview.cpp:43
QList< Album * > AlbumList
Definition: album.h:50