KIcon("foo") -> KDE::icon("foo")

include kicon.h -> kiconloader.h, or often, nothing at all.
This commit is contained in:
David Faure 2012-04-28 13:03:35 +02:00
parent 2ffa5b905a
commit af211f7c93
19 changed files with 30 additions and 46 deletions

View File

@ -28,7 +28,6 @@
#include <QTimer> #include <QTimer>
#include <kdebug.h> #include <kdebug.h>
#include <kicon.h>
#include <kplugininfo.h> #include <kplugininfo.h>
#include <kservicetypetrader.h> #include <kservicetypetrader.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
@ -296,7 +295,7 @@ QString AbstractRunner::name() const
QIcon AbstractRunner::icon() const QIcon AbstractRunner::icon() const
{ {
if (d->runnerDescription.isValid()) { if (d->runnerDescription.isValid()) {
return KIcon(d->runnerDescription.icon()); return KDE::icon(d->runnerDescription.icon());
} }
return QIcon(); return QIcon();

View File

@ -55,7 +55,6 @@
#include <kcolorscheme.h> #include <kcolorscheme.h>
#include <kdialog.h> #include <kdialog.h>
#include <kdesktopfile.h> #include <kdesktopfile.h>
#include <kicon.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kkeysequencewidget.h> #include <kkeysequencewidget.h>
#include <kplugininfo.h> #include <kplugininfo.h>

View File

@ -38,7 +38,6 @@
#include <kaction.h> #include <kaction.h>
#include <kauthorized.h> #include <kauthorized.h>
#include <kicon.h>
#include <kmenu.h> #include <kmenu.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kmimetype.h> #include <kmimetype.h>
@ -255,7 +254,7 @@ void ContainmentPrivate::addDefaultActions(KActionCollection *actions, Containme
KAction *appletBrowserAction = actions->addAction("add widgets"); KAction *appletBrowserAction = actions->addAction("add widgets");
appletBrowserAction->setAutoRepeat(false); appletBrowserAction->setAutoRepeat(false);
appletBrowserAction->setText(i18n("Add Widgets...")); appletBrowserAction->setText(i18n("Add Widgets..."));
appletBrowserAction->setIcon(KIcon("list-add")); appletBrowserAction->setIcon(KDE::icon("list-add"));
appletBrowserAction->setShortcut(KShortcut("alt+d, a")); appletBrowserAction->setShortcut(KShortcut("alt+d, a"));
appletBrowserAction->setData(AbstractToolBox::AddTool); appletBrowserAction->setData(AbstractToolBox::AddTool);
@ -1319,7 +1318,7 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS
q, SLOT(mimeTypeRetrieved(KIO::Job*,QString))); q, SLOT(mimeTypeRetrieved(KIO::Job*,QString)));
KMenu *choices = new KMenu("Content dropped"); KMenu *choices = new KMenu("Content dropped");
choices->addAction(KIcon("process-working"), i18n("Fetching file type...")); choices->addAction(KDE::icon("process-working"), i18n("Fetching file type..."));
if (dropEvent) { if (dropEvent) {
choices->popup(dropEvent->screenPos()); choices->popup(dropEvent->screenPos());
} else { } else {
@ -1365,7 +1364,7 @@ void ContainmentPrivate::dropData(QPointF scenePos, QPoint screenPos, QGraphicsS
foreach (const KPluginInfo &info, seenPlugins) { foreach (const KPluginInfo &info, seenPlugins) {
QAction *action; QAction *action;
if (!info.icon().isEmpty()) { if (!info.icon().isEmpty()) {
action = choices.addAction(KIcon(info.icon()), info.name()); action = choices.addAction(KDE::icon(info.icon()), info.name());
} else { } else {
action = choices.addAction(info.name()); action = choices.addAction(info.name());
} }
@ -1541,7 +1540,7 @@ void ContainmentPrivate::mimeTypeRetrieved(KIO::Job *job, const QString &mimeTyp
#endif #endif
QAction *action; QAction *action;
if (!info.icon().isEmpty()) { if (!info.icon().isEmpty()) {
action = choices->addAction(KIcon(info.icon()), info.name()); action = choices->addAction(KDE::icon(info.icon()), info.name());
} else { } else {
action = choices->addAction(info.name()); action = choices->addAction(info.name());
} }
@ -1565,7 +1564,7 @@ void ContainmentPrivate::mimeTypeRetrieved(KIO::Job *job, const QString &mimeTyp
foreach (const KPluginInfo &info, wallpaperList) { foreach (const KPluginInfo &info, wallpaperList) {
QAction *action; QAction *action;
if (!info.icon().isEmpty()) { if (!info.icon().isEmpty()) {
action = choices->addAction(KIcon(info.icon()), info.name()); action = choices->addAction(KDE::icon(info.icon()), info.name());
} else { } else {
action = choices->addAction(info.name()); action = choices->addAction(info.name());
} }

View File

@ -40,7 +40,6 @@
#include <kmimetype.h> #include <kmimetype.h>
#include <kshortcutsdialog.h> #include <kshortcutsdialog.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>
#include <kicon.h>
#include "coronabase.h" #include "coronabase.h"
#include "abstractdialogmanager.h" #include "abstractdialogmanager.h"

View File

@ -40,7 +40,6 @@
#include <kmimetype.h> #include <kmimetype.h>
#include <kshortcutsdialog.h> #include <kshortcutsdialog.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>
#include <kicon.h>
#include "abstractdialogmanager.h" #include "abstractdialogmanager.h"
#include "abstracttoolbox.h" #include "abstracttoolbox.h"
@ -338,7 +337,7 @@ void CoronaBase::setImmutability(const ImmutabilityType immutable)
} else { } else {
bool unlocked = d->immutability == Mutable; bool unlocked = d->immutability == Mutable;
action->setText(unlocked ? i18n("Lock Widgets") : i18n("Unlock Widgets")); action->setText(unlocked ? i18n("Lock Widgets") : i18n("Unlock Widgets"));
action->setIcon(KIcon(unlocked ? "object-locked" : "object-unlocked")); action->setIcon(KDE::icon(unlocked ? "object-locked" : "object-unlocked"));
action->setEnabled(true); action->setEnabled(true);
action->setVisible(true); action->setVisible(true);
} }
@ -478,7 +477,7 @@ void CoronaBasePrivate::init()
QObject::connect(lockAction, SIGNAL(triggered(bool)), q, SLOT(toggleImmutability())); QObject::connect(lockAction, SIGNAL(triggered(bool)), q, SLOT(toggleImmutability()));
lockAction->setText(i18n("Lock Widgets")); lockAction->setText(i18n("Lock Widgets"));
lockAction->setAutoRepeat(true); lockAction->setAutoRepeat(true);
lockAction->setIcon(KIcon("object-locked")); lockAction->setIcon(KDE::icon("object-locked"));
lockAction->setData(AbstractToolBox::ControlTool); lockAction->setData(AbstractToolBox::ControlTool);
lockAction->setShortcut(KShortcut("alt+d, l")); lockAction->setShortcut(KShortcut("alt+d, l"));
lockAction->setShortcutContext(Qt::ApplicationShortcut); lockAction->setShortcutContext(Qt::ApplicationShortcut);
@ -489,7 +488,7 @@ void CoronaBasePrivate::init()
KAction *action = actions.addAction("configure shortcuts"); KAction *action = actions.addAction("configure shortcuts");
QObject::connect(action, SIGNAL(triggered()), q, SLOT(showShortcutConfig())); QObject::connect(action, SIGNAL(triggered()), q, SLOT(showShortcutConfig()));
action->setText(i18n("Shortcut Settings")); action->setText(i18n("Shortcut Settings"));
action->setIcon(KIcon("configure-shortcuts")); action->setIcon(KDE::icon("configure-shortcuts"));
action->setAutoRepeat(false); action->setAutoRepeat(false);
action->setData(AbstractToolBox::ConfigureTool); action->setData(AbstractToolBox::ConfigureTool);
//action->setShortcut(KShortcut("ctrl+h")); //action->setShortcut(KShortcut("ctrl+h"));

View File

@ -94,7 +94,7 @@ void GraphicsViewAppletPrivate::showMessage(const QIcon &icon, const QString &me
if (buttons & ButtonOk) { if (buttons & ButtonOk) {
messageOkButton = new PushButton(mainWidget); messageOkButton = new PushButton(mainWidget);
messageOkButton.data()->setText(i18n("&OK")); messageOkButton.data()->setText(i18n("&OK"));
messageOkButton.data()->setIcon(KIcon("dialog-ok")); messageOkButton.data()->setIcon(KDE::icon("dialog-ok"));
buttonLayout->addItem(messageOkButton.data()); buttonLayout->addItem(messageOkButton.data());
QObject::connect(messageOkButton.data(), SIGNAL(clicked()), q, SLOT(destroyMessageOverlay())); QObject::connect(messageOkButton.data(), SIGNAL(clicked()), q, SLOT(destroyMessageOverlay()));
} }
@ -116,7 +116,7 @@ void GraphicsViewAppletPrivate::showMessage(const QIcon &icon, const QString &me
if (buttons & ButtonCancel) { if (buttons & ButtonCancel) {
messageCancelButton = new PushButton(mainWidget); messageCancelButton = new PushButton(mainWidget);
messageCancelButton.data()->setText(i18n("&Cancel")); messageCancelButton.data()->setText(i18n("&Cancel"));
messageCancelButton.data()->setIcon(KIcon("dialog-cancel")); messageCancelButton.data()->setIcon(KDE::icon("dialog-cancel"));
buttonLayout->addItem(messageCancelButton.data()); buttonLayout->addItem(messageCancelButton.data());
QObject::connect(messageCancelButton.data(), SIGNAL(clicked()), q, SLOT(destroyMessageOverlay())); QObject::connect(messageCancelButton.data(), SIGNAL(clicked()), q, SLOT(destroyMessageOverlay()));
} }
@ -153,7 +153,7 @@ void GraphicsViewAppletPrivate::showMessage(const QIcon &icon, const QString &me
if (buttonLayout->count() < 1) { if (buttonLayout->count() < 1) {
PushButton *ok = new PushButton(mainWidget); PushButton *ok = new PushButton(mainWidget);
ok->setText(i18n("OK")); ok->setText(i18n("OK"));
ok->setIcon(KIcon("dialog-ok")); ok->setIcon(KDE::icon("dialog-ok"));
buttonLayout->addItem(ok); buttonLayout->addItem(ok);
QObject::connect(ok, SIGNAL(clicked()), q, SLOT(destroyMessageOverlay())); QObject::connect(ok, SIGNAL(clicked()), q, SLOT(destroyMessageOverlay()));
} }
@ -216,7 +216,7 @@ void GraphicsViewAppletPrivate::updateFailedToLaunch(const QString &reason)
failureLayout->setContentsMargins(0, 0, 0, 0); failureLayout->setContentsMargins(0, 0, 0, 0);
IconWidget *failureIcon = new IconWidget(q); IconWidget *failureIcon = new IconWidget(q);
failureIcon->setIcon(KIcon("dialog-error")); failureIcon->setIcon(KDE::icon("dialog-error"));
failureLayout->addItem(failureIcon); failureLayout->addItem(failureIcon);
Label *failureWidget = new Plasma::Label(q); Label *failureWidget = new Plasma::Label(q);
@ -227,7 +227,7 @@ void GraphicsViewAppletPrivate::updateFailedToLaunch(const QString &reason)
Plasma::ToolTipManager::self()->registerWidget(failureIcon); Plasma::ToolTipManager::self()->registerWidget(failureIcon);
Plasma::ToolTipContent data(i18n("Unable to load the widget"), reason, Plasma::ToolTipContent data(i18n("Unable to load the widget"), reason,
KIcon("dialog-error")); KDE::icon("dialog-error"));
Plasma::ToolTipManager::self()->setContent(failureIcon, data); Plasma::ToolTipManager::self()->setContent(failureIcon, data);
q->setLayout(failureLayout); q->setLayout(failureLayout);

View File

@ -32,7 +32,6 @@
#include <QX11Info> #include <QX11Info>
#endif #endif
#include <kicon.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
@ -94,7 +93,7 @@ void PopupApplet::setPopupIcon(const QString &iconName)
if (package().isValid()) { if (package().isValid()) {
const QString file = package().filePath("images", iconName); const QString file = package().filePath("images", iconName);
if (!file.isEmpty()) { if (!file.isEmpty()) {
setPopupIcon(KIcon(file)); setPopupIcon(KDE::icon(file));
return; return;
} }
} }
@ -105,14 +104,14 @@ void PopupApplet::setPopupIcon(const QString &iconName)
d->createIconWidget(); d->createIconWidget();
d->icon->setSvg(name, iconName); d->icon->setSvg(name, iconName);
if (d->icon->svg().isEmpty()) { if (d->icon->svg().isEmpty()) {
setPopupIcon(KIcon(iconName)); setPopupIcon(KDE::icon(iconName));
} }
return; return;
} }
// Final Attempt: use KIcon // Final Attempt: use KDE::icon
setPopupIcon(KIcon(iconName)); setPopupIcon(KDE::icon(iconName));
} }
QIcon PopupApplet::popupIcon() const QIcon PopupApplet::popupIcon() const

View File

@ -34,7 +34,6 @@
#include <kcolorscheme.h> #include <kcolorscheme.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <kicon.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kwindowsystem.h> #include <kwindowsystem.h>

View File

@ -36,7 +36,6 @@
#include <kaction.h> #include <kaction.h>
#include <kkeysequencewidget.h> #include <kkeysequencewidget.h>
#include <kicon.h>
#include <kstandarddirs.h> #include <kstandarddirs.h>
namespace Plasma namespace Plasma
@ -292,21 +291,21 @@ KActionCollection* AppletPrivate::defaultActions(QObject *parent)
KAction *configAction = actions->addAction("configure"); KAction *configAction = actions->addAction("configure");
configAction->setAutoRepeat(false); configAction->setAutoRepeat(false);
configAction->setText(i18n("Widget Settings")); configAction->setText(i18n("Widget Settings"));
configAction->setIcon(KIcon("configure")); configAction->setIcon(KDE::icon("configure"));
configAction->setShortcut(KShortcut("alt+d, s")); configAction->setShortcut(KShortcut("alt+d, s"));
configAction->setData(AbstractToolBox::ConfigureTool); configAction->setData(AbstractToolBox::ConfigureTool);
KAction *closeApplet = actions->addAction("remove"); KAction *closeApplet = actions->addAction("remove");
closeApplet->setAutoRepeat(false); closeApplet->setAutoRepeat(false);
closeApplet->setText(i18n("Remove this Widget")); closeApplet->setText(i18n("Remove this Widget"));
closeApplet->setIcon(KIcon("edit-delete")); closeApplet->setIcon(KDE::icon("edit-delete"));
closeApplet->setShortcut(KShortcut("alt+d, r")); closeApplet->setShortcut(KShortcut("alt+d, r"));
closeApplet->setData(AbstractToolBox::DestructiveTool); closeApplet->setData(AbstractToolBox::DestructiveTool);
KAction *runAssociatedApplication = actions->addAction("run associated application"); KAction *runAssociatedApplication = actions->addAction("run associated application");
runAssociatedApplication->setAutoRepeat(false); runAssociatedApplication->setAutoRepeat(false);
runAssociatedApplication->setText(i18n("Run the Associated Application")); runAssociatedApplication->setText(i18n("Run the Associated Application"));
runAssociatedApplication->setIcon(KIcon("system-run")); runAssociatedApplication->setIcon(KDE::icon("system-run"));
runAssociatedApplication->setShortcut(KShortcut("alt+d, t")); runAssociatedApplication->setShortcut(KShortcut("alt+d, t"));
runAssociatedApplication->setVisible(false); runAssociatedApplication->setVisible(false);
runAssociatedApplication->setEnabled(false); runAssociatedApplication->setEnabled(false);

View File

@ -25,7 +25,6 @@
#include <QFile> #include <QFile>
#include <kstandarddirs.h> #include <kstandarddirs.h>
#include <kicon.h>
#ifndef PLASMA_NO_KIO #ifndef PLASMA_NO_KIO
#include <krun.h> #include <krun.h>
@ -129,7 +128,7 @@ void AssociatedApplicationManager::run(Plasma::Applet *applet)
#endif #endif
if (!success) { if (!success) {
applet->showMessage(KIcon("application-exit"), i18n("There was an error attempting to exec the associated application with this widget."), ButtonOk); applet->showMessage(KDE::icon("application-exit"), i18n("There was an error attempting to exec the associated application with this widget."), ButtonOk);
} }
} else if (d->urlLists.contains(applet) && !d->urlLists.value(applet).isEmpty()) { } else if (d->urlLists.contains(applet) && !d->urlLists.value(applet).isEmpty()) {

View File

@ -37,7 +37,6 @@
// KDE // KDE
#include <kdebug.h> #include <kdebug.h>
#include <kcolorutils.h> #include <kcolorutils.h>
#include <kicon.h>
#include <kiconeffect.h> #include <kiconeffect.h>
#include <kiconloader.h> #include <kiconloader.h>

View File

@ -26,7 +26,6 @@
#include <kdesktopfile.h> #include <kdesktopfile.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <kzip.h> #include <kzip.h>
#include <kicon.h>
#include "config-plasma.h" #include "config-plasma.h"
@ -135,7 +134,7 @@ public:
dialog->setButtonText(KDialog::Yes, i18n("Open Widget")); dialog->setButtonText(KDialog::Yes, i18n("Open Widget"));
dialog->setButtonText(KDialog::No, i18n("Reject Widget")); dialog->setButtonText(KDialog::No, i18n("Reject Widget"));
int answer = KMessageBox::createKMessageBox(dialog, KIcon(iconName), message, int answer = KMessageBox::createKMessageBox(dialog, KDE::icon(iconName), message,
QStringList(), QString(), 0, QStringList(), QString(), 0,
KMessageBox::Dangerous); KMessageBox::Dangerous);

View File

@ -48,7 +48,7 @@ class Corona;
* Plasma::ToolTipContent data; * Plasma::ToolTipContent data;
* data.mainText = i18n("My Title"); * data.mainText = i18n("My Title");
* data.subText = i18n("This is a little tooltip"); * data.subText = i18n("This is a little tooltip");
* data.image = KIcon("some-icon").pixmap(IconSize(KIconLoader::Desktop)); * data.image = KDE::icon("some-icon").pixmap(IconSize(KIconLoader::Desktop));
* Plasma::ToolTipManager::self()->setContent(widget, data); * Plasma::ToolTipManager::self()->setContent(widget, data);
* @endcode * @endcode
* *

View File

@ -38,7 +38,6 @@
#include <kcolorscheme.h> #include <kcolorscheme.h>
#include <kdebug.h> #include <kdebug.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <kicon.h>
#include <kiconeffect.h> #include <kiconeffect.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <kmimetype.h> #include <kmimetype.h>
@ -1307,7 +1306,7 @@ void IconWidget::setIcon(const QString &icon)
return; return;
} }
setIcon(KIcon(icon)); setIcon(KDE::icon(icon));
} }
void IconWidget::setIcon(const QIcon &icon) void IconWidget::setIcon(const QIcon &icon)

View File

@ -139,7 +139,7 @@ public:
/** /**
* Sets the graphical icon for this Plasma::IconWidget. * Sets the graphical icon for this Plasma::IconWidget.
* @param icon the KIcon to associate with this icon. * @param icon the KDE::icon to associate with this icon.
*/ */
void setIcon(const QIcon &icon); void setIcon(const QIcon &icon);

View File

@ -25,7 +25,6 @@
#include <QStyleOptionGraphicsItem> #include <QStyleOptionGraphicsItem>
#include <QWeakPointer> #include <QWeakPointer>
#include <kicon.h>
#include <kiconeffect.h> #include <kiconeffect.h>
#include <kmimetype.h> #include <kmimetype.h>
#include <kpushbutton.h> #include <kpushbutton.h>
@ -99,7 +98,7 @@ public:
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }
static_cast<KPushButton*>(q->widget())->setIcon(KIcon(pm)); static_cast<KPushButton*>(q->widget())->setIcon(KDE::icon(pm));
} }
void pressedChanged() void pressedChanged()

