-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.h
60 lines (49 loc) · 1.48 KB
/
main.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
#ifndef MAIN_H
#define MAIN_H
#include <QtGlobal>
#include <QCommandLineOption>
class QTextStream;
QTextStream &qStdout();
// Ini file goes where GPX expects to find it
#ifdef Q_OS_WIN
#define INIFILENAME_PREFIX ""
#else
#define INIFILENAME_PREFIX "."
#endif
class QDir;
class QCommandLineParser;
class IniEditor;
namespace GpxUiInfo
{
void init();
const QDir &iniLocation();
const QDir &machineIniLocation();
};
class SetupEvents
{
public:
#ifdef Q_OS_WIN
void addOptions(QCommandLineParser &);
bool handleOptions(QCommandLineParser &);
SetupEvents() :
cloInstall("squirrel-install", "Perform squirrel post install action", "version"),
cloFirstRun("squirrel-firstrun", "First run after squirrel install"),
cloUpdated("squirrel-updated", "Perform squirrel post update action", "version"),
cloObsolete("squirrel-obsolete", "Perform squirrel post update cleanup action", "version"),
cloUninstall("squirrel-uninstall", "Perform squirrel pre uninstall action", "version") {}
QCommandLineOption cloInstall;
QCommandLineOption cloFirstRun;
QCommandLineOption cloUpdated;
QCommandLineOption cloObsolete;
QCommandLineOption cloUninstall;
#else
void addOptions(QCommandLineParser &clp) {}
bool handleOptions(QCommandLineParser &clp) {return false;}
#endif // Q_OS_WIN
};
#ifdef Q_OS_WIN
bool CopyToVersionIndependentLocation(IniEditor &);
#else
#define CopyToVersionIndependentLocation(ie) (true)
#endif // !Q_OS_WIN
#endif // MAIN_H