summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Toscano <[email protected]>2017-05-01 17:42:24 +0200
committerLuigi Toscano <[email protected]>2017-05-01 19:17:43 +0200
commitf508c52e05a2eabf800502729a8dfe22f3d4f284 (patch)
treee6b85d95902ad00b344fb72261ad89590df18555
parent748e52bc0b3348309084058dd932f989cbb328e1 (diff)
Port KIcon to QIcon
-rw-r--r--gui/dialogviewconfiguration.cpp6
-rw-r--r--gui/kmixerwidget.cpp2
-rw-r--r--gui/mdwmoveaction.cpp6
-rw-r--r--gui/mdwslider.cpp2
-rw-r--r--gui/osdwidget.cpp10
-rw-r--r--gui/viewbase.cpp8
-rw-r--r--gui/viewbase.h4
-rw-r--r--gui/viewdockareapopup.cpp7
-rw-r--r--gui/viewdockareapopup.h5
-rw-r--r--gui/viewsliders.cpp2
-rw-r--r--plasma/engine/mixerengine.cpp3
11 files changed, 25 insertions, 30 deletions
diff --git a/gui/dialogviewconfiguration.cpp b/gui/dialogviewconfiguration.cpp
index 6545bb2..32ce34c 100644
--- a/gui/dialogviewconfiguration.cpp
+++ b/gui/dialogviewconfiguration.cpp
@@ -24,6 +24,7 @@
#include <algorithm>
#include <QCheckBox>
+#include <QIcon>
#include <QPushButton>
#include <QLabel>
#include <QScrollArea>
@@ -31,7 +32,6 @@
#include <QGridLayout>
#include <kdialog.h>
-#include <kicon.h>
#include <KIconLoader>
#include <klocale.h>
#include <kvbox.h>
@@ -279,14 +279,14 @@ void DialogViewConfiguration::createPage()
this , SLOT(slotDropped(DialogViewConfigurationWidget*,int,DialogViewConfigurationItem*,bool)));
addSpacer(1,1);
- const KIcon& icon = KIcon( QLatin1String( "arrow-left" ));
+ const QIcon& icon = QIcon::fromTheme( QLatin1String( "arrow-left" ));
moveLeftButton = new QPushButton(icon, "");
moveLeftButton->setEnabled(false);
_glayout->addWidget(moveLeftButton,1,2);
connect(moveLeftButton, SIGNAL(clicked(bool)), SLOT(moveSelectionToActiveList()));
addSpacer(1,3);
- const KIcon& icon2 = KIcon( QLatin1String( "arrow-right" ));
+ const QIcon& icon2 = QIcon::fromTheme( QLatin1String( "arrow-right" ));
moveRightButton = new QPushButton(icon2, "");
moveRightButton->setEnabled(false);
_glayout->addWidget(moveRightButton,1,4);
diff --git a/gui/kmixerwidget.cpp b/gui/kmixerwidget.cpp
index 74fd0ef..ce84cde 100644
--- a/gui/kmixerwidget.cpp
+++ b/gui/kmixerwidget.cpp
@@ -21,6 +21,7 @@
#include "gui/kmixerwidget.h"
// Qt
+#include <QIcon>
#include <QLabel>
#include <qpixmap.h>
#include <QString>
@@ -32,7 +33,6 @@
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kglobal.h>
-#include <kicon.h>
#include <klocale.h>
#include <ktabwidget.h>
diff --git a/gui/mdwmoveaction.cpp b/gui/mdwmoveaction.cpp
index 6ef2c5b..5ba234c 100644
--- a/gui/mdwmoveaction.cpp
+++ b/gui/mdwmoveaction.cpp
@@ -22,13 +22,11 @@
#include "mdwmoveaction.h"
-// KDE
-#include <kicon.h>
-
//KMix
#include "core/mixdevice.h"
// Qt
+#include <QIcon>
#include <QString>
MDWMoveAction::MDWMoveAction(shared_ptr<MixDevice> md, QObject *parent)
@@ -37,7 +35,7 @@ MDWMoveAction::MDWMoveAction(shared_ptr<MixDevice> md, QObject *parent)
Q_ASSERT(md);
setText(m_mixDevice->readableName());
- setIcon(KIcon(m_mixDevice->iconName()));
+ setIcon(QIcon::fromTheme(m_mixDevice->iconName()));
connect(this, SIGNAL(triggered(bool)), SLOT(triggered(bool)));
}
diff --git a/gui/mdwslider.cpp b/gui/mdwslider.cpp
index 7cab68c..22a24c4 100644
--- a/gui/mdwslider.cpp
+++ b/gui/mdwslider.cpp
@@ -30,7 +30,7 @@
#include <kactioncollection.h>
#include <ktoggleaction.h>
-#include <qicon.h>
+#include <QIcon>
#include <qtoolbutton.h>
#include <QObject>
#include <qcursor.h>
diff --git a/gui/osdwidget.cpp b/gui/osdwidget.cpp
index e3e8418..f056feb 100644
--- a/gui/osdwidget.cpp
+++ b/gui/osdwidget.cpp
@@ -22,13 +22,13 @@
#include "gui/osdwidget.h"
// Qt
+#include <QIcon>
#include <QGraphicsLinearLayout>
#include <QPainter>
#include <QTimer>
#include <QLabel>
// KDE
-#include <KIcon>
#include <KDialog>
#include <KWindowSystem>
#include <Plasma/Svg>
@@ -161,10 +161,10 @@ void OSDWidget::themeUpdated()
m_volumeMutedPixmap = svgIcon.pixmap("audio-volume-muted");
} else {
iconSize = QSize(IconSize(KIconLoader::Toolbar), IconSize(KIconLoader::Toolbar));
- m_volumeHighPixmap = KIcon( QLatin1String( "audio-volume-high" )).pixmap(iconSize);
- m_volumeMediumPixmap = KIcon( QLatin1String( "audio-volume-medium" )).pixmap(iconSize);
- m_volumeLowPixmap = KIcon( QLatin1String( "audio-volume-low" )).pixmap(iconSize);
- m_volumeMutedPixmap = KIcon( QLatin1String( "audio-volume-muted" )).pixmap(iconSize);
+ m_volumeHighPixmap = QIcon::fromTheme( QLatin1String( "audio-volume-high" )).pixmap(iconSize);
+ m_volumeMediumPixmap = QIcon::fromTheme( QLatin1String( "audio-volume-medium" )).pixmap(iconSize);
+ m_volumeLowPixmap = QIcon::fromTheme( QLatin1String( "audio-volume-low" )).pixmap(iconSize);
+ m_volumeMutedPixmap = QIcon::fromTheme( QLatin1String( "audio-volume-muted" )).pixmap(iconSize);
}
m_iconLabel->nativeWidget()->setPixmap(m_volumeHighPixmap);
diff --git a/gui/viewbase.cpp b/gui/viewbase.cpp
index 874a0da..c7a0b97 100644
--- a/gui/viewbase.cpp
+++ b/gui/viewbase.cpp
@@ -27,7 +27,6 @@
// KDE
#include <kaction.h>
-#include <kicon.h>
#include <kmenu.h>
#include <klocale.h>
#include <kiconloader.h>
@@ -58,7 +57,7 @@ ViewBase::ViewBase(QWidget* parent, QString id, Qt::WFlags f, ViewBase::ViewFlag
setObjectName(id);
// When loding the View from the XML profile, guiLevel can get overridden
m_viewId = id;
- configureIcon = new KIcon( QLatin1String( "configure" ));
+ configureIcon = QIcon::fromTheme( QLatin1String( "configure" ));
if ( _actions == 0 ) {
@@ -82,7 +81,6 @@ ViewBase::ViewBase(QWidget* parent, QString id, Qt::WFlags f, ViewBase::ViewFlag
ViewBase::~ViewBase()
{
- delete configureIcon;
// Hint: The GUI profile will not be removed, as it is pooled and might be applied to a new View.
}
@@ -99,7 +97,7 @@ void ViewBase::addMixer(Mixer *mixer)
QPushButton* ViewBase::createConfigureViewButton()
{
- QPushButton* configureViewButton = new QPushButton(*configureIcon, "", this);
+ QPushButton* configureViewButton = new QPushButton(configureIcon, "", this);
configureViewButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
configureViewButton->setToolTip(i18n( "Configure Channels" ));
connect(configureViewButton, SIGNAL(clicked(bool)), SLOT(configureView()));
@@ -215,7 +213,7 @@ void ViewBase::popupReset()
delete _popMenu;
_popMenu = new KMenu( this );
- _popMenu->addTitle( KIcon( QLatin1String( "kmix" ) ), i18n("Device Settings" ));
+ _popMenu->addTitle( QIcon::fromTheme( QLatin1String( "kmix" ) ), i18n("Device Settings" ));
act = _localActionColletion->action( "toggle_channels" );
if ( act ) _popMenu->addAction(act);
diff --git a/gui/viewbase.h b/gui/viewbase.h
index fb7514e..0d8bdfb 100644
--- a/gui/viewbase.h
+++ b/gui/viewbase.h
@@ -23,12 +23,12 @@
// QT
#include <QWidget>
+#include <QIcon>
#include <QList>
#include <QPushButton>
// KDE
#include <KActionCollection>
-class KIcon;
class KMenu;
class Mixer;
@@ -136,7 +136,7 @@ protected:
const QString _guiProfileId;
KActionCollection *_localActionColletion;
- KIcon* configureIcon;
+ QIcon configureIcon;
virtual void _setMixSet() = 0;
void resetMdws();
diff --git a/gui/viewdockareapopup.cpp b/gui/viewdockareapopup.cpp
index 9d07fee..6d8a2e7 100644
--- a/gui/viewdockareapopup.cpp
+++ b/gui/viewdockareapopup.cpp
@@ -25,6 +25,7 @@
#include <qevent.h>
#include <qframe.h>
#include <QGridLayout>
+#include <QIcon>
#include <QLayoutItem>
#include <QPushButton>
#include <QSizePolicy>
@@ -33,7 +34,6 @@
#include <kaction.h>
#include <kapplication.h>
#include <kdialog.h>
-#include <kicon.h>
#include <klocale.h>
#include <kwindowsystem.h>
@@ -87,7 +87,7 @@ ViewDockAreaPopup::ViewDockAreaPopup(QWidget* parent, QString id, ViewBase::View
// The list will be redone in _setMixSet() with the actual Mixer instances to use
}
- restoreVolumeIcon = new KIcon(QLatin1String("quickopen-file"));
+ restoreVolumeIcon = QIcon::fromTheme(QLatin1String("quickopen-file"));
createDeviceWidgets();
// Register listeners for all mixers
@@ -102,7 +102,6 @@ ViewDockAreaPopup::~ViewDockAreaPopup()
{
ControlManager::instance().removeListener(this);
delete _layoutMDW;
- delete restoreVolumeIcon;
// Hint: optionsLayout and "everything else" is deleted when "delete _layoutMDW" cascades down
}
@@ -403,7 +402,7 @@ void ViewDockAreaPopup::constructionFinished()
QPushButton* ViewDockAreaPopup::createRestoreVolumeButton ( int storageSlot )
{
QString buttonText = QString("%1").arg(storageSlot);
- QPushButton* profileButton = new QPushButton(*restoreVolumeIcon, buttonText, this);
+ QPushButton* profileButton = new QPushButton(restoreVolumeIcon, buttonText, this);
profileButton->setToolTip(i18n("Load volume profile %1").arg(storageSlot));
profileButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
return profileButton;
diff --git a/gui/viewdockareapopup.h b/gui/viewdockareapopup.h
index 1cdbc67..9930e1b 100644
--- a/gui/viewdockareapopup.h
+++ b/gui/viewdockareapopup.h
@@ -26,11 +26,10 @@
class QBoxLayout;
class QFrame;
class QGridLayout;
+#include <QIcon>;
#include <QPushButton>
class QWidget;
-class KIcon;
-
class Mixer;
class MixDevice;
class KMixWindow;
@@ -68,7 +67,7 @@ private:
QPushButton *restoreVolumeButton2;
QPushButton *restoreVolumeButton3;
QPushButton *restoreVolumeButton4;
- KIcon* restoreVolumeIcon;
+ QIcon restoreVolumeIcon;
static ProfControl* MatchAllForSoundMenu;
static QString InternedString_Star;
diff --git a/gui/viewsliders.cpp b/gui/viewsliders.cpp
index 139b035..e4f04ed 100644
--- a/gui/viewsliders.cpp
+++ b/gui/viewsliders.cpp
@@ -46,10 +46,10 @@
// KDE
-#include <KIcon>
#include <KLocale>
// Qt
+#include <QIcon>
#include <QPushButton>
#include <QLabel>
#include <QLayoutItem>
diff --git a/plasma/engine/mixerengine.cpp b/plasma/engine/mixerengine.cpp
index b5a3f22..6324c71 100644
--- a/plasma/engine/mixerengine.cpp
+++ b/plasma/engine/mixerengine.cpp
@@ -23,8 +23,9 @@
#include "mixer_interface.h"
#include "control_interface.h"
#include "mixerservice.h"
-#include <QTimer>
+
#include <QIcon>
+#include <QTimer>
const QString MixerEngine::KMIX_DBUS_SERVICE = "org.kde.kmix";