1 /* ============================================================
2 * QuiteRSS is a open-source cross-platform RSS/Atom news feeds reader
3 * Copyright (C) 2011-2020 QuiteRSS Team <quiterssteam@gmail.com>
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 * ============================================================ */
18 /* ============================================================
19 * QupZilla - WebKit based browser
20 * Copyright (C) 2010-2014  David Rosca <nowrep@gmail.com>
21 *
22 * This program is free software: you can redistribute it and/or modify
23 * it under the terms of the GNU General Public License as published by
24 * the Free Software Foundation, either version 3 of the License, or
25 * (at your option) any later version.
26 *
27 * This program is distributed in the hope that it will be useful,
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30 * GNU General Public License for more details.
31 *
32 * You should have received a copy of the GNU General Public License
33 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
34 * ============================================================ */
35 #ifndef CABUNDLEUPDATER_H
36 #define CABUNDLEUPDATER_H
37 
38 #include <QObject>
39 
40 class QNetworkReply;
41 
42 class NetworkManager;
43 
44 class CaBundleUpdater : public QObject
45 {
46   Q_OBJECT
47 public:
48   explicit CaBundleUpdater(NetworkManager* manager, QObject* parent = 0);
49 
50 signals:
51 
52 public slots:
53 
54 private slots:
55   void start();
56   void replyFinished();
57 
58 private:
59   enum Progress { Start, CheckLastUpdate, LoadBundle };
60 
61   NetworkManager* m_manager;
62   Progress m_progress;
63   QNetworkReply* m_reply;
64 
65   QString m_bundleVersionFileName;
66   QString m_bundleFileName;
67   QString m_lastUpdateFileName;
68 
69   int m_latestBundleVersion;
70 };
71 
72 #endif // CABUNDLEUPDATER_H
73