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
ddf99734
Unverified
Commit
ddf99734
authored
Jul 12, 2020
by
Don Gagne
Committed by
GitHub
Jul 12, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8907 from DonLakeFlyer/DeleteBingTiles
Delete bogus Bing no data tiles from cache
parents
93205655
a42f029a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
0 deletions
+46
-0
QGCTileCacheWorker.cpp
src/QtLocationPlugin/QGCTileCacheWorker.cpp
+45
-0
QGCTileCacheWorker.h
src/QtLocationPlugin/QGCTileCacheWorker.h
+1
-0
No files found.
src/QtLocationPlugin/QGCTileCacheWorker.cpp
View file @
ddf99734
...
...
@@ -26,6 +26,7 @@
#include <QDateTime>
#include <QApplication>
#include <QFile>
#include <QSettings>
#include "time.h"
...
...
@@ -120,6 +121,7 @@ QGCCacheWorker::run()
_db
->
setConnectOptions
(
"QSQLITE_ENABLE_SHARED_CACHE"
);
_valid
=
_db
->
open
();
}
_deleteBingNoTileTiles
();
while
(
true
)
{
QGCMapTask
*
task
;
if
(
_taskQueue
.
count
())
{
...
...
@@ -203,6 +205,49 @@ QGCCacheWorker::run()
QSqlDatabase
::
removeDatabase
(
kSession
);
}
}
//-----------------------------------------------------------------------------
void
QGCCacheWorker
::
_deleteBingNoTileTiles
()
{
QSettings
settings
;
static
const
char
*
alreadyDoneKey
=
"_deleteBingNoTileTilesDone"
;
if
(
settings
.
value
(
alreadyDoneKey
,
false
).
toBool
())
{
return
;
}
settings
.
setValue
(
alreadyDoneKey
,
true
);
// Previously we would store these empty tile graphics in the cache. This prevented the ability to zoom beyong the level
// of available tiles. So we need to remove only of these still hanging around to make higher zoom levels work.
QFile
file
(
":/res/BingNoTileBytes.dat"
);
file
.
open
(
QFile
::
ReadOnly
);
QByteArray
noTileBytes
=
file
.
readAll
();
file
.
close
();
QSqlQuery
query
(
*
_db
);
QString
s
;
//-- Select tiles in default set only, sorted by oldest.
s
=
QString
(
"SELECT tileID, tile, hash FROM Tiles WHERE LENGTH(tile) = %1"
).
arg
(
noTileBytes
.
count
());
QList
<
quint64
>
idsToDelete
;
if
(
query
.
exec
(
s
))
{
while
(
query
.
next
())
{
if
(
query
.
value
(
1
).
toByteArray
()
==
noTileBytes
)
{
idsToDelete
.
append
(
query
.
value
(
0
).
toULongLong
());
qCDebug
(
QGCTileCacheLog
)
<<
"_deleteBingNoTileTiles HASH:"
<<
query
.
value
(
2
).
toString
();
}
}
for
(
const
quint64
tileId
:
idsToDelete
)
{
s
=
QString
(
"DELETE FROM Tiles WHERE tileID = %1"
).
arg
(
tileId
);
if
(
!
query
.
exec
(
s
))
{
qCWarning
(
QGCTileCacheLog
)
<<
"Delete failed"
;
}
}
}
else
{
qCWarning
(
QGCTileCacheLog
)
<<
"_deleteBingNoTileTiles query failed"
;
}
}
//-----------------------------------------------------------------------------
bool
QGCCacheWorker
::
_findTileSetID
(
const
QString
name
,
quint64
&
setID
)
...
...
src/QtLocationPlugin/QGCTileCacheWorker.h
View file @
ddf99734
...
...
@@ -68,6 +68,7 @@ private:
void
_importSets
(
QGCMapTask
*
mtask
);
bool
_testTask
(
QGCMapTask
*
mtask
);
void
_testInternet
();
void
_deleteBingNoTileTiles
();
quint64
_findTile
(
const
QString
hash
);
bool
_findTileSetID
(
const
QString
name
,
quint64
&
setID
);
...
...
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