-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
34 lines (27 loc) · 794 Bytes
/
main.cpp
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
#include <QApplication>
#include <QDir>
#include <QTextStream>
#include "MetronomeWindow.h"
#include "metronomeconf.h"
QString appPath;
QString dataPath;
QTextStream err(stderr);
int main(int argc, char **argv)
{
QApplication app(argc,argv);
app.setApplicationName("QMetronome");
QString path1 = QDir::homePath()+"/.qmetronome";
QString path2 = app.applicationDirPath()+"/conf";
MetronomeConf* conf = 0;
if( MetronomeConf::isValidConfDir(path1) ) {
conf = new MetronomeConf(path1);
} else if( MetronomeConf::isValidConfDir(path2) ) {
conf = new MetronomeConf(path2);
} else {
err << "Application data does not exist! Exiting..";
return -1;
}
MetronomeWindow *w = new MetronomeWindow(conf);
w->show();
return app.exec();
}