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
04ea3c19
Commit
04ea3c19
authored
Feb 18, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for Linux and Android
Fixing QmlObjectListModel usage bug
parent
4112826b
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
49 additions
and
63 deletions
+49
-63
QGCMapEngine.cpp
src/QtLocationPlugin/QGCMapEngine.cpp
+2
-1
QGCMapEngineData.h
src/QtLocationPlugin/QGCMapEngineData.h
+1
-12
QGCMapTileSet.cpp
src/QtLocationPlugin/QGCMapTileSet.cpp
+5
-3
QGCTileCacheWorker.cpp
src/QtLocationPlugin/QGCTileCacheWorker.cpp
+1
-3
QGeoTiledMappingManagerEngineQGC.cpp
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
+3
-1
OfflineMap.qml
src/QtLocationPlugin/QMLControl/OfflineMap.qml
+35
-28
QGCMapEngineManager.cc
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
+2
-14
QGCMapEngineManager.h
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
+0
-1
No files found.
src/QtLocationPlugin/QGCMapEngine.cpp
View file @
04ea3c19
...
...
@@ -114,7 +114,7 @@ destroyMapEngine()
//-----------------------------------------------------------------------------
QGCMapEngine
::
QGCMapEngine
()
:
_urlFactory
(
new
UrlFactory
::
UrlFactory
())
:
_urlFactory
(
new
UrlFactory
())
#ifdef WE_ARE_KOSHER
//-- TODO: Get proper version
#if defined Q_OS_MAC
...
...
@@ -173,6 +173,7 @@ QGCMapEngine::init()
if
(
!
_cachePath
.
isEmpty
())
{
_cacheFile
=
kDbFileName
;
_worker
.
setDatabaseFile
(
_cachePath
+
"/"
+
_cacheFile
);
qDebug
()
<<
"Map Cache in:"
<<
_cachePath
<<
"/"
<<
_cacheFile
;
}
else
{
qCritical
()
<<
"Could not find suitable map cache directory."
;
}
...
...
src/QtLocationPlugin/QGCMapEngineData.h
View file @
04ea3c19
...
...
@@ -42,9 +42,8 @@ This file is part of the QGROUNDCONTROL project
class
QGCCachedTileSet
;
//-----------------------------------------------------------------------------
class
QGCTile
:
public
QObject
class
QGCTile
{
Q_OBJECT
public:
QGCTile
()
:
_x
(
0
)
...
...
@@ -55,16 +54,6 @@ public:
{
}
QGCTile
(
const
QGCTile
&
other
)
:
_x
(
other
.
x
())
,
_y
(
other
.
y
())
,
_z
(
other
.
z
())
,
_set
(
other
.
set
())
,
_hash
(
other
.
hash
())
,
_type
(
other
.
type
())
{
}
enum
TyleState
{
StatePending
=
0
,
StateDownloading
,
...
...
src/QtLocationPlugin/QGCMapTileSet.cpp
View file @
04ea3c19
...
...
@@ -115,8 +115,10 @@ QGCCachedTileSet::savedSizeStr()
QString
QGCCachedTileSet
::
downloadStatus
()
{
//-- Default size has no estimage. If complete, show only total size as well.
if
(
_defaultSet
||
_numTiles
==
_savedTiles
)
{
if
(
_defaultSet
)
{
return
tilesSizeStr
();
}
if
(
_numTiles
==
_savedTiles
)
{
return
savedSizeStr
();
}
else
{
return
savedSizeStr
()
+
" / "
+
tilesSizeStr
();
...
...
@@ -222,7 +224,7 @@ void QGCCachedTileSet::_prepareDownload()
connect
(
reply
,
&
QNetworkReply
::
finished
,
this
,
&
QGCCachedTileSet
::
_networkReplyFinished
);
connect
(
reply
,
static_cast
<
void
(
QNetworkReply
::*
)(
QNetworkReply
::
NetworkError
)
>
(
&
QNetworkReply
::
error
),
this
,
&
QGCCachedTileSet
::
_networkReplyError
);
_replies
.
insert
(
tile
->
hash
(),
reply
);
tile
->
deleteLater
()
;
delete
tile
;
//-- Refill queue if running low
if
(
!
_batchRequested
&&
!
_noMoreTiles
&&
_tilesToDownload
.
count
()
<
(
QGCMapEngine
::
concurrentDownloads
(
_type
)
*
10
))
{
//-- Request new batch of tiles
...
...
src/QtLocationPlugin/QGCTileCacheWorker.cpp
View file @
04ea3c19
...
...
@@ -352,9 +352,8 @@ QGCCacheWorker::_getTileSets(QGCMapTask* mtask)
void
QGCCacheWorker
::
_updateSetTotals
(
QGCCachedTileSet
*
set
)
{
_updateTotals
();
if
(
set
->
defaultSet
())
{
//-- Default Set is already computed
_updateTotals
();
set
->
setSavedTiles
(
_totalCount
);
set
->
setSavedSize
(
_totalSize
);
set
->
setNumTiles
(
_defaultCount
);
...
...
@@ -362,7 +361,6 @@ QGCCacheWorker::_updateSetTotals(QGCCachedTileSet* set)
return
;
}
QSqlQuery
subquery
(
*
_db
);
//-- Count everythin for Default Set
QString
sq
=
QString
(
"SELECT COUNT(size), SUM(size) FROM Tiles A INNER JOIN SetTiles B on A.tileID = B.tileID WHERE B.setID = %1"
).
arg
(
set
->
id
());
if
(
subquery
.
exec
(
sq
))
{
if
(
subquery
.
next
())
{
...
...
src/QtLocationPlugin/QGeoTiledMappingManagerEngineQGC.cpp
View file @
04ea3c19
...
...
@@ -226,7 +226,9 @@ QGeoTiledMappingManagerEngineQGC::_setCache(const QVariantMap ¶meters)
QGeoTileCache
*
pTileCache
=
createTileCacheWithDir
(
cacheDir
);
if
(
pTileCache
)
{
pTileCache
->
setMaxDiskUsage
(
1
);
//-- We're basically telling it to use 1kb of disk for cache. It doesn't like
// values smaller than that and I could not find a way to make it NOT cache.
pTileCache
->
setMaxDiskUsage
(
1024
);
pTileCache
->
setMaxMemoryUsage
(
memLimit
);
}
}
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
04ea3c19
This diff is collapsed.
Click to expand it.
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.cc
View file @
04ea3c19
...
...
@@ -54,7 +54,7 @@ QGCMapEngineManager::QGCMapEngineManager(QGCApplication* app)
//-----------------------------------------------------------------------------
QGCMapEngineManager
::~
QGCMapEngineManager
()
{
//_clearTileSets
();
_tileSets
.
clear
();
}
//-----------------------------------------------------------------------------
...
...
@@ -120,7 +120,7 @@ void
QGCMapEngineManager
::
loadTileSets
()
{
if
(
_tileSets
.
count
())
{
_
clearTileSets
();
_
tileSets
.
clear
();
emit
tileSetsChanged
();
}
QGCFetchTileSetTask
*
task
=
new
QGCFetchTileSetTask
();
...
...
@@ -142,18 +142,6 @@ QGCMapEngineManager::_tileSetFetched(QGCCachedTileSet* tileSet)
emit
tileSetsChanged
();
}
//-----------------------------------------------------------------------------
void
QGCMapEngineManager
::
_clearTileSets
()
{
while
(
_tileSets
.
count
())
{
QGCCachedTileSet
*
tileSet
=
qobject_cast
<
QGCCachedTileSet
*>
(
_tileSets
[
0
]);
if
(
tileSet
)
delete
tileSet
;
_tileSets
.
removeAt
(
0
);
}
}
//-----------------------------------------------------------------------------
void
QGCMapEngineManager
::
startDownload
(
const
QString
&
name
,
const
QString
&
description
,
const
QString
&
mapType
,
const
QImage
&
image
)
...
...
src/QtLocationPlugin/QMLControl/QGCMapEngineManager.h
View file @
04ea3c19
...
...
@@ -123,7 +123,6 @@ private slots:
void
_resetCompleted
();
private:
void
_clearTileSets
();
void
_updateDiskFreeSpace
();
private:
...
...
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