summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtem Fedoskin <afedoskin3@gmail.com>2016-05-22 01:27:24 (GMT)
committerArtem Fedoskin <afedoskin3@gmail.com>2016-05-22 01:27:24 (GMT)
commitdff369e15c0cc9f14546c7c31fd73757ab591144 (patch)
tree4ddd4483a6ec5498f63b6b1de60a75a838d1a46b
parent6395454f744d99b92b6bdd2b3ea44047596e6866 (diff)
Android build compiles and works well. Introduced new class KPaths that
is a wrapper for QStandardPaths. The reason behind creating KPaths is that in Android all app files are installed in location that can't be resolved by QStandardPaths. If the target platform is Android, KPaths::locate and KPaths::locateAll will first check all standard locations and then special for Android location (assets). Otherwise it simply calls QStandardPaths's locate and locateAll respectively. Also changed a splash screen to fit better to mobiles.
-rw-r--r--CMakeLists.txt2
-rw-r--r--apk/res/drawable-hdpi/splash.xml2
-rw-r--r--apk/res/drawable-hdpi/splashicon.pngbin0 -> 8834 bytes
-rw-r--r--apk/res/drawable-ldpi/splash.xml2
-rw-r--r--apk/res/drawable-mdpi/splash.xml2
-rw-r--r--apk/res/drawable-mdpi/splashicon.pngbin0 -> 8834 bytes
-rw-r--r--apk/res/drawable-xhdpi/splash.xml2
-rw-r--r--apk/res/drawable-xhdpi/splashicon.pngbin0 -> 23830 bytes
-rw-r--r--apk/res/drawable-xxhdpi/splash.xml2
-rw-r--r--apk/res/drawable-xxhdpi/splashicon.pngbin0 -> 23830 bytes
-rw-r--r--apk/res/drawable-xxxhdpi/splash.xml2
-rw-r--r--apk/res/drawable-xxxhdpi/splashicon.pngbin0 -> 23830 bytes
-rw-r--r--datahandlers/catalogdb.cpp3
-rw-r--r--kstars/CMakeLists.txt10
-rw-r--r--kstars/auxiliary/binfilehelper.cpp5
-rw-r--r--kstars/auxiliary/ksfilereader.cpp3
-rw-r--r--kstars/auxiliary/ksfilereader.h2
-rw-r--r--kstars/auxiliary/kspaths.cpp27
-rw-r--r--kstars/auxiliary/kspaths.h39
-rw-r--r--kstars/auxiliary/ksuserdb.cpp4
-rw-r--r--kstars/auxiliary/ksutils.cpp3
-rw-r--r--kstars/auxiliary/kswizard.cpp8
-rw-r--r--kstars/indi/drivermanager.cpp2
-rw-r--r--kstars/kstarsdata.cpp7
-rw-r--r--kstars/kstarsinit.cpp3
-rw-r--r--kstars/kstarslite.cpp9
-rw-r--r--kstars/kstarslite/qml/main.qml34
-rw-r--r--kstars/kstarslite/qml/modules/Splash.qml88
-rw-r--r--kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt1
-rw-r--r--kstars/kstarslite/qml/modules/images/hdpi/splash.pngbin0 -> 8834 bytes
-rw-r--r--kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt1
-rw-r--r--kstars/kstarslite/qml/modules/images/ldpi/splash.pngbin0 -> 8834 bytes
-rw-r--r--kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt1
-rw-r--r--kstars/kstarslite/qml/modules/images/mdpi/splash.pngbin0 -> 8834 bytes
-rw-r--r--kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt1
-rw-r--r--kstars/kstarslite/qml/modules/images/xhdpi/splash.pngbin0 -> 23830 bytes
-rw-r--r--kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt1
-rw-r--r--kstars/kstarslite/qml/modules/images/xxhdpi/splash.pngbin0 -> 23830 bytes
-rw-r--r--kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt1
-rw-r--r--kstars/kstarslite/qml/modules/images/xxxhdpi/splash.pngbin0 -> 23830 bytes
-rw-r--r--kstars/kstarssplash.cpp4
-rw-r--r--kstars/main.cpp94
-rw-r--r--kstars/options/opscolors.cpp3
-rw-r--r--kstars/printing/printingwizard.cpp3
-rw-r--r--kstars/skycomponents/asteroidscomponent.cpp13
-rw-r--r--kstars/skycomponents/cometscomponent.cpp9
-rw-r--r--kstars/skycomponents/constellationartcomponent.cpp3
-rw-r--r--kstars/skycomponents/deepskycomponent.cpp3
-rw-r--r--kstars/skycomponents/flagcomponent.cpp3
-rw-r--r--kstars/skycomponents/linelistindex.cpp1
-rw-r--r--kstars/skycomponents/skymapcomposite.cpp4
-rw-r--r--kstars/skycomponents/supernovaecomponent.cpp5
-rw-r--r--kstars/skymaplite.cpp3
-rw-r--r--kstars/skymaplite.h5
-rw-r--r--kstars/skymaplitevents.cpp261
-rw-r--r--kstars/texturemanager.cpp10
-rw-r--r--kstars/tools/observinglist.cpp4
-rw-r--r--kstars/tools/scriptbuilder.cpp3
-rw-r--r--kstars/tools/whatsinteresting/wiview.cpp3
-rw-r--r--kstars/widgets/mapcanvas.cpp4
60 files changed, 464 insertions, 241 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6e5bf29..f32798e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,6 +19,7 @@ set(CMAKE_AUTOMOC ON)
if(CMAKE_SYSTEM_NAME STREQUAL Android)
add_definitions(-DANDROID )
+ set(ANDROID TRUE)
endif()
find_package(ECM 1.7.0 REQUIRED NO_MODULE)
@@ -30,7 +31,6 @@ find_package(Qt5 5.4 REQUIRED COMPONENTS Gui Qml Quick Xml Sql Svg Network Print
include(KDEInstallDirs)
if(NOT ANDROID)
- message("CHECK ANDROID DEFINITION")
#We get error "could not find main method" with this module
include(KDECompilerSettings NO_POLICY_SCOPE)
endif()
diff --git a/apk/res/drawable-hdpi/splash.xml b/apk/res/drawable-hdpi/splash.xml
index 26b3306..a1e5210 100644
--- a/apk/res/drawable-hdpi/splash.xml
+++ b/apk/res/drawable-hdpi/splash.xml
@@ -6,6 +6,6 @@
</shape>
</item>
<item>
- <bitmap android:src="@drawable/icon" android:gravity="center" />
+ <bitmap android:src="@drawable/splashicon" android:gravity="center" />
</item>
</layer-list>
diff --git a/apk/res/drawable-hdpi/splashicon.png b/apk/res/drawable-hdpi/splashicon.png
new file mode 100644
index 0000000..fccb40b
--- /dev/null
+++ b/apk/res/drawable-hdpi/splashicon.png
Binary files differ
diff --git a/apk/res/drawable-ldpi/splash.xml b/apk/res/drawable-ldpi/splash.xml
index 26b3306..a1e5210 100644
--- a/apk/res/drawable-ldpi/splash.xml
+++ b/apk/res/drawable-ldpi/splash.xml
@@ -6,6 +6,6 @@
</shape>
</item>
<item>
- <bitmap android:src="@drawable/icon" android:gravity="center" />
+ <bitmap android:src="@drawable/splashicon" android:gravity="center" />
</item>
</layer-list>
diff --git a/apk/res/drawable-mdpi/splash.xml b/apk/res/drawable-mdpi/splash.xml
index 26b3306..a1e5210 100644
--- a/apk/res/drawable-mdpi/splash.xml
+++ b/apk/res/drawable-mdpi/splash.xml
@@ -6,6 +6,6 @@
</shape>
</item>
<item>
- <bitmap android:src="@drawable/icon" android:gravity="center" />
+ <bitmap android:src="@drawable/splashicon" android:gravity="center" />
</item>
</layer-list>
diff --git a/apk/res/drawable-mdpi/splashicon.png b/apk/res/drawable-mdpi/splashicon.png
new file mode 100644
index 0000000..fccb40b
--- /dev/null
+++ b/apk/res/drawable-mdpi/splashicon.png
Binary files differ
diff --git a/apk/res/drawable-xhdpi/splash.xml b/apk/res/drawable-xhdpi/splash.xml
index 26b3306..a1e5210 100644
--- a/apk/res/drawable-xhdpi/splash.xml
+++ b/apk/res/drawable-xhdpi/splash.xml
@@ -6,6 +6,6 @@
</shape>
</item>
<item>
- <bitmap android:src="@drawable/icon" android:gravity="center" />
+ <bitmap android:src="@drawable/splashicon" android:gravity="center" />
</item>
</layer-list>
diff --git a/apk/res/drawable-xhdpi/splashicon.png b/apk/res/drawable-xhdpi/splashicon.png
new file mode 100644
index 0000000..6a8fa57
--- /dev/null
+++ b/apk/res/drawable-xhdpi/splashicon.png
Binary files differ
diff --git a/apk/res/drawable-xxhdpi/splash.xml b/apk/res/drawable-xxhdpi/splash.xml
index 26b3306..a1e5210 100644
--- a/apk/res/drawable-xxhdpi/splash.xml
+++ b/apk/res/drawable-xxhdpi/splash.xml
@@ -6,6 +6,6 @@
</shape>
</item>
<item>
- <bitmap android:src="@drawable/icon" android:gravity="center" />
+ <bitmap android:src="@drawable/splashicon" android:gravity="center" />
</item>
</layer-list>
diff --git a/apk/res/drawable-xxhdpi/splashicon.png b/apk/res/drawable-xxhdpi/splashicon.png
new file mode 100644
index 0000000..6a8fa57
--- /dev/null
+++ b/apk/res/drawable-xxhdpi/splashicon.png
Binary files differ
diff --git a/apk/res/drawable-xxxhdpi/splash.xml b/apk/res/drawable-xxxhdpi/splash.xml
index 26b3306..a1e5210 100644
--- a/apk/res/drawable-xxxhdpi/splash.xml
+++ b/apk/res/drawable-xxxhdpi/splash.xml
@@ -6,6 +6,6 @@
</shape>
</item>
<item>
- <bitmap android:src="@drawable/icon" android:gravity="center" />
+ <bitmap android:src="@drawable/splashicon" android:gravity="center" />
</item>
</layer-list>
diff --git a/apk/res/drawable-xxxhdpi/splashicon.png b/apk/res/drawable-xxxhdpi/splashicon.png
new file mode 100644
index 0000000..6a8fa57
--- /dev/null
+++ b/apk/res/drawable-xxxhdpi/splashicon.png
Binary files differ
diff --git a/datahandlers/catalogdb.cpp b/datahandlers/catalogdb.cpp
index 5b12a4d..e6016da 100644
--- a/datahandlers/catalogdb.cpp
+++ b/datahandlers/catalogdb.cpp
@@ -17,11 +17,12 @@
#include "catalogdb.h"
#include "kstars/version.h"
+#include "../kstars/auxiliary/kspaths.h"
bool CatalogDB::Initialize() {
skydb_ = QSqlDatabase::addDatabase("QSQLITE", "skydb");
- QString dbfile = QStandardPaths::locate(QStandardPaths::DataLocation, QString("skycomponents.sqlite"));
+ QString dbfile = KSPaths::locate(QStandardPaths::DataLocation, QString("skycomponents.sqlite"));
if (dbfile.isEmpty())
dbfile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QString("/skycomponents.sqlite");
diff --git a/kstars/CMakeLists.txt b/kstars/CMakeLists.txt
index 30d2fcb..16ad223 100644
--- a/kstars/CMakeLists.txt
+++ b/kstars/CMakeLists.txt
@@ -217,8 +217,7 @@ if(NOT BUILD_KSTARS_LITE)
)
if (${KF5_VERSION} VERSION_EQUAL 5.18.0 OR ${KF5_VERSION} VERSION_GREATER 5.18.0)
- set(libkstarstools_SRCS
- ${libkstarstools_SRCS}
+ LIST(APPEND libkstarstools_SRCS
tools/whatsinteresting/skyobjlistmodel.cpp
tools/whatsinteresting/wiview.cpp
tools/whatsinteresting/modelmanager.cpp
@@ -454,8 +453,7 @@ set(libkstarscomponents_SRCS
skycomponents/targetlistcomponent.cpp
)
if(NOT BUILD_KSTARS_LITE)
- set(libkstarscomponents_SRCS
- ${libkstarscomponents_SRCS}
+ LIST(APPEND libkstarscomponents_SRCS
skycomponents/notifyupdatesui.cpp
)
endif(NOT BUILD_KSTARS_LITE)
@@ -506,6 +504,7 @@ set(kstars_extra_SRCS
auxiliary/qcustomplot.cpp
auxiliary/profileinfo.cpp
auxiliary/filedownloader.cpp
+ auxiliary/kspaths.cpp
time/simclock.cpp
time/kstarsdatetime.cpp
time/timezonerule.cpp
@@ -517,8 +516,7 @@ set(kstars_extra_SRCS
)
if(NOT BUILD_KSTARS_LITE)
- set(kstars_extra_SRCS
- ${kstars_extra_SRCS}
+ LIST(APPEND kstars_extra_SRCS
auxiliary/imageviewer.cpp
auxiliary/thumbnailpicker.cpp
auxiliary/thumbnaileditor.cpp
diff --git a/kstars/auxiliary/binfilehelper.cpp b/kstars/auxiliary/binfilehelper.cpp
index 637e877..2a164c6 100644
--- a/kstars/auxiliary/binfilehelper.cpp
+++ b/kstars/auxiliary/binfilehelper.cpp
@@ -20,6 +20,7 @@
#include <QStandardPaths>
#include "byteorder.h"
+#include "auxiliary/kspaths.h"
class BinFileHelper;
@@ -53,7 +54,7 @@ void BinFileHelper::clearFields() {
}
bool BinFileHelper::testFileExists( const QString &fileName ) {
- QString FilePath = QStandardPaths::locate(QStandardPaths::DataLocation, fileName );
+ QString FilePath = KSPaths::locate(QStandardPaths::DataLocation, fileName );
QByteArray b = FilePath.toLatin1();
const char *filepath = b.data();
FILE *f = fopen(filepath, "rb");
@@ -66,7 +67,7 @@ bool BinFileHelper::testFileExists( const QString &fileName ) {
}
FILE *BinFileHelper::openFile(const QString &fileName) {
- QString FilePath = QStandardPaths::locate(QStandardPaths::DataLocation, fileName );
+ QString FilePath = KSPaths::locate(QStandardPaths::DataLocation, fileName );
init();
QByteArray b = FilePath.toLatin1();
const char *filepath = b.data();
diff --git a/kstars/auxiliary/ksfilereader.cpp b/kstars/auxiliary/ksfilereader.cpp
index 139552d..ec0db8d 100644
--- a/kstars/auxiliary/ksfilereader.cpp
+++ b/kstars/auxiliary/ksfilereader.cpp
@@ -90,7 +90,10 @@ void KSFileReader::showProgress()
//printf("%8d %8d %3d\n", m_curLine, m_totalLines, percent );
if ( percent > 100 ) percent = 100;
emit progressText( QString("%1 (%2%)").arg( m_label ).arg( percent ) );
+//#ifdef ANDROID
+// Can cause crashes on Android
qApp->processEvents();
+//#endif
}
diff --git a/kstars/auxiliary/ksfilereader.h b/kstars/auxiliary/ksfilereader.h
index 3c5300f..e48528b 100644
--- a/kstars/auxiliary/ksfilereader.h
+++ b/kstars/auxiliary/ksfilereader.h
@@ -94,7 +94,7 @@ public:
/** @short opens the file with full path fname and uses that
* file for the QTextStream. open() locates QStandardPaths::DataLocation behind the scenes,
* so passing fname such that
- * QString fname = QStandardPaths::locate(QStandardPaths::DataLocation, "file_name" );
+ * QString fname = KSPaths::locate(QStandardPaths::DataLocation, "file_name" );
* is equivalent
*
* @param fname full path to directory + name of the file to open
diff --git a/kstars/auxiliary/kspaths.cpp b/kstars/auxiliary/kspaths.cpp
new file mode 100644
index 0000000..4ef0988
--- /dev/null
+++ b/kstars/auxiliary/kspaths.cpp
@@ -0,0 +1,27 @@
+#include "auxiliary/kspaths.h"
+
+QString KSPaths::locate(QStandardPaths::StandardLocation location, const QString &fileName,
+ QStandardPaths::LocateOptions options) {
+#ifdef ANDROID
+ QString file = QStandardPaths::locate(location,fileName,options);
+ if(file.isEmpty()) {
+ file = "/data/data/org.kde.kstars/qt-reserved-files/share/kstars/" + fileName;
+ }
+ return file;
+#else
+ return QStandardPaths::locate(location,fileName,options);
+#endif
+}
+
+QStringList KSPaths::locateAll(QStandardPaths::StandardLocation location, const QString &fileName,
+ QStandardPaths::LocateOptions options) {
+#ifdef ANDROID
+ QStringList file = QStandardPaths::locateAll(location,fileName,options);
+ if(file.isEmpty()) {
+ file[0] = "/data/data/org.kde.kstars/qt-reserved-files/share/kstars/" + fileName;
+ }
+ return file;
+#else
+ return QStandardPaths::locateAll(location,fileName,options);
+#endif
+}
diff --git a/kstars/auxiliary/kspaths.h b/kstars/auxiliary/kspaths.h
new file mode 100644
index 0000000..3e0e8f3
--- /dev/null
+++ b/kstars/auxiliary/kspaths.h
@@ -0,0 +1,39 @@
+/** *************************************************************************
+ kspaths.h - K Desktop Planetarium
+ -------------------
+ begin : 20/05/2016
+ copyright : (C) 2016 by Artem Fedoskin
+ email : afedoskin3@gmail.com
+ ***************************************************************************/
+/** *************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef KSPATHS_H_
+#define KSPATHS_H_
+#include <QStandardPaths>
+
+/**
+ *@class KSPaths
+ *@short Wrapper for QStandardPaths with Android assets support
+ *The purpose of this class is to search for resources on some platforms with paths that are not
+ *provided by QStandardPaths (e.g. assets:/ on Android that).
+ *@author Artem Fedoskin
+ *@version 1.0
+ */
+
+class KSPaths
+{
+
+public:
+ static QString locate(QStandardPaths::StandardLocation location, const QString &fileName,
+ QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
+ static QStringList locateAll(QStandardPaths::StandardLocation, const QString &fileNames,
+ QStandardPaths::LocateOptions options = QStandardPaths::LocateFile);
+};
+#endif
diff --git a/kstars/auxiliary/ksuserdb.cpp b/kstars/auxiliary/ksuserdb.cpp
index 195dc79..9ade60b 100644
--- a/kstars/auxiliary/ksuserdb.cpp
+++ b/kstars/auxiliary/ksuserdb.cpp
@@ -61,7 +61,7 @@ bool KSUserDB::Initialize() {
version.setTable("Version");
version.select();
QSqlRecord record = version.record(0);
- qDebug() << " Verion string is " << record.value("Version").toString();
+ qDebug() << " Version string is " << record.value("Version").toString();
version.clear();
// If prior to 2.4.0 upgrade database for horizon table
@@ -112,7 +112,7 @@ bool KSUserDB::Initialize() {
}
}
}
- userdb_.close();
+ userdb_.close();
return true;
}
diff --git a/kstars/auxiliary/ksutils.cpp b/kstars/auxiliary/ksutils.cpp
index 616f597..a1e3cc5 100644
--- a/kstars/auxiliary/ksutils.cpp
+++ b/kstars/auxiliary/ksutils.cpp
@@ -27,12 +27,13 @@
#include <QStandardPaths>
#include <cmath>
+#include "auxiliary/kspaths.h"
namespace KSUtils {
bool openDataFile( QFile &file, const QString &s ) {
- QString FileName = QStandardPaths::locate(QStandardPaths::DataLocation, s );
+ QString FileName = KSPaths::locate(QStandardPaths::DataLocation, s );
if ( !FileName.isNull() ) {
file.setFileName( FileName );
return file.open( QIODevice::ReadOnly );
diff --git a/kstars/auxiliary/kswizard.cpp b/kstars/auxiliary/kswizard.cpp
index e72a6d5..486c45c 100644
--- a/kstars/auxiliary/kswizard.cpp
+++ b/kstars/auxiliary/kswizard.cpp
@@ -25,7 +25,7 @@
#include <kns3/downloaddialog.h>
#include <QStandardPaths>
-
+#include "kspaths.h"
#include "kstarsdata.h"
#include "geolocation.h"
#include "widgets/dmsbox.h"
@@ -83,11 +83,11 @@ KSWizard::KSWizard( QWidget *parent ) :
//Load images into banner frames.
QPixmap im;
- if( im.load(QStandardPaths::locate(QStandardPaths::DataLocation, "wzstars.png")) )
+ if( im.load(KSPaths::locate(QStandardPaths::DataLocation, "wzstars.png")) )
welcome->Banner->setPixmap( im );
- if( im.load(QStandardPaths::locate(QStandardPaths::DataLocation, "wzgeo.png")) )
+ if( im.load(KSPaths::locate(QStandardPaths::DataLocation, "wzgeo.png")) )
location->Banner->setPixmap( im );
- if( im.load(QStandardPaths::locate(QStandardPaths::DataLocation, "wzdownload.png")) )
+ if( im.load(KSPaths::locate(QStandardPaths::DataLocation, "wzdownload.png")) )
download->Banner->setPixmap( im );
//connect signals/slots
diff --git a/kstars/indi/drivermanager.cpp b/kstars/indi/drivermanager.cpp
index d78adf3..baff1af 100644
--- a/kstars/indi/drivermanager.cpp
+++ b/kstars/indi/drivermanager.cpp
@@ -855,7 +855,7 @@ bool DriverManager::readINDIHosts()
lastGroup = NULL;
- file.setFileName( QStandardPaths::locate(QStandardPaths::DataLocation, indiFile ) );
+ file.setFileName( KSPaths::locate(QStandardPaths::DataLocation, indiFile ) );
if ( file.fileName().isEmpty() || !file.open( QIODevice::ReadOnly ) )
return false;
diff --git a/kstars/kstarsdata.cpp b/kstars/kstarsdata.cpp
index 1b2e8d6..28d1cab 100644
--- a/kstars/kstarsdata.cpp
+++ b/kstars/kstarsdata.cpp
@@ -34,6 +34,7 @@
#include "ksutils.h"
#include "ksfilereader.h"
#include "ksnumbers.h"
+#include "auxiliary/kspaths.h"
#include "skyobjects/skyobject.h"
#include "skycomponents/supernovaecomponent.h"
#include "skycomponents/skymapcomposite.h"
@@ -170,8 +171,8 @@ bool KStarsData::initialize() {
//Initialize SkyMapComposite//
emit progressText(i18n("Loading sky objects" ) );
m_SkyComposite = new SkyMapComposite(0);
-
//Load Image URLs//
+
emit progressText( i18n("Loading Image URLs" ) );
if( !readURLData( "image_url.dat", 0 ) && !nonFatalErrorMessage( "image_url.dat" ) )
return false;
@@ -359,7 +360,7 @@ SkyObject* KStarsData::objectNamed( const QString &name ) {
bool KStarsData::readCityData()
{
QSqlDatabase citydb = QSqlDatabase::addDatabase("QSQLITE", "citydb");
- QString dbfile = QStandardPaths::locate(QStandardPaths::DataLocation, "citydb.sqlite");
+ QString dbfile = KSPaths::locate(QStandardPaths::DataLocation, "citydb.sqlite");
//QString dbfile = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QDir::separator() + "citydb.sqlite";
citydb.setDatabaseName(dbfile);
if (citydb.open() == false)
@@ -484,7 +485,7 @@ bool KStarsData::openUrlFile(const QString &urlfile, QFile & file) {
//Find global file(s) in findAllResources() list.
QFileInfo fi_local( file.fileName() );
- QStringList flist = QStandardPaths::locateAll(QStandardPaths::DataLocation, urlfile);
+ QStringList flist = KSPaths::locateAll(QStandardPaths::DataLocation, urlfile);
for ( int i=0; i< flist.size(); i++ ) {
if ( flist[i] != file.fileName() ) {
QFileInfo fi_global( flist[i] );
diff --git a/kstars/kstarsinit.cpp b/kstars/kstarsinit.cpp
index 94e24b7..39400bd 100644
--- a/kstars/kstarsinit.cpp
+++ b/kstars/kstarsinit.cpp
@@ -36,6 +36,7 @@
#include "fov.h"
#include "kstars.h"
#include "kstarsdata.h"
+#include "kspaths.h"
#include "skymap.h"
#include "projections/projector.h"
#include "skyobjects/skyobject.h"
@@ -329,7 +330,7 @@ void KStars::initActions() {
addColorMenuItem( i18n("&Moonless Night" ), "cs_moonless-night" );
//Add any user-defined color schemes:
- QFile file( QStandardPaths::locate(QStandardPaths::DataLocation, "colors.dat" ) ); //determine filename in local user KDE directory tree.
+ QFile file( KSPaths::locate(QStandardPaths::DataLocation, "colors.dat" ) ); //determine filename in local user KDE directory tree.
if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
while ( !stream.atEnd() ) {
diff --git a/kstars/kstarslite.cpp b/kstars/kstarslite.cpp
index 1bb0082..cb21bf7 100644
--- a/kstars/kstarslite.cpp
+++ b/kstars/kstarslite.cpp
@@ -19,6 +19,7 @@
#include "kstarsdata.h"
#include <QQmlContext>
#include <QApplication>
+#include "kspaths.h"
#include "Options.h"
#include "ksutils.h"
@@ -43,10 +44,9 @@ KStarsLite::KStarsLite( bool doSplash, bool startClock, const QString &startDate
m_Engine.rootContext()->setContextProperty("Options", Options::self());
- //Register SkyMapLite for use within QML
- qmlRegisterType<SkyMapLite>("skymaplite",1,0,"SkyMapLite");
- QString main = QStandardPaths::locate(QStandardPaths::AppDataLocation, "kstarslite/qml/main.qml");
- //QString main = QString(SOURCE_DIR) + "/kstars/kstarslite/qml/main.qml";
+ /*Register SkyMapLite for use within QML
+ qmlRegisterType<SkyMapLite>("skymaplite",1,0,"SkyMapLite");*/
+ QString main = KSPaths::locate(QStandardPaths::AppDataLocation, "kstarslite/qml/main.qml");
m_Engine.load(QUrl(main));
Q_ASSERT_X(m_Engine.rootObjects().size(),"loading root object of main.qml",
@@ -62,7 +62,6 @@ KStarsLite::KStarsLite( bool doSplash, bool startClock, const QString &startDate
/*SkyMapLite has to be loaded before KStarsData is initialized because SkyComponents derived classes
have to add SkyItems to the SkyMapLite*/
m_SkyMapLite = SkyMapLite::createInstance(skyMapLiteWrapper);
- m_SkyMapLite->update();
// Set pinstance to yourself
pinstance = this;
diff --git a/kstars/kstarslite/qml/main.qml b/kstars/kstarslite/qml/main.qml
index 5b3c1e5..6d99777 100644
--- a/kstars/kstarslite/qml/main.qml
+++ b/kstars/kstarslite/qml/main.qml
@@ -2,7 +2,6 @@ import QtQuick 2.4
import QtQuick.Window 2.2
import "modules"
import "constants" 1.0
-//import skymaplite 1.0
Window {
id: mainWindow
@@ -16,10 +15,14 @@ Window {
property int topMenuOrder: 0
Splash {
+ z:1
+ anchors.fill:parent
onTimeout: content.visible = true
}
- Item{
+ /*content is made Rectangle to allow z-index ordering
+ (for some reason it doesn't work with plain Item)*/
+ Rectangle {
id: content
anchors.fill: parent
visible: false
@@ -41,29 +44,6 @@ Window {
}
}
- /*Image {
- anchors.fill: parent
- z: skyMapOrder
- source: "modules/images/SkyMap.png"
- fillMode: Image.PreserveAspectCrop
-
- Connections {
- target: mainWindow
- onWidthChanged: {
- if (width > height) {
- source = "images/SkyMap-port.png"
- }
- else source = "images/SkyMap.png"
- }
- }
- }*/
-
- // The instance of SkyMapLite is reparanted to this item and fill it
-
- //SkyMapLite {
- //anchors.fill: parent
- //}
-
MouseArea {
property int posY
anchors {
@@ -168,10 +148,10 @@ Window {
MouseArea {
property int posY
anchors {
- left: parent.left
- right: parent.right
bottom: parent.bottom
+ horizontalCenter: parent.horizontalCenter
}
+ width: bottomMenu.width
height: parent.height *0.25
onPressed: {
diff --git a/kstars/kstarslite/qml/modules/Splash.qml b/kstars/kstarslite/qml/modules/Splash.qml
index 1ce2de8..7fa8612 100644
--- a/kstars/kstarslite/qml/modules/Splash.qml
+++ b/kstars/kstarslite/qml/modules/Splash.qml
@@ -2,59 +2,29 @@ import QtQuick 2.4
import QtQuick.Window 2.2
import "../constants"
-Item {
+//Rectangle - to allow z-index ordering (for some reason it doesn't work with plain Item)
+Rectangle {
id: splash
- //color: "transparent"
- //title: "Splash Window"
- //modality: Qt.ApplicationModal
- //flags: Qt.SplashScreen
signal timeout
-
- x: (Screen.width - splashImage.width) / 2
- y: (Screen.height - splashImage.height) / 2
-
- width: splashImage.width
- height: splashImage.height
-
- Timer {
- interval: 3500;
- running: true;
- onTriggered: {
- splash.timeout();
- visible = false
- }
- }
-
- Timer {
- id: progressText
- interval: 500
- running: true
- repeat: true
- }
+ state: "Inivisble"
Image {
id: splashImage
- source: "images/" + num.density + "/icons/icon.png"
+ source: "images/" + num.density + "/splash.png"
+ anchors.centerIn: parent
Text {
id: progress
- color: "#FFF"
-
- Connections {
- target: progressText
- onTriggered: {
- progress.text = progress.text + "a"
- }
- }
+ color: "#000"
anchors {
- top: parent.top
- left: parent.left
+ top: parent.bottom
+ horizontalCenter: parent.horizontalCenter
margins: 10
}
}
}
-/*
+
Connections {
target: KStarsData
onProgressText: {
@@ -65,12 +35,46 @@ Item {
Connections {
target: KStarsLite
onShowSplash: {
- visible = true
+ splash.state = "Visible"
}
onDataLoadFinished: {
- visible = false
splash.timeout()
+ splash.state = "Invisible"
+ }
+ }
+
+ states: [
+ State{
+ name: "Visible"
+ PropertyChanges{target: splash; opacity: 1.0}
+ PropertyChanges{target: splash; visible: true}
+ },
+ State{
+ name:"Invisible"
+ PropertyChanges{target: splash; opacity: 0.0}
+ PropertyChanges{target: splash; visible: false}
}
- }*/
+ ]
+
+ transitions: [
+ Transition {
+ from: "Visible"
+ to: "Invisible"
+
+ SequentialAnimation{
+ NumberAnimation {
+ target: splash
+ property: "opacity"
+ duration: 800
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ target: splash
+ property: "visible"
+ duration: 0
+ }
+ }
+ }
+ ]
}
diff --git a/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt
index d2cac7e..311d3cf 100644
--- a/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt
+++ b/kstars/kstarslite/qml/modules/images/hdpi/CMakeLists.txt
@@ -1,4 +1,5 @@
install( FILES arrow_down.png
arrow_up.png
+ splash.png
DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/hdpi )
add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/hdpi/splash.png b/kstars/kstarslite/qml/modules/images/hdpi/splash.png
new file mode 100644
index 0000000..fccb40b
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/hdpi/splash.png
Binary files differ
diff --git a/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt
index 640dcdb..22fb400 100644
--- a/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt
+++ b/kstars/kstarslite/qml/modules/images/ldpi/CMakeLists.txt
@@ -1,4 +1,5 @@
install( FILES arrow_down.png
arrow_up.png
+ splash.png
DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/ldpi )
add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/ldpi/splash.png b/kstars/kstarslite/qml/modules/images/ldpi/splash.png
new file mode 100644
index 0000000..fccb40b
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/ldpi/splash.png
Binary files differ
diff --git a/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt
index d9a8f97..1ece95e 100644
--- a/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt
+++ b/kstars/kstarslite/qml/modules/images/mdpi/CMakeLists.txt
@@ -1,4 +1,5 @@
install( FILES arrow_down.png
arrow_up.png
+ splash.png
DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/mdpi )
add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/mdpi/splash.png b/kstars/kstarslite/qml/modules/images/mdpi/splash.png
new file mode 100644
index 0000000..fccb40b
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/mdpi/splash.png
Binary files differ
diff --git a/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt
index e632760..dd0df1c 100644
--- a/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt
+++ b/kstars/kstarslite/qml/modules/images/xhdpi/CMakeLists.txt
@@ -1,4 +1,5 @@
install( FILES arrow_down.png
arrow_up.png
+ splash.png
DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xhdpi )
add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/xhdpi/splash.png b/kstars/kstarslite/qml/modules/images/xhdpi/splash.png
new file mode 100644
index 0000000..6a8fa57
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xhdpi/splash.png
Binary files differ
diff --git a/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt
index b702761..755b249 100644
--- a/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt
+++ b/kstars/kstarslite/qml/modules/images/xxhdpi/CMakeLists.txt
@@ -1,4 +1,5 @@
install( FILES arrow_down.png
arrow_up.png
+ splash.png
DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xxhdpi )
add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/xxhdpi/splash.png b/kstars/kstarslite/qml/modules/images/xxhdpi/splash.png
new file mode 100644
index 0000000..6a8fa57
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xxhdpi/splash.png
Binary files differ
diff --git a/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt b/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt
index 5810dcf..40eaec1 100644
--- a/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt
+++ b/kstars/kstarslite/qml/modules/images/xxxhdpi/CMakeLists.txt
@@ -1,4 +1,5 @@
install( FILES arrow_down.png
arrow_up.png
+ splash.png
DESTINATION ${KDE_INSTALL_DATADIR}/kstars/kstarslite/qml/modules/images/xxxhdpi )
add_subdirectory(icons)
diff --git a/kstars/kstarslite/qml/modules/images/xxxhdpi/splash.png b/kstars/kstarslite/qml/modules/images/xxxhdpi/splash.png
new file mode 100644
index 0000000..6a8fa57
--- /dev/null
+++ b/kstars/kstarslite/qml/modules/images/xxxhdpi/splash.png
Binary files differ
diff --git a/kstars/kstarssplash.cpp b/kstars/kstarssplash.cpp
index ac5ceb0..2be69ef 100644
--- a/kstars/kstarssplash.cpp
+++ b/kstars/kstarssplash.cpp
@@ -19,12 +19,12 @@
#include <KLocalizedString>
#include <QStandardPaths>
-
+#include "kspaths.h"
KStarsSplash::KStarsSplash(const QString& customMessage )
: QSplashScreen(QPixmap() )
{
- setPixmap(QStandardPaths::locate(QStandardPaths::DataLocation, "kstars.png"));
+ setPixmap(KSPaths::locate(QStandardPaths::DataLocation, "kstars.png"));
setMessage( customMessage.isEmpty() ?
i18n( "Welcome to KStars. Please stand by while loading..." ) :
customMessage);
diff --git a/kstars/main.cpp b/kstars/main.cpp
index 4fac9a1..1686a16 100644
--- a/kstars/main.cpp
+++ b/kstars/main.cpp
@@ -223,6 +223,100 @@ int main(int argc, char *argv[])
qWarning() << i18n( "Using CPU date/time instead." ) ;
datestring.clear();
}
+
+#else
+#ifdef ANDROID
+ Options::setAngularRulerColor("#ffffff");
+ Options::setArtificialHorizonColor("#c82828");
+ Options::setBoxBGColor("#223344");
+ Options::setBoxGrabColor("#ff0000v");
+ Options::setBoxTextColor("#ffffff");
+ Options::setCBoundColor("#333333");
+ Options::setCBoundHighColor("#555555");
+ Options::setCLineColor("#555555");
+ Options::setCNameColor("#aaaa77");
+ Options::setColorSchemeFile("classic.colors");
+ Options::setCompassColor("#ffffff");
+ //Options::setDEGuideError("#00a5ff");
+ //Options::setDSNameColor("#77aaaa");
+ //Options::setEclColor("#666633");
+ //Options::setEqColor("#ffffff");
+ Options::setEquatorialGridColor("#445566");
+ //Options::setHSTColor("#aa0000");
+ Options::setHorizontalGridColor("#55aa33");
+ //Options::setHorzColor("#55aa33");
+ Options::setICColor("#443399");
+ //Options::setMWColor("#112233");
+ //Options::setMessColor("#00ff00");
+ Options::setNGCColor("#006666");
+ //Options::setObsListColor("#ffff00");
+ //Options::setPNameColor("#aa7777");
+ Options::setPlanetTrailColor("#996633");
+ //Options::setRAGuideError("#00ff00");
+ //Options::setSNameColor("#77aaaa");
+ Options::setSatColor("#ff0000");
+ Options::setSatLabelColor("#640000");
+ Options::setSkyColor("#000022");
+ Options::setSolverFOVColor("#ffffff");
+ Options::setStarColorIntensity(4);
+ Options::setStarColorMode(0);
+ //Options::setStarHopRouteColor("#00ffff");
+ Options::setSupernovaColor("#ffa500");
+ //Options::setTargetColor("#88bb88");
+ Options::setUserLabelColor("#ffffff");
+ Options::setVisibleSatColor("#00ff00");
+
+ //[DownloadDialog Settings]
+ //Options::setHeight 768("440");
+ //Options::setWidth 1366("700");
+
+ //[GUI]
+ Options::setPositionFocusBox(QPoint(1155,0));
+ Options::setPositionGeoBox(QPoint(0,586));
+ Options::setRunStartupWizard("false");
+ Options::setWindowHeight(701);
+ Options::setWindowWidth(1366);
+
+ //[Location]
+ Options::setCityName("Saarbr├╝cken");
+ Options::setCountryName("Germany");
+ Options::setDST("EU");
+ Options::setLatitude(49.233333333333334);
+ Options::setLongitude(7);
+ Options::setTimeZone(1);
+
+ //[MainWindow]
+ /*Options::setHeight 768("709");
+ Options::setState("AAAA/wAAAAD9AAAAAQAAAAEAAAKAAAACb/wCAAAAAfsAAAAkAFcAaABhAHQAJwBzACAASQBuAHQAZQByAGUAcwB0AGkAbgBnAAAAADgAAAJvAAAAAAAAAAAAAAVWAAACYgAAAAQAAAAEAAAACAAAAAj8AAAAAQAAAAIAAAACAAAAGgBrAHMAdABhAHIAcwBUAG8AbwBsAEIAYQByAQAAAAD/////AAAAAAAAAAAAAAAWAHYAaQBlAHcAVABvAG8AbABCAGEAcgEAAAGT/////wAAAAAAAAAA");
+ Options::setToolBarsMovable("Disabled");
+ Options::setWidth 1366("1366");
+ Options::setWindow-Maximized 768x1366("true");*/
+
+ //[Satellites]
+ Options::setShowSatellites("true");
+
+ //[View]
+ Options::setAutoSelectGrid("false");
+ //Options::setFOVNames("
+ Options::setFocusDec(67.135635748539812);
+ Options::setFocusRA(9.0349369959032693);
+ Options::setRunClock(true);
+ Options::setShowCLines(false);
+ Options::setShowCNames(false);
+ Options::setShowEquatorialGrid(false);
+ Options::setShowGround(false);
+ Options::setShowPlanetImages(true);
+ Options::setShowSupernovae(true);
+ Options::setStarDensity(2);
+ Options::setZoomFactor(250);
+
+ //[WISettings]
+ //Options::setScopeListWidget("4294967295");
+
+ //[Xplanet]
+ Options::setXplanetBackgroundColorValue("#000000");
+ Options::setXplanetColor("#ff0000");
+#endif
#endif
// Create writable data dir if it does not exist
diff --git a/kstars/options/opscolors.cpp b/kstars/options/opscolors.cpp
index 1e4941b..b4be0f7 100644
--- a/kstars/options/opscolors.cpp
+++ b/kstars/options/opscolors.cpp
@@ -31,6 +31,7 @@
#include <KLocalizedString>
#include <KMessageBox>
+#include "kspaths.h"
#include "kstars.h"
#include "kstarsdata.h"
#include "skymap.h"
@@ -66,7 +67,7 @@ OpsColors::OpsColors()
QFile file;
QString line, schemeName, filename;
- file.setFileName( QStandardPaths::locate(QStandardPaths::DataLocation, "colors.dat" ) );
+ file.setFileName( KSPaths::locate(QStandardPaths::DataLocation, "colors.dat" ) );
if ( file.exists() && file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
diff --git a/kstars/printing/printingwizard.cpp b/kstars/printing/printingwizard.cpp
index 9730c10..510759d 100644
--- a/kstars/printing/printingwizard.cpp
+++ b/kstars/printing/printingwizard.cpp
@@ -40,6 +40,7 @@
#include "legend.h"
#include "shfovexporter.h"
#include "Options.h"
+#include "kspaths.h"
PWizWelcomeUI::PWizWelcomeUI(QWidget *parent) : QFrame(parent)
{
@@ -446,7 +447,7 @@ void PrintingWizard::setupWidgets()
// Set banner images for steps
QPixmap bannerImg;
- if(bannerImg.load(QStandardPaths::locate(QStandardPaths::DataLocation, "wzstars.png")))
+ if(bannerImg.load(KSPaths::locate(QStandardPaths::DataLocation, "wzstars.png")))
{
m_WizWelcomeUI->banner->setPixmap(bannerImg);
m_WizObjectSelectionUI->banner->setPixmap(bannerImg);
diff --git a/kstars/skycomponents/asteroidscomponent.cpp b/kstars/skycomponents/asteroidscomponent.cpp
index 239be9f..5f39478 100644
--- a/kstars/skycomponents/asteroidscomponent.cpp
+++ b/kstars/skycomponents/asteroidscomponent.cpp
@@ -42,6 +42,7 @@
#include "skyobjects/ksasteroid.h"
#include "kstarsdata.h"
#include "ksfilereader.h"
+#include "auxiliary/kspaths.h"
AsteroidsComponent::AsteroidsComponent(SolarSystemComposite *parent) : SolarSystemListComponent(parent)
{
@@ -95,12 +96,13 @@ void AsteroidsComponent::loadData()
emitProgressText( i18n("Loading asteroids") );
+#ifdef KSTARS_LITE
AsteroidsItem * asteroidsItem = SkyMapLite::Instance()->getAsteroidsItem();
-
+ asteroidsItem->clear();
+#endif
// Clear lists
m_ObjectList.clear();
objectNames( SkyObject::ASTEROID ).clear();
- asteroidsItem->clear();
QList< QPair<QString, KSParser::DataTypes> > sequence;
sequence.append(qMakePair(QString("full name"), KSParser::D_QSTRING));
@@ -127,8 +129,8 @@ void AsteroidsComponent::loadData()
sequence.append(qMakePair(QString("moid"), KSParser::D_DOUBLE));
sequence.append(qMakePair(QString("class"), KSParser::D_QSTRING));
- //QString file_name = QStandardPaths::locate( QStandardPaths::DataLocation, );
- QString file_name = QStandardPaths::locate(QStandardPaths::DataLocation, QString("asteroids.dat"));
+ //QString file_name = KSPaths::locate( QStandardPaths::DataLocation, );
+ QString file_name = KSPaths::locate(QStandardPaths::DataLocation, QString("asteroids.dat"));
KSParser asteroid_parser(file_name, '#', sequence);
QHash<QString, QVariant> row_content;
@@ -191,8 +193,9 @@ void AsteroidsComponent::loadData()
//new_asteroid->setAngularSize(0.005);
m_ObjectList.append(new_asteroid);
+#ifdef KSTARS_LITE
asteroidsItem->addAsteroid(new_asteroid);
-
+#endif
// Add name to the list of object names
objectNames(SkyObject::ASTEROID).append(name);
}
diff --git a/kstars/skycomponents/cometscomponent.cpp b/kstars/skycomponents/cometscomponent.cpp
index 4edefd4..c7ff887 100644
--- a/kstars/skycomponents/cometscomponent.cpp
+++ b/kstars/skycomponents/cometscomponent.cpp
@@ -32,6 +32,7 @@
#include "ksutils.h"
#include "kstarsdata.h"
#include "ksfilereader.h"
+#include "auxiliary/kspaths.h"
#ifndef KSTARS_LITE
#include "skymap.h"
#endif
@@ -89,11 +90,13 @@ void CometsComponent::loadData() {
long double JD;
float M1, M2, K1, K2, diameter, albedo, rot_period, period;
+#ifdef KSTARS_LITE
CometsItem * cometsItem = SkyMapLite::Instance()->getCometsItem();
+ cometsItem->clear();
+#endif
emitProgressText(i18n("Loading comets"));
objectNames(SkyObject::COMET).clear();
- cometsItem->clear();
QList< QPair<QString, KSParser::DataTypes> > sequence;
sequence.append(qMakePair(QString("full name"), KSParser::D_QSTRING));
@@ -118,7 +121,7 @@ void CometsComponent::loadData() {
sequence.append(qMakePair(QString("H"), KSParser::D_SKIP));
sequence.append(qMakePair(QString("G"), KSParser::D_SKIP));
- QString file_name = QStandardPaths::locate(QStandardPaths::DataLocation, QString("comets.dat") );
+ QString file_name = KSPaths::locate(QStandardPaths::DataLocation, QString("comets.dat") );
KSParser cometParser(file_name, '#', sequence);
QHash<QString, QVariant> row_content;
@@ -177,7 +180,9 @@ void CometsComponent::loadData() {
// Add *short* name to the list of object names
objectNames( SkyObject::COMET ).append( com->name() );
+#ifdef KSTARS_LITE
cometsItem->addComet(com);
+#endif
}
}
diff --git a/kstars/skycomponents/constellationartcomponent.cpp b/kstars/skycomponents/constellationartcomponent.cpp
index bd9296f..b4d5297 100644
--- a/kstars/skycomponents/constellationartcomponent.cpp
+++ b/kstars/skycomponents/constellationartcomponent.cpp
@@ -18,6 +18,7 @@
#include "constellationartcomponent.h"
#include "constellationsart.h"
#include "auxiliary/ksfilereader.h"
+#include "auxiliary/kspaths.h"
#ifndef KSTARS_LITE
#include "skymap.h"
#endif
@@ -41,7 +42,7 @@ ConstellationArtComponent::~ConstellationArtComponent()
void ConstellationArtComponent::loadData(){
QSqlDatabase skydb = QSqlDatabase::addDatabase("QSQLITE", "skycultures");
- QString dbfile = QStandardPaths::locate(QStandardPaths::DataLocation, "skycultures.sqlite");
+ QString dbfile = KSPaths::locate(QStandardPaths::DataLocation, "skycultures.sqlite");
skydb.setDatabaseName(dbfile);
if (skydb.open() == false)
diff --git a/kstars/skycomponents/deepskycomponent.cpp b/kstars/skycomponents/deepskycomponent.cpp
index 70e52de..a26f157 100644
--- a/kstars/skycomponents/deepskycomponent.cpp
+++ b/kstars/skycomponents/deepskycomponent.cpp
@@ -27,6 +27,7 @@
#include "dms.h"
#include "ksfilereader.h"
#include "kstarsdata.h"
+#include "auxiliary/kspaths.h"
#ifndef KSTARS_LITE
#include "skymap.h"
#endif
@@ -137,7 +138,7 @@ void DeepSkyComponent::loadData()
sequence.append(qMakePair(QString("Longname"),KSParser::D_QSTRING));
//No width to be appended for last sequence object
- QString file_name = QStandardPaths::locate(QStandardPaths::DataLocation, QString("ngcic.dat") );
+ QString file_name = KSPaths::locate(QStandardPaths::DataLocation, QString("ngcic.dat") );
KSParser deep_sky_parser(file_name, '#', sequence, widths);
deep_sky_parser.SetProgress( i18n("Loading NGC/IC objects"), 13444, 10 );
diff --git a/kstars/skycomponents/flagcomponent.cpp b/kstars/skycomponents/flagcomponent.cpp
index 06ab8e8..68bb091 100644
--- a/kstars/skycomponents/flagcomponent.cpp
+++ b/kstars/skycomponents/flagcomponent.cpp
@@ -35,6 +35,7 @@
#include "ksfilereader.h"
#include "skypainter.h"
#include "projections/projector.h"
+#include "auxiliary/kspaths.h"
FlagComponent::FlagComponent( SkyComposite *parent )
: PointListComponent(parent)
@@ -43,7 +44,7 @@ FlagComponent::FlagComponent( SkyComposite *parent )
m_Names.append( i18n( "No icon" ) );
m_Images.append( QImage() );
m_Names.append( i18n( "Default" ) );
- m_Images.append( QImage( QStandardPaths::locate(QStandardPaths::DataLocation, "defaultflag.gif" ) ));
+ m_Images.append( QImage( KSPaths::locate(QStandardPaths::DataLocation, "defaultflag.gif" ) ));
QDir appDir( QStandardPaths::writableLocation(QStandardPaths::DataLocation));
appDir.setNameFilters(QStringList() << "flag*");
diff --git a/kstars/skycomponents/linelistindex.cpp b/kstars/skycomponents/linelistindex.cpp
index f6ccad0..a7d7c85 100644
--- a/kstars/skycomponents/linelistindex.cpp
+++ b/kstars/skycomponents/linelistindex.cpp
@@ -242,7 +242,6 @@ void LineListIndex::drawFilled( SkyPainter *skyp )
void LineListIndex::intro()
{
emitProgressText( i18n( "Loading %1", m_name ));
-
if ( skyMesh()->debug() >= 1 )
qDebug() << QString("Loading %1 ...").arg( m_name );
}
diff --git a/kstars/skycomponents/skymapcomposite.cpp b/kstars/skycomponents/skymapcomposite.cpp
index 586225e..c745cbc 100644
--- a/kstars/skycomponents/skymapcomposite.cpp
+++ b/kstars/skycomponents/skymapcomposite.cpp
@@ -69,7 +69,6 @@ SkyMapComposite::SkyMapComposite(SkyComposite *parent ) :
SkyComposite(parent), m_reindexNum( J2000 )
{
m_skyLabeler = SkyLabeler::Instance();
-
m_skyMesh = SkyMesh::Create( 3 ); // level 5 mesh = 8192 trixels
m_skyMesh->debug( 0 );
// 1 => print "indexing ..."
@@ -635,7 +634,10 @@ bool SkyMapComposite::isLocalCNames() {
void SkyMapComposite::emitProgressText( const QString &message ) {
emit progressText( message );
+//#ifdef ANDROID
+//Can cause crashes on Android, investigate it
qApp->processEvents(); // -jbb: this seemed to make it work.
+//#endif
//qDebug() << QString("PROGRESS TEXT: %1\n").arg( message );
}
diff --git a/kstars/skycomponents/supernovaecomponent.cpp b/kstars/skycomponents/supernovaecomponent.cpp
index aa06892..4954b55 100644
--- a/kstars/skycomponents/supernovaecomponent.cpp
+++ b/kstars/skycomponents/supernovaecomponent.cpp
@@ -30,6 +30,7 @@
#include "ksfilereader.h"
#include "QStandardPaths"
#include "kstarsdata.h"
+#include "auxiliary/kspaths.h"
SupernovaeComponent::SupernovaeComponent(SkyComposite* parent): ListComponent(parent), m_Parser(0)
{
@@ -83,7 +84,7 @@ void SupernovaeComponent::loadData()
sequence.append(qMakePair(QString("ignore3"), KSParser::D_SKIP));
sequence.append(qMakePair(QString("discoverers"), KSParser::D_QSTRING));
- QString file_name = QStandardPaths::locate(QStandardPaths::DataLocation,
+ QString file_name = KSPaths::locate(QStandardPaths::DataLocation,
QString("supernovae.dat"));
KSParser snParser(file_name, '#', sequence);
@@ -231,7 +232,7 @@ void SupernovaeComponent::notifyNewSupernovae()
void SupernovaeComponent::slotTriggerDataFileUpdate()
{
QString output = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + QDir::separator() + "supernovae.dat";
- QString filename= QStandardPaths::locate(QStandardPaths::DataLocation, "scripts/supernova_updates_parser.py") ;
+ QString filename= KSPaths::locate(QStandardPaths::DataLocation, "scripts/supernova_updates_parser.py") ;
QStringList args;
args << filename << output;
//qDebug()<<filename;
diff --git a/kstars/skymaplite.cpp b/kstars/skymaplite.cpp
index 724e5da..fa00922 100644
--- a/kstars/skymaplite.cpp
+++ b/kstars/skymaplite.cpp
@@ -97,6 +97,9 @@ SkyMapLite::SkyMapLite(QQuickItem* parent)
connect(parent, &QQuickItem::widthChanged, this, &SkyMapLite::resizeItem);
connect(parent, &QQuickItem::heightChanged, this, &SkyMapLite::resizeItem);
+ resizeItem(); /* Set initial size. Without it on Android SkyMapLite is not displayed until screen
+ orientation is not changed */
+
//Initialize images for stars
initStarImages();
// Set pinstance to yourself
diff --git a/kstars/skymaplite.h b/kstars/skymaplite.h
index 8a83832..2ed936e 100644
--- a/kstars/skymaplite.h
+++ b/kstars/skymaplite.h
@@ -471,6 +471,11 @@ protected:
/** Zoom in and out with the mouse wheel. */
virtual void wheelEvent( QWheelEvent *e );
+ /**
+ * @short this function handles zooming in and out using "pinch to zoom" gesture
+ */
+ virtual void touchEvent( QTouchEvent *e);
+
/** If the skymap will be resized, the sky must be new computed. So this
* function calls explicitly new computing of the skymap.
*/
diff --git a/kstars/skymaplitevents.cpp b/kstars/skymaplitevents.cpp
index 97e1c7a..1f961cd 100644
--- a/kstars/skymaplitevents.cpp
+++ b/kstars/skymaplitevents.cpp
@@ -8,6 +8,121 @@
#include "skymapcomposite.h"
#include "ksutils.h"
+void SkyMapLite::mousePressEvent( QMouseEvent *e ) {
+ KStarsLite* kstars = KStarsLite::Instance();
+
+ /*if ( ( e->modifiers() & Qt::ControlModifier ) && (e->button() == Qt::LeftButton) ) {
+ ZoomRect.moveCenter( e->pos() );
+ setZoomMouseCursor();
+ update(); //refresh without redrawing skymap
+ return;
+ }*/
+
+ // if button is down and cursor is not moved set the move cursor after 500 ms
+ QTimer::singleShot(500, this, SLOT (setMouseMoveCursor()));
+
+ // break if point is unusable
+ if ( projector()->unusablePoint( e->pos() ) )
+ return;
+
+ if ( !midMouseButtonDown && e->button() == Qt::MidButton ) {
+ //y0 = 0.5*height() - e->y(); //record y pixel coordinate for middle-button zooming
+ midMouseButtonDown = true;
+ }
+
+ if ( !mouseButtonDown ) {
+ if ( e->button() == Qt::LeftButton ) {
+ mouseButtonDown = true;
+ }
+
+ //determine RA, Dec of mouse pointer
+ m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
+ setClickedPoint( &m_MousePoint );
+
+ //Find object nearest to clickedPoint()
+ double maxrad = 1000.0/Options::zoomFactor();
+ SkyObject* obj = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
+ setClickedObject( obj );
+ if( obj )
+ setClickedPoint( obj );
+
+ switch( e->button() ) {
+ case Qt::LeftButton:
+ {
+ QString name;
+ if( clickedObject() )
+ name = clickedObject()->translatedLongName();
+ else
+ name = i18n( "Empty sky" );
+ //kstars->statusBar()->changeItem(name, 0 );
+ //kstars->statusBar()->showMessage(name, 0 );
+
+ emit positionClicked(&m_MousePoint);
+ }
+
+ break;
+ case Qt::RightButton:
+ /*if( rulerMode ) {
+ // Compute angular distance.
+ slotEndRulerMode();
+ } else {*/
+ // Show popup menu
+ if( clickedObject() ) {
+ //clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
+ } else {
+ /* pmenu->createEmptyMenu( clickedPoint() );
+ pmenu->popup( QCursor::pos() );*/
+ }
+ //}
+ break;
+ default: ;
+ }
+ }
+}
+
+void SkyMapLite::mouseReleaseEvent( QMouseEvent * ) {
+ /*if ( ZoomRect.isValid() ) {
+ //stopTracking();
+ SkyPoint newcenter = projector()->fromScreen( ZoomRect.center(), data->lst(), data->geo()->lat() );
+ setFocus( &newcenter );
+ setDestination( newcenter );
+
+ //Zoom in on center of Zoom Circle, by a factor equal to the ratio
+ //of the sky pixmap's width to the Zoom Circle's diameter
+ float factor = float(width()) / float(ZoomRect.width());
+ setZoomFactor( Options::zoomFactor() * factor );
+ }*/
+ //setDefaultMouseCursor();
+ ZoomRect = QRect(); //invalidate ZoomRect
+
+ /*if(m_previewLegend) {
+ slotCancelLegendPreviewMode();
+ }*/
+
+ //false if double-clicked, because it's unset there.
+ if (mouseButtonDown) {
+ mouseButtonDown = false;
+ if ( slewing ) {
+ slewing = false;
+ if ( Options::useAltAz() )
+ setDestinationAltAz( focus()->alt(), focus()->az() );
+ else
+ setDestination( *focus() );
+ }
+ forceUpdate(); // is needed because after moving the sky not all stars are shown
+ }
+ // if middle button was pressed unset here
+ midMouseButtonDown = false;
+}
+
+void SkyMapLite::mouseDoubleClickEvent( QMouseEvent *e ) {
+ /*if ( e->button() == Qt::LeftButton && !projector()->unusablePoint( e->pos() ) ) {
+ mouseButtonDown = false;
+ if( e->x() != width()/2 || e->y() != height()/2 )
+ slotCenter();
+ }*/
+}
+
void SkyMapLite::mouseMoveEvent( QMouseEvent *e ) {
if ( Options::useHoverLabel() ) {
//Start a single-shot timer to monitor whether we are currently hovering.
@@ -105,13 +220,6 @@ void SkyMapLite::mouseMoveEvent( QMouseEvent *e ) {
}
}
-/*void SkyMapLite::wheelEvent( QWheelEvent *e ) {
- if ( e->delta() > 0 )
- zoomInOrMagStep ( e->modifiers() );
- else if ( e->delta() < 0 )
- zoomOutOrMagStep( e->modifiers() );
-}*/
-
void SkyMapLite::wheelEvent( QWheelEvent *e ) {
if ( e->delta() > 0 )
zoomInOrMagStep ( e->modifiers() );
@@ -119,122 +227,57 @@ void SkyMapLite::wheelEvent( QWheelEvent *e ) {
zoomOutOrMagStep( e->modifiers() );
}
-void SkyMapLite::mouseReleaseEvent( QMouseEvent * ) {
- /*if ( ZoomRect.isValid() ) {
- //stopTracking();
- SkyPoint newcenter = projector()->fromScreen( ZoomRect.center(), data->lst(), data->geo()->lat() );
- setFocus( &newcenter );
- setDestination( newcenter );
-
- //Zoom in on center of Zoom Circle, by a factor equal to the ratio
- //of the sky pixmap's width to the Zoom Circle's diameter
- float factor = float(width()) / float(ZoomRect.width());
- setZoomFactor( Options::zoomFactor() * factor );
- }*/
- //setDefaultMouseCursor();
- ZoomRect = QRect(); //invalidate ZoomRect
-
- /*if(m_previewLegend) {
- slotCancelLegendPreviewMode();
- }*/
+void SkyMapLite::touchEvent( QTouchEvent *e) {
+ //Under construction. Don't take this mess seriously
+ qDebug() << "TOUCH EVENT!";
- //false if double-clicked, because it's unset there.
- if (mouseButtonDown) {
- mouseButtonDown = false;
- if ( slewing ) {
- slewing = false;
- if ( Options::useAltAz() )
- setDestinationAltAz( focus()->alt(), focus()->az() );
- else
- setDestination( *focus() );
- }
- forceUpdate(); // is needed because after moving the sky not all stars are shown
- }
- // if middle button was pressed unset here
- midMouseButtonDown = false;
-}
+ QList<QTouchEvent::TouchPoint> points = e->touchPoints();
-void SkyMapLite::mousePressEvent( QMouseEvent *e ) {
- KStarsLite* kstars = KStarsLite::Instance();
+ QPointF newPoint = points[0].pos();
- /*if ( ( e->modifiers() & Qt::ControlModifier ) && (e->button() == Qt::LeftButton) ) {
- ZoomRect.moveCenter( e->pos() );
- setZoomMouseCursor();
- update(); //refresh without redrawing skymap
- return;
- }*/
+ if(points.length() >= 2) {
+ double xdiff = abs(points[1].pos().x() - points[0].pos().x());
+ double ydiff = abs(points[1].pos().y() - points[0].pos().y());
+ double xmax = points[1].pos().x() < points[0].pos().x() ? points[1].pos().x() : points[0].pos().x();
+ double ymax = points[1].pos().y() < points[0].pos().y() ? points[1].pos().y() : points[0].pos().y();
+ double md_new = xdiff + ydiff;
+ qDebug() << md_new << "MD NEW";
- // if button is down and cursor is not moved set the move cursor after 500 ms
- QTimer::singleShot(500, this, SLOT (setMouseMoveCursor()));
+ double xolddiff = abs(points[1].lastPos().x() - points[0].lastPos().x());
+ double yolddiff = abs(points[1].lastPos().y() - points[0].lastPos().y());
+ double md_old = xolddiff + yolddiff;
+ qDebug() << xolddiff + yolddiff << "MD OLD";
- // break if point is unusable
- if ( projector()->unusablePoint( e->pos() ) )
- return;
+ if(md_old - md_new < 0) zoomInOrMagStep(Qt::ControlModifier);
+ else if(md_old - md_new > 0) zoomOutOrMagStep(Qt::ControlModifier);
+ qDebug() << Options::showGround();
+ qDebug() << "NEW1" << points[0].pos() << "MID" << QPointF(xmax+ xdiff/2,ymax + ydiff/2) << "NEW2" << points[1].pos();
- if ( !midMouseButtonDown && e->button() == Qt::MidButton ) {
- //y0 = 0.5*height() - e->y(); //record y pixel coordinate for middle-button zooming
- midMouseButtonDown = true;
+ //newPoint = QPointF(xmax + xdiff/2,ymax + ydiff/2);
}
- if ( !mouseButtonDown ) {
- if ( e->button() == Qt::LeftButton ) {
- mouseButtonDown = true;
- }
-
- //determine RA, Dec of mouse pointer
- m_MousePoint = projector()->fromScreen( e->pos(), data->lst(), data->geo()->lat() );
- setClickedPoint( &m_MousePoint );
-
- //Find object nearest to clickedPoint()
- double maxrad = 1000.0/Options::zoomFactor();
- SkyObject* obj = data->skyComposite()->objectNearest( clickedPoint(), maxrad );
- setClickedObject( obj );
- if( obj )
- setClickedPoint( obj );
-
- switch( e->button() ) {
- case Qt::LeftButton:
- {
- QString name;
- if( clickedObject() )
- name = clickedObject()->translatedLongName();
+ //This is ugly but it reduces the amount of duplicate code
+ QMouseEvent *event = new QMouseEvent(QEvent::MouseButtonPress, newPoint,
+ Qt::LeftButton, Qt::LeftButton, Qt::ControlModifier);
+ mousePressEvent(event);
+ mouseMoveEvent(event);
+
+ if(e->type() == QEvent::TouchEnd) {
+ if (mouseButtonDown) {
+ mouseButtonDown = false;
+ if ( slewing ) {
+ slewing = false;
+ if ( Options::useAltAz() )
+ setDestinationAltAz( focus()->alt(), focus()->az() );
else
- name = i18n( "Empty sky" );
- //kstars->statusBar()->changeItem(name, 0 );
- //kstars->statusBar()->showMessage(name, 0 );
-
- emit positionClicked(&m_MousePoint);
+ setDestination( *focus() );
}
-
- break;
- case Qt::RightButton:
- /*if( rulerMode ) {
- // Compute angular distance.
- slotEndRulerMode();
- } else {*/
- // Show popup menu
- if( clickedObject() ) {
- //clickedObject()->showPopupMenu( pmenu, QCursor::pos() );
- } else {
- /* pmenu->createEmptyMenu( clickedPoint() );
- pmenu->popup( QCursor::pos() );*/
- }
- //}
- break;
- default: ;
+ //forceUpdate(); // is needed because after moving the sky not all stars are shown
}
}
+ delete event;
}
-void SkyMapLite::mouseDoubleClickEvent( QMouseEvent *e ) {
- /*if ( e->button() == Qt::LeftButton && !projector()->unusablePoint( e->pos() ) ) {
- mouseButtonDown = false;
- if( e->x() != width()/2 || e->y() != height()/2 )
- slotCenter();
- }*/
-}
-
-
double SkyMapLite::zoomFactor( const int modifier ) {
double factor = ( modifier & Qt::ControlModifier) ? DZOOM : 2.0;
if ( modifier & Qt::ShiftModifier )
diff --git a/kstars/texturemanager.cpp b/kstars/texturemanager.cpp
index eb3caaf..0094e29 100644
--- a/kstars/texturemanager.cpp
+++ b/kstars/texturemanager.cpp
@@ -27,7 +27,7 @@
#include "kstars.h"
#endif
-
+#include "auxiliary/kspaths.h"
#ifdef HAVE_OPENGL
# include <QGLWidget>
#endif
@@ -68,22 +68,22 @@ TextureManager::CacheIter TextureManager::findTexture(const QString& name)
return it;
} else {
// Try to load from file in 'textures' subdirectory
- QString filename = QStandardPaths::locate(QStandardPaths::DataLocation, QString("textures/%1.png").arg(name));
+ QString filename = KSPaths::locate(QStandardPaths::DataLocation, QString("textures/%1.png").arg(name));
if( !filename.isNull() ) {
return (TextureManager::CacheIter)m_p->m_textures.insert( name, QImage(filename,"PNG") );
} else {
//Try to load from the file in 'skycultures/western' subdirectory for western constellation art
- QString filename = QStandardPaths::locate(QStandardPaths::DataLocation, QString("skycultures/western/%1.png").arg(name));
+ QString filename = KSPaths::locate(QStandardPaths::DataLocation, QString("skycultures/western/%1.png").arg(name));
if( !filename.isNull() ) {
return (TextureManager::CacheIter)m_p->m_textures.insert( name, QImage(filename,"PNG") );
} else {
//Try to load from the file in 'skycultures/inuit' subdirectory for Inuit constellation art
- QString filename = QStandardPaths::locate(QStandardPaths::DataLocation, QString("skycultures/inuit/%1.png").arg(name));
+ QString filename = KSPaths::locate(QStandardPaths::DataLocation, QString("skycultures/inuit/%1.png").arg(name));
if( !filename.isNull() ) {
return (TextureManager::CacheIter)m_p->m_textures.insert( name, QImage(filename,"PNG") );
}else {
// Try to load from file in main data directory
- filename = QStandardPaths::locate(QStandardPaths::DataLocation, QString("%1.png").arg(name));
+ filename = KSPaths::locate(QStandardPaths::DataLocation, QString("%1.png").arg(name));
if( !filename.isNull() ) {
return (TextureManager::CacheIter)m_p->m_textures.insert( name, QImage(filename,"PNG") );
} else {
diff --git a/kstars/tools/observinglist.cpp b/kstars/tools/observinglist.cpp
index 787a01c..280d5c0 100644
--- a/kstars/tools/observinglist.cpp
+++ b/kstars/tools/observinglist.cpp
@@ -56,7 +56,7 @@
#include "indi/driverinfo.h"
#include "ekos/ekosmanager.h"
#endif
-
+#include "kspaths.h"
#include <KPlotting/KPlotAxis>
#include <KPlotting/KPlotObject>
#include <KMessageBox>
@@ -1188,7 +1188,7 @@ void ObservingList::setCurrentImage( const SkyObject *o ) {
QChar decsgn = ( (o->dec0().Degrees() < 0.0 ) ? '-' : '+' );
CurrentImage = CurrentImage.remove('+').remove('-') + decsgn;
}
- CurrentImagePath = QStandardPaths::locate( QStandardPaths::DataLocation , CurrentImage );
+ CurrentImagePath = KSPaths::locate( QStandardPaths::DataLocation , CurrentImage );
DSSUrl = KSDssDownloader::getDSSURL( o );
// QString UrlPrefix("http://casjobs.sdss.org/ImgCutoutDR6/getjpeg.aspx?"); // FIXME: Upgrade to use SDSS Data Release 9 / 10. DR6 is well outdated.
// QString UrlSuffix("&scale=1.0&width=600&height=600&opt=GST&query=SR(10,20)");
diff --git a/kstars/tools/scriptbuilder.cpp b/kstars/tools/scriptbuilder.cpp
index b8fad06..8c77351 100644
--- a/kstars/tools/scriptbuilder.cpp
+++ b/kstars/tools/scriptbuilder.cpp
@@ -34,6 +34,7 @@
#include <KIO/CopyJob>
#include <KJob>
+#include "kspaths.h"
#include "scriptfunction.h"
#include "kstars.h"
#include "kstarsdata.h"
@@ -712,7 +713,7 @@ void ScriptBuilder::initViewOptions() {
QFile file;
QString line;
- file.setFileName( QStandardPaths::locate(QStandardPaths::DataLocation, "colors.dat" ) ); //determine filename in local user KDE directory tree.
+ file.setFileName( KSPaths::locate(QStandardPaths::DataLocation, "colors.dat" ) ); //determine filename in local user KDE directory tree.
if ( file.open( QIODevice::ReadOnly ) ) {
QTextStream stream( &file );
diff --git a/kstars/tools/whatsinteresting/wiview.cpp b/kstars/tools/whatsinteresting/wiview.cpp
index fe33f9b..0e41c18 100644
--- a/kstars/tools/whatsinteresting/wiview.cpp
+++ b/kstars/tools/whatsinteresting/wiview.cpp
@@ -24,6 +24,7 @@
#include "skymap.h"
#include "dialogs/detaildialog.h"
#include <klocalizedcontext.h>
+#include "kspaths.h"
WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent), m_Obs(obs), m_CurCategorySelected(-1)
@@ -43,7 +44,7 @@ WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent), m_Obs(obs
///Use instead of KDeclarative
m_Ctxt->setContextObject(new KLocalizedContext(m_BaseView));
- m_BaseView->setSource(QStandardPaths::locate(QStandardPaths::AppDataLocation, "tools/whatsinteresting/qml/wiview.qml"));
+ m_BaseView->setSource(KSPaths::locate(QStandardPaths::AppDataLocation, "tools/whatsinteresting/qml/wiview.qml"));
m_BaseObj = m_BaseView->rootObject();
diff --git a/kstars/widgets/mapcanvas.cpp b/kstars/widgets/mapcanvas.cpp
index 79ad547..93abdd1 100644
--- a/kstars/widgets/mapcanvas.cpp
+++ b/kstars/widgets/mapcanvas.cpp
@@ -23,7 +23,7 @@
#include <QMouseEvent>
#include <QPaintEvent>
#include <QStandardPaths>
-
+#include "kspaths.h"
#include "dialogs/locationdialog.h"
@@ -36,7 +36,7 @@ MapCanvas::MapCanvas( QWidget *parent ) :
{
setAutoFillBackground( false );
- QString bgFile = QStandardPaths::locate(QStandardPaths::GenericDataLocation, "kstars/geomap.png" );
+ QString bgFile = KSPaths::locate(QStandardPaths::GenericDataLocation, "kstars/geomap.png" );
bgImage = new QPixmap( bgFile );
origin.setX( bgImage->width()/2 );