Commit 6cf2242c authored by Volker Krause's avatar Volker Krause
Browse files

Port away from deprecated Bar|Desktop|SmallIcon methods

Subscribers: okular-devel

Tags: #okular

Differential Revision: https://phabricator.kde.org/D25553
parent c56a924a
Pipeline #11232 passed with stage
in 11 minutes and 7 seconds
......@@ -13,7 +13,6 @@
#include <QFont>
#include <KConfigDialogManager>
#include <KIconLoader>
#include "settings_core.h"
#include "ui_dlgperformancebase.h"
......@@ -29,8 +28,8 @@ DlgPerformance::DlgPerformance( QWidget * parent )
labelFont.setBold( true );
m_dlg->descLabel->setFont( labelFont );
m_dlg->cpuLabel->setPixmap( BarIcon( QStringLiteral("cpu"), 32 ) );
// m_dlg->memoryLabel->setPixmap( BarIcon( "kcmmemory", 32 ) ); // TODO: enable again when proper icon is available
m_dlg->cpuLabel->setPixmap( QIcon::fromTheme( QStringLiteral("cpu") ).pixmap( 32 ) );
// m_dlg->memoryLabel->setPixmap( QIcon::fromTheme( "kcmmemory" ).pixmap( 32 ) ); // TODO: enable again when proper icon is available
m_dlg->memoryLevelGroup->setId(m_dlg->lowRadio, 0);
m_dlg->memoryLevelGroup->setId(m_dlg->normalRadio, 1);
......
......@@ -34,7 +34,6 @@
#include <QTreeView>
#include <QDebug>
#include <kiconloader.h>
#include <KLocalizedString>
#include <ktoolbar.h>
......
......@@ -27,7 +27,6 @@
#include <kacceleratormanager.h>
#include <kactioncollection.h>
#include <kcolorscheme.h>
#include <kiconloader.h>
#include <KLocalizedString>
// system includes
......@@ -258,24 +257,25 @@ void PageViewMessage::display( const QString & message, const QString & details,
// load icon (if set)
m_symbol = QPixmap();
const auto symbolSize = style()->pixelMetric(QStyle::PM_SmallIconSize);
if ( icon != None )
{
switch ( icon )
{
case Annotation:
m_symbol = SmallIcon( QStringLiteral("draw-freehand") );
m_symbol = QIcon::fromTheme( QStringLiteral("draw-freehand") ).pixmap( symbolSize );
break;
case Find:
m_symbol = SmallIcon( QStringLiteral("zoom-original") );
m_symbol = QIcon::fromTheme( QStringLiteral("zoom-original") ).pixmap( symbolSize );
break;
case Error:
m_symbol = SmallIcon( QStringLiteral("dialog-error") );
m_symbol = QIcon::fromTheme( QStringLiteral("dialog-error") ).pixmap( symbolSize );
break;
case Warning:
m_symbol = SmallIcon( QStringLiteral("dialog-warning") );
m_symbol = QIcon::fromTheme( QStringLiteral("dialog-warning") ).pixmap( symbolSize );
break;
default:
m_symbol = SmallIcon( QStringLiteral("dialog-information") );
m_symbol = QIcon::fromTheme( QStringLiteral("dialog-information") ).pixmap( symbolSize );
break;
}
......
......@@ -37,7 +37,6 @@
#include <kactioncollection.h>
#include <klineedit.h>
#include <KLocalizedString>
#include <kiconloader.h>
#include <kmessagebox.h>
#include <kselectaction.h>
#include <QDialog>
......@@ -1147,7 +1146,7 @@ void PresentationWidget::generateIntroPage( QPainter & p )
}
// draw okular logo in the four corners
QPixmap logo = DesktopIcon( QStringLiteral("okular"), 64 * dpr );
QPixmap logo = QIcon::fromTheme( QStringLiteral("okular") ).pixmap( 64 * dpr );
logo.setDevicePixelRatio( dpr );
if ( !logo.isNull() )
{
......
......@@ -22,7 +22,6 @@
#include <QTimer>
#include <KLocalizedString>
#include <KIconLoader>
#include <KActionCollection>
// local includes
......@@ -640,7 +639,7 @@ void ThumbnailListPrivate::slotDelayTimeout()
delete m_bookmarkOverlay;
const int expectedWidth = q->viewport()->width() / 4;
if ( expectedWidth > 10 )
m_bookmarkOverlay = new QPixmap( DesktopIcon( QStringLiteral("bookmarks"), expectedWidth ) );
m_bookmarkOverlay = new QPixmap( QIcon::fromTheme( QStringLiteral("bookmarks") ).pixmap( expectedWidth ) );
else
m_bookmarkOverlay = nullptr;
......
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