[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -3,7 +3,7 @@
<service name="tar_git">
<param name="url">https://github.com/Karry/osmscout-sailfish.git</param>
<param name="branch">master</param>
- <param name="revision">v2.32</param>
+ <param name="revision">v2.33</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/AdminRegionInfo.h
^
|
@@ -1,70 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_ADMINREGIONINFO_H
-#define OSMSCOUT_CLIENT_QT_ADMINREGIONINFO_H
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2017 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <QObject>
-#include <QString>
-
-#include <memory>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-#include <osmscout/location/Location.h>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API AdminRegionInfo
-{
-public:
- QString database;
- osmscout::AdminRegionRef adminRegion;
- QString type; //!< adminRegion->object's type
- int adminLevel{-1};
-
-public:
- std::string name() const
- {
- return adminRegion->name;
- }
-
- QString qStringName() const
- {
- return QString::fromStdString(adminRegion->name);
- }
-
- std::string altName() const
- {
- return adminRegion->altName;
- }
-
- QString qStringAltName() const
- {
- return QString::fromStdString(adminRegion->altName);
- }
-};
-
-typedef std::shared_ptr<AdminRegionInfo> AdminRegionInfoRef;
-
-}
-
-#endif //OSMSCOUT_CLIENT_QT_ADMINREGIONINFO_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBJob.h
^
|
@@ -1,123 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_DBOPERATION_H
-#define OSMSCOUT_CLIENT_QT_DBOPERATION_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2017 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <QObject>
-#include <QHash>
-#include <QList>
-#include <QThread>
-#include <QReadWriteLock>
-#include <QMap>
-
-#include <osmscout/projection/MercatorProjection.h>
-
-#include <osmscout/db/BasemapDatabase.h>
-
-#include <osmscoutmap/DataTileCache.h>
-
-#include <osmscoutclient/DBInstance.h>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API DBJob : public QObject{
- Q_OBJECT
-
-protected:
- osmscout::BasemapDatabaseRef basemapDatabase; //!< Optional reference to the basemap db
- std::list<DBInstanceRef> databases; //!< borrowed databases
- QThread *thread; //!< job thread
-
-private:
- QReadLocker *locker; //!< db locker
-
-public:
- DBJob();
- ~DBJob() override;
-
- virtual void Run(const osmscout::BasemapDatabaseRef& basempaDatabase,
- const std::list<DBInstanceRef> &databases, QReadLocker *locker);
- virtual void Close();
-};
-
-class OSMSCOUT_CLIENT_QT_API DBLoadJob : public DBJob{
- Q_OBJECT
-
-private:
- bool closeOnFinish;
- osmscout::BreakerRef breaker;
- osmscout::MercatorProjection lookupProjection;
- osmscout::AreaSearchParameter searchParameter;
- QMap<QString,osmscout::MapService::CallbackId> callbacks;
-
- QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> allTiles;
- QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> loadingTiles;
- QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> loadedTiles;
-
-protected slots:
- void onTileStateChanged(QString dbPath,const osmscout::TileRef tile);
-
-signals:
- /**
- * This signal is not called in Job thread context!
- */
- void tileStateChanged(QString dbPath,const osmscout::TileRef tile);
-
- void databaseLoaded(QString dbPath,QList<osmscout::TileRef> tiles);
-
- void finished(QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> tiles);
-
-public:
- DBLoadJob(osmscout::MercatorProjection lookupProjection,
- unsigned long maximumAreaLevel,
- bool lowZoomOptimization,
- bool closeOnFinish=true);
- ~DBLoadJob() override;
-
- void Run(const osmscout::BasemapDatabaseRef& basempaDatabase,
- const std::list<DBInstanceRef> &databases,
- QReadLocker *locker) override;
- void Close() override;
-
- bool IsFinished() const;
- QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> GetAllTiles() const;
-
- /**
- * Add tile data to map data.
- *
- * @param dbPath
- * @param tiles
- * @param data
- * @return true on success
- * false when given db was not added to this job, or job was closed
- */
- bool AddTileDataToMapData(QString dbPath,
- const QList<osmscout::TileRef> &tiles,
- osmscout::MapData &data);
-};
-
-}
-
-#endif /* OSMSCOUT_CLIENT_QT_DBOPERATION_H */
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBThread.h
^
|
@@ -1,278 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_DBTHREAD_H
-#define OSMSCOUT_CLIENT_QT_DBTHREAD_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2010 Tim Teulings
- Copyright (C) 2016 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <QThread>
-#include <QObject>
-#include <QReadWriteLock>
-#include <QDir>
-
-#include <osmscout/db/BasemapDatabase.h>
-#include <osmscout/db/Database.h>
-
-#include <osmscout/location/LocationService.h>
-
-#include <osmscoutmap/MapService.h>
-
-#include <osmscoutclient/DBInstance.h>
-#include <osmscoutclient/Settings.h>
-
-#include <osmscoutclientqt/DBJob.h>
-#include <osmscoutclientqt/MapManager.h>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-struct MapViewStruct
-{
- osmscout::GeoCoord coord;
- osmscout::Bearing angle; // canvas clockwise
- osmscout::Magnification magnification;
- size_t width;
- size_t height;
- double dpi;
-};
-
-inline bool operator!=(const MapViewStruct &r1, const MapViewStruct &r2)
-{
- return r1.coord!=r2.coord ||
- r1.angle!=r2.angle ||
- r1.magnification!=r2.magnification ||
- r1.width!=r2.width ||
- r1.height!=r2.height ||
- r1.dpi!=r2.dpi;
-}
-
-/**
- * \ingroup QtAPI
- */
-struct DatabaseLoadedResponse
-{
- osmscout::GeoBox boundingBox;
-};
-
-/**
- * \ingroup QtAPI
- * \see DBThread::databaseCoverage
- */
-enum DatabaseCoverage{
- Outside = 0,
- Covered = 1,
- Intersects = 2,
-};
-
-/**
- * \ingroup QtAPI
- *
- * Central object that manage db instances (\ref DBInstance),
- * its map styles (there is one global map style now)
- * and provides simple thread-safe, asynchronous api for accessing it.
- *
- * DBThread is de facto singleton, that is created and accessible by OSMScoutQt.
- *
- * List of databases is protected by read-write lock. There may be multiple
- * readers at one time. DBThread warrants that none db will be closed
- * or modified (except thread-safe caches) when read lock is hold.
- * Databases may be accessed via \see RunJob or \see RunSynchronousJob methods.
- */
-class OSMSCOUT_CLIENT_QT_API DBThread : public QObject
-{
- friend class OSMScoutQt; // accessing to protected constructor
-
- Q_OBJECT
- Q_PROPERTY(QString stylesheetFilename READ GetStylesheetFilename NOTIFY stylesheetFilenameChanged)
-
-public:
- using SynchronousDBJob = std::function<void (const std::list<DBInstanceRef> &)>;
-
-signals:
- void initialisationFinished(const DatabaseLoadedResponse& response);
- void stylesheetFilenameChanged();
- void databaseLoadFinished(osmscout::GeoBox boundingBox);
- void styleErrorsChanged();
-
- void mapDpiSignal(double);
-
-public slots:
- void ToggleDaylight();
- void onMapDPIChange(double dpi);
- void SetStyleFlag(const QString &key, bool value);
- void ReloadStyle(const QString &suffix="");
- void LoadStyle(QString stylesheetFilename,
- std::unordered_map<std::string,bool> stylesheetFlags,
- const QString &suffix="");
- void Initialize();
- void onDatabaseListChanged(QList<QDir> databaseDirectories);
-
- /**
- * Flush all caches for db that was not used in recent idleMs
- */
- void FlushCaches(qint64 idleMs);
-
-private:
- QThread *backgroundThread;
- MapManagerRef mapManager;
- QString basemapLookupDirectory;
- SettingsRef settings;
-
- double mapDpi;
-
- mutable QReadWriteLock lock;
-
- osmscout::BasemapDatabaseParameter basemapDatabaseParameter;
- osmscout::BasemapDatabaseRef basemapDatabase;
- osmscout::DatabaseParameter databaseParameter;
- std::list<DBInstanceRef> databases;
-
- TypeConfigRef emptyTypeConfig; // type config just with special and custom poi types
- StyleConfigRef emptyStyleConfig;
-
- QString stylesheetFilename;
- QString iconDirectory;
- std::unordered_map<std::string,bool>
- stylesheetFlags;
- bool daylight;
-
- bool renderError;
- std::list<StyleError> styleErrors;
-
- std::vector<std::string> customPoiTypes;
-
- Slot<double> mapDpiSlot{
- [this](const double &d) {
- mapDpiSignal(d);
- }
- };
-
-protected:
-
- /**
- * Check if DBThread is initialized without acquire lock
- *
- * @return true if all databases are open
- */
- bool isInitializedInternal();
-
- /**
- * Load stylesheet for all databases, write lock needs to be hold
- *
- * @param stylesheetFilename
- * @param stylesheetFlags
- * @param suffix
- */
- void LoadStyleInternal(QString stylesheetFilename,
- std::unordered_map<std::string,bool> stylesheetFlags,
- const QString &suffix="");
-
- void registerCustomPoiTypes(TypeConfigRef typeConfig) const;
-
- StyleConfigRef makeStyleConfig(TypeConfigRef typeConfig, bool suppressWarnings=false) const;
-
-public:
- DBThread(QThread *backgroundThread,
- QString basemapLookupDirectory,
- QString iconDirectory,
- SettingsRef settings,
- MapManagerRef mapManager,
- const std::vector<std::string> &customPoiTypes);
-
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapManager.h
^
|
@@ -1,252 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_MAPMANAGER_H
-#define OSMSCOUT_CLIENT_QT_MAPMANAGER_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2016 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-#include <osmscoutclient/MapProvider.h>
-#include <osmscoutclient/Settings.h>
-
-#include <osmscoutclientqt/AvailableMapsModel.h>
-#include <osmscoutclientqt/FileDownloader.h>
-
-#include <QObject>
-#include <QStringList>
-#include <QList>
-#include <QDir>
-#include <QTimer>
-#include <QtGlobal>
-#include <QStorageInfo>
-
-namespace osmscout {
-
-/**
- * Utility class for downloading map db described by AvailableMapsModelMap
- * over http.
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API MapDownloadJob: public DownloadJob
-{
- Q_OBJECT
-
- AvailableMapsModelMap map;
-
-public:
- static const char* FILE_METADATA;
-
- MapDownloadJob(QNetworkAccessManager *webCtrl, AvailableMapsModelMap map, QDir target, bool replaceExisting);
-
- /**
- * Cancel downloading,
- * when db is not downloaded successfully, remove it from disk
- * (even already downloaded files).
- */
- ~MapDownloadJob() override;
-
- void start();
-
- QString getMapName() const
- {
- return map.getName();
- }
-
- QStringList getMapPath() const
- {
- return map.getPath();
- }
-
- uint64_t expectedSize() const override
- {
- return map.getSize();
- }
-};
-
-/**
- * Holder for map db metadata
- *
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API MapDirectory
-{
-public:
- MapDirectory() = default;
- explicit MapDirectory(QDir dir);
- ~MapDirectory() = default;
-
- MapDirectory(const MapDirectory &other) = default;
- MapDirectory &operator=(const MapDirectory &other) = default;
-
- MapDirectory(MapDirectory &&other) = default;
- MapDirectory &operator=(MapDirectory &&other) = default;
-
- QDir getDir() const
- {
- return dir;
- }
-
- static QStringList mandatoryFiles();
- static QStringList optionalFiles();
- static QStringList metadataFiles();
-
- /**
- * byte size of all db files on disk
- * @return
- */
- qint64 byteSize() const;
-
- /**
- * Delete complete db
- */
- bool deleteDatabase();
-
- /**
- * Check if directory contains all required files for osmscout db
- * @return true if all requirements met and directory may be used as db
- */
- bool isValid() const
- {
- return valid;
- }
-
- /**
- * Check if map directory contains metadata created by downloader
- * @return true if map directory contains metadata
- */
- bool hasMetadata() const
- {
- return metadata;
- }
-
- /**
- * Human readable name of the map. It is name of geographical region usually (eg: Germany, Czech Republic...).
- * Name is localised by server when it is downloading. When locale is changed later, name will remain
- * in its original locale.
- * @return map name
- */
- QString getName() const
- {
- return name;
- }
-
- /**
- * Logical path of the map, eg: europe/gemany; europe/czech-republic
- * @return
- */
- QStringList getPath() const
- {
- return path;
- }
-
- /**
- * Time of map import
- * @return
- */
- QDateTime getCreation() const
- {
- return creation;
- }
-
- int getVersion() const
- {
- return version;
- }
-
- bool operator<(const MapDirectory &o) const
- {
- if (getName() == o.getName()){
- return getDir().absolutePath() < o.getDir().absolutePath();
- }
- return getName() < o.getName();
- }
-
-private:
- QDir dir;
- bool valid{false};
- bool metadata{false};
- QString name;
- QStringList path;
- QDateTime creation;
- int version{0};
-};
-
-/**
- * Manager of map databases. It provide db lookup
- * (in databaseDirectories) and simple scheduler for downloading maps.
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API MapManager: public QObject
-{
- Q_OBJECT
-
-private:
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/POILookupModule.h
^
|
@@ -1,69 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_POILOOKUPSERVICE_H
-#define OSMSCOUT_CLIENT_QT_POILOOKUPSERVICE_H
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2018 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-#include <osmscoutclientqt/DBThread.h>
-#include <osmscoutclientqt/LocationEntry.h>
-
-#include <QObject>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API POILookupModule: public QObject
-{
- Q_OBJECT
-
-signals:
- void lookupAborted(int requestId);
- void lookupFinished(int requestId);
- void lookupResult(int requestId, QList<LocationEntry> locations);
-
-public slots:
- void lookupPOIRequest(int requestId,
- osmscout::BreakerRef breaker,
- osmscout::GeoCoord searchCenter,
- QStringList types,
- double maxDistance);
-
-private:
- QThread *thread;
- DBThreadRef dbThread;
-
-public:
- POILookupModule(QThread *thread,DBThreadRef dbThread);
-
- ~POILookupModule() override;
-
-private:
- QList<LocationEntry> doPOIlookup(DBInstanceRef db,
- osmscout::GeoBox searchBoundingBox,
- osmscout::BreakerRef breaker,
- QStringList types);
-
-};
-
-}
-
-#endif //OSMSCOUT_CLIENT_QT_POILOOKUPSERVICE_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBJob.cpp
^
|
@@ -1,240 +0,0 @@
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2017 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <QDebug>
-#include <osmscoutclientqt/DBJob.h>
-
-namespace osmscout {
-
-DBJob::DBJob():
- QObject(),
- thread(QThread::currentThread()),
- locker(nullptr)
-{
-}
-
-DBJob::~DBJob()
-{
- if (thread!=QThread::currentThread()){
- qWarning() << "Destroy" << this << "from non Job thread" << thread << " in " << QThread::currentThread();
- }
- Close();
-}
-
-void DBJob::Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
- const std::list<DBInstanceRef> &databases,
- QReadLocker *locker)
-{
- if (thread!=QThread::currentThread()){
- qWarning() << "Run" << this << "from non Job thread" << thread << " in " << QThread::currentThread();
- }
- this->basemapDatabase=basemapDatabase;
- this->databases=databases;
- this->locker=locker;
-}
-
-void DBJob::Close()
-{
- if (locker==nullptr){
- return;
- }
- if (thread!=QThread::currentThread()){
- qWarning() << "Closing" << this << "from non Job thread" << thread << " in " << QThread::currentThread();
- }
- delete locker;
- locker=nullptr;
- databases.clear();
-}
-
-DBLoadJob::DBLoadJob(osmscout::MercatorProjection lookupProjection,
- unsigned long maximumAreaLevel,
- bool lowZoomOptimization,
- bool closeOnFinish):
- DBJob(),
- closeOnFinish(closeOnFinish),
- breaker(std::make_shared<ThreadedBreaker>()),
- lookupProjection(lookupProjection)
-{
- //qDebug() << "create: " << this << " in " << QThread::currentThread();
-
- searchParameter.SetMaximumAreaLevel(maximumAreaLevel);
- searchParameter.SetUseMultithreading(true);
- searchParameter.SetUseLowZoomOptimization(lowZoomOptimization);
- searchParameter.SetBreaker(breaker);
-
- connect(this, &DBLoadJob::tileStateChanged,
- this, &DBLoadJob::onTileStateChanged,
- Qt::QueuedConnection);
-}
-
-DBLoadJob::~DBLoadJob()
-{
- //qDebug() << "destroying:" << this << "in" << QThread::currentThread();
-
- // we have to call Close from ~DBLoadJob
- // it (DBLoadJob::Close) is unreachable when ~DBJob is called
- Close();
- //qDebug() << "destroyed:" << this << "in" << QThread::currentThread();
-}
-
-void DBLoadJob::Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
- const std::list<DBInstanceRef> &databases,
- QReadLocker *locker)
-{
- osmscout::GeoBox lookupBox(lookupProjection.GetDimensions());
- std::list<DBInstanceRef> relevantDatabases;
- for (const auto &db:databases){
- if (!db->IsOpen() || (!db->GetStyleConfig())) {
- log.Warn() << "Database is not ready" << db->path;
- continue;
- }
- osmscout::GeoBox dbBox=db->GetDBGeoBox();
- if (!dbBox.Intersects(lookupBox)){
- log.Debug() << "Skip db" << db->path;
- continue;
- }
- relevantDatabases.push_back(db);
- }
-
- DBJob::Run(basemapDatabase,relevantDatabases,locker);
- for (auto &db:relevantDatabases){
- std::list<osmscout::TileRef> tiles;
- db->GetMapService()->LookupTiles(lookupProjection,tiles);
-
- QString path=QString::fromStdString(db->path);
- osmscout::MapService::TileStateCallback callback=[this,path](const osmscout::TileRef& tile) {
- //std::cout << "callback called for job: " << this << std::endl;
- emit tileStateChanged(path,tile);
- };
-
- osmscout::MapService::CallbackId callbackId=db->GetMapService()->RegisterTileStateCallback(callback);
- //std::cout << "callback registered for job: " << this << " " << db->path.toStdString() << ": " << callbackId << std::endl ;
- callbacks[path]=callbackId;
- loadedTiles[path]=QMap<osmscout::TileKey,osmscout::TileRef>();
- QMap<osmscout::TileKey,osmscout::TileRef> tileMap;
- for (const auto &tile:tiles){
- tileMap[tile->GetKey()]=tile;
- }
- allTiles[path]=tileMap;
- loadingTiles[path]=tileMap;
-
- // load tiles asynchronous
- db->GetMapService()->LoadMissingTileDataAsync(searchParameter,
- *db->GetStyleConfig(),
- tiles);
-
- // process already completed tiles (state callback is not called in such case)
- for (auto &tile:tiles){
- if (tile->IsComplete()){
- emit tileStateChanged(path,tile);
- }
- }
-
- }
- if (relevantDatabases.empty()){
- emit finished(loadedTiles);
- //qDebug() << "Loaded completely (no relevant databases):" << this << "in" << QThread::currentThread();
- if (closeOnFinish){
- Close();
- }
- }
-}
-
-void DBLoadJob::onTileStateChanged(QString dbPath,const osmscout::TileRef tile)
-{
- if (!tile->IsComplete()){
- return; // ignore incomplete
- }
- // qDebug() << "Callback:" << this << "in" << QThread::currentThread();
- if (thread!=QThread::currentThread()){
- qWarning() << "Tile callback" << this << "from non Job thread" << thread << " in " << QThread::currentThread();
- }
- if (!loadingTiles.contains(dbPath)){
- return; // loaded already
- }
-
- QMap<osmscout::TileKey,osmscout::TileRef> &loadingTileMap=loadingTiles[dbPath];
- auto tileIt=loadingTileMap.find(tile->GetKey());
- if (tileIt==loadingTileMap.end()){
- return; // not our request, ignore
- }
-
- // mark as complete
- QMap<osmscout::TileKey,osmscout::TileRef> &loadedTileMap=loadedTiles[dbPath];
- loadedTileMap[tile->GetKey()]=tileIt.value();
- loadingTileMap.remove(tile->GetKey());
-
- if (loadingTileMap.isEmpty()){ // this db is finished
- loadingTiles.remove(dbPath);
- emit databaseLoaded(dbPath,loadedTileMap.values());
- if (loadingTiles.isEmpty()){ // all databases are finished
- emit finished(loadedTiles);
- //qDebug() << "Loaded completely:" << this << "in" << QThread::currentThread();
- if (closeOnFinish){
- Close();
- }
- }
- }
-}
-
-void DBLoadJob::Close()
-{
- // stop asynchronous loading if it is still running
- breaker->Break();
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBThread.cpp
^
|
@@ -1,501 +0,0 @@
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2010 Tim Teulings
- Copyright (C) 2016 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <osmscoutmap/MapService.h>
-
-#include <osmscoutclientqt/DBThread.h>
-#include <osmscoutclientqt/private/Config.h>
-#include <osmscoutclientqt/MapManager.h>
-
-#ifdef OSMSCOUT_HAVE_LIB_MARISA
-#include <osmscout/db/TextSearchIndex.h>
-#endif
-
-#include <osmscout/log/Logger.h>
-
-namespace osmscout {
-
-DBThread::DBThread(QThread *backgroundThread,
- QString basemapLookupDirectory,
- QString iconDirectory,
- SettingsRef settings,
- MapManagerRef mapManager,
- const std::vector<std::string> &customPoiTypes)
- : backgroundThread(backgroundThread),
- mapManager(mapManager),
- basemapLookupDirectory(basemapLookupDirectory),
- settings(settings),
- mapDpi(-1),
- lock(QReadWriteLock::Recursive),
- iconDirectory(iconDirectory),
- daylight(true),
- customPoiTypes(customPoiTypes)
-{
- double physicalDpi = settings->GetPhysicalDPI();
- osmscout::log.Debug() << "Reported screen DPI: " << physicalDpi;
- mapDpi = settings->GetMapDPI();
- osmscout::log.Debug() << "Map DPI override: " << mapDpi;
-
- stylesheetFilename=QString::fromStdString(settings->GetStyleSheetAbsoluteFile());
- stylesheetFlags=settings->GetStyleSheetFlags();
- osmscout::log.Debug() << "Using stylesheet: " << stylesheetFilename.toStdString();
-
- emptyTypeConfig=std::make_shared<TypeConfig>();
- registerCustomPoiTypes(emptyTypeConfig);
- emptyStyleConfig=makeStyleConfig(emptyTypeConfig, true);
-
- settings->mapDPIChange.Connect(mapDpiSlot);
- connect(this, &DBThread::mapDpiSignal,
- this, &DBThread::onMapDPIChange,
- Qt::QueuedConnection);
-
- connect(mapManager.get(), &MapManager::databaseListChanged,
- this, &DBThread::onDatabaseListChanged,
- Qt::QueuedConnection);
-}
-
-DBThread::~DBThread()
-{
- QWriteLocker locker(&lock);
- osmscout::log.Debug() << "DBThread::~DBThread()";
-
- mapDpiSlot.Disconnect();
-
- if (basemapDatabase) {
- basemapDatabase->Close();
- basemapDatabase=nullptr;
- }
-
- for (auto& db:databases){
- db->Close();
- }
- databases.clear();
- backgroundThread->quit(); // deleteLater() is invoked when thread is finished
-}
-
-bool DBThread::isInitializedInternal()
-{
- return std::all_of(databases.begin(), databases.end(),
- [](const auto &db) { return db->IsOpen(); });
-}
-
-bool DBThread::isInitialized()
-{
- QReadLocker locker(&lock);
- return isInitializedInternal();
-}
-
-double DBThread::GetMapDpi() const
-{
- return mapDpi;
-}
-
-double DBThread::GetPhysicalDpi() const
-{
- return settings->GetPhysicalDPI();
-}
-
-const DatabaseLoadedResponse DBThread::loadedResponse() const {
- QReadLocker locker(&lock);
- DatabaseLoadedResponse response;
- for (const auto& db:databases){
- response.boundingBox.Include(db->GetDBGeoBox());
- }
- return response;
-}
-
-DatabaseCoverage DBThread::databaseCoverage(const osmscout::Magnification &magnification,
- const osmscout::GeoBox &bbox)
-{
- QReadLocker locker(&lock);
-
- osmscout::GeoBox boundingBox;
- for (const auto &db:databases){
- boundingBox.Include(db->GetDBGeoBox());
- }
- if (boundingBox.IsValid()) {
- /*
- qDebug() << "Database bounding box: " <<
- QString::fromStdString( boundingBox.GetDisplayText()) <<
- " test bounding box: " <<
- QString::fromStdString( tileBoundingBox.GetDisplayText() );
- */
-
- if (boundingBox.Includes(bbox.GetMinCoord()) &&
- boundingBox.Includes(bbox.GetMaxCoord())) {
-
- // test if some db has full coverage for this box
- bool fullCoverage=false;
- for (const auto &db:databases){
- std::list<osmscout::GroundTile> groundTiles;
- if (!db->GetMapService()->GetGroundTiles(bbox,magnification,groundTiles)){
- break;
- }
- bool mayContainsUnknown=false;
- for (const auto &tile:groundTiles){
- if (tile.type==osmscout::GroundTile::unknown ||
- tile.type==osmscout::GroundTile::coast){
- mayContainsUnknown=true;
- break;
- }
- }
- if (!mayContainsUnknown){
- fullCoverage=true;
- break;
- }
- }
-
- return fullCoverage? DatabaseCoverage::Covered: DatabaseCoverage::Intersects;
- }
- if (boundingBox.Intersects(bbox)){
- return DatabaseCoverage::Intersects;
- }
- }
- return DatabaseCoverage::Outside;
-}
-
-void DBThread::Initialize()
-{
- QReadLocker locker(&lock);
- mapManager->lookupDatabases();
-}
-
-void DBThread::onDatabaseListChanged(QList<QDir> databaseDirectories)
-{
- QWriteLocker locker(&lock);
-
- if (basemapDatabase) {
- basemapDatabase->Close();
- basemapDatabase=nullptr;
- }
-
- for (const auto& db:databases){
- db->Close();
- }
- databases.clear();
- osmscout::GeoBox boundingBox;
-
-#if defined(HAVE_MMAP)
- if (sizeof(void*)<=4){
- // we are on 32 bit system probably, we have to be careful with mmap
- qint64 mmapQuota=1.5 * (1<<30); // 1.5 GiB
- QStringList mmapFiles;
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapManager.cpp
^
|
@@ -1,346 +0,0 @@
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2016 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <QDirIterator>
-#include <QDebug>
-#include <QJsonDocument>
-#include <QJsonArray>
-#include <QJsonObject>
-
-#include <osmscoutclientqt/MapManager.h>
-#include <osmscoutclientqt/PersistentCookieJar.h>
-
-#include <osmscout/TypeConfig.h>
-#include <osmscout/log/Logger.h>
-
-namespace osmscout {
-
-const char* MapDownloadJob::FILE_METADATA = "metadata.json";
-
-MapDownloadJob::MapDownloadJob(QNetworkAccessManager *webCtrl,
- AvailableMapsModelMap map,
- QDir target,
- bool replaceExisting):
- DownloadJob(webCtrl, target, replaceExisting),
- map(map)
-{
-}
-
-MapDownloadJob::~MapDownloadJob()
-{
- if (started && !successful){
- // delete partial db
- clearJobs(); // need to remove temporary files before deleting db directory
- MapDirectory dir(target);
- dir.deleteDatabase();
- }
-}
-
-void MapDownloadJob::start()
-{
- if (target.exists()){
- MapDirectory mapDir(target);
- if (mapDir.hasMetadata() &&
- !mapDir.isValid() &&
- mapDir.getPath() == map.getPath() &&
- mapDir.getCreation() == map.getCreation()) {
- // directory contains partial download
- // (contains downloader metadata, but not all required files)
- // TODO: continue partial download
- }
- qWarning() << "Directory already exists"<<target.canonicalPath()<<"!";
- onJobFailed("Directory already exists", false);
- return;
- }
-
- if (!target.mkpath(target.path())) {
- qWarning() << "Can't create directory" << target.canonicalPath() << "!";
- onJobFailed("Can't create directory", false);
- return;
- }
-
- started=true;
- QStorageInfo storage=QStorageInfo(target);
- if (storage.bytesAvailable() > 0 && (uint64_t)storage.bytesAvailable() < map.getSize()){
- qWarning() << "Free space" << storage.bytesAvailable() << "bytes is less than map size (" << map.getSize() << ")!";
- onJobFailed("Not enough space", false);
- return;
- }
-
- QJsonObject mapMetadata;
- mapMetadata["name"] = map.getName();
- mapMetadata["map"] = map.getPath().join("/");
- mapMetadata["version"] = map.getVersion();
-#if QT_VERSION > QT_VERSION_CHECK(5, 8, 0) /* For compatibility with QT 5.6 */
- mapMetadata["creation"] = (double)map.getCreation().toSecsSinceEpoch();
-#else
- mapMetadata["creation"] = (double)map.getCreation().toTime_t();
-#endif
-
- QJsonDocument doc(mapMetadata);
- QFile metadataFile(target.filePath(FILE_METADATA));
- metadataFile.open(QFile::OpenModeFlag::WriteOnly);
- metadataFile.write(doc.toJson());
- metadataFile.close();
- if (metadataFile.error() != QFile::FileError::NoError){
- done = true;
- error = metadataFile.errorString();
- emit failed(metadataFile.errorString());
- return;
- }
-
- QStringList fileNames = MapDirectory::optionalFiles() + MapDirectory::mandatoryFiles();
-
- DownloadJob::start(QString::fromStdString(map.getProvider().getUri())+"/"+map.getServerDirectory(), fileNames);
-}
-
-MapDirectory::MapDirectory(QDir dir):
- dir(dir)
-{
- QStringList fileNames = mandatoryFiles();
- // coverage.idx is optional, introduced after database version 16
- // router.idx is optional, it was removed with database version 17
- // route.dat, arearoute.idx are optional, introduced with database version 21
-
- // text*.dat files are optional, these files are missing
- // when db is build without Marisa support
-
- osmscout::log.Debug() << "Checking db files in directory " << dir.absolutePath().toStdString();
- valid=true;
- for (const auto &fileName: fileNames) {
- bool exists=dir.exists(fileName);
- if (!exists){
- osmscout::log.Debug() << "Missing mandatory file: " << fileName.toStdString();
- }
- valid &= exists;
- }
- if (!valid){
- osmscout::log.Warn() << "Can't use db " << dir.absolutePath().toStdString() << ", some mandatory files are missing.";
- }
-
- // metadata
- if (dir.exists(MapDownloadJob::FILE_METADATA)){
- QFile jsonFile(dir.filePath(MapDownloadJob::FILE_METADATA));
- jsonFile.open(QFile::OpenModeFlag::ReadOnly);
- QJsonDocument doc = QJsonDocument::fromJson(jsonFile.readAll());
- QJsonObject metadataObject = doc.object();
- if (metadataObject.contains("name") &&
- metadataObject.contains("map") &&
- metadataObject.contains("creation") &&
- metadataObject.contains("version")) {
- name = metadataObject["name"].toString();
- path = metadataObject["map"].toString().split("/");
-#if QT_VERSION > QT_VERSION_CHECK(5, 8, 0) /* For compatibility with QT 5.6 */
- creation.setSecsSinceEpoch(metadataObject["creation"].toDouble());
-#else
- creation.setTime_t(metadataObject["creation"].toDouble());
-#endif
- version = metadataObject["version"].toInt();
- metadata = true;
- }
- }
-}
-
-QStringList MapDirectory::mandatoryFiles()
-{
- QStringList fileNames;
- fileNames << "bounding.dat"
- << "nodes.dat"
- << "areas.dat"
- << "ways.dat"
- << "areanode.idx"
- << "areaarea.idx"
- << "areaway.idx"
- << "areasopt.dat"
- << "waysopt.dat"
- << "location.idx"
- << "water.idx"
- << "intersections.dat"
- << "intersections.idx"
- << "route.dat"
- << "arearoute.idx"
- << "router.dat"
- << "router2.dat"
- // types.dat should be last, when download is interrupted,
- // directory is not recognized as valid map
- << "types.dat";
-
- return fileNames;
-}
-
-QStringList MapDirectory::optionalFiles(){
- QStringList fileNames;
- fileNames << "textloc.dat"
- << "textother.dat"
- << "textpoi.dat"
- << "textregion.dat"
- << "coverage.idx";
- return fileNames;
-}
-
-QStringList MapDirectory::metadataFiles()
-{
- QStringList fileNames;
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/POILookupModule.cpp
^
|
@@ -1,185 +0,0 @@
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2018 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <osmscoutclientqt/POILookupModule.h>
-
-#include <osmscout/feature/OperatorFeature.h>
-
-#include <osmscout/poi/POIService.h>
-
-namespace osmscout {
-
-POILookupModule::POILookupModule(QThread *thread,DBThreadRef dbThread):
- thread(thread), dbThread(dbThread)
-{
-
-}
-
-POILookupModule::~POILookupModule()
-{
- if (thread!=QThread::currentThread()){
- qWarning() << "Destroy" << this << "from non incorrect thread;" << thread << "!=" << QThread::currentThread();
- }
- if (thread!=nullptr){
- thread->quit();
- }
-}
-
-template<class T>
-LocationEntry buildLocationEntry(T obj,
- QString dbPath,
- osmscout::GeoCoord coordinates,
- osmscout::GeoBox bbox)
-{
- QString title;
- QString altName;
- QString objectType = QString::fromUtf8(obj->GetType()->GetName().c_str());
- const osmscout::FeatureValueBuffer &features=obj->GetFeatureValueBuffer();
-
- if (const osmscout::NameFeatureValue *name=features.findValue<osmscout::NameFeatureValue>();
- name!=nullptr){
- title=QString::fromStdString(name->GetLabel(osmscout::Locale(), 0));
- //std::cout << " \"" << name->GetLabel() << "\"";
- } else if (const osmscout::OperatorFeatureValue *operatorVal=features.findValue<osmscout::OperatorFeatureValue>();
- operatorVal!=nullptr) {
- title=QString::fromStdString(operatorVal->GetLabel(osmscout::Locale(), 0));
- } else if (const osmscout::RefFeatureValue *ref=features.findValue<osmscout::RefFeatureValue>();
- ref!=nullptr) {
- title=QString::fromStdString(ref->GetLabel(osmscout::Locale(), 0));
- }
-
- if (const osmscout::NameAltFeatureValue *name=features.findValue<osmscout::NameAltFeatureValue>();
- name!=nullptr) {
- altName = QString::fromStdString(name->GetLabel(osmscout::Locale(), 0));
- }
-
- LocationEntry location(LocationEntry::typeObject, title, altName, objectType, QList<AdminRegionInfoRef>(),
- dbPath, coordinates, bbox);
- location.addReference(obj->GetObjectFileRef());
- return LocationEntry(location); // explicit copy. some older compilers (GCC 7.5.0) fails when tries to use deleted move constructor
-}
-
-QList<LocationEntry> POILookupModule::doPOIlookup(DBInstanceRef db,
- osmscout::GeoBox searchBoundingBox,
- osmscout::BreakerRef /*breaker*/,
- QStringList types)
-{
- QList<LocationEntry> result;
-
- osmscout::TypeInfoSet nodeTypes;
- std::vector<osmscout::NodeRef> nodes;
- osmscout::TypeInfoSet wayTypes;
- std::vector<osmscout::WayRef> ways;
- osmscout::TypeInfoSet areaTypes;
- std::vector<osmscout::AreaRef> areas;
-
- auto database=db->GetDatabase();
- if (!database){
- osmscout::log.Error() << "No db available";
- return result;
- }
- osmscout::TypeConfigRef typeConfig=database->GetTypeConfig();
- if (!typeConfig){
- osmscout::log.Error() << "No typeConfig available";
- return result;
- }
-
- // prepare type set
- for (const QString &typeName: types){
- osmscout::TypeInfoRef typeInfo=typeConfig->GetTypeInfo(typeName.toStdString());
- if (!typeInfo){
- osmscout::log.Warn() << "There is no type " << typeName.toStdString();
- continue;
- }
- if (typeInfo->CanBeArea()){
- areaTypes.Set(typeInfo);
- }
- if (typeInfo->CanBeWay()){
- wayTypes.Set(typeInfo);
- }
- if (typeInfo->CanBeNode()){
- nodeTypes.Set(typeInfo);
- }
- }
-
- // lookup objects
- osmscout::POIService poiService(database);
- try {
- poiService.GetPOIsInArea(searchBoundingBox,
- nodeTypes,
- nodes,
- wayTypes,
- ways,
- areaTypes,
- areas);
- }
- catch (const std::exception& e) {
- osmscout::log.Error() << "Failed to load POIs in area: " << e.what();
- return result;
- }
-
- // build location entries
- for (osmscout::AreaRef &area:areas) {
- osmscout::GeoBox bbox=area->GetBoundingBox();
- osmscout::GeoCoord coordinates=bbox.GetCenter();
-
- result << buildLocationEntry(area, QString::fromStdString(db->path), coordinates, bbox);
- }
-
- for (osmscout::WayRef &way:ways) {
- osmscout::GeoBox bbox=way->GetBoundingBox();
- osmscout::GeoCoord coordinates=bbox.GetCenter();
-
- result << buildLocationEntry(way, QString::fromStdString(db->path), coordinates, bbox);
- }
-
- for (osmscout::NodeRef &node:nodes) {
- osmscout::GeoCoord coordinates=node->GetCoords();
- osmscout::GeoBox bbox;
- bbox.Include(osmscout::GeoBox::BoxByCenterAndRadius(node->GetCoords(), Distance::Of<Meter>(2.0)));
-
- result << buildLocationEntry(node, QString::fromStdString(db->path), coordinates, bbox);
- }
-
- return result;
-}
-
-void POILookupModule::lookupPOIRequest(int requestId,
- osmscout::BreakerRef breaker,
- osmscout::GeoCoord searchCenter,
- QStringList types,
- double maxDistance)
-{
- osmscout::GeoBox searchBoundingBox=osmscout::GeoBox::BoxByCenterAndRadius(searchCenter, Distance::Of<Meter>(maxDistance));
-
- dbThread->RunSynchronousJob([&](const std::list<DBInstanceRef>& databases){
-
- for (auto &db : databases) {
- if (breaker && breaker->IsAborted()){
- emit lookupAborted(requestId);
- break;
- }
- emit lookupResult(requestId,
- doPOIlookup(db, searchBoundingBox, breaker, types));
- }
- });
-
- emit lookupFinished(requestId);
-}
-}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/CMakeLists.txt
^
|
@@ -6,7 +6,7 @@
# Redistribution and use is allowed according to the terms of the BSD license.
cmake_policy(SET CMP0048 NEW)
-project(osmscout-sailfish VERSION 2.32.0 LANGUAGES C CXX)
+project(osmscout-sailfish VERSION 2.33.0 LANGUAGES C CXX)
# ==================================================================================================
# Information to update before to release this package.
@@ -579,9 +579,12 @@
add_executable(PerformanceTest ${SOURCE_FILES})
set_property(TARGET PerformanceTest PROPERTY CXX_STANDARD 17)
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/PerformanceTestConfig.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/include/PerformanceTest/config.h)
+
target_include_directories(PerformanceTest PRIVATE
${OSMSCOUT_INCLUDE_DIRS}
${LIBSAILFISHAPP_INCLUDE_DIRS}
+ ${CMAKE_CURRENT_BINARY_DIR}/include/PerformanceTest/
)
target_link_libraries(PerformanceTest
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/CMakeMod/features.cmake
^
|
@@ -94,7 +94,8 @@
check_function_exists(mmap HAVE_MMAP)
check_function_exists(posix_fadvise HAVE_POSIX_FADVISE)
check_function_exists(posix_madvise HAVE_POSIX_MADVISE)
-
+check_function_exists(mallinfo HAVE_MALLINFO)
+check_function_exists(mallinfo2 HAVE_MALLINFO2)
# check libraries and tools
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/Apple/OSMScoutOSX/Readme.md
^
|
@@ -36,7 +36,7 @@
cd libosmscout
mkdir build.ios
cd build.ios
-cmake -DIOS_DEPLOYMENT_TARGET=13.0 -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DMARISA_INCLUDE_DIRS=~/Dev/marisa/lib -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config ..
+cmake -DPLATFORM=OS64 -DDEPLOYMENT_TARGET=15.0 -DCMAKE_TOOLCHAIN_FILE=../../cmake/iOS.cmake -DMARISA_INCLUDE_DIRS=~/Dev/marisa/lib -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config ..
make
```
@@ -44,13 +44,13 @@
The framework directory used by the iOS simulator target is:
>OSMScoutOSX/OSMScoutiOS/Frameworks_simulator
-When you have installed the OSMScout sources and the needed dependencies, to compile the library for iOS simulator you might do something like:
+When you have installed the OSMScout sources and the needed dependencies, to compile the library for iOS simulator for X86 and ARM target you might do something like:
```
cd libosmscout
mkdir build.simulator
cd build.simulator
-cmake -DIOS_DEPLOYMENT_TARGET=13.0 -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DMARISA_INCLUDE_DIRS=~/Dev/marisa/lib -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config -DIOS_PLATFORM=SIMULATOR64 ..
-make
+cmake -G Xcode -DPLATFORM=SIMULATOR64COMBINED -DDEPLOYMENT_TARGET=15.0 -DCMAKE_TOOLCHAIN_FILE=../../cmake/iOS.cmake -DMARISA_INCLUDE_DIRS=~/Dev/marisa/lib -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config ..
+xcodebuild -project libosmscout.xcodeproj
```
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/CMakeLists.txt
^
|
@@ -682,7 +682,7 @@
message(STATUS "documentation: ${OSMSCOUT_BUILD_DOC_API}")
message(STATUS "webpage: ${OSMSCOUT_BUILD_WEBPAGE}")
-install(DIRECTORY ${CMAKE_SOURCE_DIR}/stylesheets DESTINATION share/osmscout)
+install(DIRECTORY ${PROJECT_SOURCE_DIR}/stylesheets DESTINATION share/osmscout)
if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
install(DIRECTORY "${CMAKE_BINARY_DIR}/windeployqt/" DESTINATION bin)
endif()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/Demos/src/LocationLookup.cpp
^
|
@@ -378,7 +378,7 @@
args.repeat=value;
}),
"repeat",
- "Cout of repeat for performance test");
+ "Count of repeat for performance test");
argParser.AddOption(osmscout::CmdLineFlag([&args](const bool& value) {
args.transliterate=value;
@@ -435,7 +435,7 @@
}
osmscout::DatabaseParameter databaseParameter;
- osmscout::DatabaseRef database(new osmscout::Database(databaseParameter));
+ osmscout::DatabaseRef database=std::make_shared<osmscout::Database>(databaseParameter);
if (!database->Open(args.databaseDirectory)) {
std::cerr << "Cannot open db" << std::endl;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/StyleEditor/src/MainWindow.cpp
^
|
@@ -30,13 +30,5 @@
: QQmlApplicationEngine(QUrl("qrc:/qml/main.qml")),
dbThread(dbThread)
{
- connect(dbThread.get(),
- SIGNAL(initialisationFinished(const DatabaseLoadedResponse&)),
- this,
- SLOT(InitialisationFinished(const DatabaseLoadedResponse&)));
-}
-
-void MainWindow::InitialisationFinished(const DatabaseLoadedResponse& /*response*/) // NOLINT
-{
- osmscout::log.Info() << "InitialisationFinished()";
+ dbThread->databaseLoadFinished.Connect(dbLoadedSlot);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/StyleEditor/src/MainWindow.h
^
|
@@ -30,12 +30,15 @@
{
Q_OBJECT
-public slots:
- void InitialisationFinished(const osmscout::DatabaseLoadedResponse& response);
-
private:
osmscout::DBThreadRef dbThread;
+ osmscout::Slot<osmscout::GeoBox> dbLoadedSlot{
+ [](const osmscout::GeoBox &) {
+ osmscout::log.Info() << "InitialisationFinished()";
+ }
+ };
+
public:
explicit MainWindow(const osmscout::DBThreadRef& dbThread);
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/StyleEditor/src/StyleAnalyser.cpp
^
|
@@ -19,7 +19,8 @@
#include <StyleAnalyser.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/OSMScoutQt.h>
using namespace osmscout;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/StyleEditor/src/StyleEditor.cpp
^
|
@@ -105,7 +105,7 @@
MainWindow window(dbThread);
result = app.exec();
- QString tmpStylesheet(dbThread->GetStylesheetFilename()+TMP_SUFFIX);
+ QString tmpStylesheet = QString::fromStdString(dbThread->GetStylesheetFilename()+TMP_SUFFIX);
if(QFile::exists(tmpStylesheet)){
QFile::remove(tmpStylesheet);
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/Tests/meson.build
^
|
@@ -601,7 +601,7 @@
threadingMocs,
include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutclientIncDir, osmscoutmapIncDir, osmscoutIncDir, osmscoutclientqtIncDir],
dependencies: [mathDep, threadDep, openmpDep, qtClientDep],
- link_with: [osmscoutmapqt, osmscoutmap, osmscout, osmscoutclientqt],
+ link_with: [osmscoutmapqt, osmscoutmap, osmscout, osmscoutclient, osmscoutclientqt],
install: true,
install_dir: testInstallDir)
endif
@@ -614,7 +614,7 @@
testMocs,
include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir, osmscoutclientIncDir, osmscoutclientqtIncDir],
dependencies: [mathDep, threadDep, openmpDep, qtClientDep],
- link_with: [osmscoutmapqt, osmscoutmap, osmscout, osmscoutclientqt],
+ link_with: [osmscoutmapqt, osmscoutmap, osmscout, osmscoutclient, osmscoutclientqt],
install: true,
install_dir: testInstallDir)
endif
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/Tests/src/ClientQtThreading.cpp
^
|
@@ -86,7 +86,7 @@
connect(loadJob, &DBLoadJob::finished,
this, &ThreadingTest::onLoadJobFinished);
- dbThread->RunJob(loadJob);
+ dbThread->RunJob(std::bind(&DBLoadJob::Run, loadJob, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
}
void ThreadingTest::onLoadJobFinished(QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> tiles)
@@ -99,7 +99,7 @@
for (const auto &tileKey:map.keys()){
const auto &tile=map[tileKey];
- std::cout << "Stylesheet: " << dbThread->GetStylesheetFilename().toStdString()
+ std::cout << "Stylesheet: " << dbThread->GetStylesheetFilename()
<< ", " << dbPath.toStdString()
<< ", " << tileKey.GetDisplayText()
<< " object count: " << tile->GetAreaData().GetDataSize()
@@ -110,9 +110,9 @@
objectCount += tile->GetAreaData().GetDataSize() + tile->GetWayData().GetDataSize() + tile->GetNodeData().GetDataSize();
}
}
- std::cout << "Stylesheet: " << dbThread->GetStylesheetFilename().toStdString() << ", sum object count: " << objectCount << std::endl;
- if (objectCountPerStylesheet.contains(dbThread->GetStylesheetFilename())){
- size_t lastObjectCount = objectCountPerStylesheet[dbThread->GetStylesheetFilename()];
+ std::cout << "Stylesheet: " << dbThread->GetStylesheetFilename() << ", sum object count: " << objectCount << std::endl;
+ if (objectCountPerStylesheet.contains(QString::fromStdString(dbThread->GetStylesheetFilename()))){
+ size_t lastObjectCount = objectCountPerStylesheet[QString::fromStdString(dbThread->GetStylesheetFilename())];
if (objectCount < lastObjectCount){
std::cerr << "Less objects! " << lastObjectCount << " > " << objectCount << std::endl;
failure = true;
@@ -121,7 +121,7 @@
}
}
- objectCountPerStylesheet[dbThread->GetStylesheetFilename()] = objectCount;
+ objectCountPerStylesheet[QString::fromStdString(dbThread->GetStylesheetFilename())] = objectCount;
stylesheetCtn++;
emit loadStyleRequested(stylesheets.at(stylesheetCtn % stylesheets.size()).absoluteFilePath(),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/Tests/src/ScreenBox.cpp
^
|
@@ -97,7 +97,7 @@
osmscout::ScreenBox resizedBox=box.Resize(0);
osmscout::ScreenBox expectedResizedBox(osmscout::Vertex2D(-1, -1),
- osmscout::Vertex2D(1, 1));
+ osmscout::Vertex2D(-1, 1));
REQUIRE(expectedResizedBox==resizedBox);
}
@@ -112,4 +112,10 @@
osmscout::Vertex2D(0, 0));
REQUIRE(expectedResizedBox==resizedBox);
+ REQUIRE(resizedBox.IsEmpty());
+
+ resizedBox=resizedBox.Resize(-1);
+
+ REQUIRE(expectedResizedBox==resizedBox);
+ REQUIRE(resizedBox.IsEmpty());
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/cmake/iOS.cmake
^
|
@@ -1,4 +1,6 @@
# This file is part of the ios-cmake project. It was retrieved from
+# https://github.com/leetal/ios-cmake.git, which is a fork of
+# https://github.com/gerstrong/ios-cmake.git, which is a fork of
# https://github.com/cristeab/ios-cmake.git, which is a fork of
# https://code.google.com/p/ios-cmake/. Which in turn is based off of
# the Platform/Darwin.cmake and Platform/UnixPaths.cmake files which
@@ -35,264 +37,1063 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
-# This file is based off of the Platform/Darwin.cmake and
+# This file is based on the Platform/Darwin.cmake and
# Platform/UnixPaths.cmake files which are included with CMake 2.8.4
# It has been altered for iOS development.
#
-# Updated by Alex Stewart (alexs.mac@gmail.com).
-# The following variables control the behaviour of this toolchain:
+# Updated by Alex Stewart (alexs.mac@gmail.com)
#
-# IOS_PLATFORM: OS (default) or SIMULATOR or SIMULATOR64
+# *****************************************************************************
+# Now maintained by Alexander Widerberg (widerbergaren [at] gmail.com)
+# under the BSD-3-Clause license
+# https://github.com/leetal/ios-cmake
+# *****************************************************************************
+#
+# INFORMATION / HELP
+#
+###############################################################################
+# OPTIONS #
+###############################################################################
+#
+# PLATFORM: (default "OS64")
# OS = Build for iPhoneOS.
-# SIMULATOR = Build for x86 i386 iPhone Simulator.
-# SIMULATOR64 = Build for x86 x86_64 iPhone Simulator.
-# CMAKE_OSX_SYSROOT: Path to the iOS SDK to use. By default this is
-# automatically determined from IOS_PLATFORM and xcodebuild, but
+# OS64 = Build for arm64 iphoneOS.
+# OS64COMBINED = Build for arm64 x86_64 iphoneOS + iphoneOS Simulator. Combined into FAT STATIC lib (only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step)
+# SIMULATOR = Build for x86 i386 iphoneOS Simulator.
+# SIMULATOR64 = Build for x86_64 iphoneOS Simulator.
+# SIMULATORARM64 = Build for arm64 iphoneOS Simulator.
+# SIMULATOR64COMBINED = Build for arm64 x86_64 iphoneOS Simulator. Combined into FAT STATIC lib (supported on 3.14+ of CMakewith "-G Xcode" argument ONLY)
+# TVOS = Build for arm64 tvOS.
+# TVOSCOMBINED = Build for arm64 x86_64 tvOS + tvOS Simulator. Combined into FAT STATIC lib (only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step)
+# SIMULATOR_TVOS = Build for x86_64 tvOS Simulator.
+# SIMULATORARM64_TVOS = Build for arm64 tvOS Simulator.
+# WATCHOS = Build for armv7k arm64_32 for watchOS.
+# WATCHOSCOMBINED = Build for armv7k arm64_32 x86_64 watchOS + watchOS Simulator. Combined into FAT STATIC lib (only supported on 3.14+ of CMake with "-G Xcode" argument in combination with the "cmake --install" CMake build step)
+# SIMULATOR_WATCHOS = Build for x86_64 for watchOS Simulator.
+# MAC = Build for x86_64 macOS.
+# MAC_ARM64 = Build for Apple Silicon macOS.
+# MAC_UNIVERSAL = Combined build for x86_64 and Apple Silicon on macOS.
+# MAC_CATALYST = Build for x86_64 macOS with Catalyst support (iOS toolchain on macOS).
+# Note: The build argument "MACOSX_DEPLOYMENT_TARGET" can be used to control min-version of macOS
+# MAC_CATALYST_ARM64 = Build for Apple Silicon macOS with Catalyst support (iOS toolchain on macOS).
+# Note: The build argument "MACOSX_DEPLOYMENT_TARGET" can be used to control min-version of macOS
+#
+# CMAKE_OSX_SYSROOT: Path to the SDK to use. By default this is
+# automatically determined from PLATFORM and xcodebuild, but
# can also be manually specified (although this should not be required).
-# CMAKE_IOS_DEVELOPER_ROOT: Path to the Developer directory for the iOS platform
-# being compiled for. By default this is automatically determined from
+#
+# CMAKE_DEVELOPER_ROOT: Path to the Developer directory for the platform
+# being compiled for. By default, this is automatically determined from
# CMAKE_OSX_SYSROOT, but can also be manually specified (although this should
# not be required).
#
-# This toolchain defines the following variables for use externally:
+# DEPLOYMENT_TARGET: Minimum SDK version to target. Default 2.0 on watchOS and 9.0 on tvOS+iOS
+#
+# NAMED_LANGUAGE_SUPPORT:
+# ON (default) = Will require "enable_language(OBJC) and/or enable_language(OBJCXX)" for full OBJC|OBJCXX support
+# OFF = Will embed the OBJC and OBJCXX flags into the CMAKE_C_FLAGS and CMAKE_CXX_FLAGS (legacy behavior, CMake version < 3.16)
+#
+# ENABLE_BITCODE: (ON|OFF) Enables or disables bitcode support. Default OFF
+#
+# ENABLE_ARC: (ON|OFF) Enables or disables ARC support. Default ON (ARC enabled by default)
+#
+# ENABLE_VISIBILITY: (ON|OFF) Enables or disables symbol visibility support. Default OFF (visibility hidden by default)
#
+# ENABLE_STRICT_TRY_COMPILE: (ON|OFF) Enables or disables strict try_compile() on all Check* directives (will run linker
+# to actually check if linking is possible). Default OFF (will set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY)
+#
+# ARCHS: (armv7 armv7s armv7k arm64 arm64_32 i386 x86_64) If specified, will override the default architectures for the given PLATFORM
+# OS = armv7 armv7s arm64 (if applicable)
+# OS64 = arm64 (if applicable)
+# SIMULATOR = i386
+# SIMULATOR64 = x86_64
+# SIMULATORARM64 = arm64
+# TVOS = arm64
+# SIMULATOR_TVOS = x86_64 (i386 has since long been deprecated)
+# SIMULATORARM64_TVOS = arm64
+# WATCHOS = armv7k arm64_32 (if applicable)
+# SIMULATOR_WATCHOS = x86_64 (i386 has since long been deprecated)
+# MAC = x86_64
+# MAC_ARM64 = arm64
+# MAC_UNIVERSAL = x86_64 arm64
+# MAC_CATALYST = x86_64
+# MAC_CATALYST_ARM64 = arm64
+#
+# NOTE: When manually specifying ARCHS, put a semi-colon between the entries. E.g., -DARCHS="armv7;arm64"
+#
+###############################################################################
+# END OPTIONS #
+###############################################################################
+#
+# This toolchain defines the following properties (available via get_property()) for use externally:
+#
+# PLATFORM: The currently targeted platform.
# XCODE_VERSION: Version number (not including Build version) of Xcode detected.
-# IOS_SDK_VERSION: Version of iOS SDK being used.
-# CMAKE_OSX_ARCHITECTURES: Architectures being compiled for (generated from
-# IOS_PLATFORM).
+# SDK_VERSION: Version of SDK being used.
+# OSX_ARCHITECTURES: Architectures being compiled for (generated from PLATFORM).
+# APPLE_TARGET_TRIPLE: Used by autoconf build systems. NOTE: If "ARCHS" is overridden, this will *NOT* be set!
#
# This toolchain defines the following macros for use externally:
#
-# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE)
-# A convenience macro for setting xcode specific properties on targets
-# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1").
+# set_xcode_property (TARGET XCODE_PROPERTY XCODE_VALUE XCODE_VARIANT)
+# A convenience macro for setting xcode specific properties on targets.
+# Available variants are: All, Release, RelWithDebInfo, Debug, MinSizeRel
+# example: set_xcode_property (myioslib IPHONEOS_DEPLOYMENT_TARGET "3.1" "all").
#
# find_host_package (PROGRAM ARGS)
# A macro used to find executable programs on the host system, not within the
-# iOS environment. Thanks to the android-cmake project for providing the
+# environment. Thanks to the android-cmake project for providing the
# command.
+#
+
+cmake_minimum_required(VERSION 3.8.0)
+
+# CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds.
+if(DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN})
+ return()
+endif()
+set(ENV{_IOS_TOOLCHAIN_HAS_RUN} true)
+
+# List of supported platform values
+list(APPEND _supported_platforms
+ "OS" "OS64" "OS64COMBINED" "SIMULATOR" "SIMULATOR64" "SIMULATORARM64" "SIMULATOR64COMBINED"
+ "TVOS" "TVOSCOMBINED" "SIMULATOR_TVOS" "SIMULATORARM64_TVOS"
+ "WATCHOS" "WATCHOSCOMBINED" "SIMULATOR_WATCHOS"
+ "MAC" "MAC_ARM64" "MAC_UNIVERSAL"
+ "VISIONOS" "SIMULATOR_VISIONOS" "SIMULATOR64_VISIONOS"
+ "MAC_CATALYST" "MAC_CATALYST_ARM64")
+
+# Cache what generator is used
+set(USED_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
+
+# Check if using a CMake version capable of building combined FAT builds (simulator and target slices combined in one static lib)
+if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.14")
+ set(MODERN_CMAKE YES)
+endif()
+
# Get the Xcode version being used.
-execute_process(COMMAND xcodebuild -version
- OUTPUT_VARIABLE XCODE_VERSION
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-string(REGEX MATCH "Xcode [0-9\\.]+" XCODE_VERSION "${XCODE_VERSION}")
-string(REGEX REPLACE "Xcode ([0-9\\.]+)" "\\1" XCODE_VERSION "${XCODE_VERSION}")
-message(STATUS "Building with Xcode version: ${XCODE_VERSION}")
-# Default to building for iPhoneOS if not specified otherwise, and we cannot
-# determine the platform from the CMAKE_OSX_ARCHITECTURES variable. The use
-# of CMAKE_OSX_ARCHITECTURES is such that try_compile() projects can correctly
-# determine the value of IOS_PLATFORM from the root project, as
-# CMAKE_OSX_ARCHITECTURES is propagated to them by CMake.
-if (NOT DEFINED IOS_PLATFORM)
- if (CMAKE_OSX_ARCHITECTURES)
- if (CMAKE_OSX_ARCHITECTURES MATCHES ".*arm.*")
- set(IOS_PLATFORM "OS")
- elseif (CMAKE_OSX_ARCHITECTURES MATCHES "i386")
- set(IOS_PLATFORM "SIMULATOR")
- elseif (CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
- set(IOS_PLATFORM "SIMULATOR64")
- endif()
+# Problem: CMake runs toolchain files multiple times, but can't read cache variables on some runs.
+# Workaround: On the first run (in which cache variables are always accessible), set an intermediary environment variable.
+#
+# NOTE: This pattern is used in many places in this toolchain to speed up checks of all sorts
+if(DEFINED XCODE_VERSION_INT)
+ # Environment variables are always preserved.
+ set(ENV{_XCODE_VERSION_INT} "${XCODE_VERSION_INT}")
+elseif(DEFINED ENV{_XCODE_VERSION_INT})
+ set(XCODE_VERSION_INT "$ENV{_XCODE_VERSION_INT}")
+elseif(NOT DEFINED XCODE_VERSION_INT)
+ find_program(XCODEBUILD_EXECUTABLE xcodebuild)
+ if(NOT XCODEBUILD_EXECUTABLE)
+ message(FATAL_ERROR "xcodebuild not found. Please install either the standalone commandline tools or Xcode.")
endif()
- if (NOT IOS_PLATFORM)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/CMakeLists.txt
^
|
@@ -2,9 +2,7 @@
set(CMAKE_AUTORCC ON)
set(HEADER_FILES
- include/osmscoutclientqt/AdminRegionInfo.h
include/osmscoutclientqt/ClientQtImportExport.h
- include/osmscoutclientqt/DBThread.h
include/osmscoutclientqt/ElevationChartWidget.h
include/osmscoutclientqt/ElevationModule.h
include/osmscoutclientqt/FileDownloader.h
@@ -24,13 +22,13 @@
include/osmscoutclientqt/TileCache.h
include/osmscoutclientqt/AvailableMapsModel.h
include/osmscoutclientqt/PersistentCookieJar.h
- include/osmscoutclientqt/MapManager.h
+ include/osmscoutclientqt/MapDownloader.h
include/osmscoutclientqt/MapDownloadsModel.h
include/osmscoutclientqt/MapObjectInfoModel.h
include/osmscoutclientqt/MapStyleModel.h
include/osmscoutclientqt/StyleFlagsModel.h
include/osmscoutclientqt/OSMScoutQt.h
- include/osmscoutclientqt/DBJob.h
+ include/osmscoutclientqt/DBLoadJob.h
include/osmscoutclientqt/LookupModule.h
include/osmscoutclientqt/SearchModule.h
include/osmscoutclientqt/StyleModule.h
@@ -50,9 +48,9 @@
include/osmscoutclientqt/QmlSettings.h
include/osmscoutclientqt/QtRouteData.h
include/osmscoutclientqt/QtSettingsStorage.h
+ include/osmscoutclientqt/QtStdConverters.h
include/osmscoutclientqt/RouteStep.h
include/osmscoutclientqt/NearPOIModel.h
- include/osmscoutclientqt/POILookupModule.h
include/osmscoutclientqt/InstalledMapsModel.h
include/osmscoutclientqt/Voice.h
include/osmscoutclientqt/VoiceManager.h
@@ -61,7 +59,6 @@
)
set(SOURCE_FILES
- src/osmscoutclientqt/DBThread.cpp
src/osmscoutclientqt/ElevationChartWidget.cpp
src/osmscoutclientqt/ElevationModule.cpp
src/osmscoutclientqt/FileDownloader.cpp
@@ -80,13 +77,13 @@
src/osmscoutclientqt/SearchLocationModel.cpp
src/osmscoutclientqt/TileCache.cpp
src/osmscoutclientqt/AvailableMapsModel.cpp
- src/osmscoutclientqt/MapManager.cpp
+ src/osmscoutclientqt/MapDownloader.cpp
src/osmscoutclientqt/MapDownloadsModel.cpp
src/osmscoutclientqt/MapObjectInfoModel.cpp
src/osmscoutclientqt/MapStyleModel.cpp
src/osmscoutclientqt/StyleFlagsModel.cpp
src/osmscoutclientqt/OSMScoutQt.cpp
- src/osmscoutclientqt/DBJob.cpp
+ src/osmscoutclientqt/DBLoadJob.cpp
src/osmscoutclientqt/LookupModule.cpp
src/osmscoutclientqt/SearchModule.cpp
src/osmscoutclientqt/StyleModule.cpp
@@ -107,8 +104,8 @@
src/osmscoutclientqt/QmlSettings.cpp
src/osmscoutclientqt/QtRouteData.cpp
src/osmscoutclientqt/QtSettingsStorage.cpp
+ src/osmscoutclientqt/QtStdConverters.cpp
src/osmscoutclientqt/NearPOIModel.cpp
- src/osmscoutclientqt/POILookupModule.cpp
src/osmscoutclientqt/InstalledMapsModel.cpp
src/osmscoutclientqt/Voice.cpp
src/osmscoutclientqt/VoiceManager.cpp
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/meson.build
^
|
@@ -1,9 +1,7 @@
osmscoutclientqtIncDir = include_directories('.')
osmscoutclientqtHeader = [
- 'osmscoutclientqt/AdminRegionInfo.h',
'osmscoutclientqt/ClientQtImportExport.h',
- 'osmscoutclientqt/DBThread.h',
'osmscoutclientqt/ElevationChartWidget.h',
'osmscoutclientqt/ElevationModule.h',
'osmscoutclientqt/RoutingModel.h',
@@ -14,6 +12,7 @@
'osmscoutclientqt/QmlSettings.h',
'osmscoutclientqt/QtRouteData.h',
'osmscoutclientqt/QtSettingsStorage.h',
+ 'osmscoutclientqt/QtStdConverters.h',
'osmscoutclientqt/NavigationModule.h',
'osmscoutclientqt/NavigationModel.h',
'osmscoutclientqt/VehiclePosition.h',
@@ -31,13 +30,13 @@
'osmscoutclientqt/FileDownloader.h',
'osmscoutclientqt/IconAnimation.h',
'osmscoutclientqt/IconLookup.h',
- 'osmscoutclientqt/MapManager.h',
+ 'osmscoutclientqt/MapDownloader.h',
'osmscoutclientqt/MapDownloadsModel.h',
'osmscoutclientqt/MapObjectInfoModel.h',
'osmscoutclientqt/MapStyleModel.h',
'osmscoutclientqt/StyleFlagsModel.h',
'osmscoutclientqt/OSMScoutQt.h',
- 'osmscoutclientqt/DBJob.h',
+ 'osmscoutclientqt/DBLoadJob.h',
'osmscoutclientqt/LookupModule.h',
'osmscoutclientqt/SearchModule.h',
'osmscoutclientqt/StyleModule.h',
@@ -50,7 +49,6 @@
'osmscoutclientqt/TiledMapOverlay.h',
'osmscoutclientqt/TiledRenderingHelper.h',
'osmscoutclientqt/NearPOIModel.h',
- 'osmscoutclientqt/POILookupModule.h',
'osmscoutclientqt/InstalledMapsModel.h',
'osmscoutclientqt/Voice.h',
'osmscoutclientqt/VoiceManager.h',
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBLoadJob.h
^
|
@@ -0,0 +1,107 @@
+#ifndef OSMSCOUT_CLIENT_QT_DBLOADJOB_H
+#define OSMSCOUT_CLIENT_QT_DBLOADJOB_H
+
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2017 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <QObject>
+#include <QHash>
+#include <QList>
+#include <QThread>
+#include <QMap>
+
+#include <osmscout/projection/MercatorProjection.h>
+
+#include <osmscout/db/BasemapDatabase.h>
+
+#include <osmscoutmap/DataTileCache.h>
+
+#include <osmscoutclient/DBInstance.h>
+#include <osmscoutclient/DBJob.h>
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <shared_mutex>
+
+namespace osmscout {
+
+/**
+ * \ingroup QtAPI
+ */
+class OSMSCOUT_CLIENT_QT_API DBLoadJob : public QObject, public DBJob {
+ Q_OBJECT
+
+private:
+ bool closeOnFinish;
+ osmscout::BreakerRef breaker;
+ osmscout::MercatorProjection lookupProjection;
+ osmscout::AreaSearchParameter searchParameter;
+ QMap<QString,osmscout::MapService::CallbackId> callbacks;
+
+ QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> allTiles;
+ QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> loadingTiles;
+ QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> loadedTiles;
+
+protected slots:
+ void onTileStateChanged(QString dbPath,const osmscout::TileRef tile);
+
+signals:
+ /**
+ * This signal is not called in Job thread context!
+ */
+ void tileStateChanged(QString dbPath,const osmscout::TileRef tile);
+
+ void databaseLoaded(QString dbPath,QList<osmscout::TileRef> tiles);
+
+ void finished(QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> tiles);
+
+public:
+ DBLoadJob(osmscout::MercatorProjection lookupProjection,
+ unsigned long maximumAreaLevel,
+ bool lowZoomOptimization,
+ bool closeOnFinish=true);
+
+ ~DBLoadJob() override;
+
+ void Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
+ const std::list<DBInstanceRef> &databases,
+ std::shared_lock<std::shared_mutex> &&locker) override;
+
+ void Close() override;
+
+ bool IsFinished() const;
+ QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> GetAllTiles() const;
+
+ /**
+ * Add tile data to map data.
+ *
+ * @param dbPath
+ * @param tiles
+ * @param data
+ * @return true on success
+ * false when given db was not added to this job, or job was closed
+ */
+ bool AddTileDataToMapData(QString dbPath,
+ const QList<osmscout::TileRef> &tiles,
+ osmscout::MapData &data);
+};
+
+}
+
+#endif /* OSMSCOUT_CLIENT_QT_DBLOADJOB_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/ElevationModule.h
^
|
@@ -20,13 +20,16 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <osmscoutclientqt/OverlayObject.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
#include <osmscout/elevation/ElevationService.h>
-#include <osmscoutclientqt/ClientQtImportExport.h>
+#include <osmscoutclient/DBThread.h>
+
+#include <osmscoutclientqt/OverlayObject.h>
#include <QThread>
+
#include <memory>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/FileDownloader.h
^
|
@@ -46,6 +46,7 @@
static constexpr std::chrono::seconds BackOffInitial{1}; ///< Initial back-off time
static constexpr std::chrono::seconds BackOffMax{300}; ///< Maximum back-off time
static constexpr int MaxDownloadRetries{-1}; ///< Maximal number of download retries before cancelling download
+static constexpr char const *TemporaryFileSuffix{".download"}; ///< suffix of file being downloaded
}
/// \brief Downloads a file specified by URL
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/IconLookup.h
^
|
@@ -22,10 +22,11 @@
#include <osmscoutmap/DataTileCache.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <osmscoutclientqt/OverlayObject.h>
+#include <osmscoutclientqt/DBLoadJob.h>
#include <QObject>
#include <QSettings>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/InstalledMapsModel.h
^
|
@@ -25,7 +25,8 @@
#include <QAbstractListModel>
-#include <osmscoutclientqt/MapManager.h>
+#include <osmscoutclientqt/MapDownloader.h>
+#include <osmscoutclientqt/QtStdConverters.h>
namespace osmscout {
@@ -37,7 +38,7 @@
Q_OBJECT
signals:
- void databaseListChanged();
+ void databaseListChanged(QList<QDir> databaseDirectories);
public slots:
void onDatabaseListChanged();
@@ -83,6 +84,12 @@
private:
QList<MapDirectory> dirs;
MapManagerRef mapManager;
+
+ Slot<std::vector<std::filesystem::path>> databaseListChangedSlot {
+ [this](const std::vector<std::filesystem::path> &paths) {
+ emit databaseListChanged(PathVectorToQDirList(paths));
+ }
+ };
};
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LocationEntry.h
^
|
@@ -30,8 +30,10 @@
#include <osmscout/location/LocationDescriptionService.h>
#include <osmscout/location/LocationService.h>
+#include <osmscoutclient/LocationInfo.h>
+#include <osmscoutclient/AdminRegionInfo.h>
+
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <osmscoutclientqt/AdminRegionInfo.h>
namespace osmscout {
@@ -51,15 +53,8 @@
Q_PROPERTY(double lat READ getLat CONSTANT)
Q_PROPERTY(double lon READ getLon CONSTANT)
-public:
- enum Type {
- typeNone,
- typeObject,
- typeCoordinate
- };
-
private:
- Type type;
+ LocationInfo::Type type;
QString label;
QString altName; // name in alternative language
QString objectType;
@@ -70,7 +65,7 @@
osmscout::GeoBox bbox;
public:
- LocationEntry(Type type,
+ LocationEntry(LocationInfo::Type type,
const QString& label,
const QString& altName,
const QString& objectType,
@@ -84,6 +79,8 @@
const osmscout::GeoCoord& coord,
QObject* parent = nullptr);
+ explicit LocationEntry(const LocationInfo &info);
+
explicit LocationEntry(QObject* parent = nullptr);
//! copy constructor copies Qt ownership
@@ -104,7 +101,7 @@
Q_INVOKABLE double distanceTo(double lat, double lon) const;
- Type getType() const;
+ LocationInfo::Type getType() const;
QString getTypeString() const;
QString getObjectType() const;
QString getLabel() const;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LocationInfoModel.h
^
|
@@ -53,7 +53,7 @@
public slots:
void setLocation(const double lat, const double lon);
- void dbInitialized(const DatabaseLoadedResponse&);
+ void dbInitialized(const osmscout::GeoBox&);
void onLocationDescription(const osmscout::GeoCoord location,
const QString database,
const osmscout::LocationDescription description,
@@ -88,8 +88,9 @@
LocationInfoModel();
~LocationInfoModel() override;
- Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
+ Q_INVOKABLE int inline rowCount(const QModelIndex &parent = QModelIndex()) const override
{
+ Q_UNUSED(parent);
return model.size();
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LookupModule.h
^
|
@@ -33,9 +33,11 @@
#include <osmscout/feature/WebsiteFeature.h>
#include <osmscout/feature/OpeningHoursFeature.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <osmscoutclientqt/LocationEntry.h>
+#include <osmscoutclientqt/DBLoadJob.h>
namespace osmscout {
@@ -94,8 +96,14 @@
QRectF filterRectangle;
std::map<QString,std::map<osmscout::FileOffset,AdminRegionInfoRef>> adminRegionCache;
+ Slot<osmscout::GeoBox> dbLoadedSlot{
+ [this](const osmscout::GeoBox &b) {
+ emit initialisationFinished(b);
+ }
+ };
+
signals:
- void initialisationFinished(const DatabaseLoadedResponse& response);
+ void initialisationFinished(const osmscout::GeoBox& response);
void viewObjectsLoaded(const MapViewStruct&,
const QList<LookupModule::ObjectInfo> &objects);
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapDownloader.h
^
|
@@ -0,0 +1,132 @@
+#ifndef OSMSCOUT_CLIENT_QT_MAPMANAGER_H
+#define OSMSCOUT_CLIENT_QT_MAPMANAGER_H
+
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2016 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscoutclient/MapProvider.h>
+#include <osmscoutclient/Settings.h>
+#include <osmscoutclient/MapDirectory.h>
+#include <osmscoutclient/MapManager.h>
+
+#include <osmscoutclientqt/AvailableMapsModel.h>
+#include <osmscoutclientqt/FileDownloader.h>
+
+#include <QObject>
+#include <QStringList>
+#include <QList>
+#include <QDir>
+#include <QTimer>
+#include <QtGlobal>
+#include <QStorageInfo>
+
+namespace osmscout {
+
+/**
+ * Utility class for downloading map db described by AvailableMapsModelMap
+ * over http.
+ * \ingroup QtAPI
+ */
+class OSMSCOUT_CLIENT_QT_API MapDownloadJob: public DownloadJob
+{
+ Q_OBJECT
+
+ AvailableMapsModelMap map;
+
+public:
+
+ MapDownloadJob(QNetworkAccessManager *webCtrl, AvailableMapsModelMap map, QDir target, bool replaceExisting);
+
+ /**
+ * Cancel downloading,
+ * when db is not downloaded successfully, remove it from disk
+ * (even already downloaded files).
+ */
+ ~MapDownloadJob() override;
+
+ void start();
+
+ QString getMapName() const
+ {
+ return map.getName();
+ }
+
+ QStringList getMapPath() const
+ {
+ return map.getPath();
+ }
+
+ uint64_t expectedSize() const override
+ {
+ return map.getSize();
+ }
+};
+
+/**
+ * Manager of map databases. It provide db lookup
+ * (in databaseDirectories) and simple scheduler for downloading maps.
+ * \ingroup QtAPI
+ */
+class OSMSCOUT_CLIENT_QT_API MapDownloader: public QObject
+{
+ Q_OBJECT
+
+private:
+ QList<MapDownloadJob*> downloadJobs;
+ QNetworkAccessManager webCtrl;
+ MapManagerRef mapManager;
+
+public slots:
+ void onJobFinished();
+ void onJobFailed(QString errorMessage);
+
+signals:
+ void mapDownloadFails(QString message);
+ void downloadJobsChanged();
+
+public:
+ MapDownloader(MapManagerRef mapManager, SettingsRef settings);
+
+ ~MapDownloader() override;
+
+ /**
+ * Start map downloading into local dir.
+ *
+ * @param map
+ * @param dir
+ * @param replaceExisting - when true, manager will delete existing db with same path (MapDirectory::getPath)
+ */
+ void downloadMap(AvailableMapsModelMap map, QDir dir, bool replaceExisting = true);
+ void downloadNext();
+
+ QList<MapDownloadJob*> getDownloadJobs() const {
+ return downloadJobs;
+ }
+};
+
+/**
+ * \ingroup QtAPI
+ */
+using MapDownloaderRef = std::shared_ptr<MapDownloader>;
+
+}
+
+#endif /* OSMSCOUT_CLIENT_QT_MAPMANAGER_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapDownloadsModel.h
^
|
@@ -22,8 +22,9 @@
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <osmscoutclientqt/MapManager.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
+
+#include <osmscoutclientqt/MapDownloader.h>
#include <QObject>
#include <QStringList>
@@ -49,7 +50,7 @@
void onDownloadProgress();
private:
- MapManagerRef mapManager;
+ MapDownloaderRef mapDownloader;
public:
MapDownloadsModel(QObject *parent=Q_NULLPTR);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapObjectInfoModel.h
^
|
@@ -25,9 +25,9 @@
#include <osmscout/GeoCoord.h>
#include <osmscout/util/GeoBox.h>
-#include <osmscoutclientqt/DBThread.h>
-#include <osmscoutclientqt/LookupModule.h>
+#include <osmscoutclient/DBThread.h>
+#include <osmscoutclientqt/LookupModule.h>
#include <osmscoutclientqt/LocationInfoModel.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
@@ -72,7 +72,7 @@
void objectsRequested(const LocationEntry &entry, bool reverseLookupAddresses);
public slots:
- void dbInitialized(const DatabaseLoadedResponse&);
+ void dbInitialized(const osmscout::GeoBox&);
void setPosition(QObject *mapView,
const int width, const int height,
const int screenX, const int screenY);
@@ -92,8 +92,9 @@
MapObjectInfoModel();
~MapObjectInfoModel() override;
- Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
+ Q_INVOKABLE int inline rowCount(const QModelIndex &parent = QModelIndex()) const override
{
+ Q_UNUSED(parent);
return model.size();
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapRenderer.h
^
|
@@ -23,10 +23,11 @@
#include <osmscoutmap/DataTileCache.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <osmscoutclientqt/OverlayObject.h>
+#include <osmscoutclientqt/DBLoadJob.h>
#include <QObject>
#include <QSettings>
@@ -38,7 +39,7 @@
/**
* \ingroup QtAPI
*/
-class OSMSCOUT_CLIENT_QT_API DBRenderJob : public DBJob{
+class OSMSCOUT_CLIENT_QT_API DBRenderJob : public QObject, public DBJob{
Q_OBJECT
private:
osmscout::MercatorProjection renderProjection;
@@ -67,7 +68,7 @@
void Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
const std::list<DBInstanceRef> &allDatabases,
- QReadLocker *locker) override;
+ std::shared_lock<std::shared_mutex> &&locker) override;
inline bool IsSuccess() const{
return success;
@@ -117,6 +118,7 @@
void fontSizeSignal(double);
void showAltLanguageSignal(bool);
void unitsSignal(QString);
+ void stylesheetFilenameChanged();
private:
// slots
@@ -156,6 +158,8 @@
}
};
+ Slot<> stylesheetFilenameChangedSlot{ std::bind(&MapRenderer::stylesheetFilenameChanged, this) };
+
public slots:
virtual void Initialize() = 0;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapStyleModel.h
^
|
@@ -58,8 +58,9 @@
QString getStyle() const;
void setStyle(const QString &style);
- Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
+ Q_INVOKABLE int inline rowCount(const QModelIndex &parent = QModelIndex()) const override
{
+ Q_UNUSED(parent);
return stylesheets.size();
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapWidget.h
^
|
@@ -25,10 +25,10 @@
#include <osmscout/GeoCoord.h>
#include <osmscout/util/GeoBox.h>
+#include <osmscoutclient/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/MapRenderer.h>
#include <osmscoutclientqt/SearchLocationModel.h>
#include <osmscoutclientqt/InputHandler.h>
@@ -276,9 +276,23 @@
void onIconFound(QPoint lookupCoord, MapIcon icon);
private:
- Slot<double> mapDpiSlot{
- [this](const double &d) {
- this->onMapDPIChange(d);
+ Slot<double> mapDpiSlot{ std::bind(&MapWidget::onMapDPIChange, this, std::placeholders::_1) };
+
+ Slot<> stylesheetFilenameChangedSlot{
+ [this](){
+ emit stylesheetFilenameChanged();
+ }
+ };
+
+ Slot<> styleErrorsChangedSlot{
+ [this](){
+ emit styleErrorsChanged();
+ }
+ };
+
+ Slot<osmscout::GeoBox> databaseLoadedSlot{
+ [this](const osmscout::GeoBox &geoBox){
+ emit databaseLoaded(geoBox);
}
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NavigationModel.h
^
|
@@ -26,6 +26,8 @@
#include <osmscoutclientqt/ClientQtImportExport.h>
+#include <QAbstractListModel>
+#include <QDateTime>
#include <QObject>
#include <optional>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NavigationModule.h
^
|
@@ -21,8 +21,8 @@
*/
#include <osmscoutclient/Settings.h>
+#include <osmscoutclient/DBThread.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/Router.h>
#include <osmscout/navigation/Navigation.h>
@@ -44,6 +44,7 @@
#include <QObject>
#include <QTimer>
#include <QMediaPlayer>
+#include <QDateTime>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QMediaPlaylist>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NearPOIModel.h
^
|
@@ -20,14 +20,18 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclient/POILookupModule.h>
+
#include <osmscoutclientqt/LocationEntry.h>
-#include <osmscoutclientqt/POILookupModule.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <QObject>
#include <QAbstractListModel>
+#include <functional>
+#include <optional>
+
namespace osmscout {
#define INVALID_COORD -1000.0
@@ -95,29 +99,37 @@
void SearchingChanged(bool);
- void lookupPOIRequest(int requestId,
- osmscout::BreakerRef breaker,
- osmscout::GeoCoord searchCenter,
- QStringList types,
- double maxDistance);
+ void lookupFinished(int requestId);
+ void lookupResult(int requestId, QList<LocationEntry> locations);
public slots:
void onLookupFinished(int requestId);
void onLookupResult(int requestId, QList<LocationEntry> locations);
private:
- bool searching{false};
int currentRequest{0};
QList<LocationEntryRef> locations;
osmscout::GeoCoord searchCenter{INVALID_COORD,INVALID_COORD};
int resultLimit{100};
- osmscout::BreakerRef breaker;
+ std::optional<POILookupModule::LookupFuture> future;
Distance maxDistance{Distance::Of<Kilometer>(1)};
QStringList types;
POILookupModule *poiModule{nullptr};
SettingsRef settings;
+ Slot<int> lookupFinishedSlot{ std::bind(&NearPOIModel::lookupFinished, this, std::placeholders::_1) };
+
+ Slot<int, POILookupModule::LookupResult> lookupResultSlot {
+ [this](int requestId, const POILookupModule::LookupResult &locationsVector) {
+ QList<LocationEntry> locations;
+ for (const auto &info: locationsVector) {
+ locations << LocationEntry(info);
+ }
+ emit lookupResult(requestId, locations);
+ }
+ };
+
public:
NearPOIModel();
~NearPOIModel() override;
@@ -134,7 +146,7 @@
inline bool isSearching() const
{
- return searching;
+ return future.has_value();
}
inline double GetLat() const
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OSMScoutQt.h
^
|
@@ -23,14 +23,18 @@
#include <QSettings>
#include <osmscoutmap/DataTileCache.h>
-#include <osmscoutclientqt/DBThread.h>
+
+#include <osmscoutclient/MapManager.h>
+#include <osmscoutclient/DBThread.h>
+#include <osmscoutclient/POILookupModule.h>
+
#include <osmscoutclientqt/LookupModule.h>
+#include <osmscoutclientqt/MapDownloader.h>
#include <osmscoutclientqt/MapRenderer.h>
#include <osmscoutclientqt/Router.h>
#include <osmscoutclientqt/SearchModule.h>
#include <osmscoutclientqt/StyleModule.h>
#include <osmscoutclientqt/NavigationModule.h>
-#include <osmscoutclientqt/POILookupModule.h>
#include <osmscoutclientqt/VoiceManager.h>
#include <osmscoutclientqt/ElevationModule.h>
#include <osmscoutclientqt/IconLookup.h>
@@ -236,16 +240,19 @@
friend class OSMScoutQtBuilder;
private:
- SettingsRef settings;
- MapManagerRef mapManager;
- DBThreadRef dbThread;
- QString iconDirectory;
- QString cacheLocation;
- size_t onlineTileCacheSize;
- size_t offlineTileCacheSize;
- QString userAgent;
- std::atomic_int liveBackgroundThreads;
- VoiceManagerRef voiceManager; // created lazy
+ SettingsRef settings;
+ MapManagerRef mapManager;
+ DBThreadRef dbThread;
+ QString iconDirectory;
+ QString cacheLocation;
+ size_t onlineTileCacheSize;
+ size_t offlineTileCacheSize;
+ QString userAgent;
+ std::atomic_int liveBackgroundThreads;
+
+ std::mutex mutex;
+ MapDownloaderRef mapDownloader; // created lazy, guarded by mutex
+ VoiceManagerRef voiceManager; // created lazy, guarded by mutex
private:
OSMScoutQt(SettingsRef settings,
@@ -301,6 +308,7 @@
DBThreadRef GetDBThread() const;
SettingsRef GetSettings() const;
MapManagerRef GetMapManager() const;
+ MapDownloaderRef GetMapDownloader();
VoiceManagerRef GetVoiceManager();
LookupModule* MakeLookupModule();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OnlineTileProviderModel.h
^
|
@@ -20,37 +20,37 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <QAbstractListModel>
-
#include <osmscoutclient/OnlineTileProvider.h>
+#include <osmscoutclient/DBThread.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
+#include <QAbstractListModel>
+
namespace osmscout {
/**
* \ingroup QtAPI
- *
+ *
* Provide Qt model with loaded online tile providers (see Settings::loadOnlineTileProviders).
* It should be registered by qmlRegisterType method before first usage.
- *
+ *
* Usage in QML (Silica UI example):
* ```
* import harbour.osmscout.map 1.0
- *
+ *
* Settings {
* id: settings
* }
- *
+ *
* ComboBox {
* id: onlineTileProviderComboBox
* property bool initialized: false
- *
+ *
* OnlineTileProviderModel{
* id: providerModel
* }
- *
+ *
* menu: ContextMenu {
* Repeater {
* width: parent.width
@@ -60,7 +60,7 @@
* }
* }
* }
- *
+ *
* onCurrentItemChanged: {
* if (!initialized){
* return;
@@ -81,7 +81,7 @@
*/
class OSMSCOUT_CLIENT_QT_API OnlineTileProviderModel : public QAbstractListModel {
Q_OBJECT
-
+
public:
inline OnlineTileProviderModel()
{
@@ -91,16 +91,17 @@
onlineProviders << provider;
}
};
-
+
virtual inline ~OnlineTileProviderModel(){};
-
+
enum Roles {
NameRole = Qt::UserRole,
IdRole = Qt::UserRole+1,
};
- Q_INVOKABLE virtual int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const
+ Q_INVOKABLE virtual int inline rowCount(const QModelIndex &parent = QModelIndex()) const
{
+ Q_UNUSED(parent);
return onlineProviders.size();
};
@@ -111,7 +112,7 @@
Q_INVOKABLE int count() const;
Q_INVOKABLE QString getId(int row) const;
Q_INVOKABLE QString getName(int row) const;
-
+
private:
QList<OnlineTileProvider> onlineProviders;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OpeningHoursModel.h
^
|
@@ -65,8 +65,9 @@
OpeningHoursModel& operator=(const OpeningHoursModel&) = delete;
OpeningHoursModel& operator=(OpeningHoursModel&&) = delete;
- Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
+ Q_INVOKABLE int inline rowCount(const QModelIndex &parent = QModelIndex()) const override
{
+ Q_UNUSED(parent);
return model.size();
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/PlaneMapRenderer.h
^
|
@@ -24,9 +24,12 @@
#include <QObject>
#include <QSettings>
#include <QElapsedTimer>
+#include <QTimer>
#include <osmscoutmap/DataTileCache.h>
-#include <osmscoutclientqt/DBThread.h>
+
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/MapRenderer.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
@@ -74,7 +77,6 @@
size_t epoch{0};
signals:
- //void TileStatusChanged(const osmscout::TileRef& tile);
void TriggerMapRenderingSignal(const MapViewStruct& request, size_t requestEpoch);
void TriggerInitialRendering();
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/QtStdConverters.h
^
|
@@ -0,0 +1,57 @@
+#ifndef OSMSCOUT_CLIENT_QT_QTSTDCONVERTERS_H
+#define OSMSCOUT_CLIENT_QT_QTSTDCONVERTERS_H
+
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscout/util/Time.h>
+
+#include <QDateTime>
+#include <QStringList>
+#include <QDir>
+
+#include <filesystem>
+#include <vector>
+
+namespace osmscout {
+
+extern OSMSCOUT_CLIENT_QT_API std::vector<std::string> QStringListToStringVector(const QStringList &list);
+
+extern OSMSCOUT_CLIENT_QT_API QStringList StringVectorToQStringList(const std::vector<std::string> &v);
+
+extern OSMSCOUT_CLIENT_QT_API QDateTime TimestampToQDateTime(const osmscout::Timestamp &ts);
+
+extern OSMSCOUT_CLIENT_QT_API QList<QDir> PathVectorToQDirList(const std::vector<std::filesystem::path> &paths);
+
+template <typename T>
+QList<T> vectorToQList(const std::vector<T> &vec)
+{
+ QList<T> result;
+ for (const auto &o: vec) {
+ result << o;
+ }
+ return result;
+}
+
+}
+
+#endif //OSMSCOUT_CLIENT_QT_QTSTDCONVERTERS_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/Router.h
^
|
@@ -31,8 +31,8 @@
#include <osmscoutmap/DataTileCache.h>
#include <osmscoutclient/Settings.h>
+#include <osmscoutclient/DBThread.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/RouteDescriptionBuilder.h>
#include <osmscoutclientqt/QmlRoutingProfile.h>
#include <osmscoutclientqt/LocationEntry.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/RoutingModel.h
^
|
@@ -24,10 +24,11 @@
#include <osmscout/async/Breaker.h>
#include <osmscout/routing/RouteDescription.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <osmscoutclientqt/SearchLocationModel.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/Router.h>
#include <osmscoutclientqt/OverlayObject.h>
#include <osmscoutclientqt/QmlRoutingProfile.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/SearchLocationModel.h
^
|
@@ -24,6 +24,7 @@
#include <QObject>
#include <QAbstractListModel>
#include <QJSValue>
+#include <QTimer>
#include <osmscout/GeoCoord.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/SearchModule.h
^
|
@@ -20,7 +20,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/LookupModule.h>
#ifdef OSMSCOUT_HAVE_LIB_MARISA
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/StyleFlagsModel.h
^
|
@@ -24,6 +24,7 @@
#include <QObject>
#include <QAbstractListModel>
+#include <QSet>
#include <osmscoutclientqt/StyleModule.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
@@ -61,8 +62,9 @@
StyleFlagsModel();
~StyleFlagsModel() override;
- Q_INVOKABLE int inline rowCount(const QModelIndex &/*parent = QModelIndex()*/) const override
+ Q_INVOKABLE int inline rowCount(const QModelIndex &parent = QModelIndex()) const override
{
+ Q_UNUSED(parent);
return mapFlags.size();
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/StyleModule.h
^
|
@@ -23,8 +23,9 @@
#include <QObject>
#include <QThread>
#include <QMutex>
+#include <QMap>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
@@ -41,8 +42,20 @@
QThread *thread;
DBThreadRef dbThread;
+ Slot<osmscout::GeoBox> dbLoadedSlot{
+ [this](const osmscout::GeoBox &b) {
+ emit initialisationFinished(b);
+ }
+ };
+
+ Slot<> stylesheetFilenameChangeSlot{
+ [this]() {
+ emit stylesheetFilenameChanged();
+ }
+ };
+
signals:
- void initialisationFinished(const DatabaseLoadedResponse& response);
+ void initialisationFinished(const osmscout::GeoBox& response);
void stylesheetFilenameChanged();
void styleFlagsChanged(QMap<QString,bool>);
void flagSet(QString key, bool value);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/TiledMapRenderer.h
^
|
@@ -26,7 +26,8 @@
#include <osmscoutmap/DataTileCache.h>
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/MapRenderer.h>
#include <osmscoutclientqt/TileCache.h>
#include <osmscoutclientqt/OsmTileDownloader.h>
@@ -78,22 +79,16 @@
QColor unknownColor;
- Slot<OnlineTileProvider> onlineTileProviderSlot{
- [this](const OnlineTileProvider &provider) { onlineTileProviderSignal(provider); }
- };
-
- Slot<bool> onlineTileEnabledSlot{
- [this](const bool &b) { onlineTilesEnabledSignal(b); }
- };
-
- Slot<bool> offlineMapChangedSlot{
- [this](const bool &b) { offlineMapChangedSignal(b); }
- };
+ Slot<OnlineTileProvider> onlineTileProviderSlot{ std::bind(&TiledMapRenderer::onlineTileProviderSignal, this, std::placeholders::_1) };
+ Slot<bool> onlineTileEnabledSlot{ std::bind(&TiledMapRenderer::onlineTilesEnabledSignal, this, std::placeholders::_1) };
+ Slot<bool> offlineMapChangedSlot{ std::bind(&TiledMapRenderer::offlineMapChangedSignal, this, std::placeholders::_1) };
+ Slot<GeoBox> databaseLoadFinishedSlot{ std::bind(&TiledMapRenderer::databaseLoadFinished, this, std::placeholders::_1) };
signals:
void onlineTileProviderSignal(OnlineTileProvider provider);
void onlineTilesEnabledSignal(bool);
void offlineMapChangedSignal(bool);
+ void databaseLoadFinished(const GeoBox &geoBox);
public slots:
virtual void Initialize();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/TiledRenderingHelper.h
^
|
@@ -20,8 +20,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/TileCache.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/libosmscout-client-qt.pro
^
|
@@ -13,7 +13,7 @@
src/osmscoutclientqt/LocationEntry.cpp \
src/osmscoutclientqt/LocationInfoModel.cpp \
src/osmscoutclientqt/MapDownloadsModel.cpp \
- src/osmscoutclientqt/MapManager.cpp \
+ src/osmscoutclientqt/MapDownloader.cpp \
src/osmscoutclientqt/MapProvider.cpp \
src/osmscoutclientqt/MapWidget.cpp \
src/osmscoutclientqt/OnlineTileProvider.cpp \
@@ -38,13 +38,12 @@
HEADERS += \
include/osmscoutclientqt/AvailableMapsModel.h \
include/osmscoutclientqt/ClientQtFeatures.h \
- include/osmscoutclientqt/DBThread.h \
include/osmscoutclientqt/FileDownloader.h \
include/osmscoutclientqt/InputHandler.h \
include/osmscoutclientqt/LocationEntry.h \
include/osmscoutclientqt/LocationInfoModel.h \
include/osmscoutclientqt/MapDownloadsModel.h \
- include/osmscoutclientqt/MapManager.h \
+ include/osmscoutclientqt/MapDownloader.h \
include/osmscoutclientqt/MapProvider.h \
include/osmscoutclientqt/MapWidget.h \
include/osmscoutclientqt/OnlineTileProvider.h \
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/meson.build
^
|
@@ -1,5 +1,4 @@
osmscoutclientqtSrc = [
- 'src/osmscoutclientqt/DBThread.cpp',
'src/osmscoutclientqt/ElevationChartWidget.cpp',
'src/osmscoutclientqt/ElevationModule.cpp',
'src/osmscoutclientqt/RoutingModel.cpp',
@@ -10,6 +9,7 @@
'src/osmscoutclientqt/QmlSettings.cpp',
'src/osmscoutclientqt/QtRouteData.cpp',
'src/osmscoutclientqt/QtSettingsStorage.cpp',
+ 'src/osmscoutclientqt/QtStdConverters.cpp',
'src/osmscoutclientqt/NavigationModule.cpp',
'src/osmscoutclientqt/NavigationModel.cpp',
'src/osmscoutclientqt/VehiclePosition.cpp',
@@ -27,13 +27,13 @@
'src/osmscoutclientqt/FileDownloader.cpp',
'src/osmscoutclientqt/IconAnimation.cpp',
'src/osmscoutclientqt/IconLookup.cpp',
- 'src/osmscoutclientqt/MapManager.cpp',
+ 'src/osmscoutclientqt/MapDownloader.cpp',
'src/osmscoutclientqt/MapDownloadsModel.cpp',
'src/osmscoutclientqt/MapObjectInfoModel.cpp',
'src/osmscoutclientqt/MapStyleModel.cpp',
'src/osmscoutclientqt/StyleFlagsModel.cpp',
'src/osmscoutclientqt/OSMScoutQt.cpp',
- 'src/osmscoutclientqt/DBJob.cpp',
+ 'src/osmscoutclientqt/DBLoadJob.cpp',
'src/osmscoutclientqt/LookupModule.cpp',
'src/osmscoutclientqt/SearchModule.cpp',
'src/osmscoutclientqt/StyleModule.cpp',
@@ -46,7 +46,6 @@
'src/osmscoutclientqt/TiledMapOverlay.cpp',
'src/osmscoutclientqt/TiledRenderingHelper.cpp',
'src/osmscoutclientqt/NearPOIModel.cpp',
- 'src/osmscoutclientqt/POILookupModule.cpp',
'src/osmscoutclientqt/InstalledMapsModel.cpp',
'src/osmscoutclientqt/Voice.cpp',
'src/osmscoutclientqt/VoiceManager.cpp',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/AvailableMapsModel.cpp
^
|
@@ -19,9 +19,10 @@
#include <osmscout/util/String.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/AvailableMapsModel.h>
#include <osmscoutclientqt/PersistentCookieJar.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
#include <QString>
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBLoadJob.cpp
^
|
@@ -0,0 +1,197 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2017 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <QDebug>
+#include <osmscoutclientqt/DBLoadJob.h>
+
+namespace osmscout {
+
+DBLoadJob::DBLoadJob(osmscout::MercatorProjection lookupProjection,
+ unsigned long maximumAreaLevel,
+ bool lowZoomOptimization,
+ bool closeOnFinish):
+ DBJob(),
+ closeOnFinish(closeOnFinish),
+ breaker(std::make_shared<ThreadedBreaker>()),
+ lookupProjection(lookupProjection)
+{
+ //qDebug() << "create: " << this << " in " << QThread::currentThread();
+
+ searchParameter.SetMaximumAreaLevel(maximumAreaLevel);
+ searchParameter.SetUseMultithreading(true);
+ searchParameter.SetUseLowZoomOptimization(lowZoomOptimization);
+ searchParameter.SetBreaker(breaker);
+
+ connect(this, &DBLoadJob::tileStateChanged,
+ this, &DBLoadJob::onTileStateChanged,
+ Qt::QueuedConnection);
+}
+
+DBLoadJob::~DBLoadJob()
+{
+ //qDebug() << "destroying:" << this << "in" << QThread::currentThread();
+
+ // we have to call Close from ~DBLoadJob
+ // it (DBLoadJob::Close) is unreachable when ~DBJob is called
+ Close();
+ //qDebug() << "destroyed:" << this << "in" << QThread::currentThread();
+}
+
+void DBLoadJob::Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
+ const std::list<DBInstanceRef> &databases,
+ std::shared_lock<std::shared_mutex> &&locker)
+{
+ osmscout::GeoBox lookupBox(lookupProjection.GetDimensions());
+ std::list<DBInstanceRef> relevantDatabases;
+ for (const auto &db:databases){
+ if (!db->IsOpen() || (!db->GetStyleConfig())) {
+ log.Warn() << "Database is not ready" << db->path;
+ continue;
+ }
+ osmscout::GeoBox dbBox=db->GetDBGeoBox();
+ if (!dbBox.Intersects(lookupBox)){
+ log.Debug() << "Skip db" << db->path;
+ continue;
+ }
+ relevantDatabases.push_back(db);
+ }
+
+ DBJob::Run(basemapDatabase,relevantDatabases,std::move(locker));
+ for (auto &db:relevantDatabases){
+ std::list<osmscout::TileRef> tiles;
+ db->GetMapService()->LookupTiles(lookupProjection,tiles);
+
+ QString path=QString::fromStdString(db->path);
+ osmscout::MapService::TileStateCallback callback=[this,path](const osmscout::TileRef& tile) {
+ //std::cout << "callback called for job: " << this << std::endl;
+ emit tileStateChanged(path,tile);
+ };
+
+ osmscout::MapService::CallbackId callbackId=db->GetMapService()->RegisterTileStateCallback(callback);
+ //std::cout << "callback registered for job: " << this << " " << db->path.toStdString() << ": " << callbackId << std::endl ;
+ callbacks[path]=callbackId;
+ loadedTiles[path]=QMap<osmscout::TileKey,osmscout::TileRef>();
+ QMap<osmscout::TileKey,osmscout::TileRef> tileMap;
+ for (const auto &tile:tiles){
+ tileMap[tile->GetKey()]=tile;
+ }
+ allTiles[path]=tileMap;
+ loadingTiles[path]=tileMap;
+
+ // load tiles asynchronous
+ db->GetMapService()->LoadMissingTileDataAsync(searchParameter,
+ *db->GetStyleConfig(),
+ tiles);
+
+ // process already completed tiles (state callback is not called in such case)
+ for (auto &tile:tiles){
+ if (tile->IsComplete()){
+ emit tileStateChanged(path,tile);
+ }
+ }
+
+ }
+ if (relevantDatabases.empty()){
+ emit finished(loadedTiles);
+ //qDebug() << "Loaded completely (no relevant databases):" << this << "in" << QThread::currentThread();
+ if (closeOnFinish){
+ Close();
+ }
+ }
+}
+
+void DBLoadJob::onTileStateChanged(QString dbPath,const osmscout::TileRef tile)
+{
+ if (!tile->IsComplete()){
+ return; // ignore incomplete
+ }
+ assert(threadId==std::this_thread::get_id());
+ if (!loadingTiles.contains(dbPath)){
+ return; // loaded already
+ }
+
+ QMap<osmscout::TileKey,osmscout::TileRef> &loadingTileMap=loadingTiles[dbPath];
+ auto tileIt=loadingTileMap.find(tile->GetKey());
+ if (tileIt==loadingTileMap.end()){
+ return; // not our request, ignore
+ }
+
+ // mark as complete
+ QMap<osmscout::TileKey,osmscout::TileRef> &loadedTileMap=loadedTiles[dbPath];
+ loadedTileMap[tile->GetKey()]=tileIt.value();
+ loadingTileMap.remove(tile->GetKey());
+
+ if (loadingTileMap.isEmpty()){ // this db is finished
+ loadingTiles.remove(dbPath);
+ emit databaseLoaded(dbPath,loadedTileMap.values());
+ if (loadingTiles.isEmpty()){ // all databases are finished
+ emit finished(loadedTiles);
+ //qDebug() << "Loaded completely:" << this << "in" << QThread::currentThread();
+ if (closeOnFinish){
+ Close();
+ }
+ }
+ }
+}
+
+void DBLoadJob::Close()
+{
+ // stop asynchronous loading if it is still running
+ breaker->Break();
+
+ // deregister callbacks
+ for (auto &db:databases){
+ QString path=QString::fromStdString(db->path);
+ if (callbacks.contains(path)){
+ //qDebug() << "Remove callback for job:" << this << ":" << callbacks[db->path] << "in" << QThread::currentThread();
+ db->GetMapService()->DeregisterTileStateCallback(callbacks[path]);
+ callbacks.remove(path);
+ }
+ }
+
+ DBJob::Close();
+}
+
+bool DBLoadJob::IsFinished() const
+{
+ return loadingTiles.isEmpty();
+}
+
+QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>> DBLoadJob::GetAllTiles() const
+{
+ return allTiles;
+}
+
+bool DBLoadJob::AddTileDataToMapData(QString dbPath,
+ const QList<osmscout::TileRef> &tiles,
+ osmscout::MapData &data)
+{
+ for (auto &db:databases){
+ if (db->path==dbPath.toStdString()){
+ std::list<osmscout::TileRef> tileList;
+ for (const auto &tile:tiles){
+ tileList.push_back(tile);
+ }
+ db->GetMapService()->AddTileDataToMapData(tileList,data);
+ return true;
+ }
+ }
+ return false;
+}
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/ElevationModule.cpp
^
|
@@ -20,6 +20,8 @@
#include <osmscoutclientqt/ElevationModule.h>
#include <osmscout/elevation/ElevationService.h>
+#include <QDebug>
+
namespace osmscout {
ElevationModule::ElevationModule(QThread *thread,DBThreadRef dbThread):
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/FileDownloader.cpp
^
|
@@ -62,7 +62,7 @@
return;
}
- file.setFileName(path + ".download");
+ file.setFileName(path + FileDownloaderConfig::TemporaryFileSuffix);
if (!file.open(QIODevice::WriteOnly)) {
isOk = false;
qWarning() << "Cannot open file:" << file.fileName();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/IconAnimation.cpp
^
|
@@ -19,6 +19,8 @@
#include <osmscoutclientqt/IconAnimation.h>
+#include <osmscoutclientqt/DBLoadJob.h>
+
#include <cmath>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/IconLookup.cpp
^
|
@@ -22,6 +22,7 @@
#include <cmath>
#include <QSvgRenderer>
+#include <QDebug>
#include <osmscout/feature/OpeningHoursFeature.h>
#include <osmscout/feature/OperatorFeature.h>
@@ -30,8 +31,6 @@
#include <osmscoutmapqt/SymbolRendererQt.h>
-
-
namespace osmscout {
IconLookup::IconLookup(QThread *thread, DBThreadRef dbThread, QString iconDirectory):
@@ -310,7 +309,7 @@
connect(loadJob, &DBLoadJob::finished,
this, &IconLookup::onLoadJobFinished);
- dbThread->RunJob(loadJob);
+ dbThread->RunJob(std::bind(&DBLoadJob::Run, loadJob, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/InstalledMapsModel.cpp
^
|
@@ -19,6 +19,7 @@
#include <osmscoutclientqt/InstalledMapsModel.h>
#include <osmscoutclientqt/OSMScoutQt.h>
+#include <osmscoutclientqt/QtStdConverters.h>
#include <algorithm>
@@ -27,10 +28,10 @@
InstalledMapsModel::InstalledMapsModel()
{
mapManager=OSMScoutQt::GetInstance().GetMapManager();
- connect(mapManager.get(), &MapManager::databaseListChanged,
+ connect(this, &InstalledMapsModel::databaseListChanged,
this, &InstalledMapsModel::onDatabaseListChanged);
- connect(mapManager.get(), &MapManager::databaseListChanged,
- this, &InstalledMapsModel::databaseListChanged);
+
+ mapManager->databaseListChanged.Connect(databaseListChangedSlot);
onDatabaseListChanged();
}
@@ -40,7 +41,7 @@
void InstalledMapsModel::onDatabaseListChanged()
{
- QList<MapDirectory> currentDirs=mapManager->getDatabaseDirectories();
+ std::vector<MapDirectory> currentDirs=mapManager->GetDatabaseDirectories();
std::stable_sort(currentDirs.begin(), currentDirs.end());
@@ -50,14 +51,14 @@
// process removals
QMap<QString, MapDirectory> currentDirMap;
for (const auto& dir: currentDirs){
- currentDirMap[dir.getDir().absolutePath()] = dir;
+ currentDirMap[QString::fromStdString(dir.GetDirStr())] = dir;
}
bool deleteDone=false;
while (!deleteDone){
deleteDone=true;
for (int row=0;row<dirs.size(); row++){
- if (!currentDirMap.contains(dirs.at(row).getDir().absolutePath())){
+ if (!currentDirMap.contains(QString::fromStdString(dirs.at(row).GetDirStr()))){
beginRemoveRows(QModelIndex(), row, row);
dirs.removeAt(row);
endRemoveRows();
@@ -70,16 +71,16 @@
// process adds
QMap<QString, MapDirectory> oldDirMap;
for (const auto& dir: dirs){
- oldDirMap[dir.getDir().absolutePath()] = dir;
+ oldDirMap[QString::fromStdString(dir.GetDirStr())] = dir;
}
- for (int row = 0; row < currentDirs.size(); row++) {
+ for (size_t row = 0; row < currentDirs.size(); row++) {
const auto& dir = currentDirs.at(row);
- if (!oldDirMap.contains(dir.getDir().absolutePath())){
+ if (!oldDirMap.contains(QString::fromStdString(dir.GetDirStr()))){
beginInsertRows(QModelIndex(), row, row);
dirs.insert(row, dir);
endInsertRows();
- oldDirMap[dir.getDir().absolutePath()] = dir;
+ oldDirMap[QString::fromStdString(dir.GetDirStr())] = dir;
}
}
}
@@ -99,19 +100,19 @@
switch (role) {
case Qt::DisplayRole:
case NameRole:
- return dir.hasMetadata() ? dir.getName() : dir.getDir().dirName();
+ return dir.HasMetadata() ? QString::fromStdString(dir.GetName()) : QString::fromStdString(dir.GetDirStr());
case PathRole:
- return dir.hasMetadata() ? dir.getPath() : QStringList();
+ return dir.HasMetadata() ? StringVectorToQStringList(dir.GetPath()) : QStringList();
case DirectoryRole:
- return dir.getDir().canonicalPath();
+ return QString::fromStdString(dir.GetDirStr());
case TimeRole:
- return dir.hasMetadata() ? dir.getCreation() : QVariant();
+ return dir.HasMetadata() ? TimestampToQDateTime(dir.GetCreation()) : QVariant();
case ByteSizeRole:
- return dir.byteSize();
+ return qint64(dir.ByteSize());
case SizeRole:
- return QString::fromStdString(osmscout::ByteSizeToString(double(dir.byteSize())));
+ return QString::fromStdString(osmscout::ByteSizeToString(double(dir.ByteSize())));
case VersionRole:
- return dir.hasMetadata() ? dir.getVersion() : 0;
+ return dir.HasMetadata() ? dir.GetVersion() : 0;
default:
break;
}
@@ -150,12 +151,12 @@
for (int row = fromRow; row < (fromRow + count); row++){
auto dir=dirs.at(row);
- if (!dir.deleteDatabase()){
- qWarning() << "Failed to remove " << dir.getDir().absolutePath();
+ if (!dir.DeleteDatabase()){
+ qWarning() << "Failed to remove " << QString::fromStdString(dir.GetDirStr());
break;
}
}
- mapManager->lookupDatabases();
+ mapManager->LookupDatabases();
return true;
}
@@ -170,8 +171,8 @@
return QVariant();
}
for (const auto &dir:dirs){
- if (dir.hasMetadata() && dir.getPath()==path){
- return dir.getCreation();
+ if (dir.HasMetadata() && StringVectorToQStringList(dir.GetPath())==path){
+ return TimestampToQDateTime(dir.GetCreation());
}
}
return QVariant();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LocationEntry.cpp
^
|
@@ -19,13 +19,15 @@
*/
#include <osmscoutclientqt/LocationEntry.h>
+#include <osmscoutclientqt/QtStdConverters.h>
+
#include <osmscout/util/Geometry.h>
#include <iostream>
namespace osmscout {
-LocationEntry::LocationEntry(Type type,
+LocationEntry::LocationEntry(LocationInfo::Type type,
const QString& label,
const QString& altName,
const QString& objectType,
@@ -51,7 +53,7 @@
const osmscout::GeoCoord& coord,
QObject* parent)
: QObject(parent),
- type(typeCoordinate),
+ type(LocationInfo::Type::typeCoordinate),
label(label),
coord(coord)
{
@@ -60,11 +62,27 @@
LocationEntry::LocationEntry(QObject* parent)
: QObject(parent),
- type(typeNone)
+ type(LocationInfo::Type::typeNone)
{
// no code
}
+LocationEntry::LocationEntry(const LocationInfo &info):
+ LocationEntry(info.type,
+ QString::fromStdString(info.label),
+ QString::fromStdString(info.altName),
+ QString::fromStdString(info.objectType),
+ vectorToQList<>(info.adminRegionList),
+ QString::fromStdString(info.database),
+ info.coord,
+ info.bbox,
+ nullptr)
+{
+ for (const auto &ref: info.references) {
+ addReference(ref);
+ }
+}
+
LocationEntry::LocationEntry(const LocationEntry& other)
: QObject(other.parent()), // make copy of Qt ownership
type(other.type),
@@ -126,14 +144,14 @@
void LocationEntry::addReference(const osmscout::ObjectFileRef reference)
{
- assert(type==typeObject);
+ assert(type==LocationInfo::Type::typeObject);
references.push_back(reference);
}
void LocationEntry::mergeWith(const LocationEntry &location)
{
- assert(type==typeObject);
- assert(location.type==typeObject);
+ assert(type==LocationInfo::Type::typeObject);
+ assert(location.type==LocationInfo::Type::typeObject);
bbox.Include(location.bbox);
for (auto &ref:location.getReferences()) {
@@ -150,7 +168,7 @@
return osmscout::GetSphericalDistance(coord, osmscout::GeoCoord(lat, lon)).AsMeter();
}
-LocationEntry::Type LocationEntry::getType() const
+LocationInfo::Type LocationEntry::getType() const
{
return type;
}
@@ -158,9 +176,9 @@
QString LocationEntry::getTypeString() const
{
switch (type){
- case typeObject:
+ case LocationInfo::Type::typeObject:
return "object";
- case typeCoordinate:
+ case LocationInfo::Type::typeCoordinate:
return "coordinate";
default:
return "none";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LocationInfoModel.cpp
^
|
@@ -89,7 +89,7 @@
emit locationDescriptionRequested(location);
}
-void LocationInfoModel::dbInitialized(const DatabaseLoadedResponse&)
+void LocationInfoModel::dbInitialized(const osmscout::GeoBox&)
{
if (setup){
emit locationDescriptionRequested(location);
@@ -333,21 +333,21 @@
const AdminRegionInfoRef bottom=regions.first();
QStringList regionNames=LookupModule::AdminRegionNames(regions, settings->GetShowAltLanguage());
- obj[LabelRole] = bottom->qStringName();
+ obj[LabelRole] = QString::fromStdString(bottom->name());
obj[RegionRole] = regionNames;
- obj[AddressRole] = bottom->qStringName();
+ obj[AddressRole] = QString::fromStdString(bottom->name());
obj[InPlaceRole] = true;
obj[DistanceRole] = 0;
obj[BearingRole] = "";
obj[PoiRole] = "";
- obj[TypeRole] = bottom->type;
+ obj[TypeRole] = QString::fromStdString(bottom->type);
obj[PostalCodeRole] = "";
obj[WebsiteRole] = "";
obj[PhoneRole] = "";
obj[AddressLocationRole] = "";
obj[AddressNumberRole] = "";
obj[IndexedAdminRegionRole] = QStringList();
- obj[AltLangName] = bottom->qStringAltName();
+ obj[AltLangName] = QString::fromStdString(bottom->altName());
obj[OpeningHours] = "";
model << obj;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LookupModule.cpp
^
|
@@ -34,9 +34,7 @@
dbThread(dbThread),
loadJob(nullptr)
{
-
- connect(dbThread.get(), &DBThread::initialisationFinished,
- this, &LookupModule::initialisationFinished);
+ dbThread->databaseLoadFinished.Connect(dbLoadedSlot);
}
LookupModule::~LookupModule()
@@ -75,7 +73,7 @@
connect(loadJob, &DBLoadJob::finished,
this, &LookupModule::onLoadJobFinished);
- dbThread->RunJob(loadJob);
+ dbThread->RunJob(std::bind(&DBLoadJob::Run, loadJob, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
}
void LookupModule::addObjectInfo(QList<ObjectInfo> &objectList, // output
@@ -343,7 +341,7 @@
return info;
}
- info->database=QString::fromStdString(db->path);
+ info->database=db->path;
// read admin region features
auto database=db->GetDatabase();
@@ -361,19 +359,19 @@
case osmscout::refNode:
if (database->GetNodeByOffset(region->object.GetFileOffset(), node)) {
adminLevelValue=adminLevelReader.GetValue(node->GetFeatureValueBuffer());
- info->type=QString::fromStdString(node->GetType()->GetName());
+ info->type=node->GetType()->GetName();
}
break;
case osmscout::refWay:
if (database->GetWayByOffset(region->object.GetFileOffset(), way)) {
adminLevelValue=adminLevelReader.GetValue(way->GetFeatureValueBuffer());
- info->type=QString::fromStdString(way->GetType()->GetName());
+ info->type=way->GetType()->GetName();
}
break;
case osmscout::refArea:
if (database->GetAreaByOffset(region->object.GetFileOffset(), area)) {
adminLevelValue=adminLevelReader.GetValue(area->GetFeatureValueBuffer());
- info->type=QString::fromStdString(area->GetType()->GetName());
+ info->type=area->GetType()->GetName();
}
break;
case osmscout::refNone:
@@ -499,7 +497,7 @@
QString previousName;
QString name;
for (const auto ®ion: regionList) {
- name = (useAltNames && !region->altName().empty()) ? region->qStringAltName() : region->qStringName();
+ name = QString::fromStdString( (useAltNames && !region->altName().empty()) ? region->altName() : region->name());
if (previousName != name) {
result << name;
previousName = name;
@@ -517,7 +515,7 @@
}
for (const auto ®ion:regionList) {
if (region->adminLevel >= 0 && region->adminLevel < result.size()) {
- result[region->adminLevel] = (useAltNames && !region->altName().empty()) ? region->qStringAltName() : region->qStringName();
+ result[region->adminLevel] = QString::fromStdString((useAltNames && !region->altName().empty()) ? region->altName() : region->name());
}
}
return result;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapDownloader.cpp
^
|
@@ -0,0 +1,186 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2016 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <QDirIterator>
+#include <QDebug>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
+
+#include <osmscoutclientqt/MapDownloader.h>
+#include <osmscoutclientqt/PersistentCookieJar.h>
+#include <osmscoutclientqt/QtStdConverters.h>
+
+#include <osmscout/TypeConfig.h>
+#include <osmscout/log/Logger.h>
+
+namespace osmscout {
+
+MapDownloadJob::MapDownloadJob(QNetworkAccessManager *webCtrl,
+ AvailableMapsModelMap map,
+ QDir target,
+ bool replaceExisting):
+ DownloadJob(webCtrl, target, replaceExisting),
+ map(map)
+{
+}
+
+MapDownloadJob::~MapDownloadJob()
+{
+ if (started && !successful){
+ // delete partial db
+ clearJobs(); // need to remove temporary files before deleting db directory
+ MapDirectory dir(target.absolutePath().toStdString());
+ dir.DeleteDatabase();
+ }
+}
+
+void MapDownloadJob::start()
+{
+ using namespace std::chrono;
+ if (target.exists()){
+ MapDirectory mapDir(target.absolutePath().toStdString());
+ if (mapDir.HasMetadata() &&
+ !mapDir.IsValid() &&
+ StringVectorToQStringList(mapDir.GetPath()) == map.getPath() &&
+ duration_cast<milliseconds>(mapDir.GetCreation().time_since_epoch()).count() == map.getCreation().toMSecsSinceEpoch()) {
+ // directory contains partial download
+ // (contains downloader metadata, but not all required files)
+ if (!mapDir.DeleteDatabase()) {
+ qWarning() << "Failed to clean up partial download" << target.canonicalPath()<<"!";
+ onJobFailed("Directory already exists", false);
+ return;
+ }
+ } else {
+ qWarning() << "Directory already exists" << target.canonicalPath()<<"!";
+ onJobFailed("Directory already exists", false);
+ return;
+ }
+ }
+
+ if (!target.mkpath(target.path())) {
+ qWarning() << "Can't create directory" << target.canonicalPath() << "!";
+ onJobFailed("Can't create directory", false);
+ return;
+ }
+
+ started=true;
+ QStorageInfo storage=QStorageInfo(target);
+ if (storage.bytesAvailable() > 0 && (uint64_t)storage.bytesAvailable() < map.getSize()){
+ qWarning() << "Free space" << storage.bytesAvailable() << "bytes is less than map size (" << map.getSize() << ")!";
+ onJobFailed("Not enough space", false);
+ return;
+ }
+
+ QJsonObject mapMetadata;
+ mapMetadata["name"] = map.getName();
+ mapMetadata["map"] = map.getPath().join("/");
+ mapMetadata["version"] = map.getVersion();
+#if QT_VERSION > QT_VERSION_CHECK(5, 8, 0) /* For compatibility with QT 5.6 */
+ mapMetadata["creation"] = (double)map.getCreation().toSecsSinceEpoch();
+#else
+ mapMetadata["creation"] = (double)map.getCreation().toTime_t();
+#endif
+
+ QJsonDocument doc(mapMetadata);
+ QFile metadataFile(target.filePath(MapDirectory::FileMetadata));
+ metadataFile.open(QFile::OpenModeFlag::WriteOnly);
+ metadataFile.write(doc.toJson());
+ metadataFile.close();
+ if (metadataFile.error() != QFile::FileError::NoError){
+ done = true;
+ error = metadataFile.errorString();
+ emit failed(metadataFile.errorString());
+ return;
+ }
+
+ QStringList fileNames = StringVectorToQStringList(MapDirectory::OptionalFiles()) + StringVectorToQStringList(MapDirectory::MandatoryFiles());
+
+ DownloadJob::start(QString::fromStdString(map.getProvider().getUri())+"/"+map.getServerDirectory(), fileNames);
+}
+
+MapDownloader::MapDownloader(MapManagerRef mapManager, SettingsRef settings):
+ mapManager(mapManager)
+{
+ osmscout::log.Debug() << "MapDownloader ctor";
+ webCtrl.setCookieJar(new PersistentCookieJar(settings));
+ // we don't use disk cache here
+}
+
+MapDownloader::~MapDownloader(){
+ for (auto& job:downloadJobs){
+ delete job;
+ }
+ downloadJobs.clear();
+}
+
+void MapDownloader::downloadMap(AvailableMapsModelMap map, QDir dir, bool replaceExisting)
+{
+ auto* job=new MapDownloadJob(&webCtrl, map, dir, replaceExisting);
+ connect(job, &MapDownloadJob::finished, this, &MapDownloader::onJobFinished);
+ connect(job, &MapDownloadJob::canceled, this, &MapDownloader::onJobFinished);
+ connect(job, &MapDownloadJob::failed, this, &MapDownloader::onJobFailed);
+ downloadJobs<<job;
+ emit downloadJobsChanged();
+ downloadNext();
+}
+
+void MapDownloader::downloadNext()
+{
+ for (const auto* job:downloadJobs){
+ if (job->isDownloading()){
+ return;
+ }
+ }
+ for (const auto& job:downloadJobs){
+ job->start();
+ break;
+ }
+}
+
+void MapDownloader::onJobFailed(QString errorMessage)
+{
+ onJobFinished();
+ emit mapDownloadFails(errorMessage);
+}
+
+void MapDownloader::onJobFinished()
+{
+ QList<MapDownloadJob*> finished;
+ for (auto *job:downloadJobs){
+ if (job->isDone()){
+ finished << job;
+
+ if (job->isReplaceExisting() && job->isSuccessful()){
+ // if there is upgrade requested, delete old db with same (logical) path
+ mapManager->DeleteOther(QStringListToStringVector(job->getMapPath()), job->getDestinationDirectory().canonicalPath().toStdString());
+ }
+ }
+ }
+ if (!finished.isEmpty()){
+ mapManager->LookupDatabases();
+ }
+ for (auto *job:finished){
+ downloadJobs.removeOne(job);
+ emit downloadJobsChanged();
+ job->deleteLater();
+ }
+ downloadNext();
+}
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapDownloadsModel.cpp
^
|
@@ -26,22 +26,21 @@
MapDownloadsModel::MapDownloadsModel(QObject *parent):
QAbstractListModel(parent){
- mapManager=OSMScoutQt::GetInstance().GetMapManager();
- connect(mapManager.get(), &MapManager::downloadJobsChanged, this, &MapDownloadsModel::onDownloadJobsChanged);
- connect(mapManager.get(), &MapManager::mapDownloadFails, this, &MapDownloadsModel::mapDownloadFails);
+ mapDownloader=OSMScoutQt::GetInstance().GetMapDownloader();
+ connect(mapDownloader.get(), &MapDownloader::downloadJobsChanged, this, &MapDownloadsModel::onDownloadJobsChanged);
+ connect(mapDownloader.get(), &MapDownloader::mapDownloadFails, this, &MapDownloadsModel::mapDownloadFails);
onDownloadJobsChanged();
}
QString MapDownloadsModel::suggestedDirectory(QObject *obj, QString rootDirectory)
{
auto mapManager=OSMScoutQt::GetInstance().GetMapManager();
- auto directories=mapManager->getLookupDirectories();
- auto it=directories.begin();
+ auto directories=mapManager->GetLookupDirectories();
QString path=rootDirectory;
if (path==""){
path=".";
- if (it!=directories.end()){
- path=*it;
+ if (auto it=directories.begin(); it!=directories.end()){
+ path=QString::fromStdString(it->string());
}
}
@@ -64,7 +63,7 @@
qDebug() << "request to download map:" << obj << "to" << dir;
const AvailableMapsModelMap *map=dynamic_cast<const AvailableMapsModelMap*>(obj);
if (map!=nullptr){
- mapManager->downloadMap(*map, QDir(dir));
+ mapDownloader->downloadMap(*map, QDir(dir));
}else{
qWarning() << obj << "can't be converted to AvailableMapsModelMap";
}
@@ -72,7 +71,12 @@
QStringList MapDownloadsModel::getLookupDirectories()
{
- return mapManager->getLookupDirectories();
+ QStringList dirPaths;
+ auto dirs=OSMScoutQt::GetInstance().GetMapManager()->GetLookupDirectories();
+ for (const auto &dir: dirs) {
+ dirPaths << QString::fromStdString(dir.string());
+ }
+ return dirPaths;
}
double MapDownloadsModel::getFreeSpace(QString dir)
@@ -84,7 +88,7 @@
void MapDownloadsModel::onDownloadJobsChanged()
{
beginResetModel();
- for (auto *job:mapManager->getDownloadJobs()){
+ for (auto *job:mapDownloader->getDownloadJobs()){
connect(job, &MapDownloadJob::downloadProgress, this, &MapDownloadsModel::onDownloadProgress);
}
endResetModel();
@@ -92,7 +96,7 @@
void MapDownloadsModel::onDownloadProgress()
{
- int count=mapManager->getDownloadJobs().size();
+ int count=mapDownloader->getDownloadJobs().size();
if (count==0)
return;
QVector<int> roles;
@@ -104,12 +108,12 @@
int MapDownloadsModel::rowCount(const QModelIndex &/*parent*/) const
{
- return mapManager->getDownloadJobs().size();
+ return mapDownloader->getDownloadJobs().size();
}
QVariant MapDownloadsModel::data(const QModelIndex &index, int role) const
{
- auto jobs=mapManager->getDownloadJobs();
+ auto jobs=mapDownloader->getDownloadJobs();
if (index.row() < 0 || index.row()>=jobs.size()){
return QVariant();
}
@@ -135,7 +139,7 @@
void MapDownloadsModel::cancel(int row)
{
- auto jobs=mapManager->getDownloadJobs();
+ auto jobs=mapDownloader->getDownloadJobs();
if (row < 0 || row >= jobs.size()){
return;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapObjectInfoModel.cpp
^
|
@@ -65,7 +65,7 @@
}
}
-void MapObjectInfoModel::dbInitialized(const DatabaseLoadedResponse&)
+void MapObjectInfoModel::dbInitialized(const osmscout::GeoBox&)
{
if (setup){
emit objectsOnViewRequested(view,filterRectangle);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapRenderer.cpp
^
|
@@ -22,6 +22,8 @@
#include <osmscoutmapqt/MapPainterQt.h>
+#include <QDebug>
+
namespace osmscout {
MapRenderer::MapRenderer(QThread *thread,
@@ -48,6 +50,7 @@
settings->fontSizeChanged.Connect(fontSizeSlot);
settings->showAltLanguageChanged.Connect(showAltLanguageSlot);
settings->unitsChanged.Connect(unitsSlot);
+ dbThread->stylesheetFilenameChanged.Connect(stylesheetFilenameChangedSlot);
connect(this, &MapRenderer::mapDpiChangeSignal,
this, &MapRenderer::onMapDPIChange,
@@ -70,7 +73,7 @@
connect(thread, &QThread::started,
this, &MapRenderer::Initialize);
- connect(dbThread.get(), &DBThread::stylesheetFilenameChanged,
+ connect(this, &MapRenderer::stylesheetFilenameChanged,
this, &MapRenderer::onStylesheetFilenameChanged,
Qt::QueuedConnection);
}
@@ -247,13 +250,13 @@
void DBRenderJob::Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
const std::list<DBInstanceRef> &allDatabases,
- QReadLocker *locker)
+ std::shared_lock<std::shared_mutex> &&locker)
{
std::list<DBInstanceRef> databases; // enabled databases for rendering
if (renderDatabases) {
databases = allDatabases;
}
- DBJob::Run(basemapDatabase,databases,locker);
+ DBJob::Run(basemapDatabase,databases,std::move(locker));
success=true;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapStyleModel.cpp
^
|
@@ -18,8 +18,9 @@
*/
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/MapStyleModel.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
#include <QDirIterator>
@@ -61,7 +62,7 @@
QString MapStyleModel::getStyle() const
{
- QFileInfo fileInfo(OSMScoutQt::GetInstance().GetDBThread()->GetStylesheetFilename());
+ QFileInfo fileInfo(QString::fromStdString(OSMScoutQt::GetInstance().GetDBThread()->GetStylesheetFilename()));
return fileInfo.fileName();
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapWidget.cpp
^
|
@@ -48,17 +48,14 @@
DBThreadRef dbThread = OSMScoutQt::GetInstance().GetDBThread();
settings->mapDPIChange.Connect(mapDpiSlot);
+ dbThread->stylesheetFilenameChanged.Connect(stylesheetFilenameChangedSlot);
+ dbThread->styleErrorsChanged.Connect(styleErrorsChangedSlot);
+ dbThread->databaseLoadFinished.Connect(databaseLoadedSlot);
tapRecognizer.setPhysicalDpi(dbThread->GetPhysicalDpi());
connect(renderer, &MapRenderer::Redraw,
this, &MapWidget::redraw);
- connect(dbThread.get(), &DBThread::stylesheetFilenameChanged,
- this, &MapWidget::stylesheetFilenameChanged);
- connect(dbThread.get(), &DBThread::styleErrorsChanged,
- this, &MapWidget::styleErrorsChanged);
- connect(dbThread.get(), &DBThread::databaseLoadFinished,
- this, &MapWidget::databaseLoaded);
connect(&tapRecognizer, &TapRecognizer::tap, this, &MapWidget::onTap);
connect(&tapRecognizer, &TapRecognizer::doubleTap, this, &MapWidget::onDoubleTap);
@@ -390,32 +387,32 @@
void MapWidget::recenter()
{
DBThreadRef dbThread = OSMScoutQt::GetInstance().GetDBThread();
- DatabaseLoadedResponse resp = dbThread->loadedResponse();
- if (!resp.boundingBox.IsValid()){
+ GeoBox boundingBox = dbThread->databaseBoundingBox();
+ if (!boundingBox.IsValid()){
return;
}
- Distance dimension = osmscout::GetEllipsoidalDistance(resp.boundingBox.GetMinCoord(),
- resp.boundingBox.GetMaxCoord());
+ Distance dimension = osmscout::GetEllipsoidalDistance(boundingBox.GetMinCoord(),
+ boundingBox.GetMaxCoord());
- showCoordinates(resp.boundingBox.GetCenter(), magnificationByDimension(dimension));
+ showCoordinates(boundingBox.GetCenter(), magnificationByDimension(dimension));
}
bool MapWidget::isDatabaseLoaded()
{
DBThreadRef dbThread = OSMScoutQt::GetInstance().GetDBThread();
- DatabaseLoadedResponse resp = dbThread->loadedResponse();
- return resp.boundingBox.IsValid();
+ GeoBox boundingBox = dbThread->databaseBoundingBox();
+ return boundingBox.IsValid();
}
bool MapWidget::isInDatabaseBoundingBox(double lat, double lon)
{
DBThreadRef dbThread = OSMScoutQt::GetInstance().GetDBThread();
- DatabaseLoadedResponse resp = dbThread->loadedResponse();
- if (!resp.boundingBox.IsValid()){
+ GeoBox boundingBox = dbThread->databaseBoundingBox();
+ if (!boundingBox.IsValid()){
return false;
}
osmscout::GeoCoord coord(lat, lon);
- return resp.boundingBox.Includes(coord);
+ return boundingBox.Includes(coord);
}
QPointF MapWidget::screenPosition(double lat, double lon)
@@ -817,6 +814,8 @@
void MapWidget::onMapDPIChange(double dpi)
{
+ assert(QThread::currentThread() == this->thread());
+
MapView v = *view;
v.mapDpi = dpi;
changeView(v);
@@ -925,7 +924,7 @@
QString MapWidget::GetStylesheetFilename() const
{
DBThreadRef dbThread=OSMScoutQt::GetInstance().GetDBThread();
- return dbThread->GetStylesheetFilename();
+ return QString::fromStdString(dbThread->GetStylesheetFilename());
}
QString MapWidget::GetZoomLevelName() const
@@ -935,7 +934,7 @@
if (converter.Convert(osmscout::MagnificationLevel(view->magnification.GetLevel()),
name)) {
- return name.c_str();
+ return QString::fromStdString(name);
}
return "";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/NavigationModule.cpp
^
|
@@ -21,6 +21,10 @@
#include <osmscout/log/Logger.h>
+#include <QThread>
+#include <QDateTime>
+#include <QDir>
+
namespace osmscout {
NavigationModule::NavigationModule(QThread *thread,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/NearPOIModel.cpp
^
|
@@ -19,6 +19,7 @@
#include <osmscoutclientqt/NearPOIModel.h>
#include <osmscoutclientqt/OSMScoutQt.h>
+#include <osmscoutclientqt/QtStdConverters.h>
namespace osmscout {
@@ -27,31 +28,28 @@
poiModule=OSMScoutQt::GetInstance().MakePOILookupModule();
settings=OSMScoutQt::GetInstance().GetSettings();
- connect(this, &NearPOIModel::lookupPOIRequest,
- poiModule, &POILookupModule::lookupPOIRequest,
- Qt::QueuedConnection);
-
- connect(poiModule, &POILookupModule::lookupAborted,
+ connect(this, &NearPOIModel::lookupFinished,
this, &NearPOIModel::onLookupFinished,
Qt::QueuedConnection);
- connect(poiModule, &POILookupModule::lookupFinished,
- this, &NearPOIModel::onLookupFinished,
- Qt::QueuedConnection);
- connect(poiModule, &POILookupModule::lookupResult,
+ connect(this, &NearPOIModel::lookupResult,
this, &NearPOIModel::onLookupResult,
Qt::QueuedConnection);
+
+ poiModule->lookupResult.Connect(lookupResultSlot);
+ poiModule->lookupFinished.Connect(lookupFinishedSlot);
+ poiModule->lookupAborted.Connect(lookupFinishedSlot);
}
NearPOIModel::~NearPOIModel()
{
locations.clear();
- if (breaker){
- breaker->Break();
- breaker.reset();
+ if (future){
+ future->Cancel();
+ future.reset();
}
if (poiModule!=nullptr){
- poiModule->deleteLater();
+ poiModule->DeleteLater();
poiModule=nullptr;
}
}
@@ -70,7 +68,7 @@
case LabelRole:
return location->getLabel();
case TypeRole:
- if (location->getType()==LocationEntry::typeCoordinate)
+ if (location->getType()==LocationInfo::Type::typeCoordinate)
return "coordinate";
else
return location->getObjectType();
@@ -152,8 +150,8 @@
if (requestId!=currentRequest){
return;
}
- searching=false;
- emit SearchingChanged(searching);
+ future.reset();
+ emit SearchingChanged(future.has_value());
}
void NearPOIModel::onLookupResult(int requestId, QList<LocationEntry> newLocations)
@@ -188,8 +186,9 @@
void NearPOIModel::lookupPOI()
{
- if (breaker){
- breaker->Break();
+ if (future){
+ future->Cancel();
+ future.reset();
}
if (!locations.isEmpty()){
@@ -205,14 +204,10 @@
maxDistance.AsMeter()>0 &&
resultLimit>0){
- breaker=std::make_shared<osmscout::ThreadedBreaker>();
- searching=true;
// TODO: use resultLimit
- emit lookupPOIRequest(++currentRequest, breaker, searchCenter, types, maxDistance.AsMeter());
- }else{
- searching=false;
+ future = poiModule->lookupPOIRequest(++currentRequest, searchCenter, QStringListToStringVector(types), maxDistance);
}
- emit SearchingChanged(searching);
+ emit SearchingChanged(future.has_value());
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OSMScoutQt.cpp
^
|
@@ -22,11 +22,11 @@
#include <osmscoutmap/DataTileCache.h>
#include <osmscoutclient/Settings.h>
+#include <osmscoutclient/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
#include <osmscoutclientqt/QtSettingsStorage.h>
#include <osmscoutclientqt/QmlSettings.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/MapWidget.h>
#include <osmscoutclientqt/ElevationChartWidget.h>
#include <osmscoutclientqt/PlaneMapRenderer.h>
@@ -158,7 +158,11 @@
// setup voice
settings->SetVoiceLookupDirectory(voiceLookupDirectory.toStdString());
- MapManagerRef mapManager=std::make_shared<MapManager>(mapLookupDirectories, settings);
+ std::vector<std::filesystem::path> paths;
+ for (const auto &dir: mapLookupDirectories) {
+ paths.push_back(dir.toStdString());
+ }
+ MapManagerRef mapManager=std::make_shared<MapManager>(paths);
QString userAgent=QString("%1/%2 libosmscout/%3 Qt/%4")
.arg(appName).arg(appVersion)
@@ -187,7 +191,6 @@
int versionMinor)
{
// register osmscout + standard types for usage in Qt signals/slots
- qRegisterMetaType<DatabaseLoadedResponse>("DatabaseLoadedResponse");
qRegisterMetaType<LocationEntryRef>("LocationEntryRef");
qRegisterMetaType<osmscout::BreakerRef>("osmscout::BreakerRef");
qRegisterMetaType<osmscout::Distance>("osmscout::Distance");
@@ -208,6 +211,7 @@
qRegisterMetaType<QtRouteData>("QtRouteData");
qRegisterMetaType<uint32_t>("uint32_t");
qRegisterMetaType<uint64_t>("uint64_t");
+ qRegisterMetaType<size_t>("size_t");
qRegisterMetaType<AdminRegionInfoRef>("AdminRegionInfoRef");
qRegisterMetaType<QList<AdminRegionInfoRef>>("QList<AdminRegionInfoRef>");
qRegisterMetaType<std::unordered_map<std::string,bool>>("std::unordered_map<std::string,bool>");
@@ -303,27 +307,19 @@
customPoiTypeVector.push_back(typeName.toStdString());
}
- QThread *thread=makeThread("DBThread");
- dbThread=std::make_shared<DBThread>(thread,
- basemapLookupDirectory,
- iconDirectory,
+ dbThread=std::make_shared<DBThread>(basemapLookupDirectory.toStdString(),
+ iconDirectory.toStdString(),
settings,
mapManager,
customPoiTypeVector);
- connect(thread, &QThread::started,
- dbThread.get(), &DBThread::Initialize);
-
- dbThread->moveToThread(thread);
-
- thread->start();
-
- // move itself to DBThread event loop,
- // we need to receive threadFinished slot
- // even main loop is shutdown
+ dbThread->Initialize();
- // DBThread is responsible for thread shutdown
- this->moveToThread(thread);
+ // move itself to own event loop,
+ // we need to receive slots
+ // even when main loop is shutdown
+ // QThread *thread=makeThread("OSMScoutQt");
+ // this->moveToThread(thread);
}
OSMScoutQt::~OSMScoutQt()
@@ -355,8 +351,18 @@
return mapManager;
}
+MapDownloaderRef OSMScoutQt::GetMapDownloader()
+{
+ std::unique_lock<std::mutex> locker(mutex);
+ if (!mapDownloader){
+ mapDownloader = std::make_shared<MapDownloader>(mapManager, settings);
+ }
+ return mapDownloader;
+}
+
VoiceManagerRef OSMScoutQt::GetVoiceManager()
{
+ std::unique_lock<std::mutex> locker(mutex);
if (!voiceManager){
voiceManager = std::make_shared<VoiceManager>();
}
@@ -410,11 +416,7 @@
POILookupModule *OSMScoutQt::MakePOILookupModule()
{
- QThread *thread=makeThread("POILookupModule");
- POILookupModule *module=new POILookupModule(thread,dbThread);
- module->moveToThread(thread);
- thread->start();
- return module;
+ return new POILookupModule(dbThread);
}
ElevationModule *OSMScoutQt::MakeElevationModule()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OpeningHoursModel.cpp
^
|
@@ -29,7 +29,7 @@
QStringList result;
if (intervals.empty()) {
//: example: restaurant is "closed" at Monday
- result << OpeningHoursModel::tr("closed");
+ result << osmscout::OpeningHoursModel::tr("closed");
}
auto timeString=[](const OpeningHours::DayTime &time) -> QString {
return QString("%1:%2").arg(int(time.hour)).arg(int(time.minute), 2, 10, QLatin1Char('0'));
@@ -45,11 +45,11 @@
{
if (weekDay==OpeningHours::WeekDay::PublicHoliday) {
//: long variant
- return OpeningHoursModel::tr("Public holiday");
+ return osmscout::OpeningHoursModel::tr("Public holiday");
}
if (weekDay==OpeningHours::WeekDay::SchoolHoliday) {
//: long variant
- return OpeningHoursModel::tr("School holiday");
+ return osmscout::OpeningHoursModel::tr("School holiday");
}
return locale.standaloneDayName(int(weekDay)+1, QLocale::FormatType::LongFormat);
// return calendar.standaloneWeekDayName(locale, int(weekDay)+1, QLocale::FormatType::LongFormat);
@@ -59,11 +59,11 @@
{
if (weekDay==OpeningHours::WeekDay::PublicHoliday) {
//: short variant of "Public holiday"
- return OpeningHoursModel::tr("PH");
+ return osmscout::OpeningHoursModel::tr("PH");
}
if (weekDay==OpeningHours::WeekDay::SchoolHoliday) {
//: short variant of "School holiday"
- return OpeningHoursModel::tr("SH");
+ return osmscout::OpeningHoursModel::tr("SH");
}
// return calendar.standaloneWeekDayName(locale, int(weekDay)+1, QLocale::FormatType::ShortFormat);
return locale.standaloneDayName(int(weekDay)+1, QLocale::FormatType::ShortFormat);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OsmTileDownloader.cpp
^
|
@@ -17,7 +17,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <QDebug>
#include <QThread>
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) /* For compatibility with QT 5.6 */
#include <QRandomGenerator>
@@ -80,7 +79,7 @@
QString server = QString::fromStdString(servers[serverNumber % servers.size()]);
QUrl tileUrl(server.arg(zoomLevel).arg(x).arg(y));
- qDebug() << "Download tile" << tileUrl << "(current thread:" << QThread::currentThread() << ")";
+ osmscout::log.Debug() << "Download tile" << tileUrl.toString().toStdString() << "(current thread:" << QThread::currentThread() << ")";
TileCacheKey key = {zoomLevel, x, y};
@@ -103,7 +102,7 @@
QUrl url = reply->url();
if (reply->error() != QNetworkReply::NoError){
- qWarning() << "Downloading" << url << "failed with" << reply->errorString();
+ osmscout::log.Warn() << "Downloading" << url.toString().toStdString() << "failed with" << reply->errorString().toStdString();
#if QT_VERSION < QT_VERSION_CHECK(5, 10, 0) /* For compatibility with QT 5.6 */
serverNumber = qrand(); // try another server for future requests
#else
@@ -115,10 +114,11 @@
QImage image;
if (image.loadFromData(downloadedData, Q_NULLPTR)){
- qDebug() << "Downloaded tile " << url << " (current thread: " << QThread::currentThread() << ")";
+ osmscout::log.Debug() << "Downloaded tile " << url.toString().toStdString() << " (current thread: " << QThread::currentThread() << ")";
+
emit downloaded(key.zoomLevel, key.xtile, key.ytile, image, downloadedData);
}else{
- qWarning() << "Failed to load image data from " << url;
+ osmscout::log.Warn() << "Failed to load image data from " << url.toString().toStdString();
emit failed(key.zoomLevel, key.xtile, key.ytile, false);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OverlayObject.cpp
^
|
@@ -113,7 +113,7 @@
GeoBox bbox = boundingBox();
// QML will take ownership
- return new LocationEntry(LocationEntry::Type::typeNone,
+ return new LocationEntry(LocationInfo::Type::typeNone,
"bbox",
"bbox",
"",
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/PlaneMapRenderer.cpp
^
|
@@ -24,6 +24,7 @@
#include <osmscout/system/Math.h>
#include <QtMath>
+#include <QDebug>
namespace osmscout {
@@ -393,7 +394,7 @@
overlayObjects,
dbThread->GetEmptyStyleConfig(),
/*drawCanvasBackground*/ true);
- dbThread->RunJob(&job);
+ dbThread->RunJob(std::bind(&DBRenderJob::Run, &job, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
success=job.IsSuccess();
}
@@ -506,7 +507,7 @@
connect(loadJob, &DBLoadJob::finished,
this, &PlaneMapRenderer::onLoadJobFinished);
- dbThread->RunJob(loadJob);
+ dbThread->RunJob(std::bind(&DBLoadJob::Run, loadJob, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
}
emit TriggerInitialRendering();
}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/QtStdConverters.cpp
^
|
@@ -0,0 +1,57 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclientqt/QtStdConverters.h>
+
+namespace osmscout {
+
+std::vector<std::string> QStringListToStringVector(const QStringList &list)
+{
+ std::vector<std::string> result;
+ for (const auto &str: list) {
+ result.push_back(str.toStdString());
+ }
+ return result;
+}
+
+QStringList StringVectorToQStringList(const std::vector<std::string> &v)
+{
+ QStringList result;
+ for (const auto &str: v) {
+ result << QString::fromStdString(str);
+ }
+ return result;
+}
+
+QDateTime TimestampToQDateTime(const osmscout::Timestamp &ts)
+{
+ using namespace std::chrono;
+ return QDateTime::fromMSecsSinceEpoch(duration_cast<milliseconds>(ts.time_since_epoch()).count());
+}
+
+QList<QDir> PathVectorToQDirList(const std::vector<std::filesystem::path> &paths)
+{
+ QList<QDir> result;
+ for (const auto &path: paths) {
+ result << QDir(QString::fromStdString(path.string()));
+ }
+ return result;
+}
+
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/SearchLocationModel.cpp
^
|
@@ -18,7 +18,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <osmscoutclientqt/DBThread.h>
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/SearchLocationModel.h>
#include <osmscoutclientqt/OSMScoutQt.h>
@@ -139,8 +140,8 @@
assert(a != nullptr && b != nullptr);
if (a->getLabel()==b->getLabel() &&
a->getDatabase()==b->getDatabase() &&
- a->getType()==LocationEntry::typeObject &&
- b->getType()==LocationEntry::typeObject){
+ a->getType()==LocationInfo::Type::typeObject &&
+ b->getType()==LocationInfo::Type::typeObject){
QJSValueList args;
// to transfer ownership to QML, parent have to be null. copy constructor copy ownership
@@ -349,11 +350,11 @@
}
if (searching){
// we are still waiting for previous request, postpone current
- qDebug() << "Clear (" << locations.size() << ") postpone search" << pattern << "(default region:" << (defaultRegion?defaultRegion->qStringName():"NULL") << ")";
+ qDebug() << "Clear (" << locations.size() << ") postpone search" << pattern << "(default region:" << QString::fromStdString(defaultRegion?defaultRegion->name():"NULL") << ")";
return;
}
- qDebug() << "Clear (" << locations.size() << ") search" << pattern << "(default region:" << (defaultRegion?defaultRegion->qStringName():"NULL") << ")";
+ qDebug() << "Clear (" << locations.size() << ") search" << pattern << "(default region:" << QString::fromStdString(defaultRegion?defaultRegion->name():"NULL") << ")";
searching = true;
lastRequestPattern = pattern;
lastRequestDefaultRegion=defaultRegion;
@@ -380,7 +381,7 @@
case LabelRole:
return location->getLabel();
case TypeRole:
- if (location->getType()==LocationEntry::typeCoordinate)
+ if (location->getType()==LocationInfo::Type::typeCoordinate)
return "coordinate";
else
return location->getObjectType();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/SearchModule.cpp
^
|
@@ -68,7 +68,7 @@
}
osmscout::AdminRegionRef defaultRegion;
- if (defaultRegionInfo && defaultRegionInfo->database==QString::fromStdString(db->path)){
+ if (defaultRegionInfo && defaultRegionInfo->database==db->path){
defaultRegion=defaultRegionInfo->adminRegion;
}
@@ -317,7 +317,7 @@
}
*/
- LocationEntry location(LocationEntry::typeObject, name, altName, objectType, adminRegionList,
+ LocationEntry location(LocationInfo::Type::typeObject, name, altName, objectType, adminRegionList,
QString::fromStdString(db->path), coordinates, bbox);
location.addReference(object);
locations.append(location);
@@ -354,7 +354,7 @@
osmscout::log.Debug() << "address: " << label.toStdString();
- LocationEntry location(LocationEntry::typeObject, label, altName, objectType, adminRegionList,
+ LocationEntry location(LocationInfo::Type::typeObject, label, altName, objectType, adminRegionList,
QString::fromStdString(db->path), coordinates, bbox);
location.addReference(entry.address->object);
locations.append(location);
@@ -369,7 +369,7 @@
osmscout::log.Debug() << "loc: " << loc.toStdString();
- LocationEntry location(LocationEntry::typeObject, loc, altName, objectType, adminRegionList,
+ LocationEntry location(LocationInfo::Type::typeObject, loc, altName, objectType, adminRegionList,
QString::fromStdString(db->path), coordinates, bbox);
for (auto object : entry.location->objects) {
@@ -386,7 +386,7 @@
}
osmscout::log.Debug() << "poi: " << poi.toStdString();
- LocationEntry location(LocationEntry::typeObject, poi, altName, objectType, adminRegionList,
+ LocationEntry location(LocationInfo::Type::typeObject, poi, altName, objectType, adminRegionList,
QString::fromStdString(db->path), coordinates, bbox);
location.addReference(entry.poi->object);
locations.append(location);
@@ -398,7 +398,7 @@
QString regionName=QString::fromStdString(entry.adminRegion->name);
//=QString::fromUtf8(entry.adminRegion->name.c_str());
- LocationEntry location(LocationEntry::typeObject, regionName, altName, objectType, adminRegionList,
+ LocationEntry location(LocationInfo::Type::typeObject, regionName, altName, objectType, adminRegionList,
QString::fromStdString(db->path), coordinates, bbox);
osmscout::log.Debug() << "region: " << regionName.toStdString();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/StyleFlagsModel.cpp
^
|
@@ -17,8 +17,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/StyleFlagsModel.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/StyleModule.cpp
^
|
@@ -27,12 +27,10 @@
thread(thread),
dbThread(dbThread)
{
+ dbThread->databaseLoadFinished.Connect(dbLoadedSlot);
+ dbThread->stylesheetFilenameChanged.Connect(stylesheetFilenameChangeSlot);
- connect(dbThread.get(), &DBThread::initialisationFinished,
- this, &StyleModule::initialisationFinished);
- connect(dbThread.get(), &DBThread::stylesheetFilenameChanged,
- this, &StyleModule::stylesheetFilenameChanged);
- connect(dbThread.get(), &DBThread::stylesheetFilenameChanged,
+ connect(this, &StyleModule::stylesheetFilenameChanged,
this, &StyleModule::onStyleChanged,
Qt::QueuedConnection);
}
@@ -50,7 +48,7 @@
void StyleModule::loadStyle(QString stylesheetFilename,
std::unordered_map<std::string,bool> stylesheetFlags)
{
- dbThread->LoadStyle(stylesheetFilename,
+ dbThread->LoadStyle(stylesheetFilename.toStdString(),
stylesheetFlags);
}
@@ -60,12 +58,18 @@
void StyleModule::onStyleChanged()
{
- emit styleFlagsChanged(dbThread->GetStyleFlags());
+ QMap<QString, bool> qMap;
+ auto stdMap=dbThread->GetStyleFlags();
+ for (const auto &p: stdMap) {
+ qMap[QString::fromStdString(p.first)] = p.second;
+ }
+
+ emit styleFlagsChanged(qMap);
}
void StyleModule::onSetFlagRequest(QString key, bool value)
{
- dbThread->SetStyleFlag(key, value);
+ dbThread->SetStyleFlag(key.toStdString(), value);
emit flagSet(key, value);
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/TiledMapRenderer.cpp
^
|
@@ -56,6 +56,7 @@
settings->onlineTileProviderChanged.Connect(onlineTileProviderSlot);
settings->onlineTilesEnabledChanged.Connect(onlineTileEnabledSlot);
settings->offlineMapChanged.Connect(offlineMapChangedSlot);
+ dbThread->databaseLoadFinished.Connect(databaseLoadFinishedSlot);
connect(this, &TiledMapRenderer::onlineTileProviderSignal,
this, &TiledMapRenderer::onlineTileProviderChanged,
@@ -67,7 +68,7 @@
this, &TiledMapRenderer::onOfflineMapChanged,
Qt::QueuedConnection);
- connect(dbThread.get(), &DBThread::databaseLoadFinished,
+ connect(this, &TiledMapRenderer::databaseLoadFinished,
this, &TiledMapRenderer::onDatabaseLoaded,
Qt::QueuedConnection);
//
@@ -318,7 +319,7 @@
this, &TiledMapRenderer::onLoadJobFinished);
if (offlineTilesEnabled) {
- dbThread->RunJob(loadJob);
+ dbThread->RunJob(std::bind(&DBLoadJob::Run, loadJob, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
} else {
// offline map rendering is disabled but there are some overlay objects intersecting with the tile...
onLoadJobFinished(QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>>());
@@ -486,7 +487,7 @@
/*drawCanvasBackground*/ false,
/*renderBasemap*/ !onlineTilesEnabled,
offlineTilesEnabled);
- dbThread->RunJob(&job);
+ dbThread->RunJob(std::bind(&DBRenderJob::Run, &job, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
success=job.IsSuccess();
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/TiledRenderingHelper.cpp
^
|
@@ -18,9 +18,11 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclient/DBThread.h>
+
#include <osmscoutclientqt/TiledRenderingHelper.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMTile.h>
+#include <osmscoutclientqt/DBLoadJob.h>
#include <osmscout/system/Math.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/Voice.cpp
^
|
@@ -51,7 +51,7 @@
valid=false;
QStringList fileNames = files();
- fileNames << MapDownloadJob::FILE_METADATA;
+ fileNames << MapDirectory::FileMetadata;
bool result=true;
for (const auto &fileName: fileNames) {
@@ -161,8 +161,8 @@
}
// metadata
- if (dir.exists(MapDownloadJob::FILE_METADATA)){
- QFile jsonFile(dir.filePath(MapDownloadJob::FILE_METADATA));
+ if (dir.exists(MapDirectory::FileMetadata)){
+ QFile jsonFile(dir.filePath(MapDirectory::FileMetadata));
jsonFile.open(QFile::OpenModeFlag::ReadOnly);
QJsonDocument doc = QJsonDocument::fromJson(jsonFile.readAll());
QJsonObject metadataObject = doc.object();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/VoiceManager.cpp
^
|
@@ -71,7 +71,7 @@
metadata["description"] = voice.getDescription();
QJsonDocument doc(metadata);
- QFile metadataFile(target.filePath(MapDownloadJob::FILE_METADATA));
+ QFile metadataFile(target.filePath(MapDirectory::FileMetadata));
metadataFile.open(QFile::OpenModeFlag::WriteOnly);
metadataFile.write(doc.toJson());
metadataFile.close();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/CMakeLists.txt
^
|
@@ -1,20 +1,32 @@
set(HEADER_FILES
- include/osmscoutclient/json/json.hpp
- include/osmscoutclient/json/json_fwd.hpp
- include/osmscoutclient/DBInstance.h
- include/osmscoutclient/MapProvider.h
- include/osmscoutclient/ClientImportExport.h
- include/osmscoutclient/OnlineTileProvider.h
- include/osmscoutclient/Settings.h
- include/osmscoutclient/VoiceProvider.h
+ include/osmscoutclient/json/json.hpp
+ include/osmscoutclient/json/json_fwd.hpp
+ include/osmscoutclient/AdminRegionInfo.h
+ include/osmscoutclient/DBInstance.h
+ include/osmscoutclient/DBJob.h
+ include/osmscoutclient/DBThread.h
+ include/osmscoutclient/LocationInfo.h
+ include/osmscoutclient/MapDirectory.h
+ include/osmscoutclient/MapManager.h
+ include/osmscoutclient/MapProvider.h
+ include/osmscoutclient/ClientImportExport.h
+ include/osmscoutclient/OnlineTileProvider.h
+ include/osmscoutclient/POILookupModule.h
+ include/osmscoutclient/Settings.h
+ include/osmscoutclient/VoiceProvider.h
)
set(SOURCE_FILES
src/osmscoutclient/DBInstance.cpp
- src/osmscoutclient/MapProvider.cpp
+ src/osmscoutclient/DBJob.cpp
+ src/osmscoutclient/DBThread.cpp
+ src/osmscoutclient/MapDirectory.cpp
+ src/osmscoutclient/MapManager.cpp
+ src/osmscoutclient/MapProvider.cpp
src/osmscoutclient/OnlineTileProvider.cpp
- src/osmscoutclient/Settings.cpp
- src/osmscoutclient/VoiceProvider.cpp
+ src/osmscoutclient/POILookupModule.cpp
+ src/osmscoutclient/Settings.cpp
+ src/osmscoutclient/VoiceProvider.cpp
)
set(EXCLUDE_HEADER)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/meson.build
^
|
@@ -3,10 +3,17 @@
osmscoutclientHeader = [
'osmscoutclient/json/json.hpp',
'osmscoutclient/json/json_fwd.hpp',
+ 'osmscoutclient/AdminRegionInfo.h',
'osmscoutclient/ClientImportExport.h',
'osmscoutclient/DBInstance.h',
+ 'osmscoutclient/DBJob.h',
+ 'osmscoutclient/DBThread.h',
+ 'osmscoutclient/LocationInfo.h',
+ 'osmscoutclient/MapDirectory.h',
+ 'osmscoutclient/MapManager.h',
'osmscoutclient/MapProvider.h',
'osmscoutclient/OnlineTileProvider.h',
+ 'osmscoutclient/POILookupModule.h',
'osmscoutclient/Settings.h',
'osmscoutclient/VoiceProvider.h'
]
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/AdminRegionInfo.h
^
|
@@ -0,0 +1,56 @@
+#ifndef OSMSCOUT_CLIENT_ADMINREGIONINFO_H
+#define OSMSCOUT_CLIENT_ADMINREGIONINFO_H
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2017 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+
+#include <memory>
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscout/location/Location.h>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ */
+struct OSMSCOUT_CLIENT_API AdminRegionInfo
+{
+ std::string database;
+ osmscout::AdminRegionRef adminRegion;
+ std::string type; //!< adminRegion->object's type
+ int adminLevel{-1};
+
+ std::string name() const
+ {
+ return adminRegion->name;
+ }
+
+ std::string altName() const
+ {
+ return adminRegion->altName;
+ }
+};
+
+typedef std::shared_ptr<AdminRegionInfo> AdminRegionInfoRef;
+
+}
+
+#endif //OSMSCOUT_CLIENT_ADMINREGIONINFO_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/DBInstance.h
^
|
@@ -39,7 +39,7 @@
namespace osmscout {
/**
- * \ingroup QtAPI
+ * \ingroup ClientAPI
*
* Instance of one osmscout db and db specific objects.
*
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/DBJob.h
^
|
@@ -0,0 +1,64 @@
+#ifndef OSMSCOUT_CLIENT_DBJOB_H
+#define OSMSCOUT_CLIENT_DBJOB_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2017 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/DBInstance.h>
+
+#include <osmscout/db/BasemapDatabase.h>
+
+#include <thread>
+#include <list>
+#include <shared_mutex>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ */
+class OSMSCOUT_CLIENT_API DBJob {
+
+ protected:
+ osmscout::BasemapDatabaseRef basemapDatabase; //!< Optional reference to the basemap db
+ std::list<DBInstanceRef> databases; //!< borrowed databases
+ std::thread::id threadId; //!< job thread
+
+ private:
+ std::shared_lock<std::shared_mutex> locker; //!< db locker
+
+ public:
+ DBJob();
+ DBJob(const DBJob&) = delete;
+ DBJob(DBJob&&) = delete;
+ DBJob& operator=(const DBJob&) = delete;
+ DBJob& operator=(DBJob&&) = delete;
+ virtual ~DBJob();
+
+ virtual void Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
+ const std::list<DBInstanceRef> &databases,
+ std::shared_lock<std::shared_mutex> &&locker);
+ virtual void Close();
+};
+
+}
+
+#endif //OSMSCOUT_CLIENT_DBJOB_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/DBThread.h
^
|
@@ -0,0 +1,310 @@
+#ifndef OSMSCOUT_CLIENT_DBTHREAD_H
+#define OSMSCOUT_CLIENT_DBTHREAD_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscout/db/BasemapDatabase.h>
+#include <osmscout/db/Database.h>
+
+#include <osmscout/location/LocationService.h>
+
+#include <osmscout/async/Signal.h>
+#include <osmscout/async/AsyncWorker.h>
+
+#include <osmscoutmap/MapService.h>
+
+#include <osmscoutclient/DBInstance.h>
+#include <osmscoutclient/Settings.h>
+#include <osmscoutclient/MapManager.h>
+
+#include <shared_mutex>
+#include <filesystem>
+#include <map>
+#include <string>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ */
+struct MapViewStruct
+{
+ osmscout::GeoCoord coord;
+ osmscout::Bearing angle; // canvas clockwise
+ osmscout::Magnification magnification;
+ size_t width;
+ size_t height;
+ double dpi;
+};
+
+inline bool operator!=(const MapViewStruct &r1, const MapViewStruct &r2)
+{
+ return r1.coord!=r2.coord ||
+ r1.angle!=r2.angle ||
+ r1.magnification!=r2.magnification ||
+ r1.width!=r2.width ||
+ r1.height!=r2.height ||
+ int32_t(r1.dpi*1000)!=int32_t(r2.dpi*1000);
+}
+
+/**
+ * \ingroup ClientAPI
+ * \see DBThread::databaseCoverage
+ */
+enum class DatabaseCoverage{
+ Outside = 0,
+ Covered = 1,
+ Intersects = 2,
+};
+
+/**
+ * \ingroup ClientAPI
+ *
+ * Central object that manage db instances (\ref DBInstance),
+ * its map styles (there is one global map style now)
+ * and provides simple thread-safe, asynchronous api for accessing it.
+ *
+ * List of databases is protected by read-write lock. There may be multiple
+ * readers at one time. DBThread warrants that none db will be closed
+ * or modified (except thread-safe caches) when read lock is hold.
+ * Databases may be accessed via \see AsynchronousDBJob or \see RunSynchronousJob methods.
+ */
+class OSMSCOUT_CLIENT_API DBThread: public AsyncWorker
+{
+public:
+ using SynchronousDBJob = std::function<void (const std::list<DBInstanceRef> &)>;
+
+ using AsynchronousDBJob = std::function<void (const osmscout::BasemapDatabaseRef& basemapDatabase,
+ const std::list<DBInstanceRef> &databases,
+ std::shared_lock<std::shared_mutex> &&locker)>;
+
+ // signals
+ Signal<> stylesheetFilenameChanged;
+ Signal<osmscout::GeoBox> databaseLoadFinished;
+ Signal<> styleErrorsChanged;
+
+ // slots
+ Slot<> toggleDaylight{
+ [this](){
+ ToggleDaylight();
+ }
+ };
+
+ Slot<std::string, bool> setStyleFlag{
+ [this](const std::string &key, bool value) {
+ SetStyleFlag(key, value);
+ }
+ };
+
+ Slot<std::string> reloadStyle{
+ [this](const std::string &suffix) {
+ ReloadStyle(suffix);
+ }
+ };
+
+ Slot<std::string, std::unordered_map<std::string,bool>, std::string> loadStyle {
+ [this](const std::string &stylesheetFilename,
+ const std::unordered_map<std::string,bool> &stylesheetFlags,
+ const std::string &suffix) {
+ LoadStyle(stylesheetFilename, stylesheetFlags, suffix);
+ }
+ };
+
+ Slot<> initialize{
+ [this](){
+ Initialize();
+ }
+ };
+
+ Slot<std::vector<std::filesystem::path>> databaseListChangedSlot {
+ [this](const std::vector<std::filesystem::path> &paths) {
+ OnDatabaseListChanged(paths);
+ }
+ };
+
+ /**
+ * Flush all caches for db that was not used in recent idleMs
+ */
+ Slot<std::chrono::milliseconds> flushCaches {
+ [this](const std::chrono::milliseconds &idleMs) {
+ FlushCaches(idleMs);
+ }
+ };
+
+private:
+ MapManagerRef mapManager;
+ std::string basemapLookupDirectory;
+ SettingsRef settings;
+
+ double mapDpi;
+
+ mutable std::shared_mutex lock;
+
+ osmscout::BasemapDatabaseParameter basemapDatabaseParameter;
+ osmscout::BasemapDatabaseRef basemapDatabase;
+ osmscout::DatabaseParameter databaseParameter;
+ std::list<DBInstanceRef> databases;
+
+ TypeConfigRef emptyTypeConfig; // type config just with special and custom poi types
+ StyleConfigRef emptyStyleConfig;
+
+ std::string stylesheetFilename;
+ std::string iconDirectory;
+ std::unordered_map<std::string,bool>
+ stylesheetFlags;
+ bool daylight;
+
+ std::list<StyleError> styleErrors;
+
+ std::vector<std::string> customPoiTypes;
+
+ Slot<double> mapDpiSlot {
+ [this](const double &dpi) {
+ OnMapDPIChange(dpi);
+ }
+ };
+
+protected:
+
+ /**
+ * Check if DBThread is initialized without acquire lock
+ *
+ * @return true if all databases are open
+ */
+ bool isInitializedInternal();
+
+ /**
+ * Load stylesheet for all databases, write lock needs to be hold
+ *
+ * @param stylesheetFilename
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/LocationInfo.h
^
|
@@ -0,0 +1,55 @@
+#ifndef OSMSCOUT_CLIENT_LOCATIONDESCRIPTION_H
+#define OSMSCOUT_CLIENT_LOCATIONDESCRIPTION_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/AdminRegionInfo.h>
+
+#include <string>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ */
+struct OSMSCOUT_CLIENT_API LocationInfo {
+
+ enum class Type {
+ typeNone,
+ typeObject,
+ typeCoordinate
+ };
+
+ Type type;
+ std::string label;
+ std::string altName; // name in alternative language
+ std::string objectType;
+ std::vector<AdminRegionInfoRef> adminRegionList;
+ std::string database;
+ std::vector<ObjectFileRef> references;
+ GeoCoord coord;
+ GeoBox bbox;
+
+};
+
+}
+#endif //OSMSCOUT_CLIENT_LOCATIONDESCRIPTION_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/MapDirectory.h
^
|
@@ -0,0 +1,150 @@
+#ifndef OSMSCOUT_CLIENT_MAPDIRECTORY_H
+#define OSMSCOUT_CLIENT_MAPDIRECTORY_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscout/util/Time.h>
+
+#include <vector>
+#include <string>
+#include <filesystem>
+
+namespace osmscout {
+
+/**
+ * Holder for map db metadata
+ *
+ * \ingroup QtAPI
+ */
+class OSMSCOUT_CLIENT_API MapDirectory
+{
+public:
+ static constexpr char const *FileMetadata = "metadata.json";
+ static constexpr char const *TemporaryFileSuffix = ".download"; ///< suffix of file being downloaded
+
+public:
+ MapDirectory() = default;
+ explicit MapDirectory(const std::filesystem::path &dir);
+ ~MapDirectory() = default;
+
+ MapDirectory(const MapDirectory &other) = default;
+ MapDirectory &operator=(const MapDirectory &other) = default;
+
+ MapDirectory(MapDirectory &&other) = default;
+ MapDirectory &operator=(MapDirectory &&other) = default;
+
+ std::string GetDirStr() const
+ {
+ return dir.string();
+ }
+
+ std::filesystem::path GetDir() const
+ {
+ return dir;
+ }
+
+ static std::vector<std::string> MandatoryFiles();
+ static std::vector<std::string> OptionalFiles();
+ static std::vector<std::string> MetadataFiles();
+
+ /**
+ * byte size of all db files on disk
+ * @return
+ */
+ uint64_t ByteSize() const;
+
+ /**
+ * Delete complete db
+ */
+ bool DeleteDatabase();
+
+ /**
+ * Check if directory contains all required files for osmscout db
+ * @return true if all requirements met and directory may be used as db
+ */
+ bool IsValid() const
+ {
+ return valid;
+ }
+
+ /**
+ * Check if map directory contains metadata created by downloader
+ * @return true if map directory contains metadata
+ */
+ bool HasMetadata() const
+ {
+ return metadata;
+ }
+
+ /**
+ * Human readable name of the map. It is name of geographical region usually (eg: Germany, Czech Republic...).
+ * Name is localised by server when it is downloading. When locale is changed later, name will remain
+ * in its original locale.
+ * @return map name
+ */
+ std::string GetName() const
+ {
+ return name;
+ }
+
+ /** Logical path of the map, eg: europe/germany; europe/czech-republic
+ */
+ std::vector<std::string> GetPath() const
+ {
+ return path;
+ }
+
+ /**
+ * Time of map import
+ * @return
+ */
+ Timestamp GetCreation() const
+ {
+ return creation;
+ }
+
+ int GetVersion() const
+ {
+ return version;
+ }
+
+ bool operator<(const MapDirectory &o) const
+ {
+ if (GetName() == o.GetName()){
+ return GetDirStr() < o.GetDirStr();
+ }
+ return GetName() < o.GetName();
+ }
+
+private:
+ std::filesystem::path dir;
+ bool valid{false};
+ bool metadata{false};
+ std::string name;
+ std::vector<std::string> path;
+ Timestamp creation;
+ int version{0};
+};
+
+}
+
+#endif //OSMSCOUT_CLIENT_MAPDIRECTORY_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/MapManager.h
^
|
@@ -0,0 +1,90 @@
+#ifndef OSMSCOUT_CLIENT_MAPMANAGER_H
+#define OSMSCOUT_CLIENT_MAPMANAGER_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/MapDirectory.h>
+
+#include <osmscout/async/Signal.h>
+#include <osmscout/async/AsyncWorker.h>
+
+#include <filesystem>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ *
+ * Manager of map databases. It provide db lookup (in databaseDirectories).
+ */
+class OSMSCOUT_CLIENT_API MapManager: public AsyncWorker
+{
+public:
+ Slot<> lookupDatabases;
+ Signal<std::vector<std::filesystem::path>> databaseListChanged;
+
+private:
+ const std::vector<std::filesystem::path> databaseLookupDirs;
+ std::vector<MapDirectory> databaseDirectories;
+ std::mutex mutex;
+
+public:
+ explicit MapManager(const std::vector<std::filesystem::path> &databaseLookupDirs);
+ MapManager(const MapManager&) = delete;
+ MapManager(MapManager&&) = delete;
+
+ MapManager& operator=(const MapManager&) = delete;
+ MapManager& operator=(MapManager&&) = delete;
+
+ ~MapManager() override = default;
+
+ std::vector<std::filesystem::path> GetLookupDirectories() const
+ {
+ return databaseLookupDirs;
+ }
+
+ std::vector<MapDirectory> GetDatabaseDirectories() const
+ {
+ std::unique_lock<std::mutex> lock;
+ return databaseDirectories;
+ }
+
+ /** Lookup map databases
+ *
+ * @return future, always true
+ */
+ CancelableFuture<bool> LookupDatabases();
+
+ /** Deletes databases with logical map path other than specified by filesystem path
+ *
+ * @param mapPath
+ * @param fsPath
+ * @return future boolean, true when some database was deleted, false otherwise
+ */
+ CancelableFuture<bool> DeleteOther(const std::vector<std::string> &mapPath, const std::filesystem::path &fsPath);
+};
+
+using MapManagerRef = std::shared_ptr<MapManager>;
+
+}
+
+#endif //OSMSCOUT_CLIENT_MAPMANAGER_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/POILookupModule.h
^
|
@@ -0,0 +1,74 @@
+#ifndef OSMSCOUT_CLIENT_POILOOKUPSERVICE_H
+#define OSMSCOUT_CLIENT_POILOOKUPSERVICE_H
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2018 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/DBThread.h>
+#include <osmscoutclient/LocationInfo.h>
+
+namespace osmscout {
+
+/**
+ * \ingroup QtAPI
+ */
+class OSMSCOUT_CLIENT_API POILookupModule: public AsyncWorker
+{
+private:
+ DBThreadRef dbThread;
+
+public:
+
+ using LookupResult = std::vector<LocationInfo>;
+ using LookupFuture = CancelableFuture<LookupResult>;
+
+ Signal<int> lookupAborted; //<! requestId was aborted
+ Signal<int> lookupFinished; //<! requestId was finished
+ Signal<int, LookupResult> lookupResult; //<! partial result for requestId
+
+public:
+ explicit POILookupModule(DBThreadRef dbThread);
+
+ POILookupModule(const POILookupModule&) = delete;
+ POILookupModule(POILookupModule&&) = delete;
+ POILookupModule& operator=(const POILookupModule&) = delete;
+ POILookupModule& operator=(POILookupModule&&) = delete;
+
+ ~POILookupModule() override;
+
+ /** Lookup POI around some point, to maximum distance by given types.
+ * It returns future with complete result and emits lookupResult signal
+ * with partial results.
+ */
+ LookupFuture lookupPOIRequest(int requestId,
+ const GeoCoord &searchCenter,
+ const std::vector<std::string> &types,
+ const Distance &maxDistance);
+
+private:
+ LookupResult doPOIlookup(DBInstanceRef db,
+ const GeoBox &searchBoundingBox,
+ const std::vector<std::string> &types);
+
+};
+
+}
+
+#endif //OSMSCOUT_CLIENT_POILOOKUPSERVICE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/Settings.h
^
|
@@ -182,7 +182,7 @@
};
/**
- * \ingroup QtAPI
+ * \ingroup ClientAPI
*/
using SettingsRef = std::shared_ptr<Settings>;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/src/meson.build
^
|
@@ -1,7 +1,12 @@
osmscoutclientSrc = [
'src/osmscoutclient/DBInstance.cpp',
+ 'src/osmscoutclient/DBJob.cpp',
+ 'src/osmscoutclient/DBThread.cpp',
+ 'src/osmscoutclient/MapDirectory.cpp',
+ 'src/osmscoutclient/MapManager.cpp',
'src/osmscoutclient/MapProvider.cpp',
'src/osmscoutclient/OnlineTileProvider.cpp',
+ 'src/osmscoutclient/POILookupModule.cpp',
'src/osmscoutclient/Settings.cpp',
'src/osmscoutclient/VoiceProvider.cpp'
]
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/DBJob.cpp
^
|
@@ -0,0 +1,54 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2017 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+#include <osmscoutclient/DBJob.h>
+
+namespace osmscout {
+
+DBJob::DBJob():
+ threadId(std::this_thread::get_id())
+{
+}
+
+DBJob::~DBJob()
+{
+ assert(threadId==std::this_thread::get_id());
+ Close();
+}
+
+void DBJob::Run(const osmscout::BasemapDatabaseRef& basemapDatabase,
+ const std::list<DBInstanceRef> &databases,
+ std::shared_lock<std::shared_mutex> &&locker)
+{
+ assert(threadId==std::this_thread::get_id());
+ this->basemapDatabase=basemapDatabase;
+ this->databases=databases;
+ this->locker=std::move(locker);
+}
+
+void DBJob::Close()
+{
+ if (!locker.owns_lock()){
+ return;
+ }
+ assert(threadId==std::this_thread::get_id());
+ locker.unlock();
+ databases.clear();
+}
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/DBThread.cpp
^
|
@@ -0,0 +1,529 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2010 Tim Teulings
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutmap/MapService.h>
+
+#include <osmscoutclient/DBThread.h>
+#include <osmscoutclient/private/Config.h>
+
+#ifdef OSMSCOUT_HAVE_LIB_MARISA
+#include <osmscout/db/TextSearchIndex.h>
+#endif
+
+#include <osmscout/log/Logger.h>
+
+namespace osmscout {
+
+DBThread::DBThread(const std::string &basemapLookupDirectory,
+ const std::string &iconDirectory,
+ SettingsRef settings,
+ MapManagerRef mapManager,
+ const std::vector<std::string> &customPoiTypes)
+ : AsyncWorker("DBThread"),
+ mapManager(mapManager),
+ basemapLookupDirectory(basemapLookupDirectory),
+ settings(settings),
+ mapDpi(-1),
+ iconDirectory(iconDirectory),
+ daylight(true),
+ customPoiTypes(customPoiTypes)
+{
+ double physicalDpi = settings->GetPhysicalDPI();
+ osmscout::log.Debug() << "Reported screen DPI: " << physicalDpi;
+ mapDpi = settings->GetMapDPI();
+ osmscout::log.Debug() << "Map DPI override: " << mapDpi;
+
+ stylesheetFilename = settings->GetStyleSheetAbsoluteFile();
+ stylesheetFlags=settings->GetStyleSheetFlags();
+ osmscout::log.Debug() << "Using stylesheet: " << stylesheetFilename;
+
+ emptyTypeConfig=std::make_shared<TypeConfig>();
+ registerCustomPoiTypes(emptyTypeConfig);
+ emptyStyleConfig=makeStyleConfig(emptyTypeConfig, true);
+
+ settings->mapDPIChange.Connect(mapDpiSlot);
+ mapManager->databaseListChanged.Connect(databaseListChangedSlot);
+}
+
+DBThread::~DBThread()
+{
+ std::unique_lock locker(lock);
+ osmscout::log.Debug() << "DBThread::~DBThread()";
+
+ mapDpiSlot.Disconnect();
+ databaseListChangedSlot.Disconnect();
+
+ if (basemapDatabase) {
+ basemapDatabase->Close();
+ basemapDatabase=nullptr;
+ }
+
+ for (auto& db:databases){
+ db->Close();
+ }
+ databases.clear();
+}
+
+bool DBThread::isInitializedInternal()
+{
+ return std::all_of(databases.begin(), databases.end(),
+ [](const auto &db) { return db->IsOpen(); });
+}
+
+bool DBThread::isInitialized()
+{
+ std::shared_lock locker(lock);
+ return isInitializedInternal();
+}
+
+double DBThread::GetMapDpi() const
+{
+ return mapDpi;
+}
+
+double DBThread::GetPhysicalDpi() const
+{
+ return settings->GetPhysicalDPI();
+}
+
+const GeoBox DBThread::databaseBoundingBox() const {
+ std::shared_lock locker(lock);
+ GeoBox response;
+ for (const auto& db:databases){
+ response.Include(db->GetDBGeoBox());
+ }
+ return response;
+}
+
+DatabaseCoverage DBThread::databaseCoverage(const osmscout::Magnification &magnification,
+ const osmscout::GeoBox &bbox)
+{
+ std::shared_lock locker(lock);
+
+ osmscout::GeoBox boundingBox;
+ for (const auto &db:databases){
+ boundingBox.Include(db->GetDBGeoBox());
+ }
+ if (boundingBox.IsValid()) {
+ /*
+ qDebug() << "Database bounding box: " <<
+ QString::fromStdString( boundingBox.GetDisplayText()) <<
+ " test bounding box: " <<
+ QString::fromStdString( tileBoundingBox.GetDisplayText() );
+ */
+
+ if (boundingBox.Includes(bbox.GetMinCoord()) &&
+ boundingBox.Includes(bbox.GetMaxCoord())) {
+
+ // test if some db has full coverage for this box
+ bool fullCoverage=false;
+ for (const auto &db:databases){
+ std::list<osmscout::GroundTile> groundTiles;
+ if (!db->GetMapService()->GetGroundTiles(bbox,magnification,groundTiles)){
+ break;
+ }
+ bool mayContainsUnknown=false;
+ for (const auto &tile:groundTiles){
+ if (tile.type==osmscout::GroundTile::unknown ||
+ tile.type==osmscout::GroundTile::coast){
+ mayContainsUnknown=true;
+ break;
+ }
+ }
+ if (!mayContainsUnknown){
+ fullCoverage=true;
+ break;
+ }
+ }
+
+ return fullCoverage? DatabaseCoverage::Covered: DatabaseCoverage::Intersects;
+ }
+ if (boundingBox.Intersects(bbox)){
+ return DatabaseCoverage::Intersects;
+ }
+ }
+ return DatabaseCoverage::Outside;
+}
+
+void DBThread::Initialize()
+{
+ mapManager->LookupDatabases();
+}
+
+CancelableFuture<bool> DBThread::OnDatabaseListChanged(const std::vector<std::filesystem::path> &databaseDirectories)
+{
+ return Async<bool>([this, databaseDirectories](const Breaker &breaker) -> bool {
+ if (breaker.IsAborted()) {
+ return false;
+ }
+ std::unique_lock locker(lock);
+
+ if (basemapDatabase) {
+ basemapDatabase->Close();
+ basemapDatabase=nullptr;
+ }
+
+ for (const auto& db:databases){
+ db->Close();
+ }
+ databases.clear();
+ osmscout::GeoBox boundingBox;
+
+#if defined(HAVE_MMAP)
+ constexpr bool haveMmap = true;
+#else
+ constexpr bool haveMmap = false;
+#endif
+
+ if constexpr (haveMmap && sizeof(void*)<=4){
+ // we are on 32 bit system probably, we have to be careful with mmap
+ int64_t mmapQuota=1.5 * (1<<30); // 1.5 GiB
+ std::vector<std::string> mmapFiles{
+ "bounding.dat", "router2.dat", "types.dat", "textregion.dat", "textpoi.dat",
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/MapDirectory.cpp
^
|
@@ -0,0 +1,179 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/MapDirectory.h>
+
+#include <osmscoutclient/json/json.hpp>
+
+#include <osmscout/log/Logger.h>
+#include <osmscout/io/File.h>
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+MapDirectory::MapDirectory(const std::filesystem::path &dir):
+ dir(dir)
+{
+ std::vector<std::string> fileNames = MandatoryFiles();
+ // coverage.idx is optional, introduced after database version 16
+ // router.idx is optional, it was removed with database version 17
+ // route.dat, arearoute.idx are optional, introduced with database version 21
+ // text*.dat files are optional, these files are missing when db is build without Marisa support
+
+ osmscout::log.Debug() << "Checking db files in directory " << GetDirStr();
+ valid=true;
+ for (const auto &fileName: fileNames) {
+ bool exists=ExistsInFilesystem((dir / fileName).string());
+ if (!exists){
+ osmscout::log.Debug() << "Missing mandatory file: " << fileName;
+ }
+ valid &= exists;
+ }
+ if (!valid){
+ osmscout::log.Warn() << "Can't use db " << GetDirStr() << ", some mandatory files are missing.";
+ }
+
+ // metadata
+ if (auto metadataPath = dir / FileMetadata;
+ ExistsInFilesystem(metadataPath.string())) {
+ // we need map metadata even when it is not valid (not fully downloaded for example...)
+
+ std::vector<char> content;
+ if (!ReadFile(metadataPath.string(), content)) {
+ log.Warn() << "Couldn't open" << metadataPath.string() << "file.";
+ return;
+ }
+ log.Debug() << "Loading map metadata from " << metadataPath.string();
+
+ using json = nlohmann::json;
+ try {
+ auto metadataObject = json::parse(content);
+ if (metadataObject["name"].is_string() &&
+ metadataObject["map"].is_string() &&
+ metadataObject["creation"].is_number() &&
+ metadataObject["version"].is_number()) {
+
+ name = metadataObject["name"].get<std::string>();
+ auto list = SplitString(metadataObject["map"].get<std::string>(), "/");
+ std::copy(list.begin(), list.end(), std::back_inserter(path));
+ using namespace std::chrono;
+ creation = time_point<system_clock, seconds>(seconds(metadataObject["creation"].get<uint64_t>()));
+ version = metadataObject["version"].get<uint32_t>();
+ metadata = true;
+ }
+ } catch (const json::exception &e) {
+ log.Warn() << "Failed to parse json from" << metadataPath.string() << ":" << e.what();
+ }
+ }
+}
+
+std::vector<std::string> MapDirectory::MandatoryFiles()
+{
+ return std::vector<std::string>{
+ "bounding.dat",
+ "nodes.dat",
+ "areas.dat",
+ "ways.dat",
+ "areanode.idx",
+ "areaarea.idx",
+ "areaway.idx",
+ "areasopt.dat",
+ "waysopt.dat",
+ "location.idx",
+ "water.idx",
+ "intersections.dat",
+ "intersections.idx",
+ "route.dat",
+ "arearoute.idx",
+ "router.dat",
+ "router2.dat",
+ // types.dat should be last, when download is interrupted,
+ //directory is not recognized as valid map
+ "types.dat"
+ };
+}
+
+std::vector<std::string> MapDirectory::OptionalFiles(){
+ return std::vector<std::string>{{
+ "textloc.dat",
+ "textother.dat",
+ "textpoi.dat",
+ "textregion.dat",
+ "coverage.idx"
+ }};
+}
+
+std::vector<std::string> MapDirectory::MetadataFiles()
+{
+ return std::vector<std::string>{
+ FileMetadata
+ };
+}
+
+uint64_t MapDirectory::ByteSize() const
+{
+ uint64_t size = 0;
+ auto Count = [&size, this](const std::vector<std::string> &fileNames) {
+ for (const auto &fileName: fileNames) {
+ if(std::filesystem::exists(dir / fileName)){
+ size+=std::filesystem::file_size(dir / fileName);
+ }
+ }
+ };
+
+ Count(MandatoryFiles());
+ Count(OptionalFiles());
+ Count(MetadataFiles());
+
+ return size;
+}
+
+bool MapDirectory::DeleteDatabase()
+{
+ valid=false;
+
+ bool result=true;
+ auto DeleteFiles = [&result, this](const std::vector<std::string> &fileNames){
+ for (const auto &fileName: fileNames) {
+ if(std::filesystem::exists(dir / fileName)) {
+ result&=RemoveFile((dir / fileName).string());
+ } else {
+ // check for partial download
+ std::string tempFileName = (dir / fileName).string() + MapDirectory::TemporaryFileSuffix;
+ if (std::filesystem::exists(tempFileName)) {
+ result &= RemoveFile(tempFileName);
+ }
+ }
+ }
+ };
+
+ DeleteFiles(MandatoryFiles());
+ DeleteFiles(OptionalFiles());
+ DeleteFiles(MetadataFiles());
+
+ result&=RemoveFile(GetDirStr());
+ if (result){
+ log.Debug() << "Removed db" << GetDirStr();
+ }else{
+ log.Warn() << "Failed to remove db directory completely" << GetDirStr();
+ }
+ return result;
+}
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/MapManager.cpp
^
|
@@ -0,0 +1,101 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2017 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/MapManager.h>
+
+#include <osmscout/TypeConfig.h>
+
+namespace osmscout {
+
+MapManager::MapManager(const std::vector<std::filesystem::path> &databaseLookupDirs):
+ AsyncWorker("MapManager"),
+ lookupDatabases(std::bind(&MapManager::LookupDatabases, this)),
+ databaseLookupDirs(databaseLookupDirs)
+{
+
+}
+
+CancelableFuture<bool> MapManager::LookupDatabases()
+{
+ return Async<bool>([this](Breaker&) -> bool{
+
+ osmscout::log.Info() << "Lookup databases";
+ std::unique_lock<std::mutex> lock;
+
+ databaseDirectories.clear();
+ std::set<std::filesystem::path> uniqPaths;
+ std::vector<std::filesystem::path> databaseFsDirectories;
+
+ for (const auto &lookupDir:databaseLookupDirs){
+ // Symlinks are automatically resolved when using exists() and is_directory().
+ // https://en.cppreference.com/w/cpp/filesystem/exists
+ // https://en.cppreference.com/w/cpp/filesystem/is_directory
+ // https://en.cppreference.com/w/cpp/filesystem/status
+ if (!std::filesystem::exists(lookupDir) || !std::filesystem::is_directory(lookupDir)) {
+ osmscout::log.Warn() << "Lookup dir" << lookupDir.string() << "doesn't exist or isn't a directory";
+ continue;
+ }
+
+ for (const auto & fInfo : std::filesystem::recursive_directory_iterator(lookupDir)) {
+ auto entryPath = fInfo.path();
+ if (fInfo.is_regular_file() && entryPath.has_filename() && entryPath.has_parent_path() && entryPath.filename() == TypeConfig::FILE_TYPES_DAT){
+ MapDirectory mapDir(entryPath.parent_path());
+ if (mapDir.IsValid()) {
+ osmscout::log.Info() << "found db " << mapDir.GetName() << ": " << mapDir.GetDirStr();
+ if (uniqPaths.find(mapDir.GetDir()) == uniqPaths.end()) {
+ databaseDirectories.push_back(mapDir);
+ databaseFsDirectories.push_back(mapDir.GetDir());
+ uniqPaths.insert(mapDir.GetDir());
+ }
+ }
+ }
+ }
+ }
+ databaseListChanged.Emit(databaseFsDirectories);
+
+ return true;
+ });
+}
+
+CancelableFuture<bool> MapManager::DeleteOther(const std::vector<std::string> &mapPath, const std::filesystem::path &fsPath)
+{
+ return Async<bool>([this, mapPath, fsPath](Breaker&) -> bool{
+ std::unique_lock<std::mutex> lock;
+
+ bool result = false;
+ for (auto &mapDir:databaseDirectories) {
+ if (mapDir.HasMetadata() &&
+ mapDir.GetPath() == mapPath &&
+ mapDir.GetDir() != fsPath) {
+
+ osmscout::log.Debug() << "deleting map db " << mapDir.GetName() << ": " << mapDir.GetDirStr();
+ mapDir.DeleteDatabase();
+ result = true;
+ }
+ }
+
+ if (result) {
+ LookupDatabases();
+ }
+ return result;
+ });
+}
+
+}
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/POILookupModule.cpp
^
|
@@ -0,0 +1,187 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2018 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/POILookupModule.h>
+
+#include <osmscout/feature/OperatorFeature.h>
+
+#include <osmscout/poi/POIService.h>
+
+namespace osmscout {
+
+POILookupModule::POILookupModule(DBThreadRef dbThread):
+ AsyncWorker("POILookupModule"), dbThread(dbThread)
+{
+ // no code
+}
+
+POILookupModule::~POILookupModule()
+{
+ ThreadAssert();
+}
+
+template<class T>
+LocationInfo buildLocationEntry(T obj,
+ const std::string &dbPath,
+ const GeoCoord &coordinates,
+ const GeoBox &bbox)
+{
+ std::string title;
+ std::string altName;
+ std::string objectType = obj->GetType()->GetName();
+ const FeatureValueBuffer &features=obj->GetFeatureValueBuffer();
+
+ if (const NameFeatureValue *name=features.findValue<NameFeatureValue>();
+ name!=nullptr){
+ title=name->GetLabel(Locale(), 0);
+ //std::cout << " \"" << name->GetLabel() << "\"";
+ } else if (const OperatorFeatureValue *operatorVal=features.findValue<OperatorFeatureValue>();
+ operatorVal!=nullptr) {
+ title=operatorVal->GetLabel(Locale(), 0);
+ } else if (const RefFeatureValue *ref=features.findValue<RefFeatureValue>();
+ ref!=nullptr) {
+ title=ref->GetLabel(Locale(), 0);
+ }
+
+ if (const NameAltFeatureValue *name=features.findValue<NameAltFeatureValue>();
+ name!=nullptr) {
+ altName = name->GetLabel(Locale(), 0);
+ }
+
+ return LocationInfo{LocationInfo::Type::typeObject,
+ title,
+ altName,
+ objectType,
+ std::vector<AdminRegionInfoRef>(),
+ dbPath,
+ {obj->GetObjectFileRef()},
+ coordinates,
+ bbox};
+}
+
+POILookupModule::LookupResult POILookupModule::doPOIlookup(DBInstanceRef db,
+ const GeoBox &searchBoundingBox,
+ const std::vector<std::string> &types)
+{
+ LookupResult result;
+
+ TypeInfoSet nodeTypes;
+ std::vector<NodeRef> nodes;
+ TypeInfoSet wayTypes;
+ std::vector<WayRef> ways;
+ TypeInfoSet areaTypes;
+ std::vector<AreaRef> areas;
+
+ auto database=db->GetDatabase();
+ if (!database){
+ log.Error() << "No db available";
+ return result;
+ }
+ TypeConfigRef typeConfig=database->GetTypeConfig();
+ if (!typeConfig){
+ log.Error() << "No typeConfig available";
+ return result;
+ }
+
+ // prepare type set
+ for (const auto &typeName: types){
+ TypeInfoRef typeInfo=typeConfig->GetTypeInfo(typeName);
+ if (!typeInfo){
+ log.Warn() << "There is no type " << typeName;
+ continue;
+ }
+ if (typeInfo->CanBeArea()){
+ areaTypes.Set(typeInfo);
+ }
+ if (typeInfo->CanBeWay()){
+ wayTypes.Set(typeInfo);
+ }
+ if (typeInfo->CanBeNode()){
+ nodeTypes.Set(typeInfo);
+ }
+ }
+
+ // lookup objects
+ POIService poiService(database);
+ try {
+ poiService.GetPOIsInArea(searchBoundingBox,
+ nodeTypes,
+ nodes,
+ wayTypes,
+ ways,
+ areaTypes,
+ areas);
+ }
+ catch (const std::exception& e) {
+ log.Error() << "Failed to load POIs in area: " << e.what();
+ return result;
+ }
+
+ // build location entries
+ for (AreaRef &area:areas) {
+ GeoBox bbox=area->GetBoundingBox();
+ GeoCoord coordinates=bbox.GetCenter();
+
+ result.push_back(buildLocationEntry(area, db->path, coordinates, bbox));
+ }
+
+ for (WayRef &way:ways) {
+ GeoBox bbox=way->GetBoundingBox();
+ GeoCoord coordinates=bbox.GetCenter();
+
+ result.push_back(buildLocationEntry(way, db->path, coordinates, bbox));
+ }
+
+ for (NodeRef &node:nodes) {
+ GeoCoord coordinates=node->GetCoords();
+ GeoBox bbox;
+ bbox.Include(GeoBox::BoxByCenterAndRadius(node->GetCoords(), Distance::Of<Meter>(2.0)));
+
+ result.push_back(buildLocationEntry(node, db->path, coordinates, bbox));
+ }
+
+ return result;
+}
+
+POILookupModule::LookupFuture POILookupModule::lookupPOIRequest(int requestId,
+ const GeoCoord &searchCenter,
+ const std::vector<std::string> &types,
+ const Distance &maxDistance)
+{
+ return Async<LookupResult>([=](Breaker &breaker) -> LookupResult {
+ LookupResult result;
+ GeoBox searchBoundingBox=GeoBox::BoxByCenterAndRadius(searchCenter, maxDistance);
+
+ dbThread->RunSynchronousJob([&](const std::list<DBInstanceRef>& databases){
+ for (auto &db : databases) {
+ if (breaker.IsAborted()){
+ lookupAborted.Emit(requestId);
+ break;
+ }
+ auto partialResult=doPOIlookup(db, searchBoundingBox, types);
+ lookupResult.Emit(requestId,partialResult);
+ std::copy(partialResult.begin(), partialResult.end(), std::back_inserter(result));
+ }
+ });
+
+ lookupFinished.Emit(requestId);
+ return result;
+ });
+}
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-gpx/src/osmscoutgpx/Import.cpp
^
|
@@ -335,12 +335,20 @@
return xmlGetPredefinedEntity(name);
}
- static void StructuredErrorHandler(void* data, xmlErrorPtr error)
+ // overloaded method for libxml2 >= 2.12.0
+ static void StructuredErrorHandler(void* data, const xmlError *error)
{
auto* parser=static_cast<GpxParser*>(data);
parser->Error("XML error, line " + std::to_string(error->line) + ": " + error->message);
}
+ // overloaded method for libxml2 < 2.12.0
+ [[maybe_unused]]
+ static void StructuredErrorHandler(void* data, xmlErrorPtr error)
+ {
+ StructuredErrorHandler(data, static_cast<const xmlError*>(error));
+ }
+
static void WarningHandler(void* data, const char* msg,...)
{
auto* parser=static_cast<GpxParser*>(data);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/PreprocessOSM.cpp
^
|
@@ -339,11 +339,19 @@
return xmlGetPredefinedEntity(name);
}
- static void StructuredErrorHandler(void* /*data*/, xmlErrorPtr error)
+ // overloaded method for libxml2 >= 2.12.0
+ static void StructuredErrorHandler(void* /*data*/, const xmlError *error)
{
std::cerr << "XML error, line " << error->line << ": " << error->message << std::endl;
}
+ // overloaded method for libxml2 < 2.12.0
+ [[maybe_unused]]
+ static void StructuredErrorHandler(void* data, xmlErrorPtr error)
+ {
+ StructuredErrorHandler(data, static_cast<const xmlError*>(error));
+ }
+
static void WarningHandler(void* /*data*/, const char* msg,...)
{
std::cerr << "XML warning:" << msg << std::endl;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/oss/Parser.h
^
|
@@ -30,10 +30,12 @@
#include <osmscout/TypeConfig.h>
#include <osmscout/io/File.h>
+
#include <osmscout/util/String.h>
#include <osmscout/util/Transformation.h>
#include <osmscout/log/Logger.h>
+
#include <osmscoutmap/oss/Scanner.h>
#include <osmscoutmap/StyleConfig.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-map/parser/OSS/OSS.atg
^
|
@@ -10,6 +10,7 @@
#include <osmscout/util/String.h>
#include <osmscout/util/Transformation.h>
+#include <osmscout/log/Logger.h>
COMPILER OSS
@@ -95,7 +96,7 @@
if (!filter.FiltersByType() ||
filter.HasType(type)) {
// Add type only if the filter either has no types or
- // if the the type is already filtered
+ // if the type is already filtered
resultTypes.Set(type);
}
}
@@ -180,7 +181,8 @@
bool success=config.Load(moduleFileName,
colorPostprocessor,
- true);
+ true,
+ errors->log);
if (!success) {
std::string e="Cannot load module '"+moduleFileName+"'";
@@ -1407,18 +1409,18 @@
ATTRIBUTEVALUE<PartialStyleBase& style, const StyleAttributeDescriptor& descriptor>
=
(.
- ValueType valueType=ValueType::NO_VALUE;
- bool negate=false;
- std::string ident;
- std::string subIdent;
- std::string stringValue;
- std::string function;
- double factor=-1;
- std::string unit;
- std::string number;
- std::list<std::string> numberList;
- Color color;
- StyleConstantRef constant;
+ ValueType valueType=ValueType::NO_VALUE;
+ bool negate=false;
+ std::string ident;
+ std::string subIdent;
+ std::string stringValue;
+ std::string function;
+ double factor=-1;
+ std::string unit;
+ std::string number;
+ std::vector<std::string> numberList;
+ Color color;
+ StyleConstantRef constant;
.)
(
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-map/parser/OSS/Parser.frame
^
|
@@ -37,10 +37,11 @@
public:
std::list<Err> errors;
- bool hasErrors;
+ bool hasErrors=false;
+ Log log;
public:
- Errors();
+ explicit Errors(const Log &log);
void SynErr(int line, int col, int n);
void Error(int line, int col, const char *s);
void Warning(int line, int col, const char *s);
@@ -80,7 +81,8 @@
Parser(Scanner *scanner,
const std::string& filename,
StyleConfig& config,
- osmscout::ColorPostprocessor colorPostprocessor=nullptr);
+ osmscout::ColorPostprocessor colorPostprocessor=nullptr,
+ const Log &log=osmscout::log);
~Parser();
void SemErr(const char* msg);
@@ -237,7 +239,8 @@
Parser::Parser(Scanner *scanner,
const std::string& filename,
StyleConfig& config,
- osmscout::ColorPostprocessor colorPostprocessor)
+ osmscout::ColorPostprocessor colorPostprocessor,
+ const Log &log)
: filename(filename),
config(config)
{
@@ -247,7 +250,7 @@
minErrDist = 2;
errDist = minErrDist;
this->scanner = scanner;
- errors = new Errors();
+ errors = new Errors(log);
this->colorPostprocessor=colorPostprocessor;
}
@@ -276,8 +279,8 @@
}
}
-Errors::Errors()
- : hasErrors(false)
+Errors::Errors(const Log &log)
+ : log(log)
{
// no code
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/oss/Parser.cpp
^
|
@@ -269,7 +269,8 @@
bool success=config.Load(moduleFileName,
colorPostprocessor,
- true);
+ true,
+ errors->log);
if (!success) {
std::string e="Cannot load module '"+moduleFileName+"'";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/async/AsyncWorker.h
^
|
@@ -27,6 +27,7 @@
#include <osmscout/async/WorkQueue.h>
#include <thread>
+#include <cassert>
namespace osmscout {
@@ -58,6 +59,16 @@
void DeleteLater();
+ std::thread::id GetThreadId() const
+ {
+ return thread.get_id();
+ }
+
+ void ThreadAssert() const
+ {
+ assert(std::this_thread::get_id()==thread.get_id());
+ }
+
protected:
template<typename T>
CancelableFuture<T> Async(const std::function<T(Breaker&)> &task)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/async/Thread.h
^
|
@@ -26,6 +26,7 @@
#include <string>
#include <thread>
+#include <optional>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/elevation/ElevationService.h
^
|
@@ -20,19 +20,16 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <vector>
-
-#include <osmscout/lib/CoreImportExport.h>
-
#include <osmscout/Way.h>
-
#include <osmscout/TypeConfig.h>
-
+#include <osmscout/async/Breaker.h>
#include <osmscout/feature/EleFeature.h>
-
+#include <osmscout/lib/CoreImportExport.h>
#include <osmscout/log/Logger.h>
#include <osmscout/util/TileId.h>
+#include <vector>
+
namespace osmscout {
struct ContoursData
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/ScreenBox.h
^
|
@@ -53,6 +53,11 @@
ScreenBox(const ScreenBox& other) = default;
/**
+ * Move-Constructor
+ */
+ ScreenBox(ScreenBox&& other) = default;
+
+ /**
* Initialize the GeoBox based on the given coordinates. The two Coordinates
* together span a rectangular (in coordinates, not on the sphere) area.
*/
@@ -65,6 +70,11 @@
ScreenBox& operator=(const ScreenBox& other) = default;
/**
+ * Move assignment operator
+ */
+ ScreenBox& operator=(ScreenBox&& other) = default;
+
+ /**
* Compare two values
*/
bool operator==(const ScreenBox& other) const;
@@ -106,6 +116,26 @@
}
/**
+ * Returns the size of the screen box (width*height).
+ *
+ * @return GetWidth()*GetHeight()
+ */
+ [[nodiscard]] double GetSize() const
+ {
+ return GetWidth()*GetHeight();
+ }
+
+ /**
+ * Check if size of the screen box is zero
+ *
+ * @return GetSize()==0.0
+ */
+ [[nodiscard]] bool IsEmpty() const
+ {
+ return GetSize()==0.0;
+ }
+
+ /**
* Returns the center coordinates of the box
* @return the center coordinates
*/
@@ -121,11 +151,12 @@
/**
* Resize the rectangle in all dimension using the given amount.
- * If pixel is >=0 the resulting area will be bigger, else smaller.
+ * If offset is >=0 the resulting area will be bigger, else smaller.
*
- * It is checked that offset>=width/-2 and offset>=height/-2
+ * If the reduction (negative offset) is bigger than width/2 or height/2,
+ * resulted screen box will have zero size (will be empty).
*
- * The size delta will be 2*pixel in width and in height!
+ * The size delta will be 2*offset in width and in height!
*
* @param offset the amount to change the coordinates.
* @return the resulting ScreenBox
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/async/AsyncWorker.cpp
^
|
@@ -19,12 +19,17 @@
#include <osmscout/async/AsyncWorker.h>
+#include <osmscout/async/Thread.h>
+
namespace osmscout {
-AsyncWorker::AsyncWorker(const std::string&):
+AsyncWorker::AsyncWorker(const std::string &name):
thread(&AsyncWorker::Loop,this)
{
-
+ Async<int>([name](Breaker &) -> int {
+ SetThreadName(name);
+ return 0;
+ });
}
AsyncWorker::~AsyncWorker()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/location/LocationService.cpp
^
|
@@ -1088,7 +1088,7 @@
* @param tokenString
* Token to remove
* @param tokens
- * List to rmeove token parameter from
+ * List to remove token parameter from
* @return
* New list
*/
@@ -1379,9 +1379,19 @@
locationIgnoreTokenSet.insert(UTF8StringToUpper(token));
}
+ // Locations are streets in town usually. But for small villages without named streets,
+ // village name (region) is added as virtual location to our location index.
+ // Address points are linked by "addr:place" tag to the place (region).
+ //
+ // So, to be able lookup address points just by phrase "Village 123",
+ // we add region name to location search patterns.
+ // We would force users to use pattern "Village Village 123" otherwise.
+ std::list<std::string> extendedLocationTokens=locationTokens;
+ extendedLocationTokens.push_back(regionMatch.name);
+
// Build Location search patterns
- std::list<TokenStringRef> locationSearchPatterns=GenerateSearchPatterns(locationTokens,
+ std::list<TokenStringRef> locationSearchPatterns=GenerateSearchPatterns(extendedLocationTokens,
locationIgnoreTokenSet,
locationIndex->GetLocationMaxWords());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/ScreenBox.cpp
^
|
@@ -65,14 +65,24 @@
ScreenBox ScreenBox::Resize(double offset) const
{
- // If the offset is negative its absolute value must not be >= than width/2 or height/2
- assert(offset >= GetWidth()/-2);
- assert(offset >= GetHeight()/-2);
+ double minX, minY, maxX, maxY;
- return {Vertex2D(minCoord.GetX()-offset,
- minCoord.GetY()-offset),
- Vertex2D(maxCoord.GetX()+offset,
- maxCoord.GetY()+offset)};
+ if (offset < GetWidth()/-2) {
+ maxX=minX=(maxCoord.GetX()+minCoord.GetX()) / 2;
+ } else {
+ minX=minCoord.GetX()-offset;
+ maxX=maxCoord.GetX()+offset;
+ }
+
+ if(offset < GetHeight()/-2){
+ maxY=minY=(maxCoord.GetY()+minCoord.GetY()) / 2;
+ } else {
+ minY=minCoord.GetY()-offset;
+ maxY=maxCoord.GetY()+offset;
+ }
+
+ return {Vertex2D(minX,minY),
+ Vertex2D(maxX,maxY)};
}
ScreenBox ScreenBox::Merge(const ScreenBox& other) const
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/graphics/cover-2.33.svg
^
|
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="845"
+ height="422"
+ id="svg2054"
+ version="1.1"
+ sodipodi:docname="cover-2.17.svg"
+ inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata
+ id="metadata14">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs12">
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect68354"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect67275"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect61307"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect60161"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect58467"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect52944"
+ is_visible="true"
+ lpeversion="1" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter51493"
+ x="-0.2313123"
+ y="-0.37891728"
+ width="1.4626246"
+ height="1.7578346">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.0860482"
+ id="feGaussianBlur51495" />
+ </filter>
+ <meshgradient
+ inkscape:collect="always"
+ id="meshgradient21283"
+ gradientUnits="userSpaceOnUse"
+ x="-332.61957"
+ y="814.60327">
+ <meshrow
+ id="meshrow47633">
+ <meshpatch
+ id="meshpatch47635">
+ <stop
+ path="c 5.2076,-5.43232e-05 13.5814,1.93095 18.7891,1.93095"
+ style="stop-color:#ffffff;stop-opacity:1"
+ id="stop47637" />
+ <stop
+ path="c 0.22361,7.77765 -1.84395,8.97825 -1.84406,16.3893"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47639" />
+ <stop
+ path="c -5.20756,0.000281765 -8.57128,5.84397 -13.779,5.84397"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47641" />
+ <stop
+ path="c 0,-7.41092 -3.16582,-16.7528 -3.16604,-24.1642"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47643" />
+ </meshpatch>
+ <meshpatch
+ id="meshpatch47645">
+ <stop
+ path="c 5.2077,0 9.81985,0.929076 15.0274,0.929122"
+ id="stop47647" />
+ <stop
+ path="c 0.000144097,7.41081 0.595604,13.893 0.595604,21.3039"
+ style="stop-color:#5b471d;stop-opacity:1"
+ id="stop47649" />
+ <stop
+ path="c -2.11035,-6.44281 -10.3606,-5.23983 -17.4671,-5.84374"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47651" />
+ </meshpatch>
+ </meshrow>
+ <meshrow
+ id="meshrow47653">
+ <meshpatch
+ id="meshpatch47655">
+ <stop
+ path="c -1.68717,14.2356 1.43271,21.6624 1.84406,28.0763"
+ id="stop47657" />
+ <stop
+ path="c -5.2077,0 -10.4154,0 -15.6231,1.13687e-13"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47659" />
+ <stop
+ path="c -5.68434e-14,-7.41092 -5.68434e-14,-14.8218 4e-05,-22.2324"
+ style="stop-color:#cbb55e;stop-opacity:1"
+ id="stop47661" />
+ </meshpatch>
+ <meshpatch
+ id="meshpatch47663">
+ <stop
+ path="c 0,7.41092 -4.3727,6.98682 -4.37276,14.3978"
+ id="stop47665" />
+ <stop
+ path="c -5.20757,-0.000164599 -6.04249,7.83479 -11.2502,7.83478"
+ style="stop-color:#1f180a;stop-opacity:1"
+ id="stop47667" />
+ </meshpatch>
+ </meshrow>
+ </meshgradient>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter48085"
+ x="-0.011683676"
+ y="-0.0082102014"
+ width="1.0233674"
+ height="1.0164204">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.1521128"
+ id="feGaussianBlur48087" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1136"
+ id="namedview10"
+ showgrid="false"
+ inkscape:zoom="0.87407407"
+ inkscape:cx="353.51695"
+ inkscape:cy="253.98305"
+ inkscape:window-x="1920"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2054"
+ inkscape:pagecheckerboard="0" />
+ <image
+ sodipodi:absref="/home/karry/SailfishOS/projects/osmscout-sailfish/graphics/cover-2.17.jpg"
+ xlink:href="cover-2.17.jpg"
+ y="0"
+ x="0"
+ id="image892"
+ style="image-rendering:optimizeSpeed"
+ preserveAspectRatio="none"
+ height="422"
+ width="845" />
+ <g
+ id="label"
+ transform="matrix(1.4841993,0,0,1.4841993,49.48781,-1166.5396)"
+ style="opacity:1">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:50px;line-height:99%;font-family:Arial;-inkscape-font-specification:Arial;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
+ x="263.37292"
+ y="835.81036"
+ id="text4187"><tspan
+ style="fill:#411f11;fill-opacity:0.734982"
|
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/pics/cover.jpg
^
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/CollectionModel.cpp
^
|
@@ -355,7 +355,7 @@
case WaypointTypeRole: return waypointType(waypoint.data.symbol);
case LocationObjectRole:
// QML will take ownership
- return QVariant::fromValue(new osmscout::LocationEntry(osmscout::LocationEntry::typeObject,
+ return QVariant::fromValue(new osmscout::LocationEntry(osmscout::LocationInfo::Type::typeObject,
QString::fromStdString(waypoint.data.name.value_or(""s)),
"",
waypointType(waypoint.data.symbol),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/CollectionTrackModel.cpp
^
|
@@ -218,7 +218,7 @@
}
// QML will take ownership
- return new LocationEntry(LocationEntry::Type::typeNone,
+ return new LocationEntry(LocationInfo::Type::typeNone,
"bbox",
"",
"bbox",
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/MemoryManager.cpp
^
|
@@ -62,16 +62,14 @@
auto dbThread=OSMScoutQt::GetInstance().GetDBThread();
assert(dbThread);
- connect(this, &MemoryManager::flushCachesRequest,
- dbThread.get(), &DBThread::FlushCaches,
- Qt::QueuedConnection);
+ flushCachesRequest.Connect(dbThread->flushCaches);
}
void MemoryManager::onTimeout()
{
using namespace std::chrono;
malloc_stats();
- emit flushCachesRequest(duration_cast<milliseconds>(cacheValidity).count());
+ flushCachesRequest.Emit(duration_cast<milliseconds>(cacheValidity));
if (trimAlloc){
if (malloc_trim(0) == 0){
// The malloc_trim() function returns 1 if memory was actually released
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/MemoryManager.h
^
|
@@ -34,9 +34,6 @@
void memoryLevelChanged(const QString &arg);
void onTimeout();
-signals:
- void flushCachesRequest(qint64 idleMs);
-
public:
MemoryManager();
virtual ~MemoryManager() = default;
@@ -45,4 +42,5 @@
QTimer timer;
std::chrono::milliseconds cacheValidity=std::chrono::minutes(10);
bool trimAlloc{false};
+ osmscout::Signal<std::chrono::milliseconds> flushCachesRequest;
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/NearWaypointModel.cpp
^
|
@@ -20,8 +20,8 @@
#include "NearWaypointModel.h"
#include <osmscout/util/Geometry.h>
+#include <osmscoutclient/AdminRegionInfo.h>
#include <osmscoutclientqt/LocationEntry.h>
-#include <osmscoutclientqt/AdminRegionInfo.h>
NearWaypointModel::NearWaypointModel()
{
@@ -125,7 +125,7 @@
// QML will take ownership
return new osmscout::LocationEntry(
- osmscout::LocationEntry::typeObject,
+ osmscout::LocationInfo::Type::typeObject,
QString::fromStdString(waypoint.data.name ? waypoint.data.name.value() : waypoint.data.coord.GetDisplayText()),
"",
"",
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/PerformanceTest.cpp
^
|
@@ -22,13 +22,10 @@
#include <limits>
#include <tuple>
-//#include "config.h"
+#include "config.h"
#define HAVE_LIB_OSMSCOUTMAPQT
//#define HAVE_LIB_OSMSCOUTMAPCAIRO
-/* Define to 1 if you have the `mallinfo' function. */
-#define HAVE_MALLINFO 1
-
#include <osmscout/db/Database.h>
#include <osmscoutmap/MapService.h>
@@ -60,7 +57,7 @@
#include <gperftools/heap-profiler.h>
#include <malloc.h> // mallinfo
#else
-#if defined(HAVE_MALLINFO)
+#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2)
#include <malloc.h> // mallinfo
#endif
#endif
@@ -732,11 +729,15 @@
}
struct mallinfo alloc_info = tc_mallinfo();
#else
+#if defined(HAVE_MALLINFO2)
+ struct mallinfo2 alloc_info = mallinfo2();
+#else
#if defined(HAVE_MALLINFO)
struct mallinfo alloc_info = mallinfo();
#endif
#endif
-#if defined(HAVE_MALLINFO) || defined(HAVE_LIB_GPERFTOOLS)
+#endif
+#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2) || defined(HAVE_LIB_GPERFTOOLS)
std::cout << "memory usage: " << formatAlloc(alloc_info.uordblks) << std::endl;
stats.allocMax = std::max(stats.allocMax, (double) alloc_info.uordblks);
stats.allocSum = stats.allocSum + (double) alloc_info.uordblks;
@@ -816,7 +817,7 @@
std::cout << "Level: " << stats.level << std::endl;
std::cout << "Tiles: " << stats.tileCount << " (load " << args.loadRepeat << "x, drawn " << args.drawRepeat << "x)" << std::endl;
-#if defined(HAVE_MALLINFO) || defined(HAVE_LIB_GPERFTOOLS)
+#if defined(HAVE_MALLINFO) || defined(HAVE_MALLINFO2) || defined(HAVE_LIB_GPERFTOOLS)
std::cout << " Used memory: ";
std::cout << "max: " << formatAlloc(stats.allocMax) << " ";
std::cout << "avg: " << formatAlloc(stats.allocSum / (stats.tileCount * args.loadRepeat)) << std::endl;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/src/PerformanceTestConfig.h.cmake
^
|
@@ -0,0 +1,16 @@
+#ifndef LIBOSMSCOUT_PERFORMANCETEST_PRIVATE_CONFIG_H
+#define LIBOSMSCOUT_PERFORMANCETEST_PRIVATE_CONFIG_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mallinfo' function. */
+#cmakedefine HAVE_MALLINFO 1
+
+/* Define to 1 if you have the `mallinfo2' function. */
+#cmakedefine HAVE_MALLINFO2 1
+
+/* Define to 1 if you have the `mmap' function. */
+#cmakedefine HAVE_MMAP 1
+
+#endif
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/stylesheets/outdoor.oss
^
|
@@ -1427,7 +1427,7 @@
[MAG veryClose-] {
[TYPE highway_tertiary,
- highway_tertiary_link,
+ highway_tertiary_link,
highway_unclassified,
highway_road,
highway_residential,
@@ -1696,6 +1696,7 @@
tourism_information_building,
tourism_motel_building,
tourism_museum_building,
+ tourism_building,
historic_castle_building,
historic_monument_building,
historic_memorial_building,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/cs.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation>zavřeno</translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Státní svátky</translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Školní prázdniny</translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation>Státní svátky</translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation>Školní prázdniny</translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2363,6 +2335,34 @@
</message>
</context>
<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>zavřeno</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Státní svátky</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Školní prázdniny</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation>Státní svátky</translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation>Školní prázdniny</translation>
+ </message>
+</context>
+<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
<source>Turn sharp left</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/de.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation>geschlossen</translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation>gesetzlicher Feiertag</translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Schulferien</translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation>GF</translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation>SF</translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2354,6 +2326,34 @@
</message>
</context>
<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>geschlossen</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>gesetzlicher Feiertag</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Schulferien</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation>GF</translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation>SF</translation>
+ </message>
+</context>
+<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
<source>Turn sharp left</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/en.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2354,6 +2326,34 @@
</message>
</context>
<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
<source>Turn sharp left</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/es.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/et.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation>suletud</translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Riigipühad</translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Koolivaheajad</translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation>RP</translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation>KV</translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2354,6 +2326,34 @@
</message>
</context>
<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>suletud</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Riigipühad</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Koolivaheajad</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation>RP</translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation>KV</translation>
+ </message>
+</context>
+<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
<source>Turn sharp left</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/fa.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2344,6 +2316,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/fr.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/hu.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2344,6 +2316,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/it.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/nb.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/nl.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/nl_BE.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/pl.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation>zamknięte</translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Wakacje</translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Szkolne wakacje</translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2362,6 +2334,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>zamknięte</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Wakacje</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Szkolne wakacje</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/pt_BR.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2353,6 +2325,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/ru.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2362,6 +2334,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/sv.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation>stängd</translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Helgdag</translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation>Skollov</translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation>Hd</translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation>Sl</translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2354,6 +2326,34 @@
</message>
</context>
<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation>stängd</translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Helgdag</translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation>Skollov</translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation>Hd</translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation>Sl</translation>
+ </message>
+</context>
+<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
<source>Turn sharp left</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.33.tar.bz2/translations/zh_CN.ts
^
|
@@ -987,34 +987,6 @@
</message>
</context>
<context>
- <name>OpeningHoursModel</name>
- <message>
- <source>closed</source>
- <extracomment>example: restaurant is "closed" at Monday</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>Public holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>School holiday</source>
- <extracomment>long variant</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>PH</source>
- <extracomment>short variant of "Public holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
- <message>
- <source>SH</source>
- <extracomment>short variant of "School holiday"</extracomment>
- <translation type="unfinished"></translation>
- </message>
-</context>
-<context>
<name>PlaceDetail</name>
<message>
<source>You are here</source>
@@ -2344,6 +2316,34 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>osmscout::OpeningHoursModel</name>
+ <message>
+ <source>closed</source>
+ <extracomment>example: restaurant is "closed" at Monday</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Public holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>School holiday</source>
+ <extracomment>long variant</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>PH</source>
+ <extracomment>short variant of "Public holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>SH</source>
+ <extracomment>short variant of "School holiday"</extracomment>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>osmscout::RouteDescriptionBuilder</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.changes.in
^
|
@@ -610,3 +610,8 @@
- replace online wmflabs "Hike and Bike" map with "Topo" map from Tracestrack
- fix crash during map rendering of zero-size area (happening with Bern in Switzerland)
- allow to select stored waypoint as navigation start or destination
+
+* 2023-12-15 Lukáš Karas <lukas.karas@centrum.cz> 2.33
+- delete partially downloaded database before new download - it avoids "Directory already exists" error
+- fix translations related to opening hours
+- improve search for villages without named street, simple "Village <house number>" phrase is working now
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.yaml
^
|
@@ -1,6 +1,6 @@
Name: harbour-osmscout
Summary: OSMScout for Sailfish
-Version: 2.32
+Version: 2.33
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
|