Skip to content
This repository has been archived by the owner on Oct 17, 2019. It is now read-only.

Commit

Permalink
Remove obsolete font/size setting
Browse files Browse the repository at this point in the history
  • Loading branch information
mujx committed Sep 29, 2018
1 parent 29f442a commit d1e08e0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <QFile>
#include <QFontDatabase>
#include <QLabel>
#include <QLayout>
#include <QLibraryInfo>
#include <QMessageBox>
#include <QPoint>
Expand Down Expand Up @@ -113,9 +112,6 @@ main(int argc, char *argv[])

if (factor != -1)
qputenv("QT_SCALE_FACTOR", QString::number(factor).toUtf8());

if (factor == -1 || factor == 1)
qputenv("QT_AUTO_SCREEN_SCALE_FACTOR", "1");
}
#endif

Expand All @@ -124,6 +120,7 @@ main(int argc, char *argv[])
QCoreApplication::setApplicationVersion(nheko::version);
QCoreApplication::setOrganizationName("nheko");
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

QCommandLineParser parser;
parser.addHelpOption();
Expand Down Expand Up @@ -153,14 +150,7 @@ main(int argc, char *argv[])
std::exit(1);
}

QSettings settings;

// Set the default if a value has not been set.
if (settings.value("font/size").toInt() == 0)
settings.setValue("font/size", 12);

QFont font("Open Sans", settings.value("font/size").toInt());
app.setFont(font);
app.setFont(QFont("Open Sans"));

QString lang = QLocale::system().name();

Expand All @@ -177,6 +167,8 @@ main(int argc, char *argv[])
// Move the MainWindow to the center
w.move(screenCenter(w.width(), w.height()));

QSettings settings;

if (!settings.value("user/window/start_in_tray", false).toBool() ||
!settings.value("user/window/tray", true).toBool())
w.show();
Expand Down

0 comments on commit d1e08e0

Please sign in to comment.