Skip to content

Commit

Permalink
MGCongig is deplecated
Browse files Browse the repository at this point in the history
  • Loading branch information
neochapay committed Feb 5, 2025
1 parent 811c450 commit f71cade
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/core/sizing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include "sizing.h"
#include "logging.h"

#include <MGConfItem>
#include <MDConfItem>
#include <QGuiApplication>
#include <QScreen>
#include <math.h>
Expand All @@ -32,8 +32,8 @@ Sizing::Sizing(QObject* parent)
, m_screenDPI(0)
{
// All sizes we get from LipstickSettings::exportScreenProperties()
MGConfItem* physicalDotsPerInchConf = new MGConfItem("/lipstick/screen/primary/physicalDotsPerInch");
connect(physicalDotsPerInchConf, &MGConfItem::valueChanged, this, &Sizing::recalcConstants);
MDConfItem* physicalDotsPerInchConf = new MDConfItem("/lipstick/screen/primary/physicalDotsPerInch");
connect(physicalDotsPerInchConf, &MDConfItem::valueChanged, this, &Sizing::recalcConstants);
if (physicalDotsPerInchConf->value().isNull()) {
QScreen* primaryScreen = QGuiApplication::primaryScreen();
physicalDotsPerInchConf->set(primaryScreen->physicalDotsPerInch());
Expand All @@ -45,7 +45,7 @@ Sizing::Sizing(QObject* parent)

void Sizing::setDpScaleFactor()
{
MGConfItem* dpScaleFactorValue = new MGConfItem(QStringLiteral("/nemo/apps/libglacier/dpScaleFactor"));
MDConfItem* dpScaleFactorValue = new MDConfItem(QStringLiteral("/nemo/apps/libglacier/dpScaleFactor"));
float value = dpScaleFactorValue->value("0").toFloat();

if (value != m_dpScaleFactor && value != 0) {
Expand Down Expand Up @@ -74,7 +74,7 @@ float Sizing::mm(float value)

void Sizing::recalcConstants()
{
qreal dpi = MGConfItem("/lipstick/screen/primary/physicalDotsPerInch").value().toReal();
qreal dpi = MDConfItem("/lipstick/screen/primary/physicalDotsPerInch").value().toReal();

if (dpi == m_screenDPI) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/core/theme.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ Theme::Theme(QObject* parent)

loadDefaultValue();

m_themeValue = new MGConfItem(QStringLiteral("/nemo/apps/libglacier/themePath"));
m_themeValue = new MDConfItem(QStringLiteral("/nemo/apps/libglacier/themePath"));
m_theme = m_themeValue->value().toString();

connect(m_themeValue, &MGConfItem::valueChanged, this, &Theme::themeValueChanged);
connect(m_themeValue, &MDConfItem::valueChanged, this, &Theme::themeValueChanged);
connect(size, &Sizing::dpScaleFactorChanged, this, &Theme::setThemeValues);

if (!m_theme.isEmpty()) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/theme.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef THEME_H
#define THEME_H

#include <MGConfItem>
#include <MDConfItem>
#include <QObject>

class Sizing;
Expand Down Expand Up @@ -184,7 +184,7 @@ private slots:
void loadDefaultValue();
void setThemeValues();

MGConfItem* m_themeValue;
MDConfItem* m_themeValue;
};

#endif // THEME_H

0 comments on commit f71cade

Please sign in to comment.