Commit e038950f authored by Vishesh Handa's avatar Vishesh Handa
Browse files

KIcon -> QIcon

parent fb330dd4
......@@ -46,22 +46,22 @@ WidgetAnnotTools::WidgetAnnotTools( QWidget * parent )
QVBoxLayout *vBoxLayout = new QVBoxLayout();
m_btnAdd = new KPushButton( i18n("&Add..."), this );
m_btnAdd->setIcon( KIcon("list-add") );
m_btnAdd->setIcon( QIcon::fromTheme("list-add") );
vBoxLayout->addWidget( m_btnAdd );
m_btnEdit = new KPushButton( i18n("&Edit..."), this );
m_btnEdit->setIcon( KIcon("edit-rename") );
m_btnEdit->setIcon( QIcon::fromTheme("edit-rename") );
m_btnEdit->setEnabled( false );
vBoxLayout->addWidget( m_btnEdit );
m_btnRemove = new KPushButton( i18n("&Remove"), this );
m_btnRemove->setIcon( KIcon("list-remove") );
m_btnRemove->setIcon( QIcon::fromTheme("list-remove") );
m_btnRemove->setEnabled( false );
vBoxLayout->addWidget( m_btnRemove );
m_btnMoveUp = new KPushButton( i18n("Move &Up"), this );
m_btnMoveUp->setIcon( KIcon("arrow-up") );
m_btnMoveUp->setIcon( QIcon::fromTheme("arrow-up") );
m_btnMoveUp->setEnabled( false );
vBoxLayout->addWidget( m_btnMoveUp );
m_btnMoveDown = new KPushButton( i18n("Move &Down"), this );
m_btnMoveDown->setIcon( KIcon("arrow-down") );
m_btnMoveDown->setIcon( QIcon::fromTheme("arrow-down") );
m_btnMoveDown->setEnabled( false );
vBoxLayout->addWidget( m_btnMoveDown );
vBoxLayout->addStretch();
......
......@@ -553,7 +553,7 @@ void PixmapRequestPrivate::swap()
class Okular::ExportFormatPrivate : public QSharedData
{
public:
ExportFormatPrivate( const QString &description, const KMimeType::Ptr &mimeType, const KIcon &icon = KIcon() )
ExportFormatPrivate( const QString &description, const KMimeType::Ptr &mimeType, const QIcon &icon = QIcon() )
: QSharedData(), mDescription( description ), mMimeType( mimeType ), mIcon( icon )
{
}
......@@ -563,7 +563,7 @@ class Okular::ExportFormatPrivate : public QSharedData
QString mDescription;
KMimeType::Ptr mMimeType;
KIcon mIcon;
QIcon mIcon;
};
ExportFormat::ExportFormat()
......@@ -576,7 +576,7 @@ ExportFormat::ExportFormat( const QString &description, const KMimeType::Ptr &mi
{
}
ExportFormat::ExportFormat( const KIcon &icon, const QString &description, const KMimeType::Ptr &mimeType )
ExportFormat::ExportFormat( const QIcon &icon, const QString &description, const KMimeType::Ptr &mimeType )
: d( new ExportFormatPrivate( description, mimeType, icon ) )
{
}
......@@ -610,7 +610,7 @@ KMimeType::Ptr ExportFormat::mimeType() const
return d->mMimeType;
}
KIcon ExportFormat::icon() const
QIcon ExportFormat::icon() const
{
return d->mIcon;
}
......@@ -625,19 +625,19 @@ ExportFormat ExportFormat::standardFormat( StandardExportFormat type )
switch ( type )
{
case PlainText:
return ExportFormat( KIcon( "text-x-generic" ), i18n( "Plain &Text..." ), KMimeType::mimeType( "text/plain" ) );
return ExportFormat( QIcon::fromTheme( "text-x-generic" ), i18n( "Plain &Text..." ), KMimeType::mimeType( "text/plain" ) );
break;
case PDF:
return ExportFormat( KIcon( "application-pdf" ), i18n( "PDF" ), KMimeType::mimeType( "application/pdf" ) );
return ExportFormat( QIcon::fromTheme( "application-pdf" ), i18n( "PDF" ), KMimeType::mimeType( "application/pdf" ) );
break;
case OpenDocumentText:
return ExportFormat(
KIcon( "application-vnd.oasis.opendocument.text" ),
QIcon::fromTheme( "application-vnd.oasis.opendocument.text" ),
i18nc( "This is the document format", "OpenDocument Text" ),
KMimeType::mimeType( "application/vnd.oasis.opendocument.text" ) );
break;
case HTML:
return ExportFormat( KIcon( "text-html" ), i18nc( "This is the document format", "HTML" ), KMimeType::mimeType( "text/html" ) );
return ExportFormat( QIcon::fromTheme( "text-html" ), i18nc( "This is the document format", "HTML" ), KMimeType::mimeType( "text/html" ) );
break;
}
return ExportFormat();
......
......@@ -37,7 +37,7 @@ class QByteArray;
class QMutex;
class QPrinter;
class QPrintDialog;
class KIcon;
class QIcon;
namespace Okular {
......@@ -100,7 +100,7 @@ class OKULAR_EXPORT ExportFormat
* @param description The i18n'ed description of the format.
* @param mimeType The supported mime type of the format.
*/
ExportFormat( const KIcon &icon, const QString &description, const KMimeType::Ptr &mimeType );
ExportFormat( const QIcon &icon, const QString &description, const KMimeType::Ptr &mimeType );
/**
* Destroys the export format.
......@@ -130,7 +130,7 @@ class OKULAR_EXPORT ExportFormat
/**
* Returns the icon for GUI representations of the format.
*/
KIcon icon() const;
QIcon icon() const;
/**
* Returns whether the export format is null/valid.
......
......@@ -63,7 +63,7 @@ KIMGIOGenerator::KIMGIOGenerator( QObject *parent, const QVariantList &args )
setXMLFile( "gui.rc" );
KAction * kimgio_test = new KAction( this );
kimgio_test->setText( "Image test" );
kimgio_test->setIcon( KIcon( "smiley" ) );
kimgio_test->setIcon( QIcon::fromTheme( "smiley" ) );
connect( kimgio_test, SIGNAL(triggered(bool)), this, SLOT(slotTest()) );
actionCollection()->addAction( "kimgio_test", kimgio_test );
*/
......
......@@ -360,7 +360,7 @@ m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentW
// [left toolbox: Table of Contents] | []
m_toc = new TOC( 0, m_document );
connect( m_toc, SIGNAL(hasTOC(bool)), this, SLOT(enableTOC(bool)) );
tbIndex = m_sidebar->addItem( m_toc, KIcon(QApplication::isLeftToRight() ? "format-justify-left" : "format-justify-right"), i18n("Contents") );
tbIndex = m_sidebar->addItem( m_toc, QIcon::fromTheme(QApplication::isLeftToRight() ? "format-justify-left" : "format-justify-right"), i18n("Contents") );
enableTOC( false );
// [left toolbox: Thumbnails and Bookmarks] | []
......@@ -370,17 +370,17 @@ m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentW
m_thumbnailList = new ThumbnailList( thumbsBox, m_document );
// ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList );
connect( m_thumbnailList, SIGNAL(rightClick(const Okular::Page*,QPoint)), this, SLOT(slotShowMenu(const Okular::Page*,QPoint)) );
tbIndex = m_sidebar->addItem( thumbsBox, KIcon( "view-preview" ), i18n("Thumbnails") );
tbIndex = m_sidebar->addItem( thumbsBox, QIcon::fromTheme( "view-preview" ), i18n("Thumbnails") );
m_sidebar->setCurrentIndex( tbIndex );
// [left toolbox: Reviews] | []
m_reviewsWidget = new Reviews( 0, m_document );
m_sidebar->addItem( m_reviewsWidget, KIcon("draw-freehand"), i18n("Reviews") );
m_sidebar->addItem( m_reviewsWidget, QIcon::fromTheme("draw-freehand"), i18n("Reviews") );
m_sidebar->setItemEnabled( 2, false );
// [left toolbox: Bookmarks] | []
m_bookmarkList = new BookmarkList( m_document, 0 );
m_sidebar->addItem( m_bookmarkList, KIcon("bookmarks"), i18n("Bookmarks") );
m_sidebar->addItem( m_bookmarkList, QIcon::fromTheme("bookmarks"), i18n("Bookmarks") );
m_sidebar->setItemEnabled( 3, false );
// widgets: [../miniBarContainer] | []
......@@ -415,7 +415,7 @@ m_cliPresentation(false), m_cliPrint(false), m_embedMode(detectEmbedMode(parentW
m_topMessage->setWordWrap( true );
m_topMessage->setMessageType( KMessageWidget::Information );
m_topMessage->setText( i18n( "This document has embedded files. <a href=\"okular:/embeddedfiles\">Click here to see them</a> or go to File -> Embedded Files." ) );
m_topMessage->setIcon( KIcon( "mail-attachment" ) );
m_topMessage->setIcon( QIcon::fromTheme( "mail-attachment" ) );
connect( m_topMessage, SIGNAL(linkActivated(QString)), this, SLOT(slotShowEmbeddedFiles()) );
rightLayout->addWidget( m_topMessage );
m_formsMessage = new KMessageWidget( rightContainer );
......@@ -605,19 +605,19 @@ void Part::setupViewerActions()
m_renameBookmark = ac->addAction("rename_bookmark");
m_renameBookmark->setText(i18n( "Rename Bookmark" ));
m_renameBookmark->setIcon(KIcon( "edit-rename" ));
m_renameBookmark->setIcon(QIcon::fromTheme( "edit-rename" ));
m_renameBookmark->setWhatsThis( i18n( "Rename the current bookmark" ) );
connect( m_renameBookmark, SIGNAL(triggered()), this, SLOT(slotRenameCurrentViewportBookmark()) );
m_prevBookmark = ac->addAction("previous_bookmark");
m_prevBookmark->setText(i18n( "Previous Bookmark" ));
m_prevBookmark->setIcon(KIcon( "go-up-search" ));
m_prevBookmark->setIcon(QIcon::fromTheme( "go-up-search" ));
m_prevBookmark->setWhatsThis( i18n( "Go to the previous bookmark" ) );
connect( m_prevBookmark, SIGNAL(triggered()), this, SLOT(slotPreviousBookmark()) );
m_nextBookmark = ac->addAction("next_bookmark");
m_nextBookmark->setText(i18n( "Next Bookmark" ));
m_nextBookmark->setIcon(KIcon( "go-down-search" ));
m_nextBookmark->setIcon(QIcon::fromTheme( "go-down-search" ));
m_nextBookmark->setWhatsThis( i18n( "Go to the next bookmark" ) );
connect( m_nextBookmark, SIGNAL(triggered()), this, SLOT(slotNextBookmark()) );
......@@ -662,7 +662,7 @@ void Part::setupViewerActions()
{
genPrefs->setText( i18n( "Configure Backends..." ) );
}
genPrefs->setIcon( KIcon( "configure" ) );
genPrefs->setIcon( QIcon::fromTheme( "configure" ) );
genPrefs->setEnabled( m_document->configurableGenerators() > 0 );
connect( genPrefs, SIGNAL(triggered(bool)), this, SLOT(slotGeneratorPreferences()) );
......@@ -674,7 +674,7 @@ void Part::setupViewerActions()
m_showProperties = ac->addAction("properties");
m_showProperties->setText(i18n("&Properties"));
m_showProperties->setIcon(KIcon("document-properties"));
m_showProperties->setIcon(QIcon::fromTheme("document-properties"));
connect(m_showProperties, SIGNAL(triggered()), this, SLOT(slotShowProperties()));
m_showProperties->setEnabled( false );
......@@ -693,7 +693,7 @@ void Part::setupViewerActions()
KAction *reload = ac->add<KAction>( "file_reload" );
reload->setText( i18n( "Reloa&d" ) );
reload->setIcon( KIcon( "view-refresh" ) );
reload->setIcon( QIcon::fromTheme( "view-refresh" ) );
reload->setWhatsThis( i18n( "Reload the current document from disk." ) );
connect( reload, SIGNAL(triggered()), this, SLOT(slotReload()) );
reload->setShortcut( QKeySequence(QKeySequence::Refresh) );
......@@ -747,7 +747,7 @@ void Part::setupActions()
m_showLeftPanel = ac->add<KToggleAction>("show_leftpanel");
m_showLeftPanel->setText(i18n( "Show &Navigation Panel"));
m_showLeftPanel->setIcon(KIcon( "view-sidetree" ));
m_showLeftPanel->setIcon(QIcon::fromTheme( "view-sidetree" ));
connect( m_showLeftPanel, SIGNAL(toggled(bool)), this, SLOT(slotShowLeftPanel()) );
m_showLeftPanel->setShortcut( Qt::Key_F7 );
m_showLeftPanel->setChecked( Okular::Settings::showLeftPanel() );
......@@ -761,13 +761,13 @@ void Part::setupActions()
m_showEmbeddedFiles = ac->addAction("embedded_files");
m_showEmbeddedFiles->setText(i18n("&Embedded Files"));
m_showEmbeddedFiles->setIcon( KIcon( "mail-attachment" ) );
m_showEmbeddedFiles->setIcon( QIcon::fromTheme( "mail-attachment" ) );
connect(m_showEmbeddedFiles, SIGNAL(triggered()), this, SLOT(slotShowEmbeddedFiles()));
m_showEmbeddedFiles->setEnabled( false );
m_exportAs = ac->addAction("file_export_as");
m_exportAs->setText(i18n("E&xport As"));
m_exportAs->setIcon( KIcon( "document-export" ) );
m_exportAs->setIcon( QIcon::fromTheme( "document-export" ) );
m_exportAsMenu = new QMenu();
connect(m_exportAsMenu, SIGNAL(triggered(QAction*)), this, SLOT(slotExportAs(QAction*)));
m_exportAs->setMenu( m_exportAsMenu );
......@@ -783,19 +783,19 @@ void Part::setupActions()
m_showPresentation = ac->addAction("presentation");
m_showPresentation->setText(i18n("P&resentation"));
m_showPresentation->setIcon( KIcon( "view-presentation" ) );
m_showPresentation->setIcon( QIcon::fromTheme( "view-presentation" ) );
connect(m_showPresentation, SIGNAL(triggered()), this, SLOT(slotShowPresentation()));
m_showPresentation->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_P ) );
m_showPresentation->setEnabled( false );
QAction * importPS = ac->addAction("import_ps");
importPS->setText(i18n("&Import PostScript as PDF..."));
importPS->setIcon(KIcon("document-import"));
importPS->setIcon(QIcon::fromTheme("document-import"));
connect(importPS, SIGNAL(triggered()), this, SLOT(slotImportPSFile()));
#if 0
QAction * ghns = ac->addAction("get_new_stuff");
ghns->setText(i18n("&Get Books From Internet..."));
ghns->setIcon(KIcon("get-hot-new-stuff"));
ghns->setIcon(QIcon::fromTheme("get-hot-new-stuff"));
connect(ghns, SIGNAL(triggered()), this, SLOT(slotGetNewStuff()));
// TEMP, REMOVE ME!
ghns->setShortcut( Qt::Key_G );
......@@ -804,22 +804,22 @@ void Part::setupActions()
KToggleAction *blackscreenAction = new KToggleAction( i18n( "Switch Blackscreen Mode" ), ac );
ac->addAction( "switch_blackscreen_mode", blackscreenAction );
blackscreenAction->setShortcut( QKeySequence( Qt::Key_B ) );
blackscreenAction->setIcon( KIcon( "view-presentation" ) );
blackscreenAction->setIcon( QIcon::fromTheme( "view-presentation" ) );
blackscreenAction->setEnabled( false );
KToggleAction *drawingAction = new KToggleAction( i18n( "Toggle Drawing Mode" ), ac );
ac->addAction( "presentation_drawing_mode", drawingAction );
drawingAction->setIcon( KIcon( "draw-freehand" ) );
drawingAction->setIcon( QIcon::fromTheme( "draw-freehand" ) );
drawingAction->setEnabled( false );
KAction *eraseDrawingAction = new KAction( i18n( "Erase Drawings" ), ac );
ac->addAction( "presentation_erase_drawings", eraseDrawingAction );
eraseDrawingAction->setIcon( KIcon( "draw-eraser" ) );
eraseDrawingAction->setIcon( QIcon::fromTheme( "draw-eraser" ) );
eraseDrawingAction->setEnabled( false );
KAction *configureAnnotations = new KAction( i18n( "Configure Annotations..." ), ac );
ac->addAction( "options_configure_annotations", configureAnnotations );
configureAnnotations->setIcon( KIcon( "configure" ) );
configureAnnotations->setIcon( QIcon::fromTheme( "configure" ) );
connect(configureAnnotations, SIGNAL(triggered()), this, SLOT(slotAnnotationPreferences()));
KAction *playPauseAction = new KAction( i18n( "Play/Pause Presentation" ), ac );
......@@ -1338,7 +1338,7 @@ bool Part::openFile()
if ( ok && m_document->metaData( "HasUnsupportedXfaForm" ).toBool() == true )
{
m_formsMessage->setText( i18n( "This document has XFA forms, which are currently <b>unsupported</b>." ) );
m_formsMessage->setIcon( KIcon( "dialog-warning" ) );
m_formsMessage->setIcon( QIcon::fromTheme( "dialog-warning" ) );
m_formsMessage->setMessageType( KMessageWidget::Warning );
m_formsMessage->setVisible( true );
}
......@@ -1847,7 +1847,7 @@ void Part::updateBookmarksActions()
if ( m_document->bookmarkManager()->isBookmarked( m_document->viewport() ) )
{
m_addBookmark->setText( i18n( "Remove Bookmark" ) );
m_addBookmark->setIcon( KIcon( "edit-delete-bookmark" ) );
m_addBookmark->setIcon( QIcon::fromTheme( "edit-delete-bookmark" ) );
m_renameBookmark->setEnabled( true );
}
else
......@@ -2055,7 +2055,7 @@ void Part::slotAboutToShowContextMenu(KMenu * /*menu*/, QAction *action, QMenu *
{
QAction *separatorAction = contextMenu->addSeparator();
separatorAction->setObjectName("OkularPrivateRenameBookmarkActions");
QAction *renameAction = contextMenu->addAction( KIcon( "edit-rename" ), i18n( "Rename this Bookmark" ), this, SLOT(slotRenameBookmarkFromMenu()) );
QAction *renameAction = contextMenu->addAction( QIcon::fromTheme( "edit-rename" ), i18n( "Rename this Bookmark" ), this, SLOT(slotRenameBookmarkFromMenu()) );
renameAction->setData(ba->property("htmlRef").toString());
renameAction->setObjectName("OkularPrivateRenameBookmarkActions");
}
......@@ -2401,11 +2401,11 @@ void Part::slotShowMenu(const Okular::Page *page, const QPoint &point)
popup->addTitle( i18n( "Page %1", page->number() + 1 ) );
if ( ( !currentPage && m_document->bookmarkManager()->isBookmarked( page->number() ) ) ||
( currentPage && m_document->bookmarkManager()->isBookmarked( m_document->viewport() ) ) )
removeBookmark = popup->addAction( KIcon("edit-delete-bookmark"), i18n("Remove Bookmark") );
removeBookmark = popup->addAction( QIcon::fromTheme("edit-delete-bookmark"), i18n("Remove Bookmark") );
else
addBookmark = popup->addAction( KIcon("bookmark-new"), i18n("Add Bookmark") );
addBookmark = popup->addAction( QIcon::fromTheme("bookmark-new"), i18n("Add Bookmark") );
if ( m_pageView->canFitPageWidth() )
fitPageWidth = popup->addAction( KIcon("zoom-fit-best"), i18n("Fit Width") );
fitPageWidth = popup->addAction( QIcon::fromTheme("zoom-fit-best"), i18n("Fit Width") );
popup->addAction( m_prevBookmark );
popup->addAction( m_nextBookmark );
reallyShow = true;
......
......@@ -619,7 +619,7 @@ void Shell::setTabIcon( KMimeType::Ptr mimeType )
int i = findTabIndex( sender() );
if( i != -1 )
{
m_tabWidget->setTabIcon( i, KIcon(mimeType->iconName()) );
m_tabWidget->setTabIcon( i, QIcon::fromTheme(mimeType->iconName()) );
}
}
......
......@@ -304,7 +304,7 @@ QVariant AnnotationModel::data( const QModelIndex &index, int role ) const
if ( role == Qt::DisplayRole )
return i18n( "Page %1", item->page + 1 );
else if ( role == Qt::DecorationRole )
return KIcon( "text-plain" );
return QIcon::fromTheme( "text-plain" );
else if ( role == PageRole )
return item->page;
......@@ -316,7 +316,7 @@ QVariant AnnotationModel::data( const QModelIndex &index, int role ) const
return GuiUtils::captionForAnnotation( item->annotation );
break;
case Qt::DecorationRole:
return KIcon( "okular" );
return QIcon::fromTheme( "okular" );
break;
case Qt::ToolTipRole:
return GuiUtils::prettyToolTip( item->annotation );
......
......@@ -60,12 +60,12 @@ void AnnotationPopup::exec( const QPoint &point )
menu.addTitle( i18np( "Annotation", "%1 Annotations", mAnnotations.count() ) );
action = menu.addAction( KIcon( "comment" ), i18n( "&Open Pop-up Note" ) );
action = menu.addAction( QIcon::fromTheme( "comment" ), i18n( "&Open Pop-up Note" ) );
action->setData( QVariant::fromValue( pair ) );
action->setEnabled( onlyOne );
action->setProperty( actionTypeId, openId );
action = menu.addAction( KIcon( "list-remove" ), i18n( "&Delete" ) );
action = menu.addAction( QIcon::fromTheme( "list-remove" ), i18n( "&Delete" ) );
action->setEnabled( mDocument->isAllowed( Okular::AllowNotes ) );
action->setProperty( actionTypeId, deleteAllId );
......@@ -75,7 +75,7 @@ void AnnotationPopup::exec( const QPoint &point )
action->setEnabled( false );
}
action = menu.addAction( KIcon( "configure" ), i18n( "&Properties" ) );
action = menu.addAction( QIcon::fromTheme( "configure" ), i18n( "&Properties" ) );
action->setData( QVariant::fromValue( pair ) );
action->setEnabled( onlyOne );
action->setProperty( actionTypeId, propertiesId );
......@@ -86,7 +86,7 @@ void AnnotationPopup::exec( const QPoint &point )
fileAttachAnnot = static_cast< Okular::FileAttachmentAnnotation * >( pair.annotation );
const QString saveText = i18nc( "%1 is the name of the file to save", "&Save '%1'...", fileAttachAnnot->embeddedFile()->name() );
action = menu.addAction( KIcon( "document-save" ), saveText );
action = menu.addAction( QIcon::fromTheme( "document-save" ), saveText );
action->setData( QVariant::fromValue( pair ) );
action->setProperty( actionTypeId, saveId );
}
......@@ -97,17 +97,17 @@ void AnnotationPopup::exec( const QPoint &point )
{
menu.addTitle( GuiUtils::captionForAnnotation( pair.annotation ) );
action = menu.addAction( KIcon( "comment" ), i18n( "&Open Pop-up Note" ) );
action = menu.addAction( QIcon::fromTheme( "comment" ), i18n( "&Open Pop-up Note" ) );
action->setData( QVariant::fromValue( pair ) );
action->setProperty( actionTypeId, openId );
action = menu.addAction( KIcon( "list-remove" ), i18n( "&Delete" ) );
action = menu.addAction( QIcon::fromTheme( "list-remove" ), i18n( "&Delete" ) );
action->setEnabled( mDocument->isAllowed( Okular::AllowNotes ) &&
mDocument->canRemovePageAnnotation( pair.annotation ) );
action->setData( QVariant::fromValue( pair ) );
action->setProperty( actionTypeId, deleteId );
action = menu.addAction( KIcon( "configure" ), i18n( "&Properties" ) );
action = menu.addAction( QIcon::fromTheme( "configure" ), i18n( "&Properties" ) );
action->setData( QVariant::fromValue( pair ) );
action->setProperty( actionTypeId, propertiesId );
......@@ -117,7 +117,7 @@ void AnnotationPopup::exec( const QPoint &point )
fileAttachAnnot = static_cast< Okular::FileAttachmentAnnotation * >( pair.annotation );
const QString saveText = i18nc( "%1 is the name of the file to save", "&Save '%1'...", fileAttachAnnot->embeddedFile()->name() );
action = menu.addAction( KIcon( "document-save" ), saveText );
action = menu.addAction( QIcon::fromTheme( "document-save" ), saveText );
action->setData( QVariant::fromValue( pair ) );
action->setProperty( actionTypeId, saveId );
}
......
......@@ -61,7 +61,7 @@ AnnotsPropertiesDialog::AnnotsPropertiesDialog( QWidget *parent, Okular::Documen
//BEGIN tab 2
QFrame* page = new QFrame( this );
addPage( page, i18n( "&General" ) );
// m_tabitem[1]->setIcon( KIcon( "fonts" ) );
// m_tabitem[1]->setIcon( QIcon::fromTheme( "fonts" ) );
QGridLayout* gridlayout = new QGridLayout( page );
tmplabel = new QLabel( i18n( "&Author:" ), page );
AuthorEdit = new KLineEdit( ann->author(), page );
......
......@@ -478,7 +478,7 @@ QVariant AuthorGroupProxyModel::data( const QModelIndex &proxyIndex, int role )
if ( role == Qt::DisplayRole )
return item->author();
else if ( role == Qt::DecorationRole )
return KIcon( item->author().isEmpty() ? "user-away" : "user-identity" );
return QIcon::fromTheme( item->author().isEmpty() ? "user-away" : "user-identity" );
else
return QVariant();
} else {
......
......@@ -685,7 +685,7 @@ QWidget * FileAttachmentAnnotationWidget::createExtraWidget()
if ( mime )
{
tmplabel = new QLabel( widget );
tmplabel->setPixmap( KIcon( mime->iconName() ).pixmap( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ) );
tmplabel->setPixmap( QIcon::fromTheme( mime->iconName() ).pixmap( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE ) );
tmplabel->setFixedSize( FILEATTACH_ICONSIZE, FILEATTACH_ICONSIZE );
lay->addWidget( tmplabel, 0, 1, 3, 1, Qt::AlignTop );
}
......
......@@ -152,7 +152,7 @@ BookmarkList::BookmarkList( Okular::Document *document, QWidget *parent )
sp.setVerticalPolicy( QSizePolicy::Minimum );
bookmarkController->setSizePolicy( sp );
// insert a togglebutton [show only bookmarks in the current document]
m_showBoomarkOnlyAction = bookmarkController->addAction( KIcon( "bookmarks" ), i18n( "Current document only" ) );
m_showBoomarkOnlyAction = bookmarkController->addAction( QIcon::fromTheme( "bookmarks" ), i18n( "Current document only" ) );
m_showBoomarkOnlyAction->setCheckable( true );
connect( m_showBoomarkOnlyAction, SIGNAL(toggled(bool)), this, SLOT(slotFilterBookmarks(bool)) );
......@@ -189,7 +189,7 @@ void BookmarkList::notifySetup( const QVector< Okular::Page * > & pages, int set
m_currentDocumentItem = itemForUrl( m_document->currentDocument() );
if ( m_currentDocumentItem && m_currentDocumentItem != m_tree->invisibleRootItem() )
{
m_currentDocumentItem->setIcon( 0, KIcon( "bookmarks" ) );
m_currentDocumentItem->setIcon( 0, QIcon::fromTheme( "bookmarks" ) );
m_currentDocumentItem->setExpanded( true );
}
connect( m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(slotChanged(QTreeWidgetItem*)) );
......@@ -246,8 +246,8 @@ void BookmarkList::contextMenuForBookmarkItem( const QPoint& p, BookmarkItem* bm
KMenu menu( this );
QAction * gotobm = menu.addAction( i18n( "Go to This Bookmark" ) );
QAction * editbm = menu.addAction( KIcon( "edit-rename" ), i18n( "Rename Bookmark" ) );
QAction * removebm = menu.addAction( KIcon( "list-remove" ), i18n( "Remove Bookmark" ) );
QAction * editbm = menu.addAction( QIcon::fromTheme( "edit-rename" ), i18n( "Rename Bookmark" ) );
QAction * removebm = menu.addAction( QIcon::fromTheme( "list-remove" ), i18n( "Remove Bookmark" ) );
QAction * res = menu.exec( QCursor::pos() );
if ( !res )
return;
......@@ -273,8 +273,8 @@ void BookmarkList::contextMenuForFileItem( const QPoint& p, FileItem* fItem )
QAction * open = 0;
if ( !thisdoc )
open = menu.addAction( i18nc( "Opens the selected document", "Open Document" ) );
QAction * editbm = menu.addAction( KIcon( "edit-rename" ), i18n( "Rename Bookmark" ) );
QAction * removebm = menu.addAction( KIcon( "list-remove" ), i18n( "Remove Bookmarks" ) );
QAction * editbm = menu.addAction( QIcon::fromTheme( "edit-rename" ), i18n( "Rename Bookmark" ) );
QAction * removebm = menu.addAction( QIcon::fromTheme( "list-remove" ), i18n( "Remove Bookmarks" ) );
QAction * res = menu.exec( QCursor::pos() );
if ( !res )
return;
......@@ -374,7 +374,7 @@ void BookmarkList::rebuildTree( bool filter )
if ( currenturlitem )
{
currenturlitem->setExpanded( true );
currenturlitem->setIcon( 0, KIcon( "bookmarks" ) );
currenturlitem->setIcon( 0, QIcon::fromTheme( "bookmarks" ) );
m_tree->scrollToItem( currenturlitem, QAbstractItemView::PositionAtTop );
m_currentDocumentItem = currenturlitem;
}
......@@ -436,7 +436,7 @@ void BookmarkList::selectiveUrlUpdate( const KUrl& url, QTreeWidgetItem*& item )
}
if ( m_document->isOpened() && url == m_document->currentDocument() )
{
item->setIcon( 0, KIcon( "bookmarks" ) );
item->setIcon( 0, QIcon::fromTheme( "bookmarks" ) );
item->setExpanded( true );
}
item->addChildren( createItems( url, urlbookmarks ) );
......
# an own directory for multi-size icons retrieved by KIconLoader
# an own directory for multi-size icons retrieved by KIconThemeLoader
add_subdirectory(icons)
# install annotator xml tools description
......
......@@ -63,7 +63,7 @@ EmbeddedFilesDialog::EmbeddedFilesDialog(QWidget *parent, const Okular::Document
KMimeType::Ptr mime = KMimeType::findByPath( ef->name(), 0, true );
if (mime)
{
twi->setIcon(0, KIcon(mime->iconName()));
twi->setIcon(0, QIcon::fromTheme(mime->iconName()));
}
twi->setText(1, ef->description());
twi->setText(2, ef->size() <= 0 ? i18nc("Not available size", "N/A") : KGlobal::locale()->formatByteSize(ef->size()));
......@@ -111,7 +111,7 @@ void EmbeddedFilesDialog::attachViewContextMenu( const QPoint& /*pos*/ )
return;
QMenu menu( this );
QAction* saveAsAct = menu.addAction( KIcon( "document-save-as" ), i18nc( "@action:inmenu", "&Save As..." ) );
QAction* saveAsAct = menu.addAction( QIcon::fromTheme( "document-save-as" ), i18nc( "@action:inmenu", "&Save As..." ) );
QAction* act = menu.exec( QCursor::pos() );
if ( !act )
......
......@@ -32,7 +32,7 @@ FindBar::FindBar( Okular::Document * document, QWidget * parent )
lay->setMargin( 2 );
QToolButton * closeBtn = new QToolButton( this );
closeBtn->setIcon( KIcon( "dialog-close" ) );
closeBtn->setIcon( QIcon::fromTheme( "dialog-close" ) );
closeBtn->setToolTip( i18n( "Close" ) );
closeBtn->setAutoRaise( true );
lay->addWidget( closeBtn );
......@@ -52,11 +52,11 @@ FindBar::FindBar( Okular::Document * document, QWidget * parent )
label->setBuddy( m_search->lineEdit() );
lay->addWidget( m_search );
QPushButton * findNextBtn = new QPushButton( KIcon( "go-down-search" ), i18nc( "Find and go to the next search match", "Next" ), this );
QPushButton * findNextBtn = new QPushButton( QIcon::fromTheme( "go-down-search" ), i18nc( "Find and go to the next search match", "Next" ), this );
findNextBtn->setToolTip( i18n( "Jump to next match" ) );
lay->addWidget( findNextBtn );
QPushButton * findPrevBtn = new QPushButton( KIcon( "go-up-search" ), i18nc( "Find and go to the previous search match", "Previous" ), this );
QPushButton * findPrevBtn = new QPushButton( QIcon::fromTheme( "go-up-search" ), i18nc( "Find and go to the previous search match", "Previous" ), this );
findPrevBtn->setToolTip( i18n( "Jump to previous match" ) );
lay->addWidget( findPrevBtn );
......
......@@ -169,7 +169,7 @@ MiniBar::MiniBar( QWidget * parent, MiniBarLogic * miniBarLogic )
QSize buttonSize( KIconLoader::SizeSmallMedium, KIconLoader::SizeSmallMedium );
// bottom: left prev_page button
m_prevButton = new HoverButton( this );
m_prevButton->setIcon( KIcon( layoutDirection() == Qt::RightToLeft ? "arrow-right" : "arrow-left" ) );
m_prevButton->setIcon( QIcon::fromTheme( layoutDirection() == Qt::RightToLeft ? "arrow-right" : "arrow-left" ) );
m_prevButton->setIconSize( buttonSize );
horLayout->addWidget( m_prevButton );
// bottom: left lineEdit (current page box)
......@@ -192,7 +192,7 @@ MiniBar::MiniBar( QWidget * parent, MiniBarLogic * miniBarLogic )
horLayout->addWidget( m_pagesButton );
// bottom: right next_page button
m_nextButton = new HoverButton( this );
m_nextButton->setIcon( KIcon( layoutDirection() == Qt::RightToLeft ? "arrow-left" : "arrow-right" ) );
m_nextButton->setIcon( QIcon::fromTheme( layoutDirection() == Qt::RightToLeft ? "arrow-left" : "arrow-right" ) );
m_nextButton->setIconSize( buttonSize );
horLayout->addWidget( m_nextButton );
......
......@@ -430,7 +430,7 @@ void PageView::setupBaseActions( KActionCollection * ac )
d->actionCollection = ac;
// Zoom actions ( higher scales takes lots of memory! )
d->aZoom = new KSelectAction(KIcon( "page-zoom" ), i18n("Zoom"), this);
d->aZoom = new KSelectAction(QIcon::fromTheme( "page-zoom" ), i18n("Zoom"), this);
ac->addAction("zoom_to", d->aZoom );
d->aZoom->setEditable( true );
d->aZoom->setMaxComboViewCount( 14 );
......@@ -450,12 +450,12 @@ void PageView::setupViewerActions( KActionCollection * ac )
d->aZoomOut->setShortcut( QKeySequence(Qt::CTRL + Qt::ALT + Qt::Key_Minus) );
// orientation menu actions
d->aRotateClockwise = new KAction( KIcon( "object-rotate-right" ), i18n( "Rotate &Right" ), this );
d->aRotateClockwise = new KAction( QIcon::fromTheme( "object-rotate-right" ), i18n( "Rotate &Right" ), this );
d->aRotateClockwise->setIconText( i18nc( "Rotate right", "Right" ) );
ac->addAction( "view_orientation_rotate_cw", d->aRotateClockwise );
d->aRotateClo