summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Toscano <[email protected]>2017-04-24 21:45:48 +0200
committerLuigi Toscano <[email protected]>2017-04-24 21:45:48 +0200
commitb8b84d875694c6c84652640ad4a407a9f7569741 (patch)
tree3d47d11061b5436637dabdd0b82b77b449ae117c
parent458f268e004a3e3ee74acda41928a6a7b0346a73 (diff)
Port KStandardDirs to QStandardPaths
-rw-r--r--mainview.cpp8
-rw-r--r--playerinfo.cpp9
2 files changed, 10 insertions, 7 deletions
diff --git a/mainview.cpp b/mainview.cpp
index 064fc26..96e5515 100644
--- a/mainview.cpp
+++ b/mainview.cpp
@@ -32,7 +32,7 @@
#include <kactioncollection.h>
#include <kglobalsettings.h>
#include <KLocalizedString>
-#include <kstandarddirs.h>
+
#include <ktoggleaction.h>
#include <kconfiggroup.h>
@@ -41,6 +41,8 @@
#include <KGlobal>
#include <KShortcut>
#include <QFontDatabase>
+#include <QStandardPaths>
+#include <KSharedConfig>
#include "ai.h"
#include "options.h"
@@ -68,7 +70,7 @@ MyMainView::MyMainView(QWidget *parent)
int i,p;
setMinimumSize(600,400);
random.setSeed(0);
- QPixmap backgr(KStandardDirs::locate("appdata",QLatin1String( MV_BACKGROUND) ));
+ QPixmap backgr(QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String(MV_BACKGROUND)));
field.setBackgroundBrush(QBrush(backgr));
view.setCacheMode(QGraphicsView::CacheBackground);
@@ -88,7 +90,7 @@ MyMainView::MyMainView(QWidget *parent)
minePut[p]=false;
}
- svgrender = new QSvgRenderer(KStandardDirs::locate("appdata",QLatin1String( MV_SVG_FILE )));
+ svgrender = new QSvgRenderer(QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String(MV_SVG_FILE)));
sun=new SunSprite(svgrender,QLatin1String( MV_SUN ));
field.addItem(sun);
diff --git a/playerinfo.cpp b/playerinfo.cpp
index 03b0257..0278521 100644
--- a/playerinfo.cpp
+++ b/playerinfo.cpp
@@ -19,7 +19,8 @@
#include <QIcon>
#include <KLocalizedString>
-#include <kstandarddirs.h>
+#include <QStandardPaths>
+
QPixmap* PlayerInfo::pplayer[6];
@@ -66,14 +67,14 @@ PlayerInfo::PlayerInfo(int pnr,QWidget *parent)
str = QString::fromLatin1("sprites/playerinfo/ship%1%2.png")
.arg(pnr+1)
.arg(i);
- pix[i]=new QPixmap(KStandardDirs::locate("appdata", str));
+ pix[i]=new QPixmap(QStandardPaths::locate(QStandardPaths::DataLocation, str));
}*/
lplayer.setPixmap(*(pplayer[0]));
currentPixmap=0;
- //lenergy.setPixmap(QPixmap(KStandardDirs::locate("appdata", "sprites/playerinfo/energy.png")));
+ //lenergy.setPixmap(QPixmap(QStandardPaths::locate(QStandardPaths::DataLocation, "sprites/playerinfo/energy.png")));
lenergy.setPixmap(QIcon::fromTheme( QLatin1String( "battery" )).pixmap(32,32));;
- lwins.setPixmap(QPixmap(KStandardDirs::locate("appdata", QLatin1String( "sprites/playerinfo/win.png" ))));
+ lwins.setPixmap(QPixmap(QStandardPaths::locate(QStandardPaths::DataLocation, QLatin1String( "sprites/playerinfo/win.png" ))));
hitpoints.setGeometry(9,45,26,26);
energy.setGeometry(9,120,26,26);