diff --git a/qmapshack-1.15.0-fix_crash_in_profile.patch b/qmapshack-1.15.0-fix_crash_in_profile.patch deleted file mode 100644 index 0aba36a..0000000 --- a/qmapshack-1.15.0-fix_crash_in_profile.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 277626d9d3482fe0c64ad66a30c8d7dc7416f81b Mon Sep 17 00:00:00 2001 -From: John Floyd -Date: Wed, 24 Jun 2020 13:39:31 +1000 -Subject: [PATCH] [QMS-217] Fix Crash in Profile - -Routino_GetProfiles returns a NULL result if profile is not in profiles. -Catch this error and display error message. - -This coding error predates latest profiles work. ---- - changelog.txt | 1 + - src/qmapshack/gis/rte/router/CRouterRoutino.cpp | 8 ++++++++ - 2 files changed, 9 insertions(+) - -diff --git a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -index 91ba62c3..cc32674c 100644 ---- a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -+++ b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -@@ -378,6 +378,10 @@ void CRouterRoutino::calcRoute(const IGisItem::key_t& key) - QString strLanguage = comboLanguage->currentData(Qt::UserRole).toString(); - - Routino_Profile *profile = Routino_GetProfile(strProfile.toUtf8()); -+ if( profile == NULL ) -+ { -+ throw tr("Required profile '%1' is not the current profiles file.").arg(strProfile); -+ } - Routino_Translation *translation = Routino_GetTranslation(strLanguage.toUtf8()); - - int res = Routino_ValidateProfile(data, profile); -@@ -466,6 +470,10 @@ int CRouterRoutino::calcRoute(const QPointF& p1, const QPointF& p2, QPolygonF& c - QString strLanguage = comboLanguage->currentData(Qt::UserRole).toString(); - - Routino_Profile *profile = Routino_GetProfile(strProfile.toUtf8()); -+ if( profile == NULL ) -+ { -+ throw tr("Required profile '%1' is not the current profiles file.").arg(strProfile); -+ } - Routino_Translation *translation = Routino_GetTranslation(strLanguage.toUtf8()); - - diff --git a/qmapshack-1.15.0-libqt5-5.15.0-0.patch b/qmapshack-1.15.0-libqt5-5.15.0-0.patch deleted file mode 100644 index 5d75c3e..0000000 --- a/qmapshack-1.15.0-libqt5-5.15.0-0.patch +++ /dev/null @@ -1,251 +0,0 @@ -From a0eda8480f32cd38bfb8510a9fe40e8a6d620825 Mon Sep 17 00:00:00 2001 -From: John Floyd -Date: Sat, 23 May 2020 16:10:57 +1000 -Subject: [PATCH] [QMS-158] Change Routino Profiles search for - [prefix-]profiles.xml - -Changes the Routino profiles search to include -1) dbase-folder/prefix-profiles.xml -2) dbase-folder/profiles.xml -3) routino-shared-system-folder/profiles.xml - -Requires parsing the profiles file in the routing functions to allow -changing to a new routing database during a session by calling a new -method loadProfiles. This means that the name of the profiles.xml being -used must be known. - -buildDatabaseList method is expanded to check and keep the first -available profiles file for each routing database that is loaded. This -is kept in the UserData item of the UI comboDatabase instance in a map -variable along with the database pointer for each database item. - -Includes Latest Changes based on Review - -loadProfiles is now called in buildDatabaseList to check if the xml is -OK and when database is changed from gui. -Changelog now sequestial. - -More changes to avoid aborts and segmentation errors. - -Moved the failure messagebox from loadProfiles to buildDatabaseList. -This allows the database prefix to be referenced in the message. Message -is expanded to notify user that the profiles file needs to be fixed and -that the database associated with the failed profiles is ignored. - -Reset currentProfilesPath for test loads! - -New Review cleanups - -Move 158 entry in changelog to new version! ---- - changelog.txt | 1 + - .../gis/rte/router/CRouterRoutino.cpp | 99 ++++++++++++++++--- - src/qmapshack/gis/rte/router/CRouterRoutino.h | 2 + - 3 files changed, 87 insertions(+), 15 deletions(-) - -diff --git a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -index 81f37fa4..91ba62c3 100644 ---- a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -+++ b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -@@ -29,10 +29,8 @@ - #include - #include - -- - QPointer CRouterRoutino::progress; - -- - int ProgressFunc(double complete) - { - if(CRouterRoutino::progress.isNull()) -@@ -64,15 +62,9 @@ CRouterRoutino::CRouterRoutino(QWidget *parent) - comboMode->addItem(tr("Shortest")); - comboMode->addItem(tr("Quickest")); - -+ - int res = 0; - IAppSetup *setup = IAppSetup::getPlatformInstance(); -- res = Routino_ParseXMLProfiles(setup->routinoPath("profiles.xml").toUtf8()); -- if(res) -- { -- QMessageBox::critical(this, "Routino...", xlateRoutinoError(Routino_errno), QMessageBox::Abort); -- return; -- } -- - res = Routino_ParseXMLTranslations(setup->routinoPath("translations.xml").toUtf8()); - if(res) - { -@@ -233,6 +225,11 @@ void CRouterRoutino::buildDatabaseList() - QRegExp re("(.*)-segments.mem"); - freeDatabaseList(); - -+ // initialise -+ currentProfilesPath = ""; -+ -+ IAppSetup *setup = IAppSetup::getPlatformInstance(); -+ - for(const QString &path : dbPaths) - { - QDir dir(path); -@@ -248,33 +245,98 @@ void CRouterRoutino::buildDatabaseList() - continue; - } - -+ // qDebug() << "buildDatabase Prefix" << prefix; -+ - #ifdef Q_OS_WIN - Routino_Database * data = Routino_LoadDatabase(dir.absolutePath().toLocal8Bit(), prefix.toLocal8Bit()); - #else - Routino_Database * data = Routino_LoadDatabase(dir.absolutePath().toUtf8(), prefix.toUtf8()); - #endif -- if(data) -+ qDebug() << "Loaded Routino DB" << dir.absolutePath().toUtf8().data() << " " << prefix.toUtf8().data(); -+ -+ if(data == nullptr) -+ { -+ QMessageBox::critical(this, "Routino ...", xlateRoutinoError(Routino_errno), QMessageBox::Abort); -+ continue; -+ } -+ /* determine the profile to use for each database*/ -+ QVariantMap dmap; -+ dmap["db"] = QVariant ((qulonglong)data); -+ -+ /* check possible profiles.xml locations and use the first available */ -+ int pError = 0; -+ dmap["profilesPath"] = ""; -+ QStringList profilesPaths = { -+ dir.filePath(prefix+"-profiles.xml"), -+ dir.filePath("profiles.xml"), -+ setup->routinoPath("profiles.xml").toUtf8() -+ }; -+ -+ for(const QString& profilePath : profilesPaths) -+ { -+ QFileInfo pinfo(profilePath); -+ if( pinfo.isReadable()) -+ { -+ dmap["profilesPath"] = pinfo.filePath(); -+ break; -+ } -+ } -+ if( dmap["profilesPath"].toString().isEmpty() ) -+ { -+ QMessageBox::critical(this, "Routino...",tr("Could not find a profiles XML file in expected folders. Routino Routing will not function"), QMessageBox::Ok); -+ pError = 1; -+ } -+ else -+ { -+ /* ensure we always reload */ -+ currentProfilesPath = ""; -+ /* check if profile will load - will abort if not good */ -+ pError = loadProfiles(dmap["profilesPath"].toString()); -+ } -+ qDebug() << "Profile ... Using \n" << dmap["profilesPath"].toString(); -+ -+ if( pError == 0 ) - { -- comboDatabase->addItem(prefix.replace("_", " "), quint64(data)); -+ comboDatabase->addItem(prefix.replace("_", " "), dmap); - } - else - { -- QMessageBox::critical(this, "Routino...", xlateRoutinoError(Routino_errno), QMessageBox::Abort); -+ const QString& msg = tr( -+ "%1\n" -+ "Error in '%2'\n" -+ "This needs to be fixed\n" -+ "The associated database '%3' is ignored" -+ ).arg(xlateRoutinoError(Routino_errno)).arg(dmap["profilesPath"].toString()).arg(prefix); -+ -+ QMessageBox::warning(this, "Routino...", msg, QMessageBox::Ok); - } - } - } -+ currentProfilesPath = ""; - } - - void CRouterRoutino::freeDatabaseList() - { - for(int i = 0; i < comboDatabase->count(); i++) - { -- Routino_Database * data = (Routino_Database*)comboDatabase->itemData(i, Qt::UserRole).toULongLong(); -+ QVariantMap map = comboDatabase->itemData(i,Qt::UserRole).toMap(); -+ Routino_Database * data = (Routino_Database*)(map["db"].toULongLong()); - Routino_UnloadDatabase(data); - } - comboDatabase->clear(); - } - -+int CRouterRoutino::loadProfiles(const QString& profilesPath) -+{ -+ int res = 0; -+ if( currentProfilesPath != profilesPath) -+ { -+ currentProfilesPath = profilesPath; -+ res = Routino_ParseXMLProfiles(profilesPath.toUtf8()); -+ } -+ return res; -+} -+ - void CRouterRoutino::updateHelpText() - { - bool haveDB = (comboDatabase->count() != 0); -@@ -301,12 +363,15 @@ void CRouterRoutino::calcRoute(const IGisItem::key_t& key) - throw QString(); - } - -- Routino_Database * data = (Routino_Database*)comboDatabase->currentData(Qt::UserRole).toULongLong(); -+ QVariantMap map = comboDatabase->currentData(Qt::UserRole).toMap(); -+ Routino_Database * data = (Routino_Database*)(map["db"].toULongLong()); - if(nullptr == data) - { - throw QString(); - } - -+ loadProfiles(map["profilesPath"].toString()); -+ - rte->reset(); - - QString strProfile = comboProfile->currentData(Qt::UserRole).toString(); -@@ -388,18 +453,22 @@ int CRouterRoutino::calcRoute(const QPointF& p1, const QPointF& p2, QPolygonF& c - - try - { -- Routino_Database * data = (Routino_Database*)comboDatabase->currentData(Qt::UserRole).toULongLong(); -+ QVariantMap map = comboDatabase->currentData(Qt::UserRole).toMap(); -+ Routino_Database * data = (Routino_Database*)(map["db"].toULongLong()); - if(nullptr == data) - { - throw QString(); - } - -+ loadProfiles(map["profilesPath"].toString()); -+ - QString strProfile = comboProfile->currentData(Qt::UserRole).toString(); - QString strLanguage = comboLanguage->currentData(Qt::UserRole).toString(); - - Routino_Profile *profile = Routino_GetProfile(strProfile.toUtf8()); - Routino_Translation *translation = Routino_GetTranslation(strLanguage.toUtf8()); - -+ - int res = Routino_ValidateProfile(data, profile); - if(res != 0) - { -diff --git a/src/qmapshack/gis/rte/router/CRouterRoutino.h b/src/qmapshack/gis/rte/router/CRouterRoutino.h -index 13217532..7aae8c83 100644 ---- a/src/qmapshack/gis/rte/router/CRouterRoutino.h -+++ b/src/qmapshack/gis/rte/router/CRouterRoutino.h -@@ -57,11 +57,13 @@ private slots: - virtual ~CRouterRoutino(); - void buildDatabaseList(); - void freeDatabaseList(); -+ int loadProfiles(const QString& profilesPath); - void updateHelpText(); - QString xlateRoutinoError(int err); - static CRouterRoutino * pSelf; - - QStringList dbPaths; -+ QString currentProfilesPath; - - QMutex mutex {QMutex::NonRecursive}; - }; diff --git a/qmapshack-1.15.0-libqt5-5.15.0.patch b/qmapshack-1.15.0-libqt5-5.15.0.patch deleted file mode 100644 index ab7ff41..0000000 --- a/qmapshack-1.15.0-libqt5-5.15.0.patch +++ /dev/null @@ -1,211 +0,0 @@ -From 1563ccbc7b1e912e1fced9e0a4a27a382415719d Mon Sep 17 00:00:00 2001 -From: kiozen -Date: Thu, 25 Jun 2020 13:27:20 +0200 -Subject: [PATCH] [QMS-216] QMapShack does not compile with Qt-5.15 - -Add `#include ` whereever `QPainterPath` is used. - -Additionally ran code beautifier ---- - changelog.txt | 1 + - .../gis/rte/router/CRouterOptimization.h | 2 +- - .../gis/rte/router/CRouterRoutino.cpp | 6 ++--- - src/qmapshack/gis/wpt/CGisItemWpt.cpp | 1 + - src/qmapshack/helpers/CDraw.cpp | 1 + - src/qmapshack/map/CMapIMG.cpp | 1 + - src/qmapshack/mouse/IMouseSelect.cpp | 1 + - src/qmaptool/helpers/CDraw.cpp | 1 + - src/qmaptool/overlay/COverlayCutMap.cpp | 22 ++++++++++--------- - 9 files changed, 22 insertions(+), 14 deletions(-) - -diff --git a/src/qmapshack/gis/rte/router/CRouterOptimization.h b/src/qmapshack/gis/rte/router/CRouterOptimization.h -index 17b699ef..34b8f376 100644 ---- a/src/qmapshack/gis/rte/router/CRouterOptimization.h -+++ b/src/qmapshack/gis/rte/router/CRouterOptimization.h -@@ -19,9 +19,9 @@ - #ifndef CROUTEROPTIMIZATION_H - #define CROUTEROPTIMIZATION_H - #include -+#include - #include - #include --#include - - class CRouterOptimization - { -diff --git a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -index cc32674c..5b8e5770 100644 ---- a/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -+++ b/src/qmapshack/gis/rte/router/CRouterRoutino.cpp -@@ -267,7 +267,7 @@ void CRouterRoutino::buildDatabaseList() - int pError = 0; - dmap["profilesPath"] = ""; - QStringList profilesPaths = { -- dir.filePath(prefix+"-profiles.xml"), -+ dir.filePath(prefix + "-profiles.xml"), - dir.filePath("profiles.xml"), - setup->routinoPath("profiles.xml").toUtf8() - }; -@@ -283,7 +283,7 @@ void CRouterRoutino::buildDatabaseList() - } - if( dmap["profilesPath"].toString().isEmpty() ) - { -- QMessageBox::critical(this, "Routino...",tr("Could not find a profiles XML file in expected folders. Routino Routing will not function"), QMessageBox::Ok); -+ QMessageBox::critical(this, "Routino...", tr("Could not find a profiles XML file in expected folders. Routino Routing will not function"), QMessageBox::Ok); - pError = 1; - } - else -@@ -319,7 +319,7 @@ void CRouterRoutino::freeDatabaseList() - { - for(int i = 0; i < comboDatabase->count(); i++) - { -- QVariantMap map = comboDatabase->itemData(i,Qt::UserRole).toMap(); -+ QVariantMap map = comboDatabase->itemData(i, Qt::UserRole).toMap(); - Routino_Database * data = (Routino_Database*)(map["db"].toULongLong()); - Routino_UnloadDatabase(data); - } -diff --git a/src/qmapshack/gis/wpt/CGisItemWpt.cpp b/src/qmapshack/gis/wpt/CGisItemWpt.cpp -index c0dffa0f..0be0b00d 100644 ---- a/src/qmapshack/gis/wpt/CGisItemWpt.cpp -+++ b/src/qmapshack/gis/wpt/CGisItemWpt.cpp -@@ -36,6 +36,7 @@ - #include "mouse/IMouse.h" - #include "units/IUnit.h" - -+#include - #include - #include - -diff --git a/src/qmapshack/helpers/CDraw.cpp b/src/qmapshack/helpers/CDraw.cpp -index 803be18c..bd1437bf 100644 ---- a/src/qmapshack/helpers/CDraw.cpp -+++ b/src/qmapshack/helpers/CDraw.cpp -@@ -22,6 +22,7 @@ - - #include - #include -+#include - #include - #include - -diff --git a/src/qmapshack/map/CMapIMG.cpp b/src/qmapshack/map/CMapIMG.cpp -index 80a4a8ab..4a2e634d 100644 ---- a/src/qmapshack/map/CMapIMG.cpp -+++ b/src/qmapshack/map/CMapIMG.cpp -@@ -32,6 +32,7 @@ - #include "map/garmin/CGarminTyp.h" - #include "units/IUnit.h" - -+#include - #include - - #undef DEBUG_SHOW_SECT_DESC -diff --git a/src/qmapshack/mouse/IMouseSelect.cpp b/src/qmapshack/mouse/IMouseSelect.cpp -index 32535735..176a9221 100644 ---- a/src/qmapshack/mouse/IMouseSelect.cpp -+++ b/src/qmapshack/mouse/IMouseSelect.cpp -@@ -22,6 +22,7 @@ - #include "mouse/IMouseSelect.h" - #include "mouse/IScrOpt.h" - -+#include - #include - - IMouseSelect::IMouseSelect(CGisDraw *gis, CCanvas *canvas, CMouseAdapter *mouse) -diff --git a/src/qmaptool/helpers/CDraw.cpp b/src/qmaptool/helpers/CDraw.cpp -index 610951cf..8a0b2dab 100644 ---- a/src/qmaptool/helpers/CDraw.cpp -+++ b/src/qmaptool/helpers/CDraw.cpp -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - - QPen CDraw::penBorderBlue(QColor(10,10,150,220),2); - QPen CDraw::penBorderGray(Qt::lightGray,2); -diff --git a/src/qmaptool/overlay/COverlayCutMap.cpp b/src/qmaptool/overlay/COverlayCutMap.cpp -index 63bf0936..60d96a77 100644 ---- a/src/qmaptool/overlay/COverlayCutMap.cpp -+++ b/src/qmaptool/overlay/COverlayCutMap.cpp -@@ -23,12 +23,14 @@ - #include "overlay/COverlayCutMap.h" - - #include -+#include - #include -+ - using std::bind; - - static inline qreal sqr(qreal a) - { -- return a*a; -+ return a * a; - } - - static inline qreal sqrlen(const QPointF &a) -@@ -88,14 +90,14 @@ bool COverlayCutMap::drawFx(QPainter& p, CCanvas::redraw_e needsRedraw) - path.addRect(rectMap); - path.addPolygon(shape); - -- p.setPen(QPen(Qt::darkBlue,1)); -+ p.setPen(QPen(Qt::darkBlue, 1)); - - p.setBrush((idxFocus1 == NOIDX) ? Qt::BDiagPattern : Qt::NoBrush); - p.drawPath(path); - } - -- QRectF dot1(0,0,5,5); -- QRectF dot2(0,0,7,7); -+ QRectF dot1(0, 0, 5, 5); -+ QRectF dot2(0, 0, 7, 7); - const QPointF& pt1 = idxFocus1 != NOIDX ? shape[idxFocus1] : NOPOINTF; - const QPointF& pt2 = idxFocus2 != NOIDX ? shape[idxFocus2] : NOPOINTF; - -@@ -219,7 +221,7 @@ void COverlayCutMap::slotSetMode(mode_e m, bool on) - - void COverlayCutMap::slotResetMask() - { -- int res = QMessageBox::question(this, tr("Delete mask..."), tr("Are you sure to delete complete mask?"), QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes); -+ int res = QMessageBox::question(this, tr("Delete mask..."), tr("Are you sure to delete complete mask?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); - if(res != QMessageBox::Yes) - { - return; -@@ -317,7 +319,7 @@ void COverlayCutMap::slotLoadShape() - qreal x, y; - in2 >> x >> y; - -- QPointF pt(x,y); -+ QPointF pt(x, y); - context->convertCoord2Map(pt); - - region << pt; -@@ -428,7 +430,7 @@ void COverlayCutMap::isCloseToLine(QPointF pt, QPolygonF line, qint32& idx1, qin - - QPointF b = line[0]; - QPointF dbq = b - pt; -- qreal dist = 30*30; -+ qreal dist = 30 * 30; - - for (qint32 i = 1; i < count; ++i) - { -@@ -439,8 +441,8 @@ void COverlayCutMap::isCloseToLine(QPointF pt, QPolygonF line, qint32& idx1, qin - - const QPointF dab = a - b; - -- const qreal inv_sqrlen = 1./sqrlen(dab); -- const qreal t = (dab.x()*daq.x() + dab.y()*daq.y())*inv_sqrlen; -+ const qreal inv_sqrlen = 1. / sqrlen(dab); -+ const qreal t = (dab.x() * daq.x() + dab.y() * daq.y()) * inv_sqrlen; - if (t < 0.) - { - continue; -@@ -448,7 +450,7 @@ void COverlayCutMap::isCloseToLine(QPointF pt, QPolygonF line, qint32& idx1, qin - qreal current_dist; - if (t <= 1.) - { -- current_dist = sqr(dab.x()*dbq.y() - dab.y()*dbq.x())*inv_sqrlen; -+ current_dist = sqr(dab.x() * dbq.y() - dab.y() * dbq.x()) * inv_sqrlen; - } - else//t>1. - { diff --git a/qmapshack.spec b/qmapshack.spec index 55c9bf5..ec0e9af 100644 --- a/qmapshack.spec +++ b/qmapshack.spec @@ -1,5 +1,5 @@ Name: qmapshack -Version: 1.17.0 +Version: 1.17.1 Release: 1mamba Summary: Application to plan outdoor trips and visualize and archive all the GPS recordings Group: Graphical Desktop/Applications/Utilities @@ -8,9 +8,6 @@ Distribution: openmamba Packager: Silvan Calarco URL: https://github.com/Maproom/qmapshack/wiki Source: https://github.com/Maproom/qmapshack.git/V_%{version}/qmapshack-%{version}.tar.bz2 -Patch0: qmapshack-1.15.0-libqt5-5.15.0-0.patch -Patch1: qmapshack-1.15.0-libqt5-5.15.0.patch -Patch2: qmapshack-1.15.0-fix_crash_in_profile.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -31,7 +28,7 @@ BuildRequires: qt5-qtbase-devel BuildRequires: qt5-qtdeclarative-devel BuildRequires: qt5-qttools-devel ## AUTOBUILDREQ-END -BuildRequires: libgdal-devel >= 0:3.6.2-1mamba +BuildRequires: libgdal-devel >= 0:3.8.3-1mamba BuildRequires: libproj-devel >= 0:9.1.1-1mamba BuildRequires: cmake BuildRequires: routino @@ -48,9 +45,6 @@ QMapShack is the next generation of the famous QLandkarte GT application. And of %prep %setup -q -#%patch0 -p1 -#%patch1 -p1 -#%patch2 -p1 %build %cmake -d build @@ -104,6 +98,9 @@ QMapShack is the next generation of the famous QLandkarte GT application. And of %doc LICENSE %changelog +* Wed Dec 13 2023 Automatic Build System 1.17.1-1mamba +- automatic version update by autodist + * Sat Jul 22 2023 Automatic Build System 1.17.0-1mamba - automatic version update by autodist