[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kmousetool/frameworks] kmousetool: Port away from KStandardDirs.
From: Jeremy Whiting <jpwhiting () kde ! org>
Date: 2015-09-03 22:07:12
Message-ID: E1ZXcf2-0005Ab-Nt () scm ! kde ! org
[Download RAW message or body]
Git commit 4bc90a5d9a1ffe2824be2a57c7f5a31088df2d16 by Jeremy Whiting.
Committed on 03/09/2015 at 22:06.
Pushed by whiting into branch 'frameworks'.
Port away from KStandardDirs.
M +4 -2 kmousetool/kmousetool.cpp
M +2 -1 kmousetool/main.cpp
M +4 -3 kmousetool/mtstroke.cpp
http://commits.kde.org/kmousetool/4bc90a5d9a1ffe2824be2a57c7f5a31088df2d16
diff --git a/kmousetool/kmousetool.cpp b/kmousetool/kmousetool.cpp
index 96495d0..adda1d4 100644
--- a/kmousetool/kmousetool.cpp
+++ b/kmousetool/kmousetool.cpp
@@ -53,6 +53,8 @@
#include <iostream>
#include <khelpclient.h>
#include <kglobal.h>
+#include <QStandardPaths>
+#include <KSharedConfig>
int currentXPosition;
int currentYPosition;
@@ -88,12 +90,12 @@ void KMouseTool::init_vars()
loadOptions();
// If the ~/.mousetool directory doesn't exist, create it
- mSoundFileName = KStandardDirs::locate("appdata", QLatin1String( \
"sounds/mousetool_tap.wav" )); + mSoundFileName = \
QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( \
"sounds/mousetool_tap.wav" )); mplayer = \
Phonon::createPlayer(Phonon::AccessibilityCategory); mplayer->setParent(this);
// find application file
- appfilename = KStandardDirs::locate("exe", QLatin1String( "kmousetool" ));
+ appfilename = KStandardDirs::findExe(QLatin1String( "kmousetool" ));
// find the user's autostart directory
#pragma warning FIXME port to KF5
diff --git a/kmousetool/main.cpp b/kmousetool/main.cpp
index 3115c99..e1166c7 100644
--- a/kmousetool/main.cpp
+++ b/kmousetool/main.cpp
@@ -20,11 +20,12 @@
#include <kcmdlineargs.h>
#include <k4aboutdata.h>
#include <klocale.h>
-#include <kstandarddirs.h>
+
#include <kuniqueapplication.h>
#include <kconfig.h>
#include <kconfiggroup.h>
#include <kglobal.h>
+#include <KSharedConfig>
#include "kmousetool.h"
diff --git a/kmousetool/mtstroke.cpp b/kmousetool/mtstroke.cpp
index ad899f2..5eecdb2 100644
--- a/kmousetool/mtstroke.cpp
+++ b/kmousetool/mtstroke.cpp
@@ -22,10 +22,11 @@
#include <iostream>
// these are for locating the stroke information file
-#include <kstandarddirs.h>
+
// #include <string>
+#include <QStandardPaths>
using namespace std;
@@ -187,7 +188,7 @@ void MTStroke::getExtent()
bool MTStroke::readSequence()
{
QString strokefilename;
- strokefilename = KStandardDirs::locate("config", QLatin1String( \
"kmousetool_strokes.txt" ) ); + strokefilename = \
QStandardPaths::locate(QStandardPaths::ConfigLocation, QLatin1String( \
"kmousetool_strokes.txt" ) ); if (strokefilename.isEmpty()) {
// make default
if (sequenceMap.size()==0)
@@ -223,7 +224,7 @@ bool MTStroke::readSequence()
bool MTStroke::writeSequence()
{
QString strokefilename;
- strokefilename = KStandardDirs::locateLocal("config", QLatin1String( \
"kmousetool_strokes.txt" )); + strokefilename = \
QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + \
QLatin1String("/kmousetool_strokes.txt" );
ofstream outfile (strokefilename.toAscii(), ios::out);
if (!outfile) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic