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
25a4502a
Commit
25a4502a
authored
Jun 28, 2016
by
Gus Grubba
Committed by
GitHub
Jun 28, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3684 from dogmaphobic/limitMemoryCache
Limit max memory cache for offline maps.
parents
f0b7195e
04de1c37
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
QGCMapEngine.cpp
src/QtLocationPlugin/QGCMapEngine.cpp
+6
-0
QGeoTiledMappingManagerEngineQGC.cpp
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
+5
-1
OfflineMap.qml
src/QtLocationPlugin/QMLControl/OfflineMap.qml
+1
-1
No files found.
src/QtLocationPlugin/QGCMapEngine.cpp
View file @
25a4502a
...
...
@@ -362,6 +362,9 @@ QGCMapEngine::getMaxMemCache()
_maxMemCache
=
settings
.
value
(
kMaxMemCacheKey
,
128
).
toUInt
();
#endif
}
//-- Size in MB
if
(
_maxMemCache
>
1024
)
_maxMemCache
=
1024
;
return
_maxMemCache
;
}
...
...
@@ -369,6 +372,9 @@ QGCMapEngine::getMaxMemCache()
void
QGCMapEngine
::
setMaxMemCache
(
quint32
size
)
{
//-- Size in MB
if
(
size
>
1024
)
size
=
1024
;
QSettings
settings
;
settings
.
setValue
(
kMaxMemCacheKey
,
size
);
_maxMemCache
=
size
;
...
...
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
View file @
25a4502a
...
...
@@ -230,7 +230,10 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap ¶meters)
//-- It won't work with less than 1M of memory cache
if
(
memLimit
<
1024
*
1024
)
memLimit
=
1024
*
1024
;
//-- Disable Qt's disk cache (set memory cache otherwise Qtlocation won't work)
//-- On the other hand, Qt uses signed 32-bit integers. Limit to 1G to round it down (you don't need more than that).
if
(
memLimit
>
1024
*
1024
*
1024
)
memLimit
=
1024
*
1024
*
1024
;
//-- Disable Qt's disk cache (sort of)
#if QT_VERSION >= 0x050600
QAbstractGeoTileCache
*
pTileCache
=
new
QGeoFileTileCache
(
cacheDir
);
setTileCache
(
pTileCache
);
...
...
@@ -241,6 +244,7 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap ¶meters)
{
//-- We're basically telling it to use 100k of disk for cache. It doesn't like
// values smaller than that and I could not find a way to make it NOT cache.
// We handle our own disk caching elsewhere.
pTileCache
->
setMaxDiskUsage
(
1024
*
100
);
pTileCache
->
setMaxMemoryUsage
(
memLimit
);
}
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
25a4502a
...
...
@@ -246,7 +246,7 @@ QGCView {
id
:
maxCacheMemSize
maximumLength
:
4
inputMethodHints
:
Qt
.
ImhDigitsOnly
validator
:
IntValidator
{
bottom
:
1
;
top
:
4096
;}
validator
:
IntValidator
{
bottom
:
1
;
top
:
1024
;}
text
:
QGroundControl
.
mapEngineManager
.
maxMemCache
}
...
...
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