2018-04-15 12:41:10 +00:00
|
|
|
|
2018-02-10 18:04:31 +00:00
|
|
|
#include "CutterApplication.h"
|
2017-10-01 19:09:42 +00:00
|
|
|
#include "MainWindow.h"
|
2017-09-25 12:55:41 +00:00
|
|
|
|
2019-02-22 13:38:02 +00:00
|
|
|
/*!
|
|
|
|
* \brief Migrate Settings used before Cutter 1.8
|
|
|
|
*/
|
|
|
|
static void migrateSettings(QSettings &newSettings)
|
|
|
|
{
|
|
|
|
QSettings oldSettings(QSettings::NativeFormat, QSettings::Scope::UserScope, "Cutter", "Cutter");
|
|
|
|
for (const QString &key : oldSettings.allKeys()) {
|
|
|
|
newSettings.setValue(key, oldSettings.value(key));
|
|
|
|
}
|
|
|
|
oldSettings.clear();
|
|
|
|
QFile settingsFile(oldSettings.fileName());
|
|
|
|
settingsFile.remove();
|
|
|
|
}
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2018-05-28 20:06:24 +00:00
|
|
|
qRegisterMetaType<QList<StringDescription>>();
|
2018-06-25 19:28:34 +00:00
|
|
|
qRegisterMetaType<QList<FunctionDescription>>();
|
2018-05-28 20:06:24 +00:00
|
|
|
|
2019-02-22 13:38:02 +00:00
|
|
|
QCoreApplication::setOrganizationName("RadareOrg");
|
2019-01-20 17:00:23 +00:00
|
|
|
QCoreApplication::setApplicationName("Cutter");
|
2019-02-22 13:38:02 +00:00
|
|
|
QSettings::setDefaultFormat(QSettings::IniFormat);
|
|
|
|
|
|
|
|
QSettings settings;
|
|
|
|
if (!settings.value("settings_migrated", false).toBool()) {
|
|
|
|
qInfo() << "Settings have not been migrated before, trying to migrate from pre-1.8 if possible.";
|
|
|
|
migrateSettings(settings);
|
|
|
|
settings.setValue("settings_migrated", true);
|
|
|
|
}
|
2019-01-20 17:00:23 +00:00
|
|
|
|
2018-03-09 16:06:41 +00:00
|
|
|
CutterApplication a(argc, argv);
|
|
|
|
|
2017-10-23 09:22:15 +00:00
|
|
|
int ret = a.exec();
|
|
|
|
|
|
|
|
return ret;
|
2017-03-29 10:18:37 +00:00
|
|
|
}
|