Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d939de63
Commit
d939de63
authored
Jul 12, 2016
by
dogmaphobic
Browse files
Map Reset Dialog
Adding a dialog telling the user the map cache database has been reset.
parent
de9f2428
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/QGCApplication.cc
View file @
d939de63
...
...
@@ -116,6 +116,8 @@
#endif
#endif
#include
"QGCMapEngine.h"
QGCApplication
*
QGCApplication
::
_app
=
NULL
;
const
char
*
QGCApplication
::
parameterFileExtension
=
"params"
;
...
...
@@ -445,6 +447,11 @@ bool QGCApplication::_initForNormalAppBoot(void)
"Your saved settings have been reset to defaults."
);
}
if
(
getQGCMapEngine
()
->
wasCacheReset
())
{
showMessage
(
"The Offline Map Cache database has been upgraded. "
"Your old map cache sets have been reset."
);
}
settings
.
sync
();
return
true
;
...
...
src/QtLocationPlugin/QGCMapEngine.cpp
View file @
d939de63
...
...
@@ -126,6 +126,7 @@ QGCMapEngine::QGCMapEngine()
,
_maxDiskCache
(
0
)
,
_maxMemCache
(
0
)
,
_prunning
(
false
)
,
_cacheWasReset
(
false
)
{
qRegisterMetaType
<
QGCMapTask
::
TaskType
>
();
qRegisterMetaType
<
QGCTile
>
();
...
...
@@ -142,6 +143,17 @@ QGCMapEngine::~QGCMapEngine()
delete
_urlFactory
;
}
//-----------------------------------------------------------------------------
void
QGCMapEngine
::
_checkWipeDirectory
(
const
QString
&
dirPath
)
{
QDir
dir
(
dirPath
);
if
(
dir
.
exists
(
dirPath
))
{
_cacheWasReset
=
true
;
_wipeDirectory
(
dirPath
);
}
}
//-----------------------------------------------------------------------------
void
QGCMapEngine
::
_wipeOldCaches
()
...
...
@@ -152,13 +164,13 @@ QGCMapEngine::_wipeOldCaches()
#else
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericCacheLocation
)
+
QLatin1String
(
"/QGCMapCache55"
);
#endif
_
w
ipeDirectory
(
oldCacheDir
);
_
checkW
ipeDirectory
(
oldCacheDir
);
#ifdef __mobile__
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QLatin1String
(
"/QGCMapCache100"
);
#else
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericCacheLocation
)
+
QLatin1String
(
"/QGCMapCache100"
);
#endif
_
w
ipeDirectory
(
oldCacheDir
);
_
checkW
ipeDirectory
(
oldCacheDir
);
}
//-----------------------------------------------------------------------------
...
...
src/QtLocationPlugin/QGCMapEngine.h
View file @
d939de63
...
...
@@ -86,6 +86,7 @@ public:
void
setMaxMemCache
(
quint32
size
);
const
QString
getCachePath
()
{
return
_cachePath
;
}
const
QString
getCacheFilename
()
{
return
_cacheFile
;
}
bool
wasCacheReset
()
{
return
_cacheWasReset
;
}
UrlFactory
*
urlFactory
()
{
return
_urlFactory
;
}
...
...
@@ -108,6 +109,7 @@ signals:
private:
void
_wipeOldCaches
();
void
_checkWipeDirectory
(
const
QString
&
dirPath
);
bool
_wipeDirectory
(
const
QString
&
dirPath
);
private:
...
...
@@ -120,6 +122,7 @@ private:
quint32
_maxDiskCache
;
quint32
_maxMemCache
;
bool
_prunning
;
bool
_cacheWasReset
;
};
extern
QGCMapEngine
*
getQGCMapEngine
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment