diff --git a/src/main.cpp b/src/main.cpp index 3302d44..6492b25 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,78 +1,80 @@ /*************************************************************************** * Copyright (C) 2006 by Matthew Williams * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include "ksquareswindow.h" #include "ksquaresdemowindow.h" #include "settings.h" #include "ksquares_version.h" static const char description[] = I18N_NOOP("Take it in turns to draw lines.\nIf you complete a squares, you get another go."); int main(int argc, char **argv) { + // Fixes blurry icons with fractional scaling + QGuiApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); QApplication app(argc, argv); Kdelibs4ConfigMigrator migrate(QStringLiteral("ksquares")); migrate.setConfigFiles(QStringList() << QStringLiteral("ksquaresrc")); migrate.setUiFiles(QStringList() << QStringLiteral("ksquaresui.rc")); migrate.migrate(); KLocalizedString::setApplicationDomain("ksquares"); KAboutData about(QStringLiteral("ksquares"), i18n("KSquares"), QStringLiteral(KSQUARES_VERSION_STRING), i18n(description), KAboutLicense::GPL, i18n("(C) 2006-2007 Matt Williams")); about.addAuthor(i18n("Matt Williams"), i18n("Original creator and maintainer"), QStringLiteral("matt@milliams.com"), QStringLiteral("https://milliams.com")); about.addCredit(i18n("Fela Winkelmolen"), i18n("Many patches and bugfixes")); about.addCredit(i18n("Tom Vincent Peters"), i18n("Hard AI")); about.setHomepage(QStringLiteral("https://games.kde.org/ksquares")); QCommandLineParser parser; KAboutData::setApplicationData(about); KCrash::initialize(); parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("demo"), i18n("Run game in demo (autoplay) mode"))); about.setupCommandLine(&parser); parser.process(app); about.processCommandLine(&parser); KDBusService service; app.setWindowIcon(QIcon::fromTheme(QStringLiteral("ksquares"))); // default names for players KConfigGroup cg(KSharedConfig::openConfig(), "General"); if (cg.readEntry("initializeNames", true)) { QStringList playerNames; playerNames << KUser().property(KUser::FullName).toString(); playerNames << i18nc("default name of player", "Player %1", 2); playerNames << i18nc("default name of player", "Player %1", 3); playerNames << i18nc("default name of player", "Player %1", 4); Settings::setPlayerNames(playerNames); cg.writeEntry("initializeNames", false); } if (parser.isSet(QStringLiteral("demo"))) { KSquaresDemoWindow *demoWindow = new KSquaresDemoWindow; demoWindow->show(); demoWindow->gameNew(); } else { KSquaresWindow *mainWindow = new KSquaresWindow; mainWindow->show(); } return app.exec(); }