summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-12 15:38:07 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-12 15:38:07 (GMT)
commitc0e625605ddc84a3397bdc13fd84c9afcdd5ffbb (patch)
tree6d524304d14ebef11c2f1c88ce6ea136b711bfc4
parent60f8d7b7123f42f3a2eaac473c824a1c8ca14646 (diff)
Port to QStandardPath
-rw-r--r--ui/guiutils.cpp5
-rw-r--r--ui/pageviewannotator.cpp13
-rw-r--r--ui/searchwidget.cpp2
3 files changed, 11 insertions, 9 deletions
diff --git a/ui/guiutils.cpp b/ui/guiutils.cpp
index fc8dc78..2e5f812 100644
--- a/ui/guiutils.cpp
+++ b/ui/guiutils.cpp
@@ -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 ) );
diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp
index 51227d9..b5047ee 100644
--- a/ui/pageviewannotator.cpp
+++ b/ui/pageviewannotator.cpp
@@ -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 );
}
diff --git a/ui/searchwidget.cpp b/ui/searchwidget.cpp
index 77050ed..17b9493 100644
--- a/ui/searchwidget.cpp
+++ b/ui/searchwidget.cpp
@@ -16,7 +16,7 @@
#include <qsizepolicy.h>
#include <qtoolbutton.h>
#include <QIcon>
-#include <klocale.h>
+#include <KLocalizedString>
// local includes
#include "searchlineedit.h"