-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathSettingsUpdater.h
61 lines (53 loc) · 1.8 KB
/
SettingsUpdater.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//-----------------------------------------------------------------------------
// File: SettingsUpdater.h
//-----------------------------------------------------------------------------
// Project: Kactus 2
// Author: Joni-Matti Maatta
// Date: 15.01.2013
//
// Description:
// Settings updater which upgrades Kactus2 settings up-to-date based on a configuration file.
//-----------------------------------------------------------------------------
#ifndef SETTINGSUPDATER_H
#define SETTINGSUPDATER_H
#include <KactusAPI/include/MessageMediator.h>
#include <QFile>
#include <QVariant>
#include <QTextStream>
#include <QSettings>
namespace SettingsUpdater
{
/*!
* Upgrades the settings if not up-to-date.
*/
void runUpgrade(QSettings& settings, MessageMediator* mediator);
namespace Details
{
/*!
* Compares version numbers.
*
* @param [in] version The version to compare.
* @param [in] comparison The version to compare against.
*
* @return True, if the first version is older than the comparison.
*/
bool isVersionOlderThan(QString const& version, QString const& comparison);
/*!
* Open the configuration file for reading.
*
* @param [in] parent The parent widget.
*
* @return The open configuration file.
*/
QFile* openConfigurationFile(MessageMediator* mediator);
/*!
* Parses a QVariant from the given text stream.
*
* @param [in] lineStream The source text stream.
*
* @return The parsed QVariant.
*/
QVariant parseVariant(QTextStream& lineStream);
}
}
#endif // SETTINGSUPDATER_H