digiKam
timeadjustthread.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 : 2004-05-16
7  * Description : time adjust thread.
8  *
9  * Copyright (C) 2012 by Smit Mehta <smit dot meh at gmail dot com>
10  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  * Copyright (c) 2018-2021 by Maik Qualmann <metzpinguin at gmail dot com>
12  *
13  * This program is free software; you can redistribute it
14  * and/or modify it under the terms of the GNU General
15  * Public License as published by the Free Software Foundation;
16  * either version 2, or (at your option) 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 #ifndef DIGIKAM_TIME_ADJUST_THREAD_H
26 #define DIGIKAM_TIME_ADJUST_THREAD_H
27 
28 // Qt includes
29 
30 #include <QDateTime>
31 #include <QMap>
32 #include <QUrl>
33 
34 // Local includes
35 
36 #include "dinfointerface.h"
37 #include "actionthreadbase.h"
38 #include "timeadjustcontainer.h"
39 
40 using namespace Digikam;
41 
43 {
44 
46 {
47  Q_OBJECT
48 
49 public:
50 
51  explicit TimeAdjustThread(QObject* const parent, DInfoInterface* const iface);
52  ~TimeAdjustThread() override;
53 
54  void setUpdatedDates(const QMap<QUrl, int>& itemsMap);
55  void setPreviewDates(const QMap<QUrl, int>& itemsMap);
56  void setSettings(const TimeAdjustContainer& settings);
57 
60  QDateTime readTimestamp(const QUrl& url) const;
61  int indexForUrl(const QUrl& url) const;
62 
63 Q_SIGNALS:
64 
65  void signalProcessStarted(const QUrl&);
66  void signalDateTimeForUrl(const QUrl&, const QDateTime&, bool);
67  void signalPreviewReady(const QUrl&, const QDateTime&, const QDateTime&);
68  void signalProcessEnded(const QUrl&, const QDateTime&, const QDateTime&, int);
69 
70 private:
71 
74  QDateTime readApplicationTimestamp(const QUrl& url) const;
75 
78  QDateTime readFileNameTimestamp(const QUrl& url) const;
79 
82  QDateTime readFileTimestamp(const QUrl& url) const;
83 
86  QDateTime readMetadataTimestamp(const QUrl& url) const;
87 
88 public:
89 
90  class Private;
91 
92 private:
93 
94  Private* const d;
95 };
96 
97 } // namespace DigikamGenericTimeAdjustPlugin
98 
99 #endif // DIGIKAM_TIME_ADJUST_THREAD_H
Definition: timeadjustthread.h:46
void signalDateTimeForUrl(const QUrl &, const QDateTime &, bool)
void signalPreviewReady(const QUrl &, const QDateTime &, const QDateTime &)
void signalProcessEnded(const QUrl &, const QDateTime &, const QDateTime &, int)
Definition: actionthreadbase.h:102
Definition: dinfointerface.h:56
Definition: timeadjustcontainer.h:42
Definition: timeadjustdialog.cpp:73
Definition: datefolderview.cpp:43