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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -25,7 +25,6 @@
#include <QFile>
#include <kstandarddirs.h>
#include <kicon.h>
#ifndef PLASMA_NO_KIO
#include <krun.h>
@ -129,7 +128,7 @@ void AssociatedApplicationManager::run(Plasma::Applet *applet)
#endif
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()) {

View File

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

View File

@ -26,7 +26,6 @@
#include <kdesktopfile.h>
#include <kmessagebox.h>
#include <kzip.h>
#include <kicon.h>
#include "config-plasma.h"
@ -135,7 +134,7 @@ public:
dialog->setButtonText(KDialog::Yes, i18n("Open 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,
KMessageBox::Dangerous);

View File

@ -48,7 +48,7 @@ class Corona;
* Plasma::ToolTipContent data;
* data.mainText = i18n("My Title");
* 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);
* @endcode
*

View File

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

View File

@ -139,7 +139,7 @@ public:
/**
* 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);

View File

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

View File

@ -22,7 +22,6 @@
#include <QGraphicsProxyWidget>
#include <kicon.h>
class KPushButton;
@ -120,7 +119,7 @@ public:
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
*

View File

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

View File

@ -26,7 +26,6 @@
#include <QGraphicsLinearLayout>
#include <QGraphicsSceneResizeEvent>
#include <kicon.h>
#include <kiconloader.h>
#ifndef PLASMA_NO_KIO
@ -458,7 +457,7 @@ void VideoWidget::setUsedControls(const Controls controls)
if (controls&OpenFile) {
if (!d->openFileButton) {
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()));
}
controlsLayout->addItem(d->openFileButton);