|
|
e6e299 |
From 9b726962fddf04135afd32e99ac07929d36bc1c7 Mon Sep 17 00:00:00 2001
|
|
|
e6e299 |
From: Aaron Seigo <aseigo@kde.org>
|
|
|
e6e299 |
Date: Tue, 5 Feb 2013 12:59:40 +0100
|
|
|
e6e299 |
Subject: [PATCH 4/8] --memoryLeak;
|
|
|
e6e299 |
|
|
|
e6e299 |
it's a minor one, though; so i wouldn't worry about backporting it to 4.10.
|
|
|
e6e299 |
---
|
|
|
e6e299 |
gui/osdwidget.cpp | 19 +++++++++----------
|
|
|
e6e299 |
1 file changed, 9 insertions(+), 10 deletions(-)
|
|
|
e6e299 |
|
|
|
e6e299 |
diff --git a/gui/osdwidget.cpp b/gui/osdwidget.cpp
|
|
|
e6e299 |
index 58f87a7..72b8d9c 100644
|
|
|
e6e299 |
--- a/gui/osdwidget.cpp
|
|
|
e6e299 |
+++ b/gui/osdwidget.cpp
|
|
|
e6e299 |
@@ -31,7 +31,7 @@
|
|
|
e6e299 |
#include <KIcon>
|
|
|
e6e299 |
#include <KDialog>
|
|
|
e6e299 |
#include <KWindowSystem>
|
|
|
e6e299 |
-#include <Plasma/FrameSvg>
|
|
|
e6e299 |
+#include <Plasma/Svg>
|
|
|
e6e299 |
#include <Plasma/Label>
|
|
|
e6e299 |
#include <Plasma/Meter>
|
|
|
e6e299 |
#include <Plasma/Theme>
|
|
|
e6e299 |
@@ -151,15 +151,14 @@ void OSDWidget::themeUpdated()
|
|
|
e6e299 |
if (!Plasma::Theme::defaultTheme()->imagePath("icons/audio").isEmpty()) {
|
|
|
e6e299 |
QFontMetrics fm(m_volumeLabel->font());
|
|
|
e6e299 |
iconSize = QSize(fm.height(), fm.height());
|
|
|
e6e299 |
- // Leak | low prio | The old Plasma::Svg is not freed on a themeUpdated(), also it is not freed in the destructor
|
|
|
e6e299 |
- Plasma::Svg *svgIcon = new Plasma::Svg(this);
|
|
|
e6e299 |
- svgIcon->setImagePath("icons/audio");
|
|
|
e6e299 |
- svgIcon->setContainsMultipleImages(true);
|
|
|
e6e299 |
- svgIcon->resize(iconSize);
|
|
|
e6e299 |
- m_volumeHighPixmap = svgIcon->pixmap("audio-volume-high");
|
|
|
e6e299 |
- m_volumeMediumPixmap = svgIcon->pixmap("audio-volume-medium");
|
|
|
e6e299 |
- m_volumeLowPixmap = svgIcon->pixmap("audio-volume-low");
|
|
|
e6e299 |
- m_volumeMutedPixmap = svgIcon->pixmap("audio-volume-muted");
|
|
|
e6e299 |
+ Plasma::Svg svgIcon;
|
|
|
e6e299 |
+ svgIcon.setImagePath("icons/audio");
|
|
|
e6e299 |
+ svgIcon.setContainsMultipleImages(true);
|
|
|
e6e299 |
+ svgIcon.resize(iconSize);
|
|
|
e6e299 |
+ m_volumeHighPixmap = svgIcon.pixmap("audio-volume-high");
|
|
|
e6e299 |
+ m_volumeMediumPixmap = svgIcon.pixmap("audio-volume-medium");
|
|
|
e6e299 |
+ m_volumeLowPixmap = svgIcon.pixmap("audio-volume-low");
|
|
|
e6e299 |
+ m_volumeMutedPixmap = svgIcon.pixmap("audio-volume-muted");
|
|
|
e6e299 |
} else {
|
|
|
e6e299 |
iconSize = QSize(KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium);
|
|
|
e6e299 |
m_volumeHighPixmap = KIcon( QLatin1String( "audio-volume-high" )).pixmap(iconSize);
|
|
|
e6e299 |
--
|
|
|
e6e299 |
1.8.1.4
|
|
|
e6e299 |
|