CuteSchedule/main.cpp

43 lines
842 B
C++
Raw Normal View History

2023-04-15 18:19:07 +02:00
#ifndef _WIN32
#ifndef linux
#error "Can't recognize your platform. Please either set _WIN32 or 'linux' macro according to your system."
#endif
#endif
2023-04-06 06:10:33 +02:00
2023-04-16 02:35:13 +02:00
#ifdef _WIN32
#pragma message ( "Windows build is not supported, and should be quite unstable." )
#endif
2023-04-06 06:10:33 +02:00
#include <QApplication>
2023-04-16 03:06:30 +02:00
#include <QErrorMessage>
2023-04-15 18:09:55 +02:00
2023-04-16 02:35:13 +02:00
#include <iostream>
#include "src/config/config.h"
2023-04-15 18:19:07 +02:00
#include "src/mainwindow.h"
2023-04-16 03:06:30 +02:00
#include "src/util/userutil.h"
2023-04-06 06:10:33 +02:00
int main(int argc, char *argv[])
{
2023-04-16 03:06:30 +02:00
QApplication a(argc, argv);
2023-04-15 18:19:07 +02:00
Config config;
2023-04-16 03:06:30 +02:00
if (!config.loadDefaultConfig()) {
UserUtil::showError(
QString("Cannot load config:\n") +
"\n" +
"Error code: 0x" + QString::number(config.getLastErrorCode()) + "\n"
);
return config.getLastErrorCode();
}
2023-04-15 18:19:07 +02:00
2023-04-06 06:10:33 +02:00
MainWindow w;
w.show();
2023-04-15 18:19:07 +02:00
2023-04-06 06:10:33 +02:00
return a.exec();
}