[rkward/frameworks] rkward: Automatic conversion from KIcon to QIcon.

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Thu Nov 26 09:50:55 UTC 2015


Git commit ad9ae0f061fb41bb8020988a417802d1fec3893c by Thomas Friedrichsmeier.
Committed on 26/11/2015 at 09:17.
Pushed by tfry into branch 'frameworks'.

Automatic conversion from KIcon to QIcon.

M  +2    -2    rkward/dialogs/rkerrordialog.cpp
M  +2    -2    rkward/misc/rkfindbar.cpp
M  +47   -47   rkward/misc/rkstandardicons.cpp
M  +4    -4    rkward/rkward.cpp
M  +6    -6    rkward/windows/rkhtmlwindow.cpp
M  +2    -2    rkward/windows/rkworkplaceview.cpp

http://commits.kde.org/rkward/ad9ae0f061fb41bb8020988a417802d1fec3893c

diff --git a/rkward/dialogs/rkerrordialog.cpp b/rkward/dialogs/rkerrordialog.cpp
index 9ce04f7..6afe3a9 100644
--- a/rkward/dialogs/rkerrordialog.cpp
+++ b/rkward/dialogs/rkerrordialog.cpp
@@ -22,7 +22,7 @@
 #include <kmessagebox.h>
 #include <kvbox.h>
 #include <ktoolinvocation.h>
-#include <kicon.h>
+#include <QIcon>
 
 #include <QLabel>
 #include <QTextEdit>
@@ -50,7 +50,7 @@ public:
 		setCaption (i18n ("Reporting bugs in RKWard"));
 		setButtons (KDialog::Ok | KDialog::Cancel);
 		setButtonText (KDialog::Ok, i18n ("Report issue"));
-		setButtonIcon (KDialog::Ok, KIcon ("tools-report-bug"));
+		setButtonIcon (KDialog::Ok, QIcon::fromTheme("tools-report-bug"));
 		KVBox *vbox = new KVBox (this);
 		setMainWidget (vbox);
 		QLabel *label = new QLabel (i18n ("<p><b>Where should I report bugs or wishes?</b></p><p>Thank you for taking the time to help improve RKWard. To help us "
diff --git a/rkward/misc/rkfindbar.cpp b/rkward/misc/rkfindbar.cpp
index 0dd0bf6..e716c21 100644
--- a/rkward/misc/rkfindbar.cpp
+++ b/rkward/misc/rkfindbar.cpp
@@ -24,7 +24,7 @@
 
 #include <khistorycombobox.h>
 #include <klocale.h>
-#include <kicon.h>
+#include <QIcon>
 
 #include "rkcommonfunctions.h"
 
@@ -36,7 +36,7 @@ RKFindBar::RKFindBar (QWidget* parent, bool custom) : QWidget (parent) {
 	mlayout = new QHBoxLayout (this);
 	mlayout->setContentsMargins (0, 0, 0, 0);
 	QToolButton* close_button = new QToolButton (this);
-	close_button->setIcon (KIcon ("dialog-close"));
+	close_button->setIcon (QIcon::fromTheme("dialog-close"));
 	close_button->setAutoRaise (true);   // makes it flat
 	connect (close_button, &QToolButton::clicked, this, &RKFindBar::hide);
 	mlayout->addWidget (close_button);
diff --git a/rkward/misc/rkstandardicons.cpp b/rkward/misc/rkstandardicons.cpp
index 0e1bd4b..224b9ed 100644
--- a/rkward/misc/rkstandardicons.cpp
+++ b/rkward/misc/rkstandardicons.cpp
@@ -41,81 +41,81 @@ void RKStandardIcons::initIcons () {
 	icons[ActionRunAll] = QIcon (rkward_icon_base + "run_all.png");
 	icons[ActionRunLine] = QIcon (rkward_icon_base + "run_line.png");
 	icons[ActionRunSelection] = QIcon (rkward_icon_base + "run_selection.png");
-	icons[ActionCDToScript] = KIcon ("folder-txt");
+	icons[ActionCDToScript] = QIcon::fromTheme("folder-txt");
 
-	icons[ActionConfigurePackages] = KIcon ("utilities-file-archiver");
-	icons[ActionConfigureGeneric] = KIcon ("configure");
-	icons[ActionSearch] = KIcon ("edit-find");
+	icons[ActionConfigurePackages] = QIcon::fromTheme("utilities-file-archiver");
+	icons[ActionConfigureGeneric] = QIcon::fromTheme("configure");
+	icons[ActionSearch] = QIcon::fromTheme("edit-find");
 
-	icons[ActionDeleteRow] = KIcon ("edit-delete");
-	icons[ActionInsertRow] = KIcon ("list-add");
+	icons[ActionDeleteRow] = QIcon::fromTheme("edit-delete");
+	icons[ActionInsertRow] = QIcon::fromTheme("list-add");
 	icons[ActionDeleteVar] = icons[ActionDeleteRow];
 	icons[ActionInsertVar] = icons[ActionInsertRow];
 	icons[ActionPasteInsideTable] = QIcon (rkward_icon_base + "paste_inside_table.png");
 	icons[ActionPasteInsideSelection] = QIcon (rkward_icon_base + "paste_inside_selection.png");
 
 	icons[ActionDelete] = icons[ActionDeleteRow];
-	icons[ActionAddRight] = KIcon ("arrow-right");
-	icons[ActionRemoveLeft] = KIcon ("arrow-left");
+	icons[ActionAddRight] = QIcon::fromTheme("arrow-right");
+	icons[ActionRemoveLeft] = QIcon::fromTheme("arrow-left");
 
-	icons[ActionMoveLeft] = KIcon ("go-previous");
-	icons[ActionMoveRight] = KIcon ("go-next");
-	icons[ActionMoveFirst] = KIcon ("go-first");
-	icons[ActionMoveLast] = KIcon ("go-last");
-	icons[ActionMoveUp] = KIcon ("go-up");
-	icons[ActionMoveDown] = KIcon ("go-down");
+	icons[ActionMoveLeft] = QIcon::fromTheme("go-previous");
+	icons[ActionMoveRight] = QIcon::fromTheme("go-next");
+	icons[ActionMoveFirst] = QIcon::fromTheme("go-first");
+	icons[ActionMoveLast] = QIcon::fromTheme("go-last");
+	icons[ActionMoveUp] = QIcon::fromTheme("go-up");
+	icons[ActionMoveDown] = QIcon::fromTheme("go-down");
 
-	icons[ActionExpandDown] = KIcon ("arrow-right");
-	icons[ActionCollapseUp] = KIcon ("arrow-down");
+	icons[ActionExpandDown] = QIcon::fromTheme("arrow-right");
+	icons[ActionCollapseUp] = QIcon::fromTheme("arrow-down");
 
-	icons[ActionDocumentInfo] = KIcon ("documentinfo.png");
-	icons[ActionFlagGreen] = KIcon ("flag-green.png");
-	icons[ActionSnapshot] = KIcon ("list-add.png");
-	icons[ActionListPlots] = KIcon ("view-preview.png");
-	icons[ActionRemovePlot] = KIcon ("list-remove.png");
-	icons[ActionWindowDuplicate] = KIcon ("window-duplicate.png");
+	icons[ActionDocumentInfo] = QIcon::fromTheme("documentinfo.png");
+	icons[ActionFlagGreen] = QIcon::fromTheme("flag-green.png");
+	icons[ActionSnapshot] = QIcon::fromTheme("list-add.png");
+	icons[ActionListPlots] = QIcon::fromTheme("view-preview.png");
+	icons[ActionRemovePlot] = QIcon::fromTheme("list-remove.png");
+	icons[ActionWindowDuplicate] = QIcon::fromTheme("window-duplicate.png");
 
-	icons[ActionClear] = KIcon ("edit-clear.png");
-	icons[ActionInterrupt] = KIcon ("media-playback-stop");
+	icons[ActionClear] = QIcon::fromTheme("edit-clear.png");
+	icons[ActionInterrupt] = QIcon::fromTheme("media-playback-stop");
 
-	icons[ActionDetachWindow] = KIcon ("view-fullscreen");
-	icons[ActionAttachWindow] = KIcon ("view-restore");
+	icons[ActionDetachWindow] = QIcon::fromTheme("view-fullscreen");
+	icons[ActionAttachWindow] = QIcon::fromTheme("view-restore");
 
-	icons[ActionLock] = KIcon ("object-locked");
-	icons[ActionUnlock] = KIcon ("object-unlocked");
+	icons[ActionLock] = QIcon::fromTheme("object-locked");
+	icons[ActionUnlock] = QIcon::fromTheme("object-unlocked");
 
 	// objects
 	icons[ObjectList] = QIcon (rkward_icon_base + "list.png");
 	icons[ObjectFunction] = QIcon (rkward_icon_base + "function.png");
-	icons[ObjectEnvironment] = KIcon ("konqueror");
+	icons[ObjectEnvironment] = QIcon::fromTheme("konqueror");
 	icons[ObjectPackageEnvironment] = icons[ActionConfigurePackages];
 	icons[ObjectMatrix] = QIcon (rkward_icon_base + "matrix.png");
-	icons[ObjectDataFrame] = KIcon ("x-office-spreadsheet");
+	icons[ObjectDataFrame] = QIcon::fromTheme("x-office-spreadsheet");
 	icons[ObjectDataNumeric] = QIcon (rkward_icon_base + "data-numeric.png");
 	icons[ObjectDataFactor] = QIcon (rkward_icon_base + "data-factor.png");
-	icons[ObjectDataCharacter] = KIcon ("draw-text");
+	icons[ObjectDataCharacter] = QIcon::fromTheme("draw-text");
 	icons[ObjectDataLogical] = QIcon (rkward_icon_base + "data-logical.png");
-	icons[ObjectDataUnknown] = KIcon ("unknown");
+	icons[ObjectDataUnknown] = QIcon::fromTheme("unknown");
 	icons[ObjectDataOther] = icons[ActionDeleteRow];
 	icons[ObjectPseudo] = QIcon (rkward_icon_base + "s4_slots.png");
 
 	// windows
 	icons[WindowDataFrameEditor] = icons[ObjectDataFrame];
-	icons[WindowCommandEditor] = KIcon ("text-x-makefile");	// this may not be the most obvious choice, but it is not quite as awfully close to the data.frame editor icons as most other text icons
-	icons[WindowOutput] = KIcon ("applications-education");
-	icons[WindowHelp] = KIcon ("help-contents");
-	icons[WindowX11] = KIcon ("x");
-	icons[WindowObject] = KIcon ("zoom-original");
-	icons[WindowConsole] = KIcon ("utilities-terminal");
-	icons[WindowCommandLog] = KIcon ("format-justify-left");
-	icons[WindowWorkspaceBrowser] = KIcon ("view-list-tree");
-	icons[WindowSearchHelp] = KIcon ("help-contents");
-	icons[WindowPendingJobs] = KIcon ("system-run");
-	icons[WindowFileBrowser] = KIcon ("folder");
-	icons[WindowDebugConsole] = KIcon ("view-process-system");
-	icons[WindowCallstackViewer] = KIcon ("view-sort-ascending");
-
-	icons[DocumentPDF] = KIcon ("application-pdf");
+	icons[WindowCommandEditor] = QIcon::fromTheme("text-x-makefile");	// this may not be the most obvious choice, but it is not quite as awfully close to the data.frame editor icons as most other text icons
+	icons[WindowOutput] = QIcon::fromTheme("applications-education");
+	icons[WindowHelp] = QIcon::fromTheme("help-contents");
+	icons[WindowX11] = QIcon::fromTheme("x");
+	icons[WindowObject] = QIcon::fromTheme("zoom-original");
+	icons[WindowConsole] = QIcon::fromTheme("utilities-terminal");
+	icons[WindowCommandLog] = QIcon::fromTheme("format-justify-left");
+	icons[WindowWorkspaceBrowser] = QIcon::fromTheme("view-list-tree");
+	icons[WindowSearchHelp] = QIcon::fromTheme("help-contents");
+	icons[WindowPendingJobs] = QIcon::fromTheme("system-run");
+	icons[WindowFileBrowser] = QIcon::fromTheme("folder");
+	icons[WindowDebugConsole] = QIcon::fromTheme("view-process-system");
+	icons[WindowCallstackViewer] = QIcon::fromTheme("view-sort-ascending");
+
+	icons[DocumentPDF] = QIcon::fromTheme("application-pdf");
 
 /*	This does not work, as the icons are not really Null in this case, but some default icon. Any way to really test this?
 	RK_DO ({
diff --git a/rkward/rkward.cpp b/rkward/rkward.cpp
index 301a672..9d7c1ed 100644
--- a/rkward/rkward.cpp
+++ b/rkward/rkward.cpp
@@ -41,7 +41,7 @@
 #include <khbox.h>
 #include <ktoolbar.h>
 #include <kactionmenu.h>
-#include <kicon.h>
+#include <QIcon>
 #include <KSharedConfig>
 
 // application specific includes
@@ -520,7 +520,7 @@ void RKWardMainWindow::initActions() {
 	view_menu_dummy->setEnabled (false);
 
 	// collections for the toolbar:
-	KActionMenu* open_any_action = new KActionMenu (KIcon ("document-open-folder"), i18n ("Open..."), this);
+	KActionMenu* open_any_action = new KActionMenu (QIcon::fromTheme("document-open-folder"), i18n ("Open..."), this);
 	open_any_action->setDelayed (false);
 	actionCollection ()->addAction ("open_any", open_any_action);
 
@@ -533,14 +533,14 @@ void RKWardMainWindow::initActions() {
 	proxy_import = new QAction (i18n ("Import"), this);
 	open_any_action->addAction (proxy_import);
 
-	KActionMenu* new_any_action = new KActionMenu (KIcon ("document-new"), i18n ("Create..."), this);
+	KActionMenu* new_any_action = new KActionMenu (QIcon::fromTheme("document-new"), i18n ("Create..."), this);
 	new_any_action->setDelayed (false);
 	actionCollection ()->addAction ("new_any", new_any_action);
 
 	new_any_action->addAction (new_data_frame);
 	new_any_action->addAction (new_command_editor);
 
-	save_any_action = new KActionMenu (KIcon ("document-save"), i18n ("Save..."), this);
+	save_any_action = new KActionMenu (QIcon::fromTheme("document-save"), i18n ("Save..."), this);
 	save_any_action->setDelayed (false);
 	actionCollection ()->addAction ("save_any", save_any_action);
 
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index 02a5a8e..1092c30 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -18,7 +18,7 @@
 
 #include <klibloader.h>
 #include <klocale.h>
-#include <kicon.h>
+#include <QIcon>
 #include <kmessagebox.h>
 #include <kparts/plugin.h>
 #include <kactioncollection.h>
@@ -608,13 +608,13 @@ void RKHTMLWindowPart::initActions () {
 
 	// common actions
 	actionCollection ()->addAction (KStandardAction::Copy, "copy", window->view->pageAction (QWebPage::Copy), SLOT (trigger()));
-	QAction* zoom_in = actionCollection ()->addAction ("zoom_in", new QAction (KIcon ("zoom-in"), i18n ("Zoom In"), this));
+	QAction* zoom_in = actionCollection ()->addAction ("zoom_in", new QAction (QIcon::fromTheme("zoom-in"), i18n ("Zoom In"), this));
 	connect (zoom_in, &QAction::triggered, window, &RKHTMLWindow::zoomIn);
-	QAction* zoom_out = actionCollection ()->addAction ("zoom_out", new QAction (KIcon ("zoom-out"), i18n ("Zoom Out"), this));
+	QAction* zoom_out = actionCollection ()->addAction ("zoom_out", new QAction (QIcon::fromTheme("zoom-out"), i18n ("Zoom Out"), this));
 	connect (zoom_out, &QAction::triggered, window, &RKHTMLWindow::zoomOut);
 	actionCollection ()->addAction (KStandardAction::SelectAll, "select_all", window->view->pageAction (QWebPage::SelectAll), SLOT (trigger()));
 	// unfortunately, this will only affect the default encoding, not necessarily the "real" encoding
-	KCodecAction *encoding = new KCodecAction (KIcon ("character-set"), i18n ("Default &Encoding"), this, true);
+	KCodecAction *encoding = new KCodecAction (QIcon::fromTheme("character-set"), i18n ("Default &Encoding"), this, true);
 	encoding->setStatusTip (i18n ("Set the encoding to assume in case no explicit encoding has been set in the page or in the HTTP headers."));
 	actionCollection ()->addAction ("view_encoding", encoding);
 	connect (encoding, static_cast<void (KCodecAction::*)(QTextCodec *)>(&KCodecAction::triggered), window, &RKHTMLWindow::setTextEncoding);
@@ -634,11 +634,11 @@ void RKHTMLWindowPart::initActions () {
 	// output window actions
 	outputFlush = actionCollection ()->addAction ("output_flush", window, SLOT (flushOutput()));
 	outputFlush->setText (i18n ("&Flush Output"));
-	outputFlush->setIcon (KIcon ("edit-delete"));
+	outputFlush->setIcon (QIcon::fromTheme("edit-delete"));
 
 	outputRefresh = actionCollection ()->addAction ("output_refresh", window->page->action (QWebPage::ReloadAndBypassCache), SLOT (trigger()));
 	outputRefresh->setText (i18n ("&Refresh Output"));
-	outputRefresh->setIcon (KIcon ("view-refresh"));
+	outputRefresh->setIcon (QIcon::fromTheme("view-refresh"));
 
 	actionCollection ()->addAction (KStandardAction::Find, "find", window->findbar, SLOT (activate()));
 	QAction* findAhead = actionCollection ()->addAction ("find_ahead", new QAction (i18n ("Find as you type"), this));
diff --git a/rkward/windows/rkworkplaceview.cpp b/rkward/windows/rkworkplaceview.cpp
index 67309bd..e0aa33b 100644
--- a/rkward/windows/rkworkplaceview.cpp
+++ b/rkward/windows/rkworkplaceview.cpp
@@ -22,7 +22,7 @@
 #include <kshortcut.h>
 #include <kactioncollection.h>
 #include <QAction>
-#include <kicon.h>
+#include <QIcon>
 #include <kdeversion.h>
 #include <kacceleratormanager.h>
 #include <kmenu.h>
@@ -44,7 +44,7 @@ RKWorkplaceView::RKWorkplaceView (QWidget *parent) : KTabWidget (parent) {
 
 	// close button(s)
 	QToolButton* close_button = new QToolButton (this);
-	close_button->setIcon (KIcon ("tab-close"));
+	close_button->setIcon (QIcon::fromTheme("tab-close"));
 	connect (close_button, &QToolButton::clicked, this, &RKWorkplaceView::closeCurrentPage);
 	close_button->adjustSize ();
 	setCornerWidget (close_button, Qt::TopRightCorner);



More information about the rkward-tracker mailing list