Lomiri
Changelog.h
1 /*
2  * Copyright (C) 2018 The UBports project
3  * Written by: Marius Gripsgard <marius@ubports.com>
4  *
5  * This program is free software: you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 3, as published
7  * by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranties of
11  * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
12  * PURPOSE. See the GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef WIZARD_CHANGELOG_H
19 #define WIZARD_CHANGELOG_H
20 
21 #include <QFileSystemWatcher>
22 #include <QObject>
23 #include <QString>
24 
25 class Changelog : public QObject
26 {
27  Q_OBJECT
28  Q_PROPERTY(QString text READ text NOTIFY textChanged)
29 
30 public:
31  Changelog();
32  ~Changelog() = default;
33 
34  QString text() const;
35 
36 Q_SIGNALS:
37  void textChanged();
38 
39 private Q_SLOTS:
40  void watcherFileChanged();
41 
42 private:
43  Q_DISABLE_COPY(Changelog)
44 
45  static QString changelogPath();
46  void readChangelog();
47 
48  QFileSystemWatcher m_fsWatcher;
49  QString m_text;
50 };
51 
52 #endif