[qmapshack] 01/01: Add patch to fix upstream issue #149.
Bas Couwenberg
sebastic at debian.org
Thu Jul 14 12:30:58 UTC 2016
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch jessie-backports
in repository qmapshack.
commit 6d94eebb352c72c5e073c1aa83d090c652d4208d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Thu Jul 14 14:09:45 2016 +0200
Add patch to fix upstream issue #149.
---
debian/changelog | 8 ++++
...ath-for-systems-without-QMS-configuration.patch | 43 ++++++++++++++++++++++
debian/patches/series | 1 +
3 files changed, 52 insertions(+)
diff --git a/debian/changelog b/debian/changelog
index 0582056..5217106 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+qmapshack (1.6.2-1~bpo8+2) jessie-backports; urgency=medium
+
+ * Add patch to fix upstream issue #149.
+ An empty (not default-initialized) cachePath causes deletion of files in
+ cwd; cachePath should never be empty at all...
+
+ -- Bas Couwenberg <sebastic at debian.org> Thu, 14 Jul 2016 14:09:32 +0200
+
qmapshack (1.6.2-1~bpo8+1) jessie-backports; urgency=medium
* Rebuild for jessie-backports.
diff --git a/debian/patches/properly-initialize-cachePath-for-systems-without-QMS-configuration.patch b/debian/patches/properly-initialize-cachePath-for-systems-without-QMS-configuration.patch
new file mode 100644
index 0000000..d404cc6
--- /dev/null
+++ b/debian/patches/properly-initialize-cachePath-for-systems-without-QMS-configuration.patch
@@ -0,0 +1,43 @@
+Description: Properly initialize cachePath for systems without QMS configuration (new installations)
+ This fixes Issue #149: An empty (not default-initialized) cachePath causes
+ deletion of files in cwd; cachePath should never be empty at all...
+ .
+ Implemented additional catching of empty cacheRoot in cleanupRemovedMaps,
+ even though this should never be triggered
+Author: Christian Eichler <code at christian-eichler.de>
+Origin: https://bitbucket.org/maproom/qmapshack/pull-requests/107/issue-149-properly-initialize-cachepath/diff
+Bug: https://bitbucket.org/maproom/qmapshack/issues/149/warning-this-application-removed-several
+
+--- a/src/map/CMapDraw.cpp
++++ b/src/map/CMapDraw.cpp
+@@ -119,8 +119,13 @@ void CMapDraw::saveMapPath(QSettings& cf
+
+ void CMapDraw::loadMapPath(QSettings& cfg)
+ {
+- mapPaths = cfg.value("mapPath", mapPaths).toStringList();
+- cachePath = cfg.value("cachePath", cachePath).toString();
++ mapPaths = cfg.value("mapPath", mapPaths).toStringList();
++ cachePath = cfg.value("cachePath", cachePath).toString();
++
++ if(cachePath.isEmpty())
++ {
++ cachePath = IAppSetup::getPlatformInstance()->defaultCachePath();
++ }
+ }
+
+
+--- a/src/map/cache/CDiskCache.cpp
++++ b/src/map/cache/CDiskCache.cpp
+@@ -156,6 +156,12 @@ void CDiskCache::slotCleanup()
+ void CDiskCache::cleanupRemovedMaps(const QSet<QString> &maps)
+ {
+ QString cacheRoot = CMapDraw::getCacheRoot();
++
++ if(cacheRoot.isEmpty()) {
++ qWarning() << "cacheRoot is empty, that should not happen at all";
++ return;
++ }
++
+ const QStringList &dirs = QDir(cacheRoot).entryList(QStringList("*"), QDir::Dirs | QDir::NoDotAndDotDot);
+
+ for(const QString &dir : dirs)
diff --git a/debian/patches/series b/debian/patches/series
index 7cc6c18..b6457b2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
original-typo.patch
+properly-initialize-cachePath-for-systems-without-QMS-configuration.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/qmapshack.git
More information about the Pkg-grass-devel
mailing list