fix: actual proper fix for 471a3b1
This commit is contained in:
parent
95f85374cf
commit
29355c7fc1
23
app/main.cpp
23
app/main.cpp
|
@ -20,12 +20,8 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Settings::instance()->hiDpiScaleFactorBehavior());
|
QCoreApplication::setApplicationName("Pineapple Pictures");
|
||||||
|
QCoreApplication::setApplicationVersion(PPIC_VERSION_STRING);
|
||||||
QApplication a(argc, argv);
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
|
||||||
a.setAttribute(Qt::ApplicationAttribute::AA_UseHighDpiPixmaps);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
QString qmDir;
|
QString qmDir;
|
||||||
|
@ -35,11 +31,16 @@ int main(int argc, char *argv[])
|
||||||
qmDir = QT_STRINGIFY(QM_FILE_INSTALL_DIR);
|
qmDir = QT_STRINGIFY(QM_FILE_INSTALL_DIR);
|
||||||
#endif
|
#endif
|
||||||
if (translator.load(QLocale(), QLatin1String("PineapplePictures"), QLatin1String("_"), qmDir)) {
|
if (translator.load(QLocale(), QLatin1String("PineapplePictures"), QLatin1String("_"), qmDir)) {
|
||||||
a.installTranslator(&translator);
|
QCoreApplication::installTranslator(&translator);
|
||||||
}
|
}
|
||||||
a.setApplicationName("Pineapple Pictures");
|
|
||||||
a.setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
|
QGuiApplication::setApplicationDisplayName(QCoreApplication::translate("main", "Pineapple Pictures"));
|
||||||
a.setApplicationVersion(PPIC_VERSION_STRING);
|
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Settings::instance()->hiDpiScaleFactorBehavior());
|
||||||
|
|
||||||
|
QApplication a(argc, argv);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||||
|
a.setAttribute(Qt::ApplicationAttribute::AA_UseHighDpiPixmaps);
|
||||||
|
#endif
|
||||||
|
|
||||||
// commandline options
|
// commandline options
|
||||||
QCommandLineOption supportedImageFormats(QStringLiteral("supported-image-formats"), QCoreApplication::translate("main", "List supported image format suffixes, and quit program."));
|
QCommandLineOption supportedImageFormats(QStringLiteral("supported-image-formats"), QCoreApplication::translate("main", "List supported image format suffixes, and quit program."));
|
||||||
|
@ -67,5 +68,5 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
w.initWindowSize();
|
w.initWindowSize();
|
||||||
|
|
||||||
return a.exec();
|
return QApplication::exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
#include <QStringBuilder>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
@ -151,10 +150,7 @@ Settings::Settings()
|
||||||
|
|
||||||
if (configPath.isEmpty()) {
|
if (configPath.isEmpty()) {
|
||||||
// Should be %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux.
|
// Should be %LOCALAPPDATA%\<APPNAME> under Windows, ~/.config/<APPNAME> under Linux.
|
||||||
// Sadly <APPNAME> is unknown when Settings object is created (it's before the creation
|
configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
|
||||||
// of QApplication), so we'll need to append the app name manually.
|
|
||||||
configPath = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation) %
|
|
||||||
QDir::separator() % QLatin1String("Pineapple Pictures");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this);
|
m_qsettings = new QSettings(QDir(configPath).absoluteFilePath("config.ini"), QSettings::IniFormat, this);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user