summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2014-10-07 11:21:58 (GMT)
committerMontel Laurent <montel@kde.org>2014-10-07 11:21:58 (GMT)
commit08013f87d0a498ce00dc6c6613db70354ec70f65 (patch)
tree57af79820f0b8f9dda6ae3dbaeb6dc8b91b4edab
parent49129b788a5e0981697e8a45cb9415327f05ed32 (diff)
Port to QStandardPaths
-rw-r--r--core/bookmarkmanager.cpp5
-rw-r--r--core/document.cpp7
-rw-r--r--core/fileprinter.cpp9
3 files changed, 12 insertions, 9 deletions
diff --git a/core/bookmarkmanager.cpp b/core/bookmarkmanager.cpp
index 06bca91..44a33a0 100644
--- a/core/bookmarkmanager.cpp
+++ b/core/bookmarkmanager.cpp
@@ -17,8 +17,9 @@
#include <kbookmarkmenu.h>
#include <QtCore/QDebug>
#include <QApplication>
-#include <kstandarddirs.h>
+
#include <kurl.h>
+#include <QStandardPaths>
// local includes
#include "document_p.h"
@@ -138,7 +139,7 @@ BookmarkManager::BookmarkManager( DocumentPrivate * document )
d->document = document;
- d->file = KStandardDirs::locateLocal( "data", "okular/bookmarks.xml" );
+ d->file = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + "okular/bookmarks.xml" ;
d->manager = KBookmarkManager::managerForFile( d->file, "okular" );
d->manager->setEditorOptions( QGuiApplication::applicationDisplayName(), false );
diff --git a/core/document.cpp b/core/document.cpp
index e7b70cd..cc51ea4 100644
--- a/core/document.cpp
+++ b/core/document.cpp
@@ -50,7 +50,7 @@
#include <kprocess.h>
#include <krun.h>
#include <kshell.h>
-#include <kstandarddirs.h>
+
#include <ktoolinvocation.h>
#include <kzip.h>
@@ -90,6 +90,7 @@
#include <config-okular.h>
#include <KFormat>
+#include <QStandardPaths>
using namespace Okular;
@@ -2122,11 +2123,11 @@ QString DocumentPrivate::docDataFileName(const KUrl &url, qint64 document_size)
QString fn = url.fileName();
fn = QString::number( document_size ) + '.' + fn + ".xml";
QString newokular = "okular/docdata/" + fn;
- QString newokularfile = KStandardDirs::locateLocal( "data", newokular );
+ QString newokularfile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + newokular ;
if ( !QFile::exists( newokularfile ) )
{
QString oldkpdf = "kpdf/" + fn;
- QString oldkpdffile = KStandardDirs::locateLocal( "data", oldkpdf );
+ QString oldkpdffile = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + oldkpdf ;
if ( QFile::exists( oldkpdffile ) )
{
// ### copy or move?
diff --git a/core/fileprinter.cpp b/core/fileprinter.cpp
index 33e5a3d..e17f37e 100644
--- a/core/fileprinter.cpp
+++ b/core/fileprinter.cpp
@@ -28,6 +28,7 @@
#include <ktempdir.h>
#include <QtCore/QDebug>
#include <kdeversion.h>
+#include <QStandardPaths>
#include "debug_p.h"
@@ -124,9 +125,9 @@ int FilePrinter::doPrintFiles( QPrinter &printer, QStringList fileList, FileDele
exe = "lpr-cups";
} else if ( !KStandardDirs::findExe("lpr.cups").isEmpty() ) {
exe = "lpr.cups";
- } else if ( !KStandardDirs::findExe("lpr").isEmpty() ) {
+ } else if ( !QStandardPaths::findExecutable("lpr").isEmpty() ) {
exe = "lpr";
- } else if ( !KStandardDirs::findExe("lp").isEmpty() ) {
+ } else if ( !QStandardPaths::findExecutable("lp").isEmpty() ) {
exe = "lp";
} else {
return -9;
@@ -227,12 +228,12 @@ QString FilePrinter::pageListToPageRange( const QList<int> &pageList )
bool FilePrinter::ps2pdfAvailable()
{
- return ( !KStandardDirs::findExe("ps2pdf").isEmpty() );
+ return ( !QStandardPaths::findExecutable("ps2pdf").isEmpty() );
}
bool FilePrinter::pdf2psAvailable()
{
- return ( !KStandardDirs::findExe("pdf2ps").isEmpty() );
+ return ( !QStandardPaths::findExecutable("pdf2ps").isEmpty() );
}
bool FilePrinter::cupsAvailable()