Commit 147aa9c1 authored by David Faure's avatar David Faure
Browse files

Port to QIcon::fromTheme

parent 6e55d23d
......@@ -76,12 +76,12 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig,
KActionCollection *ac)
: d (new kpCommandHistoryBasePrivate ())
{
m_actionUndo = new KToolBarPopupAction(KDE::icon(QStringLiteral("edit-undo")), undoActionText (), this);
m_actionUndo = new KToolBarPopupAction(QIcon::fromTheme(QStringLiteral("edit-undo")), undoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Undo), m_actionUndo);
ac->setDefaultShortcuts (m_actionUndo, KStandardShortcut::shortcut (KStandardShortcut::Undo));
connect (m_actionUndo, &KToolBarPopupAction::triggered, this, &kpCommandHistoryBase::undo);
m_actionRedo = new KToolBarPopupAction(KDE::icon(QStringLiteral("edit-redo")), redoActionText (), this);
m_actionRedo = new KToolBarPopupAction(QIcon::fromTheme(QStringLiteral("edit-redo")), redoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Redo), m_actionRedo);
ac->setDefaultShortcuts (m_actionRedo, KStandardShortcut::shortcut (KStandardShortcut::Redo));
connect (m_actionRedo, &KToolBarPopupAction::triggered, this, &kpCommandHistoryBase::redo );
......
......@@ -106,12 +106,12 @@ void kpMainWindow::setupFileMenuActions ()
d->actionExport = ac->addAction(QStringLiteral("file_export"));
d->actionExport->setText (i18n ("E&xport..."));
d->actionExport->setIcon(KDE::icon(QStringLiteral("document-export")));
d->actionExport->setIcon(QIcon::fromTheme(QStringLiteral("document-export")));
connect (d->actionExport, &QAction::triggered, this, &kpMainWindow::slotExport);
d->actionScan = ac->addAction(QStringLiteral("file_scan"));
d->actionScan->setText(i18n ("Scan..."));
d->actionScan->setIcon(SmallIcon("scanner"));
d->actionScan->setIcon(QIcon::fromTheme("scanner"));
#if HAVE_KSANE
connect (d->actionScan, &QAction::triggered, this, &kpMainWindow::slotScan);
#else
......@@ -124,13 +124,13 @@ void kpMainWindow::setupFileMenuActions ()
d->actionProperties = ac->addAction (QStringLiteral("file_properties"));
d->actionProperties->setText (i18n ("Properties"));
d->actionProperties->setIcon(KDE::icon(QStringLiteral("document-properties")));
d->actionProperties->setIcon(QIcon::fromTheme(QStringLiteral("document-properties")));
connect (d->actionProperties, &QAction::triggered, this, &kpMainWindow::slotProperties);
//d->actionRevert = KStandardAction::revert (this, SLOT (slotRevert()), ac);
d->actionReload = ac->addAction (QStringLiteral("file_revert"));
d->actionReload->setText (i18n ("Reloa&d"));
d->actionReload->setIcon(KDE::icon(QStringLiteral("view-refresh")));
d->actionReload->setIcon(QIcon::fromTheme(QStringLiteral("view-refresh")));
connect (d->actionReload, &QAction::triggered, this, &kpMainWindow::slotReload);
ac->setDefaultShortcuts (d->actionReload, KStandardShortcut::reload ());
slotEnableReload ();
......
......@@ -142,19 +142,19 @@ void kpMainWindow::setupImageMenuActions ()
d->actionRotate = ac->addAction (QStringLiteral("image_rotate"));
d->actionRotate->setText (i18n ("&Rotate..."));
d->actionRotate->setIcon(KDE::icon(QStringLiteral("transform-rotate")));
d->actionRotate->setIcon(QIcon::fromTheme(QStringLiteral("transform-rotate")));
connect (d->actionRotate, &QAction::triggered, this, &kpMainWindow::slotRotate);
ac->setDefaultShortcut (d->actionRotate, Qt::CTRL + Qt::Key_R);
d->actionRotateLeft = ac->addAction (QStringLiteral("image_rotate_270deg"));
d->actionRotateLeft->setText (i18n ("Rotate &Left"));
d->actionRotateLeft->setIcon(KDE::icon(QStringLiteral("object-rotate-left")));
d->actionRotateLeft->setIcon(QIcon::fromTheme(QStringLiteral("object-rotate-left")));
connect (d->actionRotateLeft, &QAction::triggered, this, &kpMainWindow::slotRotate270);
ac->setDefaultShortcut (d->actionRotateLeft, Qt::CTRL + Qt::SHIFT + Qt::Key_Left);
d->actionRotateRight = ac->addAction (QStringLiteral("image_rotate_90deg"));
d->actionRotateRight->setText (i18n ("Rotate Righ&t"));
d->actionRotateRight->setIcon(KDE::icon(QStringLiteral("object-rotate-right")));
d->actionRotateRight->setIcon(QIcon::fromTheme(QStringLiteral("object-rotate-right")));
connect (d->actionRotateRight, &QAction::triggered, this, &kpMainWindow::slotRotate90);
ac->setDefaultShortcut (d->actionRotateRight, Qt::CTRL + Qt::SHIFT + Qt::Key_Right);
......
......@@ -66,25 +66,25 @@ void kpMainWindow::setupTextToolBarActions ()
this, &kpMainWindow::slotTextFontSizeChanged);
d->actionTextBold = ac->add<KToggleAction> (QStringLiteral("text_bold"));
d->actionTextBold->setIcon(KDE::icon(QStringLiteral("format-text-bold")));
d->actionTextBold->setIcon(QIcon::fromTheme(QStringLiteral("format-text-bold")));
d->actionTextBold->setText (i18n ("Bold"));
connect (d->actionTextBold, &KToggleAction::triggered,
this, &kpMainWindow::slotTextBoldChanged);
d->actionTextItalic = ac->add<KToggleAction> (QStringLiteral("text_italic"));
d->actionTextItalic->setIcon (KDE::icon(QStringLiteral("format-text-italic")));
d->actionTextItalic->setIcon (QIcon::fromTheme(QStringLiteral("format-text-italic")));
d->actionTextItalic->setText (i18n ("Italic"));
connect (d->actionTextItalic, &KToggleAction::triggered,
this, &kpMainWindow::slotTextItalicChanged);
d->actionTextUnderline = ac->add<KToggleAction> (QStringLiteral("text_underline"));
d->actionTextUnderline->setIcon (KDE::icon(QStringLiteral("format-text-underline")));
d->actionTextUnderline->setIcon (QIcon::fromTheme(QStringLiteral("format-text-underline")));
d->actionTextUnderline->setText (i18n ("Underline"));
connect (d->actionTextUnderline, &KToggleAction::triggered,
this, &kpMainWindow::slotTextUnderlineChanged);
d->actionTextStrikeThru = ac->add<KToggleAction> (QStringLiteral("text_strike_thru"));
d->actionTextStrikeThru->setIcon(KDE::icon(QStringLiteral("format-text-strikethrough")));
d->actionTextStrikeThru->setIcon(QIcon::fromTheme(QStringLiteral("format-text-strikethrough")));
d->actionTextStrikeThru->setText (i18n ("Strike Through"));
connect (d->actionTextStrikeThru, &KToggleAction::triggered,
this, &kpMainWindow::slotTextStrikeThruChanged);
......
......@@ -37,7 +37,7 @@ kpToolAction::kpToolAction(const QString &text,
const QString &pic, const QList<QKeySequence> &shortcut,
const QObject *receiver, const char *slot,
KActionCollection *ac, const QString &name)
: KToggleAction(KDE::icon(pic), text, ac)
: KToggleAction(QIcon::fromTheme(pic), text, ac)
{
ac->setDefaultShortcuts(this, shortcut);
......
......@@ -78,7 +78,7 @@ kpToolZoom::kpToolZoom (kpToolEnvironment *environ, QWidget *parent)
d (new kpToolZoomPrivate ())
{
// different from objectName()
action()->setIcon(KDE::icon(QStringLiteral("zoom-original")));
action()->setIcon(QIcon::fromTheme(QStringLiteral("zoom-original")));
}
//---------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment