1 /***********************************************************************
2  *
3  * Copyright (C) 2009, 2012, 2013, 2014, 2015, 2018, 2019 Graeme Gott <graeme@gottcode.org>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  ***********************************************************************/
19 
20 #include "locale_dialog.h"
21 #include "window.h"
22 
23 #include <QApplication>
24 #include <QDir>
25 
main(int argc,char ** argv)26 int main(int argc, char** argv) {
27 #if !defined(Q_OS_MAC)
28 	if (!qEnvironmentVariableIsSet("QT_DEVICE_PIXEL_RATIO")
29 			&& !qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR")
30 			&& !qEnvironmentVariableIsSet("QT_SCALE_FACTOR")
31 			&& !qEnvironmentVariableIsSet("QT_SCREEN_SCALE_FACTORS")) {
32 		QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
33 	}
34 #endif
35 	QApplication app(argc, argv);
36 	app.setApplicationName("Connectagram");
37 	app.setApplicationVersion(VERSIONSTR);
38 	app.setApplicationDisplayName(Window::tr("Connectagram"));
39 	app.setOrganizationDomain("gottcode.org");
40 	app.setOrganizationName("GottCode");
41 #if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
42 	app.setWindowIcon(QIcon::fromTheme("connectagram", QIcon(":/connectagram.png")));
43 	app.setDesktopFileName("connectagram");
44 #endif
45 	app.setAttribute(Qt::AA_UseHighDpiPixmaps, true);
46 
47 	QString path = app.applicationDirPath();
48 	QStringList paths;
49 	paths.append(path + "/data/");
50 	paths.append(path + "/../share/connectagram/data/");
51 	paths.append(path + "/../Resources/data/");
52 	QDir::setSearchPaths("connectagram", paths);
53 
54 	LocaleDialog::loadTranslator("connectagram_");
55 
56 	Window window;
57 
58 	return app.exec();
59 }
60