Commit c0e62560 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to QStandardPath

parent 60f8d7b7
......@@ -18,7 +18,7 @@
#include <kiconloader.h>
#include <klocale.h>
#include <kmessagebox.h>
#include <kstandarddirs.h>
// local includes
#include "core/action.h"
......@@ -26,6 +26,7 @@
#include "core/document.h"
#include <memory>
#include <QStandardPaths>
struct GuiUtilsHelper
{
......@@ -43,7 +44,7 @@ QSvgRenderer* GuiUtilsHelper::svgStamps()
{
if ( !svgStampFile.get() )
{
const QString stampFile = KStandardDirs::locate( "data", "okular/pics/stamps.svg" );
const QString stampFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/stamps.svg" );
if ( !stampFile.isEmpty() )
{
svgStampFile.reset( new QSvgRenderer( stampFile ) );
......
......@@ -22,13 +22,14 @@
#include <QInputDialog>
#include <kiconloader.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kuser.h>
#include <QtCore/QDebug>
#include <kmenu.h>
// system includes
#include <math.h>
#include <QStandardPaths>
// local includes
#include "core/area.h"
......@@ -1109,7 +1110,7 @@ QPixmap PageViewAnnotator::makeToolPixmap( const QDomElement &toolElement )
const QString annotType = toolElement.attribute( "type" );
// Load base pixmap. We'll draw on top of it
pixmap.load( KStandardDirs::locate( "data", "okular/pics/tool-base-okular.png" ) );
pixmap.load( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/tool-base-okular.png" ) );
/* Parse color, innerColor and icon (if present) */
QColor engineColor, innerColor;
......@@ -1143,7 +1144,7 @@ QPixmap PageViewAnnotator::makeToolPixmap( const QDomElement &toolElement )
}
else if ( annotType == "highlight" )
{
QImage overlay( KStandardDirs::locate( "data", "okular/pics/tool-highlighter-okular-colorizable.png" ) );
QImage overlay( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/tool-highlighter-okular-colorizable.png" ) );
QImage colorizedOverlay = overlay;
GuiUtils::colorizeImage( colorizedOverlay, engineColor );
......@@ -1153,7 +1154,7 @@ QPixmap PageViewAnnotator::makeToolPixmap( const QDomElement &toolElement )
}
else if ( annotType == "ink" )
{
QImage overlay( KStandardDirs::locate( "data", "okular/pics/tool-ink-okular-colorizable.png" ) );
QImage overlay( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/tool-ink-okular-colorizable.png" ) );
QImage colorizedOverlay = overlay;
GuiUtils::colorizeImage( colorizedOverlay, engineColor );
......@@ -1163,13 +1164,13 @@ QPixmap PageViewAnnotator::makeToolPixmap( const QDomElement &toolElement )
}
else if ( annotType == "note-inline" )
{
QImage overlay( KStandardDirs::locate( "data", "okular/pics/tool-note-inline-okular-colorizable.png" ) );
QImage overlay( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/tool-note-inline-okular-colorizable.png" ) );
GuiUtils::colorizeImage( overlay, engineColor );
p.drawImage( QPoint(0,0), overlay );
}
else if ( annotType == "note-linked" )
{
QImage overlay( KStandardDirs::locate( "data", "okular/pics/tool-note-okular-colorizable.png" ) );
QImage overlay( QStandardPaths::locate(QStandardPaths::GenericDataLocation, "okular/pics/tool-note-okular-colorizable.png" ) );
GuiUtils::colorizeImage( overlay, engineColor );
p.drawImage( QPoint(0,0), overlay );
}
......
......@@ -16,7 +16,7 @@
#include <qsizepolicy.h>
#include <qtoolbutton.h>
#include <QIcon>
#include <klocale.h>
#include <KLocalizedString>
// local includes
#include "searchlineedit.h"
......
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