Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
b5164290
Commit
b5164290
authored
8 years ago
by
Gus Grubba
Committed by
GitHub
8 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #3803 from dogmaphobic/offlineMapDialog
Map Reset Dialog
parents
b2a7459c
e94dea72
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/QGCApplication.cc
+7
-0
7 additions, 0 deletions
src/QGCApplication.cc
src/QtLocationPlugin/QGCMapEngine.cpp
+14
-2
14 additions, 2 deletions
src/QtLocationPlugin/QGCMapEngine.cpp
src/QtLocationPlugin/QGCMapEngine.h
+3
-0
3 additions, 0 deletions
src/QtLocationPlugin/QGCMapEngine.h
with
24 additions
and
2 deletions
src/QGCApplication.cc
+
7
−
0
View file @
b5164290
...
@@ -116,6 +116,8 @@
...
@@ -116,6 +116,8 @@
#endif
#endif
#endif
#endif
#include
"QGCMapEngine.h"
QGCApplication
*
QGCApplication
::
_app
=
NULL
;
QGCApplication
*
QGCApplication
::
_app
=
NULL
;
const
char
*
QGCApplication
::
parameterFileExtension
=
"params"
;
const
char
*
QGCApplication
::
parameterFileExtension
=
"params"
;
...
@@ -445,6 +447,11 @@ bool QGCApplication::_initForNormalAppBoot(void)
...
@@ -445,6 +447,11 @@ bool QGCApplication::_initForNormalAppBoot(void)
"Your saved settings have been reset to defaults."
);
"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
();
settings
.
sync
();
return
true
;
return
true
;
...
...
This diff is collapsed.
Click to expand it.
src/QtLocationPlugin/QGCMapEngine.cpp
+
14
−
2
View file @
b5164290
...
@@ -126,6 +126,7 @@ QGCMapEngine::QGCMapEngine()
...
@@ -126,6 +126,7 @@ QGCMapEngine::QGCMapEngine()
,
_maxDiskCache
(
0
)
,
_maxDiskCache
(
0
)
,
_maxMemCache
(
0
)
,
_maxMemCache
(
0
)
,
_prunning
(
false
)
,
_prunning
(
false
)
,
_cacheWasReset
(
false
)
{
{
qRegisterMetaType
<
QGCMapTask
::
TaskType
>
();
qRegisterMetaType
<
QGCMapTask
::
TaskType
>
();
qRegisterMetaType
<
QGCTile
>
();
qRegisterMetaType
<
QGCTile
>
();
...
@@ -142,6 +143,17 @@ QGCMapEngine::~QGCMapEngine()
...
@@ -142,6 +143,17 @@ QGCMapEngine::~QGCMapEngine()
delete
_urlFactory
;
delete
_urlFactory
;
}
}
//-----------------------------------------------------------------------------
void
QGCMapEngine
::
_checkWipeDirectory
(
const
QString
&
dirPath
)
{
QDir
dir
(
dirPath
);
if
(
dir
.
exists
(
dirPath
))
{
_cacheWasReset
=
true
;
_wipeDirectory
(
dirPath
);
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
void
void
QGCMapEngine
::
_wipeOldCaches
()
QGCMapEngine
::
_wipeOldCaches
()
...
@@ -152,13 +164,13 @@ QGCMapEngine::_wipeOldCaches()
...
@@ -152,13 +164,13 @@ QGCMapEngine::_wipeOldCaches()
#else
#else
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericCacheLocation
)
+
QLatin1String
(
"/QGCMapCache55"
);
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericCacheLocation
)
+
QLatin1String
(
"/QGCMapCache55"
);
#endif
#endif
_
w
ipeDirectory
(
oldCacheDir
);
_
checkW
ipeDirectory
(
oldCacheDir
);
#ifdef __mobile__
#ifdef __mobile__
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QLatin1String
(
"/QGCMapCache100"
);
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
AppDataLocation
)
+
QLatin1String
(
"/QGCMapCache100"
);
#else
#else
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericCacheLocation
)
+
QLatin1String
(
"/QGCMapCache100"
);
oldCacheDir
=
QStandardPaths
::
writableLocation
(
QStandardPaths
::
GenericCacheLocation
)
+
QLatin1String
(
"/QGCMapCache100"
);
#endif
#endif
_
w
ipeDirectory
(
oldCacheDir
);
_
checkW
ipeDirectory
(
oldCacheDir
);
}
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
src/QtLocationPlugin/QGCMapEngine.h
+
3
−
0
View file @
b5164290
...
@@ -86,6 +86,7 @@ public:
...
@@ -86,6 +86,7 @@ public:
void
setMaxMemCache
(
quint32
size
);
void
setMaxMemCache
(
quint32
size
);
const
QString
getCachePath
()
{
return
_cachePath
;
}
const
QString
getCachePath
()
{
return
_cachePath
;
}
const
QString
getCacheFilename
()
{
return
_cacheFile
;
}
const
QString
getCacheFilename
()
{
return
_cacheFile
;
}
bool
wasCacheReset
()
{
return
_cacheWasReset
;
}
UrlFactory
*
urlFactory
()
{
return
_urlFactory
;
}
UrlFactory
*
urlFactory
()
{
return
_urlFactory
;
}
...
@@ -108,6 +109,7 @@ signals:
...
@@ -108,6 +109,7 @@ signals:
private
:
private
:
void
_wipeOldCaches
();
void
_wipeOldCaches
();
void
_checkWipeDirectory
(
const
QString
&
dirPath
);
bool
_wipeDirectory
(
const
QString
&
dirPath
);
bool
_wipeDirectory
(
const
QString
&
dirPath
);
private
:
private
:
...
@@ -120,6 +122,7 @@ private:
...
@@ -120,6 +122,7 @@ private:
quint32
_maxDiskCache
;
quint32
_maxDiskCache
;
quint32
_maxMemCache
;
quint32
_maxMemCache
;
bool
_prunning
;
bool
_prunning
;
bool
_cacheWasReset
;
};
};
extern
QGCMapEngine
*
getQGCMapEngine
();
extern
QGCMapEngine
*
getQGCMapEngine
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment