OSDN Git Service

kcontrol: remove unused variable in ThemeDelegate::paint()
authorIvailo Monev <xakepa10@gmail.com>
Wed, 16 Aug 2023 13:31:44 +0000 (16:31 +0300)
committerIvailo Monev <xakepa10@gmail.com>
Wed, 16 Aug 2023 13:31:44 +0000 (16:31 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
kcontrol/desktoptheme/kcmdesktoptheme.cpp
kcontrol/desktoptheme/thememodel.cpp

index 28ff3f1..a299a1b 100644 (file)
@@ -106,7 +106,7 @@ void KCMDesktopTheme::load()
 void KCMDesktopTheme::save()
 {
     // Don't do anything if we don't need to.
-    if (!( m_bDesktopThemeDirty) && !(m_bDetailsDirty)) {
+    if (!(m_bDesktopThemeDirty) && !(m_bDetailsDirty)) {
         return;
     }
 
@@ -123,7 +123,7 @@ void KCMDesktopTheme::save()
     // Clean up
     m_bDesktopThemeDirty = false;
     m_bDetailsDirty = false;
-    emit changed( false );
+    emit changed(false);
 }
 
 void KCMDesktopTheme::defaults()
index 2061587..cd12980 100644 (file)
@@ -63,8 +63,10 @@ void ThemeModel::reload()
 
     // get all desktop themes
     KStandardDirs dirs;
-    const QStringList themes = dirs.findAllResources("data", "desktoptheme/*/metadata.desktop",
-                                               KStandardDirs::NoDuplicates);
+    const QStringList themes = dirs.findAllResources(
+        "data", "desktoptheme/*/metadata.desktop",
+        KStandardDirs::NoDuplicates
+    );
     foreach (const QString &theme, themes) {
         int themeSepIndex = theme.lastIndexOf('/', -1);
         QString themeRoot = theme.left(themeSepIndex);
@@ -82,8 +84,8 @@ void ThemeModel::reload()
             name = packageName;
         }
         const QString comment = df.readComment();
-        const QString author = df.desktopGroup().readEntry("X-KDE-PluginInfo-Author",QString());
-        const QString version = df.desktopGroup().readEntry("X-KDE-PluginInfo-Version",QString());
+        const QString author = df.desktopGroup().readEntry("X-KDE-PluginInfo-Author", QString());
+        const QString version = df.desktopGroup().readEntry("X-KDE-PluginInfo-Version", QString());
 
 
         Plasma::FrameSvg *svg = new Plasma::FrameSvg(this);
@@ -180,9 +182,6 @@ void ThemeDelegate::paint(QPainter *painter,
     Plasma::FrameSvg *svg = static_cast<Plasma::FrameSvg *>(
             index.model()->data(index, ThemeModel::SvgRole).value<void *>());
     svg->resizeFrame(QSize(option.rect.width() - (2 * MARGIN), 100 - (2 * MARGIN)));
-    QRect imgRect = QRect(option.rect.topLeft(),
-            QSize(option.rect.width() - (2 * MARGIN), 100 - (2 * MARGIN)))
-            .translated(MARGIN, MARGIN);
     svg->paintFrame(painter, QPoint(option.rect.left() + MARGIN, option.rect.top() + MARGIN));
 
     // draw text