View File

@ -22,7 +22,6 @@
#include <QGraphicsProxyWidget> #include <QGraphicsProxyWidget>
#include <kicon.h>
class KPushButton; class KPushButton;
@ -120,7 +119,7 @@ public:
QAction *action() const; QAction *action() const;
/** /**
* sets the icon for this push button using a KIcon * sets the icon for this push button using a KDE::icon
* *
* @param icon the icon to use * @param icon the icon to use
* *

View File

@ -26,7 +26,6 @@
#include <QToolButton> #include <QToolButton>
#include <kcolorutils.h> #include <kcolorutils.h>
#include <kicon.h>
#include <kiconeffect.h> #include <kiconeffect.h>
#include <kmimetype.h> #include <kmimetype.h>
@ -95,7 +94,7 @@ public:
pm = QPixmap(absImagePath); pm = QPixmap(absImagePath);
} }
static_cast<QToolButton*>(q->widget())->setIcon(KIcon(pm)); static_cast<QToolButton*>(q->widget())->setIcon(KDE::icon(pm));
} }
void syncActiveRect(); void syncActiveRect();

View File

@ -26,7 +26,6 @@
#include <QGraphicsLinearLayout> #include <QGraphicsLinearLayout>
#include <QGraphicsSceneResizeEvent> #include <QGraphicsSceneResizeEvent>
#include <kicon.h>
#include <kiconloader.h> #include <kiconloader.h>
#ifndef PLASMA_NO_KIO #ifndef PLASMA_NO_KIO
@ -458,7 +457,7 @@ void VideoWidget::setUsedControls(const Controls controls)
if (controls&OpenFile) { if (controls&OpenFile) {
if (!d->openFileButton) { if (!d->openFileButton) {
d->openFileButton = new IconWidget(d->controlsWidget); d->openFileButton = new IconWidget(d->controlsWidget);
d->openFileButton->setIcon(KIcon("document-open")); d->openFileButton->setIcon(KDE::icon("document-open"));
connect(d->openFileButton, SIGNAL(clicked()), this, SLOT(showOpenFileDialog())); connect(d->openFileButton, SIGNAL(clicked()), this, SLOT(showOpenFileDialog()));
} }
controlsLayout->addItem(d->openFileButton); controlsLayout->addItem(d->openFileButton);