remove settings and paths from Application
This commit is contained in:
@@ -105,13 +105,13 @@ Fonts::FontData Fonts::createFontData(FontStyle type, float scale)
|
||||
{FontStyle::ChatMedium, {1, false, QFont::Normal}},
|
||||
{FontStyle::ChatMediumBold,
|
||||
{1, false,
|
||||
QFont::Weight(getApp()->settings->boldScale.getValue())}},
|
||||
QFont::Weight(getSettings()->boldScale.getValue())}},
|
||||
{FontStyle::ChatMediumItalic, {1, true, QFont::Normal}},
|
||||
{FontStyle::ChatLarge, {1.2f, false, QFont::Normal}},
|
||||
{FontStyle::ChatVeryLarge, {1.4f, false, QFont::Normal}},
|
||||
};
|
||||
sizeScale[FontStyle::ChatMediumBold] = {
|
||||
1, false, QFont::Weight(getApp()->settings->boldScale.getValue())};
|
||||
1, false, QFont::Weight(getSettings()->boldScale.getValue())};
|
||||
auto data = sizeScale[type];
|
||||
return FontData(
|
||||
QFont(QString::fromStdString(this->chatFontFamily.getValue()),
|
||||
|
||||
@@ -43,6 +43,6 @@ private:
|
||||
boost::optional<bool> portable_;
|
||||
};
|
||||
|
||||
[[deprecated]] Paths *getPaths();
|
||||
Paths *getPaths();
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -406,7 +406,7 @@ void WindowManager::save()
|
||||
document.setObject(obj);
|
||||
|
||||
// save file
|
||||
QString settingsPath = app->paths->settingsDirectory + SETTINGS_FILENAME;
|
||||
QString settingsPath = getPaths()->settingsDirectory + SETTINGS_FILENAME;
|
||||
QFile file(settingsPath);
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Truncate);
|
||||
|
||||
@@ -518,7 +518,7 @@ int WindowManager::clampUiScale(int scale)
|
||||
|
||||
float WindowManager::getUiScaleValue()
|
||||
{
|
||||
return getUiScaleValue(getApp()->settings->uiScale.getValue());
|
||||
return getUiScaleValue(getSettings()->uiScale.getValue());
|
||||
}
|
||||
|
||||
float WindowManager::getUiScaleValue(int scale)
|
||||
|
||||
@@ -10,7 +10,7 @@ void GIFTimer::initialize()
|
||||
{
|
||||
this->timer.setInterval(30);
|
||||
|
||||
getApp()->settings->enableGifAnimations.connect([this](bool enabled, auto) {
|
||||
getSettings()->enableGifAnimations.connect([this](bool enabled, auto) {
|
||||
if (enabled) {
|
||||
this->timer.start();
|
||||
} else {
|
||||
|
||||
@@ -30,11 +30,11 @@ LoggingChannel::LoggingChannel(const QString &_channelName)
|
||||
|
||||
auto app = getApp();
|
||||
|
||||
app->settings->logPath.connect([this](const QString &logPath, auto) {
|
||||
getSettings()->logPath.connect([this](const QString &logPath, auto) {
|
||||
auto app = getApp();
|
||||
|
||||
if (logPath.isEmpty()) {
|
||||
this->baseDirectory = app->paths->messageLogDirectory;
|
||||
this->baseDirectory = getPaths()->messageLogDirectory;
|
||||
} else {
|
||||
this->baseDirectory = logPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user