digiKam
onlineversionchecker.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 : 2020-12-31
7  * Description : Online version checker
8  *
9  * Copyright (C) 2020-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_ONLINE_VERSION_CHECKER_H
25 #define DIGIKAM_ONLINE_VERSION_CHECKER_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QUrl>
31 #include <QNetworkReply>
32 #include <QDateTime>
33 
34 // Local includes
35 
36 #include "digikam_export.h"
37 
38 namespace Digikam
39 {
40 
41 class DIGIKAM_EXPORT OnlineVersionChecker : public QObject
42 {
43  Q_OBJECT
44 
45 public:
46 
47  explicit OnlineVersionChecker(QObject* const parent, bool checkPreRelease = false);
49 
50  void setCurrentVersion(const QString& version);
51  void setCurrentBuildDate(const QDateTime& dt);
52 
53  void checkForNewVersion();
54  void cancelCheck();
55 
56  void downloadReleaseNotes(const QString& version);
57 
58  QString preReleaseFileName() const;
59 
65  static bool bundleProperties(QString& arch, QString& ext);
66 
70  static QString lastCheckDate();
71 
72 Q_SIGNALS:
73 
74  void signalNewVersionAvailable(const QString& version);
75  void signalNewVersionCheckError(const QString& error);
76  void signalReleaseNotesData(const QString& notes);
77 
78 private Q_SLOTS:
79 
80  void slotDownloadFinished(QNetworkReply* reply);
81 
82 private:
83 
84  void download(const QUrl& url);
85 
86 private:
87 
88  class Private;
89  Private* const d;
90 };
91 
92 } // namespace Digikam
93 
94 #endif // DIGIKAM_ONLINE_VERSION_CHECKER_H
Definition: onlineversionchecker.h:42
void signalReleaseNotesData(const QString &notes)
void signalNewVersionCheckError(const QString &error)
void signalNewVersionAvailable(const QString &version)
Definition: datefolderview.cpp:43