Commit b67dd4e9 authored by Michal Humpula's avatar Michal Humpula

migrate from KIcon to QIcon

parent 816bcd0b
......@@ -67,7 +67,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
// FIXME KF5 enableButton( Apply, false );
KPageWidgetItem *applicationItem = addPage( new QWidget, i18n("Application") );
applicationItem->setIcon( KIcon( "preferences-other" ) );
applicationItem->setIcon( QIcon::fromTheme( "preferences-other" ) );
applicationItem->setHeader( i18n("Application Options") );
m_applicationPage = applicationItem;
......@@ -75,7 +75,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
QFrame* generalFrame = new QFrame;
KPageWidgetItem *item = addSubPage( applicationItem, generalFrame, i18n("General") );
item->setHeader( i18n("General Options") );
item->setIcon( KIcon( "go-home" ) );
item->setIcon( QIcon::fromTheme( "go-home" ) );
setCurrentPage (item);
QVBoxLayout *layout = new QVBoxLayout( generalFrame );
......@@ -141,7 +141,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
QFrame* sessionsFrame = new QFrame;
item = addSubPage( applicationItem, sessionsFrame, i18n("Sessions") );
item->setHeader( i18n("Session Management") );
item->setIcon( KIcon( "view-history" ) );
item->setIcon( QIcon::fromTheme( "view-history" ) );
layout = new QVBoxLayout( sessionsFrame );
layout->setMargin(0);
......@@ -197,7 +197,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
item = addSubPage( applicationItem, page, i18n("Plugins") );
item->setHeader( i18n("Plugin Manager") );
item->setIcon( KIcon( "preferences-plugin" ) );
item->setIcon( QIcon::fromTheme( "preferences-plugin" ) );
KatePluginList &pluginList (KatePluginManager::self()->pluginList());
foreach (const KatePluginInfo &plugin, pluginList)
......@@ -210,7 +210,7 @@ KateConfigDialog::KateConfigDialog ( KateMainWindow *parent, KTextEditor::View *
// editor widgets from kwrite/kwdialog
m_editorPage = addPage( new QWidget, i18n("Editor Component") );
m_editorPage->setIcon( KIcon( "accessories-text-editor" ) );
m_editorPage->setIcon( QIcon::fromTheme( "accessories-text-editor" ) );
m_editorPage->setHeader( i18n("Editor Component Options") );
addEditorPages();
......
......@@ -272,7 +272,7 @@ void KateMainWindow::setupActions()
fileOpenRecent->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
a = actionCollection()->addAction( "file_save_all" );
a->setIcon( KIcon("document-save-all") );
a->setIcon( QIcon::fromTheme("document-save-all") );
a->setText( i18n("Save A&ll") );
a->setShortcut( QKeySequence(Qt::CTRL + Qt::Key_L) );
connect( a, SIGNAL(triggered()), KateDocManager::self(), SLOT(saveAll()) );
......@@ -307,13 +307,13 @@ void KateMainWindow::setupActions()
a->setWhatsThis(i18n("Close this window"));
a = actionCollection()->addAction( "view_new_view" );
a->setIcon( KIcon("window-new") );
a->setIcon( QIcon::fromTheme("window-new") );
a->setText( i18n("&New Window") );
connect( a, SIGNAL(triggered()), this, SLOT(newWindow()) );
a->setWhatsThis(i18n("Create a new Kate view (a new window with the same document list)."));
a = actionCollection()->addAction( "view_quick_open" );
a->setIcon( KIcon("fork") );
a->setIcon( QIcon::fromTheme("fork") );
a->setText( i18n("&Quick Open") );
a->setShortcut( QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_O) );
connect( a, SIGNAL(triggered()), this, SLOT(slotQuickOpen()) );
......@@ -365,25 +365,25 @@ void KateMainWindow::setupActions()
// session actions
a = actionCollection()->addAction( "sessions_new" );
a->setIcon( KIcon("document-new") );
a->setIcon( QIcon::fromTheme("document-new") );
a->setText( i18nc("Menu entry Session->New", "&New") );
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect( a, SIGNAL(triggered()), KateSessionManager::self(), SLOT(sessionNew()), Qt::QueuedConnection );
a = actionCollection()->addAction( "sessions_open" );
a->setIcon( KIcon("document-open") );
a->setIcon( QIcon::fromTheme("document-open") );
a->setText( i18n("&Open Session") );
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect( a, SIGNAL(triggered()), KateSessionManager::self(), SLOT(sessionOpen()), Qt::QueuedConnection );
a = actionCollection()->addAction( "sessions_save" );
a->setIcon( KIcon("document-save") );
a->setIcon( QIcon::fromTheme("document-save") );
a->setText( i18n("&Save Session") );
connect( a, SIGNAL(triggered()), KateSessionManager::self(), SLOT(sessionSave()) );
a = actionCollection()->addAction( "sessions_save_as" );
a->setIcon( KIcon("document-save-as") );
a->setIcon( QIcon::fromTheme("document-save-as") );
a->setText( i18n("Save Session &As...") );
connect( a, SIGNAL(triggered()), KateSessionManager::self(), SLOT(sessionSaveAs()) );
a = actionCollection()->addAction( "sessions_manage" );
a->setIcon( KIcon("view-choose") );
a->setIcon( QIcon::fromTheme("view-choose") );
a->setText( i18n("&Manage Sessions...") );
// Qt::QueuedConnection to avoid deletion of code that is executed when reducing the amount of mainwindows. (bug #227008)
connect( a, SIGNAL(triggered()), KateSessionManager::self(), SLOT(sessionManage()), Qt::QueuedConnection );
......@@ -760,7 +760,7 @@ void KateMainWindow::mSlotFixOpenWithMenu()
{
KService::Ptr service = *it;
if (service->name() == "Kate") continue;
a = menu->addAction(KIcon(service->icon()), service->name());
a = menu->addAction(QIcon::fromTheme(service->icon()), service->name());
a->setData(service->entryPath());
}
// append "Other..." to call the KDE "open with" dialog.
......
......@@ -502,22 +502,22 @@ namespace KateMDI
menu->addSection(SmallIcon("view_remove"), i18n("Behavior"));
menu->addAction(w->persistent ? KIcon("view-restore") : KIcon("view-fullscreen"),
menu->addAction(w->persistent ? QIcon::fromTheme("view-restore") : QIcon::fromTheme("view-fullscreen"),
w->persistent ? i18n("Make Non-Persistent") : i18n("Make Persistent") ) -> setData(10);
menu->addSection(SmallIcon("move"), i18n("Move To"));
if (position() != 0)
menu->addAction(KIcon("go-previous"), i18n("Left Sidebar"))->setData(0);
menu->addAction(QIcon::fromTheme("go-previous"), i18n("Left Sidebar"))->setData(0);
if (position() != 1)
menu->addAction(KIcon("go-next"), i18n("Right Sidebar"))->setData(1);
menu->addAction(QIcon::fromTheme("go-next"), i18n("Right Sidebar"))->setData(1);
if (position() != 2)
menu->addAction(KIcon("go-up"), i18n("Top Sidebar"))->setData(2);
menu->addAction(QIcon::fromTheme("go-up"), i18n("Top Sidebar"))->setData(2);
if (position() != 3)
menu->addAction(KIcon("go-down"), i18n("Bottom Sidebar"))->setData(3);
menu->addAction(QIcon::fromTheme("go-down"), i18n("Bottom Sidebar"))->setData(3);
connect(menu, SIGNAL(triggered(QAction*)),
this, SLOT(buttonPopupActivate(QAction*)));
......
......@@ -120,7 +120,7 @@ void KateViewManager::setupActions ()
* view splitting
*/
a = m_mainWindow->actionCollection()->addAction("view_split_vert");
a->setIcon( KIcon("view-split-left-right") );
a->setIcon( QIcon::fromTheme("view-split-left-right") );
a->setText( i18n("Split Ve&rtical") );
a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_L );
connect(a, SIGNAL(triggered()), this, SLOT(slotSplitViewSpaceVert()));
......@@ -128,7 +128,7 @@ void KateViewManager::setupActions ()
a->setWhatsThis(i18n("Split the currently active view vertically into two views."));
a = m_mainWindow->actionCollection()->addAction("view_split_horiz");
a->setIcon( KIcon("view-split-top-bottom") );
a->setIcon( QIcon::fromTheme("view-split-top-bottom") );
a->setText( i18n("Split &Horizontal") );
a->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_T );
connect(a, SIGNAL(triggered()), this, SLOT(slotSplitViewSpaceHoriz()));
......@@ -136,7 +136,7 @@ void KateViewManager::setupActions ()
a->setWhatsThis(i18n("Split the currently active view horizontally into two views."));
m_closeView = m_mainWindow->actionCollection()->addAction("view_close_current_space");
m_closeView->setIcon( KIcon("view-close") );
m_closeView->setIcon( QIcon::fromTheme("view-close") );
m_closeView->setText( i18n("Cl&ose Current View") );
m_closeView->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_R );
connect(m_closeView, SIGNAL(triggered()), this, SLOT(slotCloseCurrentViewSpace()));
......@@ -144,7 +144,7 @@ void KateViewManager::setupActions ()
m_closeView->setWhatsThis(i18n("Close the currently active split view"));
m_closeOtherViews = m_mainWindow->actionCollection()->addAction("view_close_others");
m_closeOtherViews->setIcon(KIcon("view-close"));
m_closeOtherViews->setIcon(QIcon::fromTheme("view-close"));
m_closeOtherViews->setText(i18n("Close Inactive Views"));
connect(m_closeOtherViews, SIGNAL(triggered()), this, SLOT(slotCloseOtherViews()));
......
......@@ -27,15 +27,16 @@
#include "katedocmanager.h"
#include "kateapp.h"
#include "katesession.h"
#include "katedebug.h"
#include <KLocale>
#include <KSqueezedTextLabel>
#include <KConfig>
#include "katedebug.h"
#include <KStringHandler>
#include <KVBox>
#include <klocalizedstring.h>
#include <kglobal.h>
#include <kiconutils.h>
#include <QStackedWidget>
#include <QCursor>
......@@ -326,9 +327,12 @@ KateVSStatusBar::KateVSStatusBar ( KateViewSpace *parent)
#endif
installEventFilter( this );
m_modPm = KIcon("document-save").pixmap(16);
m_modDiscPm = KIcon("dialog-warning").pixmap(16);
m_modmodPm = KIcon("document-save", 0, QStringList () << "emblem-important").pixmap(16);
m_modPm = QIcon::fromTheme("document-save").pixmap(16);
m_modDiscPm = QIcon::fromTheme("dialog-warning").pixmap(16);
QIcon icon = KIconUtils::addOverlay(QIcon::fromTheme("document-save"),
QIcon::fromTheme("emblem-important"),
Qt::TopLeftCorner);
m_modmodPm = icon.pixmap(16);
}
KateVSStatusBar::~KateVSStatusBar ()
......
......@@ -53,36 +53,36 @@ KateFileTree::KateFileTree(QWidget *parent): QTreeView(parent)
connect( this, SIGNAL(clicked(QModelIndex)), this, SLOT(mouseClicked(QModelIndex)));
m_filelistCloseDocument = new QAction( KIcon("window-close"), i18n( "Close" ), this );
m_filelistCloseDocument = new QAction( QIcon::fromTheme("window-close"), i18n( "Close" ), this );
connect( m_filelistCloseDocument, SIGNAL(triggered()), this, SLOT(slotDocumentClose()) );
m_filelistCloseDocument->setWhatsThis(i18n("Close the current document."));
m_filelistCopyFilename = new QAction( KIcon("edit-copy"), i18n( "Copy Filename" ), this );
m_filelistCopyFilename = new QAction( QIcon::fromTheme("edit-copy"), i18n( "Copy Filename" ), this );
connect( m_filelistCopyFilename, SIGNAL(triggered()), this, SLOT(slotCopyFilename()) );
m_filelistCopyFilename->setWhatsThis(i18n("Copy the filename of the file."));
QActionGroup *modeGroup = new QActionGroup(this);
m_treeModeAction = setupOption(modeGroup, KIcon("view-list-tree"), i18n("Tree Mode"),
m_treeModeAction = setupOption(modeGroup, QIcon::fromTheme("view-list-tree"), i18n("Tree Mode"),
i18n("Set view style to Tree Mode"),
SLOT(slotTreeMode()), true);
m_listModeAction = setupOption(modeGroup, KIcon("view-list-text"), i18n("List Mode"),
m_listModeAction = setupOption(modeGroup, QIcon::fromTheme("view-list-text"), i18n("List Mode"),
i18n("Set view style to List Mode"),
SLOT(slotListMode()), false);
QActionGroup *sortGroup = new QActionGroup(this);
m_sortByFile = setupOption(sortGroup, KIcon(), i18n("Document Name"),
m_sortByFile = setupOption(sortGroup, QIcon(), i18n("Document Name"),
i18n("Sort by Document Name"),
SLOT(slotSortName()), true);
m_sortByPath = setupOption(sortGroup, KIcon(), i18n("Document Path"),
m_sortByPath = setupOption(sortGroup, QIcon(), i18n("Document Path"),
i18n("Sort by Document Path"),
SLOT(slotSortPath()), false);
m_sortByOpeningOrder = setupOption(sortGroup, KIcon(), i18n("Opening Order"),
m_sortByOpeningOrder = setupOption(sortGroup, QIcon(), i18n("Opening Order"),
i18n("Sort by Opening Order"),
SLOT(slotSortOpeningOrder()), false);
......@@ -97,7 +97,7 @@ KateFileTree::~KateFileTree()
QAction *KateFileTree::setupOption(
QActionGroup *group,
const KIcon &icon,
const QIcon &icon,
const QString &label,
const QString &whatsThis,
const char *slot,
......@@ -237,7 +237,7 @@ void KateFileTree::slotFixOpenWithMenu()
{
KService::Ptr service = *it;
if (service->name() == "Kate") continue;
a = menu->addAction(KIcon(service->icon()), service->name());
a = menu->addAction(QIcon::fromTheme(service->icon()), service->name());
a->setData(service->entryPath());
}
// append "Other..." to call the KDE "open with" dialog.
......
......@@ -19,10 +19,9 @@
#ifndef KATE_FILETREE_H
#define KATE_FILETREE_H
#include <QTreeView>
#include <QUrl>
#include <KIcon>
#include <QtCore/QUrl>
#include <QtGui/QIcon>
#include <QtWidgets/QTreeView>
namespace KTextEditor {
class Document;
......@@ -89,7 +88,7 @@ class KateFileTree: public QTreeView
void slotOpenWithMenuAction(QAction* a);
private:
QAction *setupOption(QActionGroup *group, const KIcon &, const QString &, const QString &, const char *slot, bool checked=false);
QAction *setupOption(QActionGroup *group, const QIcon &, const QString &, const QString &, const char *slot, bool checked=false);
};
#endif // KATE_FILETREE_H
......
......@@ -17,16 +17,18 @@
*/
#include "katefiletreemodel.h"
#include <KIcon>
#include <QDir>
#include <QFileInfo>
#include <QList>
#include <QMimeDatabase>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QList>
#include <QtCore/QMimeDatabase>
#include <QtGui/QIcon>
#include <KColorScheme>
#include <KColorUtils>
#include <klocale.h>
#include <klocalizedstring.h>
#include <kiconutils.h>
#include <ktexteditor/document.h>
......@@ -219,7 +221,7 @@ int ProxyItem::row()
QIcon ProxyItem::icon()
{
if(m_children.count())
return KIcon("folder");
return QIcon::fromTheme("folder");
return m_icon;
}
......@@ -1272,13 +1274,15 @@ void KateFileTreeModel::setupIcon(ProxyItem *item)
QUrl url(item->path());
icon_name = QMimeDatabase().mimeTypeForFile(url.path(), QMimeDatabase::MatchExtension).iconName();
}
QIcon icon(icon_name);
if(item->flag(ProxyItem::ModifiedExternally) || item->flag(ProxyItem::DeletedExternally)) {
emblems << "emblem-important";
icon = KIconUtils::addOverlay(icon, QIcon("emblem-important"), Qt::TopLeftCorner);
qCDebug(FILETREE) << "modified!";
}
item->setIcon(KIcon(icon_name, 0, emblems));
item->setIcon(icon);
qCDebug(FILETREE) << "END!";
}
......
......@@ -121,12 +121,12 @@ QString KateFileTreePlugin::configPageFullName (uint number) const
return QString(i18n("Configure Documents"));
}
KIcon KateFileTreePlugin::configPageIcon (uint number) const
QIcon KateFileTreePlugin::configPageIcon (uint number) const
{
if(number != 0)
return KIcon();
return QIcon();
return KIcon("view-list-tree");
return QIcon::fromTheme("view-list-tree");
}
Kate::PluginConfigPage *KateFileTreePlugin::configPage (uint number, QWidget *parent, const char *name)
......@@ -228,7 +228,7 @@ KateFileTreePluginView::KateFileTreePluginView (Kate::MainWindow *mainWindow, Ka
QAction *show_active = actionCollection()->addAction("filetree_show_active_document", mainWindow);
show_active->setText(i18n("&Show Active"));
show_active->setIcon(KIcon("folder-sync"));
show_active->setIcon(QIcon::fromTheme("folder-sync"));
connect( show_active, SIGNAL(triggered(bool)), this, SLOT(showActiveDocument()) );
/**
......
......@@ -19,7 +19,7 @@
#ifndef KATE_FILETREE_PLUGIN_H
#define KATE_FILETREE_PLUGIN_H
#include <KIcon>
#include <QtGui/QIcon>
#include <ktexteditor/commandinterface.h>
#include <ktexteditor/document.h>
......@@ -52,7 +52,7 @@ class KateFileTreePlugin: public Kate::Plugin, public Kate::PluginConfigPageInte
virtual QString configPageName (uint number = 0) const;
virtual QString configPageFullName (uint number = 0) const;
virtual KIcon configPageIcon (uint number = 0) const;
virtual QIcon configPageIcon (uint number = 0) const;
virtual Kate::PluginConfigPage *configPage (uint number = 0, QWidget *parent = 0, const char *name = 0 );
const KateFileTreePluginSettings &settings();
......
......@@ -20,9 +20,10 @@
#define kate_pluginconfigpageinterface_h
#include <kate_export.h>
#include <QtWidgets/QWidget>
#include <QtGui/QIcon>
#include <QtGui/QPixmap>
#include <kicon.h>
#include <QtWidgets/QWidget>
namespace Kate
{
......@@ -191,7 +192,7 @@ namespace Kate
* \param number the config page for the given \p number
* \return the icon for the config page
*/
virtual KIcon configPageIcon (uint number = 0) const = 0;
virtual QIcon configPageIcon (uint number = 0) const = 0;
private:
class PrivatePluginConfigPageInterface *d;
......
......@@ -21,10 +21,9 @@
#define KDELIBS_KTEXTEDITOR_EDITOR_H
#include <ktexteditor/ktexteditor_export.h>
// our main baseclass of the KTextEditor::Editor
#include <QtCore/QObject>
#include <kicon.h>
#include <QtCore/QObject>
#include <QtGui/QIcon>
class KAboutData;
class KConfig;
......@@ -256,7 +255,7 @@ class KTEXTEDITOR_EXPORT Editor : public QObject
* \return pixmap for the given page index
* \see configPageName(), configPageFullName()
*/
virtual KIcon configPageIcon (int number) const = 0;
virtual QIcon configPageIcon (int number) const = 0;
Q_SIGNALS:
/**
......
......@@ -167,7 +167,7 @@ void KWrite::setupActions()
m_recentFiles->setWhatsThis(i18n("This lists files which you have opened recently, and allows you to easily open them again."));
QAction *a = actionCollection()->addAction( "view_new_view" );
a->setIcon( KIcon("window-new") );
a->setIcon( QIcon::fromTheme("window-new") );
a->setText( i18n("&New Window") );
connect( a, SIGNAL(triggered()), this, SLOT(newView()) );
a->setWhatsThis(i18n("Create another view containing the current document"));
......@@ -584,7 +584,7 @@ void KWrite::modifiedChanged()
bool mod = m_view->document()->isModified();
if (mod && m_modPm.isNull()) {
m_modPm = KIcon("document-properties").pixmap(16);
m_modPm = QIcon::fromTheme("document-properties").pixmap(16);
}
/* const KateDocumentInfo *info
......
......@@ -50,8 +50,8 @@ KateCompletionConfig::KateCompletionConfig(KateCompletionModel* model, QWidget*
ui->sorting->setChecked(m_model->isSortingEnabled());
ui->sortingAlphabetical->setChecked(m_model->isSortingAlphabetical());
ui->sortingCaseSensitive->setChecked(m_model->sortingCaseSensitivity() == Qt::CaseSensitive);
ui->groupingOrderUp->setIcon(KIcon("go-up"));
ui->groupingOrderDown->setIcon(KIcon("go-down"));
ui->groupingOrderUp->setIcon(QIcon::fromTheme("go-up"));
ui->groupingOrderDown->setIcon(QIcon::fromTheme("go-down"));
connect(ui->groupingOrderUp, SIGNAL(pressed()), SLOT(moveGroupingOrderUp()));
connect(ui->groupingOrderDown, SIGNAL(pressed()), SLOT(moveGroupingOrderDown()));
......@@ -69,8 +69,8 @@ KateCompletionConfig::KateCompletionConfig(KateCompletionModel* model, QWidget*
// Grouping
ui->grouping->setChecked(m_model->isGroupingEnabled());
ui->groupingUp->setIcon(KIcon("go-up"));
ui->groupingDown->setIcon(KIcon("go-down"));
ui->groupingUp->setIcon(QIcon::fromTheme("go-up"));
ui->groupingDown->setIcon(QIcon::fromTheme("go-down"));
m_groupingScopeType = ui->groupingMethods->topLevelItem(0);
m_groupingScopeType->setCheckState(0, (m_model->groupingMethod() & KateCompletionModel::ScopeType) ? Qt::Checked : Qt::Unchecked);
......@@ -95,8 +95,8 @@ KateCompletionConfig::KateCompletionConfig(KateCompletionModel* model, QWidget*
// Column merging
ui->columnMerging->setChecked(m_model->isColumnMergingEnabled());
ui->columnUp->setIcon(KIcon("go-up"));
ui->columnDown->setIcon(KIcon("go-down"));
ui->columnUp->setIcon(QIcon::fromTheme("go-up"));
ui->columnDown->setIcon(QIcon::fromTheme("go-down"));
connect(ui->columnUp, SIGNAL(pressed()), SLOT(moveColumnUp()));
connect(ui->columnDown, SIGNAL(pressed()), SLOT(moveColumnDown()));
......
......@@ -103,7 +103,7 @@ QVariant KateWordCompletionModel::data(const QModelIndex& index, int role) const
return m_matches.at( index.row() );
if( index.column() == KTextEditor::CodeCompletionModel::Icon && role == Qt::DecorationRole ) {
static QIcon icon(KIcon("insert-text").pixmap(QSize(16, 16)));
static QIcon icon(QIcon::fromTheme("insert-text").pixmap(QSize(16, 16)));
return icon;
}
......
......@@ -1175,7 +1175,7 @@ KateHlDownloadDialog::KateHlDownloadDialog(QWidget *parent, const char *name, bo
list->setColumnWidth(0, 22);
new QLabel(i18n("<b>Note:</b> New versions are selected automatically."), vbox);
setButtonIcon(User1, KIcon("dialog-ok"));
setButtonIcon(User1, QIcon::fromTheme("dialog-ok"));
transferJob = KIO::get(
QUrl(QString(HLDOWNLOADPATH)
......@@ -1452,9 +1452,9 @@ KateModOnHdPrompt::KateModOnHdPrompt( KateDocument *doc,
}
setButtonText( Ok, okText );
setButtonIcon( Ok, KIcon( okIcon ) );
setButtonIcon( Ok, QIcon::fromTheme( okIcon ) );
setButtonText( Apply, i18n("&Ignore Changes") );
setButtonIcon( Apply, KIcon( "dialog-warning" ) );
setButtonIcon( Apply, QIcon::fromTheme( "dialog-warning" ) );
setButtonToolTip( Ok, okToolTip );
setButtonToolTip( Apply, i18n("Ignore the changes. You will not be prompted again.") );
......
......@@ -1926,10 +1926,10 @@ void KateDocument::showAndSetOpeningErrorAccess() {
= new KTextEditor::Message(i18n ("The file %1 could not be loaded, as it was not possible to read from it.<br />Check if you have read access to this file.", this->url().toString()),
KTextEditor::Message::Error);
message->setWordWrap(true);
QAction* tryAgainAction = new QAction(KIcon("view-refresh"), i18nc("translators: you can also translate 'Try Again' with 'Reload'", "Try Again"), 0);
QAction* tryAgainAction = new QAction(QIcon::fromTheme("view-refresh"), i18nc("translators: you can also translate 'Try Again' with 'Reload'", "Try Again"), 0);
connect(tryAgainAction, SIGNAL(triggered()), SLOT(documentReload()), Qt::QueuedConnection);
QAction* closeAction = new QAction(KIcon("window-close"), i18n("&Close"), 0);
QAction* closeAction = new QAction(QIcon::fromTheme("window-close"), i18n("&Close"), 0);
closeAction->setToolTip(i18n("Close message"));
// add try again and close actions
......@@ -5519,7 +5519,7 @@ bool KateDocument::postMessage(KTextEditor::Message* message)
// if there are no actions, add a close action by default if widget does not auto-hide
if (message->actions().count() == 0 && message->autoHide() < 0) {
QAction* closeAction = new QAction(KIcon("window-close"), i18n("&Close"), 0);
QAction* closeAction = new QAction(QIcon::fromTheme("window-close"), i18n("&Close"), 0);
closeAction->setToolTip(i18n("Close message"));
message->addAction(closeAction);
}
......
......@@ -82,7 +82,7 @@ ModeConfigPage::ModeConfigPage( QWidget *parent )
connect( ui->cmbFiletypes, SIGNAL(activated(int)), this, SLOT(typeChanged(int)) );
connect( ui->btnNew, SIGNAL(clicked()), this, SLOT(newType()) );
connect( ui->btnDelete, SIGNAL(clicked()), this, SLOT(deleteType()) );
ui->btnMimeTypes->setIcon(KIcon("tools-wizard"));
ui->btnMimeTypes->setIcon(QIcon::fromTheme("tools-wizard"));
connect(ui->btnMimeTypes, SIGNAL(clicked()), this, SLOT(showMTDlg()));
connect( ui->btnDownload, SIGNAL(clicked()), this, SLOT(hlDownload()) );
......
......@@ -138,10 +138,10 @@ KateStyleTreeWidget::KateStyleTreeWidget( QWidget *parent, bool showUseDefaults
setHeaderLabels(headers);
headerItem()->setIcon(1, KIcon("format-text-bold"));
headerItem()->setIcon(2, KIcon("format-text-italic"));
headerItem()->setIcon(3, KIcon("format-text-underline"));
headerItem()->setIcon(4, KIcon("format-text-strikethrough"));
headerItem()->setIcon(1, QIcon::fromTheme("format-text-bold"));
headerItem()->setIcon(2, QIcon::fromTheme("format-text-italic"));
headerItem()->setIcon(3, QIcon::fromTheme("format-text-underline"));
headerItem()->setIcon(4, QIcon::fromTheme("format-text-strikethrough"));
// grap the bg color, selected color and default font
normalcol = KColorScheme(QPalette::Active, KColorScheme::View).foreground().color();
......
......@@ -37,7 +37,7 @@ KateScriptAction::KateScriptAction(const ScriptActionInfo& info, KateView* view)
, m_interactive(info.interactive())
{
if (!info.icon().isEmpty()) {
setIcon(KIcon(info.icon()));
setIcon(QIcon::fromTheme(info.icon()));
}
if (!info.shortcut().isEmpty()) {
......@@ -67,7 +67,7 @@ void KateScriptAction::exec()
//BEGIN KateScriptActionMenu
KateScriptActionMenu::KateScriptActionMenu(KateView *view, const QString& text)
: KActionMenu (KIcon("code-context"), text, view)
: KActionMenu (QIcon::fromTheme("code-context"), text, view)
, m_view(view)
{
repopulate();
......
......@@ -28,7 +28,6 @@
// KDE
#include <KLocale>
#include <KIcon>
#include <klocalizedstring.h>
// Kate
......@@ -114,7 +113,7 @@ KateScriptConsole::KateScriptConsole(KateView * view, QWidget * parent)
m_result = new QLabel(this);
m_edit = new QTextEdit(this);
m_execute = new QPushButton(i18n("Execute"), this);
m_execute->setIcon(KIcon("quickopen"));
m_execute->setIcon(QIcon::fromTheme("quickopen"));
connect(m_execute, SIGNAL(clicked()), this, SLOT(executePressed()));
layout->addWidget(m_edit);
......
......@@ -80,7 +80,7 @@ public:
if (m_menu == NULL) {
return;
}
m_menu->setIcon(KIcon("list-add"));
m_menu->setIcon(QIcon::fromTheme("list-add"));
}
void enableMenu(bool enabled) {
......@@ -1343,10 +1343,10 @@ void KateSearchBar::enterPowerMode() {
m_powerUi->replacement->setModel(m_config->replacementHistoryModel());
// Icons
m_powerUi->mutate->setIcon(KIcon("arrow-down-double"));
m_powerUi->findNext->setIcon(KIcon("go-down-search"));
m_powerUi->findPrev->setIcon(KIcon("go-up-search"));
m_powerUi->findAll->setIcon(KIcon("edit-find"));
m_powerUi->mutate->setIcon(QIcon::fromTheme("arrow-down-double"));
m_powerUi->findNext->setIcon(QIcon::fromTheme("go-down-search"));
m_powerUi->findPrev->setIcon(QIcon::fromTheme("go-up-search"));
m_powerUi->findAll->setIcon(QIcon::fromTheme("edit-find"));
// Focus proxy
centralWidget()->setFocusProxy(m_powerUi->pattern);
......@@ -1480,9 +1480,9 @@ void KateSearchBar::enterIncrementalMode() {
// Icons
m_incUi->mutate->setIcon(KIcon("arrow-up-double"));
m_incUi->next->setIcon(KIcon("go-down-search"));
m_incUi->prev->setIcon(KIcon("go-up-search"));
m_incUi->mutate->setIcon(QIcon::fromTheme("arrow-up-double"));
m_incUi->next->setIcon(QIcon::fromTheme("go-down-search"));
m_incUi->prev->setIcon(QIcon::fromTheme("go-up-search"));
// Ensure minimum size
m_incUi->pattern->setMinimumWidth(12 * m_incUi->pattern->fontMetrics().height());
......
......@@ -32,7 +32,6 @@
#include <KLocalizedString>
#include <KPushButton>
#include <KMimeTypeTrader>
#include <KIcon>
#include <KTextEditor/Document>
#include <KTextEditor/View>
#include <khelpclient.h>
......@@ -61,7 +60,7 @@ QPair<KTextEditor::View*, QToolButton*> getViewForTab(QWidget* tabWidget)
QToolButton* button = new QToolButton;
button->setText(i18n("Help"));
button->setIcon(KIcon("help-contents"));
button->setIcon(QIcon::fromTheme("help-contents"));
button->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
hlayout->addWidget(button);
layout->addLayout(hlayout);
......
......@@ -25,7 +25,6 @@
#include "katesnippetglobal.h"
#include <KLocalizedString>
#include <KIcon>
#include <KColorScheme>
#include <KActionCollection>
#include <KParts/MainWindow>
......@@ -33,7 +32,7 @@
Snippet::Snippet()
: QStandardItem(i18n("<empty snippet>")), m_action(0)
{
setIcon(KIcon("text-plain"));
setIcon(QIcon::fromTheme("text-plain"));
}
Snippet::~Snippet()
......
......@@ -30,8 +30,6 @@
#include <QFileInfo>
#include <QAction>
#include <KIcon>
#include <QDomDocument>
#include <QDomElement>
......@@ -49,7 +47,7 @@
SnippetRepository::SnippetRepository(const QString& file)
: QStandardItem(i18n("<empty repository>")), m_file(file), m_registeredScript(0)
{
setIcon( KIcon("folder") );
setIcon( QIcon::fromTheme("folder") );