On 16 September 2017 at 22:12, Stefan Fuchs <[email protected]> wrote:
> Hi Lubomir,
>
> Am 16.09.2017 um 20:20 schrieb Lubomir I. Ivanov:
>
> On 16 September 2017 at 20:42, Stefan Fuchs <[email protected]> wrote:
>
> Lubomir was faster and confirms what I already typed into the mail:
> No, I didn't fix this. What is the case is that the missing private header
> file "qgeofiletilecache_p.h" is simply not existing when checking out
> version 5.5.1 of qtlocation. I checked out 5.6.0 now from git and there the
> file is available.
> So you're most probably right and Qt 5.6.0 is the minimum requirement for
> googlemaps plugin.
>
> Stefan, please try the attached patch.
>
> copy the patch in the googlemaps plugin directory and call this:
> $ git apply <name.patch>
> $ qmake
>
> No complaint but it has to be:
> cd build
> qmake
> "INCLUDEPATH=/home/stefan/Entwicklung/Subsurface/install-root/include/"
> ../googlemaps.pro
>
> Otherwise it won't find the downloaded private headers at all. Luckily even
> with my low experience I'm able to copy&paste things like this from build.sh
> ;-)
>
> $ make

ok, i see.

>
>
> if there are errors or any warnings, please report them.
>
> Unfortunately yes:

<snip>

> /home/stefan/Entwicklung/Subsurface/googlemaps/qgeotiledmappingmanagerenginegooglemaps.cpp:61:28:
> error: ‘QAbstractGeoTileCache’ has not been declared
>          m_cacheDirectory = QAbstractGeoTileCache::baseCacheDirectory() +
> QLatin1String("googlemaps");
>                             ^
> Makefile:590: die Regel für Ziel
> „.obj/qgeotiledmappingmanagerenginegooglemaps.o“ scheiterte
> make: *** [.obj/qgeotiledmappingmanagerenginegooglemaps.o] Fehler 1
>
>

attached is a updated patch to deal with the QAbstractGeoTileCache error.
please, re-try.

> Just again as a side note:
> I personally have no need to make it work with Qt 5.5.1. I can either even
> upgrade my Xubuntu to have a newer Qt directly from the distro or I'll try
> to install Qt 5.9.1 as option.
> Don't know if it's really worthwhile to make it work with Qt < 5.6
>

understood, well Qt 5.5.x support is "nice to have" for the map and
Subsurface, so we might as well try to make this work.

lubomir
--
diff --git a/qgeotiledmappingmanagerenginegooglemaps.cpp b/qgeotiledmappingmanagerenginegooglemaps.cpp
index ca1843d..6230e9e 100644
--- a/qgeotiledmappingmanagerenginegooglemaps.cpp
+++ b/qgeotiledmappingmanagerenginegooglemaps.cpp
@@ -3,7 +3,12 @@
 #include "qgeotiledmapgooglemaps.h"
 #include "qgeotilefetchergooglemaps.h"
 #include "QtLocation/private/qgeotilespec_p.h"
+#if QT_VERSION < QT_VERSION_CHECK(5,6,0)
+#include <QStandardPaths>
+#include "QtLocation/private/qgeotilecache_p.h"
+#else
 #include "QtLocation/private/qgeofiletilecache_p.h"
+#endif
 
 #include <QDebug>
 #include <QDir>
@@ -53,12 +58,21 @@ QGeoTiledMappingManagerEngineGooglemaps::QGeoTiledMappingManagerEngineGooglemaps
 
     if (parameters.contains(QStringLiteral("googlemaps.cachefolder")))
         m_cacheDirectory = parameters.value(QStringLiteral("googlemaps.cachefolder")).toString().toLatin1();
-    else
-        m_cacheDirectory = QAbstractGeoTileCache::baseCacheDirectory() + QLatin1String("googlemaps");
 
+    const int szCache = 100 * 1024 * 1024;
+#if QT_VERSION < QT_VERSION_CHECK(5,6,0)
+    if (m_cacheDirectory.isEmpty())
+        m_cacheDirectory = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation) + QLatin1String("googlemaps");
+    QGeoTileCache *tileCache = createTileCacheWithDir(m_cacheDirectory);
+    if (tileCache)
+        tileCache->setMaxDiskUsage(szCache);
+#else
+    if (m_cacheDirectory.isEmpty())
+        m_cacheDirectory = QAbstractGeoTileCache::baseCacheDirectory() + QLatin1String("googlemaps");
     QAbstractGeoTileCache *tileCache = new QGeoFileTileCache(m_cacheDirectory);
-    tileCache->setMaxDiskUsage(100 * 1024 * 1024);
+    tileCache->setMaxDiskUsage(szCache);
     setTileCache(tileCache);
+#endif
 
     *error = QGeoServiceProvider::NoError;
     errorString->clear();
_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to