From 730e43222c4461e5ce510eaa39857f1b8e638b0d Mon Sep 17 00:00:00 2001 From: Sergey Chupligin Date: Wed, 10 Jul 2024 15:22:38 +0300 Subject: [PATCH] clang format --- src/core/sizing.cpp | 15 +++++++-------- src/core/theme.h | 12 ++++++------ src/core/themedaemon/mlocalthemedaemonclient.cpp | 10 +++------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/core/sizing.cpp b/src/core/sizing.cpp index 8cd940f..5ca1b3c 100644 --- a/src/core/sizing.cpp +++ b/src/core/sizing.cpp @@ -25,18 +25,17 @@ #include #include - Sizing::Sizing(QObject* parent) : QObject(parent) , m_mmScaleFactor(10) , m_dpScaleFactor(1) , m_screenDPI(0) { -//All sizes we get from LipstickSettings::exportScreenProperties() + // All sizes we get from LipstickSettings::exportScreenProperties() MGConfItem* physicalDotsPerInchConf = new MGConfItem("/lipstick/screen/primary/physicalDotsPerInch"); connect(physicalDotsPerInchConf, &MGConfItem::valueChanged, this, &Sizing::recalcConstants); - if(physicalDotsPerInchConf->value().isNull()) { - QScreen *primaryScreen = QGuiApplication::primaryScreen(); + if (physicalDotsPerInchConf->value().isNull()) { + QScreen* primaryScreen = QGuiApplication::primaryScreen(); physicalDotsPerInchConf->set(primaryScreen->physicalDotsPerInch()); physicalDotsPerInchConf->sync(); } @@ -83,7 +82,7 @@ void Sizing::recalcConstants() qDebug() << "Screen DPI is: " << dpi; - qreal dpScaleFactor; + float dpScaleFactor; if (dpi < 200) { dpScaleFactor = 1; @@ -91,7 +90,7 @@ void Sizing::recalcConstants() dpScaleFactor = 1.5; } else if (dpi >= 300 && dpi < 450) { dpScaleFactor = 2; - } else if (dpi >= 450 && dpi < 600) { + } else { dpScaleFactor = 2.5; } @@ -103,8 +102,8 @@ void Sizing::recalcConstants() emit dpScaleFactorChanged(); } - float pixelsInMM = dpi/2.45/10; - if(pixelsInMM != m_mmScaleFactor) { + float pixelsInMM = dpi / 2.45 / 10; + if (pixelsInMM != m_mmScaleFactor) { m_mmScaleFactor = pixelsInMM; emit mmScaleFactorChanged(); } diff --git a/src/core/theme.h b/src/core/theme.h index 29e57ce..84d8b4d 100644 --- a/src/core/theme.h +++ b/src/core/theme.h @@ -171,12 +171,12 @@ private slots: int m_fontWeightMedium; // 25 QString m_fontPath; //??? - QString m_accentColor; //#0091e5 - QString m_fillColor; //#474747 - QString m_fillDarkColor; //#313131 - QString m_textColor; //#ffffff - QString m_backgroundColor; //#000000 - QString m_backgroundAccentColor; //#ffffff + QString m_accentColor; // #0091e5 + QString m_fillColor; // #474747 + QString m_fillDarkColor; // #313131 + QString m_textColor; // #ffffff + QString m_backgroundColor; // #000000 + QString m_backgroundAccentColor; // #ffffff QString m_theme; diff --git a/src/core/themedaemon/mlocalthemedaemonclient.cpp b/src/core/themedaemon/mlocalthemedaemonclient.cpp index 8b95551..bdf6526 100644 --- a/src/core/themedaemon/mlocalthemedaemonclient.cpp +++ b/src/core/themedaemon/mlocalthemedaemonclient.cpp @@ -47,7 +47,7 @@ #include #ifndef QT_INSTALL_QML - #error QT_INSTALL_QML is not set! +#error QT_INSTALL_QML is not set! #endif MLocalThemeDaemonClient::MLocalThemeDaemonClient(const QString& testPath, QObject* parent) @@ -116,14 +116,10 @@ MLocalThemeDaemonClient::MLocalThemeDaemonClient(const QString& testPath, QObjec if (themeRoots.at(i).endsWith(QDir::separator())) themeRoots[i].truncate(themeRoots.at(i).length() - 1); - buildHash(themeRoots.at(i) + QDir::separator() + "icons", QStringList() << "*.svg" - << "*.png" - << "*.jpg"); + buildHash(themeRoots.at(i) + QDir::separator() + "icons", QStringList() << "*.svg" << "*.png" << "*.jpg"); } - m_imageDirNodes.append(ImageDirNode("icons", QStringList() << ".svg" - << ".png" - << ".jpg")); + m_imageDirNodes.append(ImageDirNode("icons", QStringList() << ".svg" << ".png" << ".jpg")); } MLocalThemeDaemonClient::~MLocalThemeDaemonClient()