Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
d939de63
Commit
d939de63
authored
Jul 12, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
QGCApplication.cc
src/QGCApplication.cc
+7
-0
QGCMapEngine.cpp
src/QtLocationPlugin/QGCMapEngine.cpp
+14
-2
QGCMapEngine.h
src/QtLocationPlugin/QGCMapEngine.h
+3
-0
No files found.
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
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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