-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (28 loc) · 895 Bytes
/
main.cpp
File metadata and controls
32 lines (28 loc) · 895 Bytes
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
//Main.cpp
#include "messageHandler.h"
#include "mainwindow.h"
#include <QApplication>
#include <QMessagebox>
#include "initManager.h"
int main(int argc, char *argv[])
{
// Install the handler before creating the QApplication
qInstallMessageHandler(messageHandler);
//Create application object
QApplication a(argc, argv);
//Check database
CInitManager initManager;
QString applicationPath, dbFilename;
bool ok = initManager.copyDatabaseToAppLocal(dbFilename);
if (!ok)
{
// Critical failure: log it and tell the user
qCritical() << "Failed to initialize the local database.";
QMessageBox::critical(nullptr, "Initialization Error",
"Accessible Atlas could not set up its data folder.");
return -1;
}
MainWindow w( initManager.getApplicationPath(), dbFilename );
w.show();
return a.exec();
}