Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Education
Marble
Commits
8ba3eee2
Commit
8ba3eee2
authored
Jul 10, 2020
by
Torsten Rahn
Committed by
Torsten Rahn
Jul 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Use QT_VERSION_CHECK and remove checks for versions < 5.6.
- Remove deprecated API (e.g. qVariantFromValue).
parent
00131cf8
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
28 additions
and
79 deletions
+28
-79
src/apps/marble-maps/MarbleMaps.cpp
src/apps/marble-maps/MarbleMaps.cpp
+1
-1
src/apps/marble-maps/main.cpp
src/apps/marble-maps/main.cpp
+1
-1
src/apps/marble-qt/qtmain.cpp
src/apps/marble-qt/qtmain.cpp
+1
-1
src/lib/marble/MarblePlacemarkModel.cpp
src/lib/marble/MarblePlacemarkModel.cpp
+10
-10
src/lib/marble/MovieCapture.cpp
src/lib/marble/MovieCapture.cpp
+1
-1
src/lib/marble/ReverseGeocodingRunnerManager.cpp
src/lib/marble/ReverseGeocodingRunnerManager.cpp
+1
-13
src/lib/marble/StackedTile.cpp
src/lib/marble/StackedTile.cpp
+1
-1
src/lib/marble/StyleBuilder.cpp
src/lib/marble/StyleBuilder.cpp
+1
-1
src/lib/marble/TextureTile.h
src/lib/marble/TextureTile.h
+1
-1
src/lib/marble/geodata/data/GeoDataContainer.cpp
src/lib/marble/geodata/data/GeoDataContainer.cpp
+0
-31
src/lib/marble/geodata/data/GeoDataLineString.cpp
src/lib/marble/geodata/data/GeoDataLineString.cpp
+0
-7
src/lib/marble/geodata/data/GeoDataPlaylist.cpp
src/lib/marble/geodata/data/GeoDataPlaylist.cpp
+1
-1
src/lib/marble/geodata/data/GeoDataRelation.cpp
src/lib/marble/geodata/data/GeoDataRelation.cpp
+1
-1
src/lib/marble/geodata/data/LonLatParser.cpp
src/lib/marble/geodata/data/LonLatParser.cpp
+7
-0
src/lib/marble/kbihash_p.h
src/lib/marble/kbihash_p.h
+0
-8
src/lib/marble/routing/RoutingProfilesModel.cpp
src/lib/marble/routing/RoutingProfilesModel.cpp
+1
-1
No files found.
src/apps/marble-maps/MarbleMaps.cpp
View file @
8ba3eee2
...
...
@@ -74,7 +74,7 @@ void MarbleMaps::setKeepScreenOn(bool screenOn)
m_keepScreenOn
=
screenOn
;
char
const
*
const
action
=
m_keepScreenOn
?
"addFlags"
:
"clearFlags"
;
#ifdef Q_OS_ANDROID
#if QT_VERSION >=
0x050700
#if QT_VERSION >=
QT_VERSION_CHECK(5, 7, 0)
QtAndroid
::
runOnAndroidThread
([
action
](){
QAndroidJniObject
activity
=
QtAndroid
::
androidActivity
();
if
(
activity
.
isValid
())
{
...
...
src/apps/marble-maps/main.cpp
View file @
8ba3eee2
...
...
@@ -99,7 +99,7 @@ int main(int argc, char ** argv)
app
.
setApplicationName
(
"Marble Maps"
);
app
.
setOrganizationName
(
"KDE"
);
app
.
setOrganizationDomain
(
"kde.org"
);
#if QT_VERSION >=
0x050700
#if QT_VERSION >=
QT_VERSION_CHECK(5, 7, 0)
app
.
setDesktopFileName
(
QStringLiteral
(
"org.kde.marble.maps"
));
#endif
...
...
src/apps/marble-qt/qtmain.cpp
View file @
8ba3eee2
...
...
@@ -89,7 +89,7 @@ int main(int argc, char *argv[])
app
.
setApplicationName
(
"Marble Virtual Globe"
);
app
.
setOrganizationName
(
"KDE"
);
app
.
setOrganizationDomain
(
"kde.org"
);
#if QT_VERSION >=
0x050700
#if QT_VERSION >=
QT_VERSION_CHECK(5, 7, 0)
app
.
setDesktopFileName
(
QStringLiteral
(
"org.kde.marble-qt"
));
#endif
...
...
src/lib/marble/MarblePlacemarkModel.cpp
View file @
8ba3eee2
...
...
@@ -121,9 +121,9 @@ QVariant MarblePlacemarkModel::data( const QModelIndex &index, int role ) const
if
(
role
==
Qt
::
DisplayRole
)
{
return
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
name
();
}
else
if
(
role
==
Qt
::
DecorationRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
style
()
->
iconStyle
().
icon
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
style
()
->
iconStyle
().
icon
()
);
}
else
if
(
role
==
IconPathRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
style
()
->
iconStyle
().
iconPath
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
style
()
->
iconStyle
().
iconPath
()
);
}
else
if
(
role
==
PopularityIndexRole
)
{
return
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
zoomLevel
();
}
else
if
(
role
==
VisualCategoryRole
)
{
...
...
@@ -145,21 +145,21 @@ QVariant MarblePlacemarkModel::data( const QModelIndex &index, int role ) const
}
else
if
(
role
==
GeoTypeRole
)
{
return
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
role
();
}
else
if
(
role
==
CoordinateRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
coordinate
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
coordinate
()
);
}
else
if
(
role
==
StyleRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
style
().
data
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
style
().
data
()
);
}
else
if
(
role
==
GmtRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
extendedData
().
value
(
QStringLiteral
(
"gmt"
)).
value
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
extendedData
().
value
(
QStringLiteral
(
"gmt"
)).
value
()
);
}
else
if
(
role
==
DstRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
extendedData
().
value
(
QStringLiteral
(
"dst"
)).
value
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
extendedData
().
value
(
QStringLiteral
(
"dst"
)).
value
()
);
}
else
if
(
role
==
GeometryRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
geometry
()
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
geometry
()
);
}
else
if
(
role
==
ObjectPointerRole
)
{
return
q
Variant
F
romValue
(
dynamic_cast
<
GeoDataObject
*>
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
)
);
return
Q
Variant
::
f
romValue
(
dynamic_cast
<
GeoDataObject
*>
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
)
);
}
else
if
(
role
==
LongitudeRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
coordinate
().
longitude
(
GeoDataCoordinates
::
Degree
)
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
coordinate
().
longitude
(
GeoDataCoordinates
::
Degree
)
);
}
else
if
(
role
==
LatitudeRole
)
{
return
q
Variant
F
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
coordinate
().
latitude
(
GeoDataCoordinates
::
Degree
)
);
return
Q
Variant
::
f
romValue
(
d
->
m_placemarkContainer
->
at
(
index
.
row
()
)
->
coordinate
().
latitude
(
GeoDataCoordinates
::
Degree
)
);
}
else
return
QVariant
();
}
...
...
src/lib/marble/MovieCapture.cpp
View file @
8ba3eee2
...
...
@@ -177,7 +177,7 @@ void MovieCapture::recordFrame()
d
->
process
.
start
(
d
->
encoderExec
,
arguments
);
connect
(
&
d
->
process
,
SIGNAL
(
finished
(
int
)),
this
,
SLOT
(
processWrittenMovie
(
int
)));
}
#if QT_VERSION >=
0x051000
#if QT_VERSION >=
QT_VERSION_CHECK(5, 10, 0)
d
->
process
.
write
(
(
char
*
)
screenshot
.
bits
(),
screenshot
.
sizeInBytes
()
);
#else
d
->
process
.
write
(
(
char
*
)
screenshot
.
bits
(),
screenshot
.
byteCount
()
);
...
...
src/lib/marble/ReverseGeocodingRunnerManager.cpp
View file @
8ba3eee2
...
...
@@ -121,20 +121,8 @@ void ReverseGeocodingRunnerManager::reverseGeocoding( const GeoDataCoordinates &
{
d
->
m_reverseTasks
.
clear
();
d
->
m_reverseGeocodingResult
.
clear
();
#if QT_VERSION >= 0x050400
d
->
m_reverseGeocodingResults
.
removeAll
(
coordinates
);
#else
QVector
<
GeoDataCoordinates
>
&
vector
=
d
->
m_reverseGeocodingResults
;
QVector
<
GeoDataCoordinates
>::
iterator
it
=
vector
.
begin
();
while
(
it
!=
vector
.
end
())
{
if
(
*
it
==
coordinates
)
{
it
=
vector
.
erase
(
it
);
}
else
{
++
it
;
}
}
#endif
QList
<
const
ReverseGeocodingRunnerPlugin
*>
plugins
=
d
->
plugins
(
d
->
m_pluginManager
->
reverseGeocodingRunnerPlugins
()
);
for
(
const
ReverseGeocodingRunnerPlugin
*
plugin
:
plugins
)
{
ReverseGeocodingTask
*
task
=
new
ReverseGeocodingTask
(
plugin
->
newRunner
(),
this
,
d
->
m_marbleModel
,
coordinates
);
...
...
src/lib/marble/StackedTile.cpp
View file @
8ba3eee2
...
...
@@ -214,7 +214,7 @@ uint StackedTile::pixelF( qreal x, qreal y, const QRgb& topLeftValue ) const
int
StackedTile
::
calcByteCount
(
const
QImage
&
resultImage
,
const
QVector
<
QSharedPointer
<
TextureTile
>
>
&
tiles
)
{
#if QT_VERSION >=
0x051000
#if QT_VERSION >=
QT_VERSION_CHECK(5, 10, 0)
int
byteCount
=
resultImage
.
sizeInBytes
();
#else
int
byteCount
=
resultImage
.
byteCount
();
...
...
src/lib/marble/StyleBuilder.cpp
View file @
8ba3eee2
...
...
@@ -141,7 +141,7 @@ StyleBuilder::Private::Private() :
QLocale
::
WallisAndFutunaIslands
,
QLocale
::
NorfolkIsland
})
{
#if QT_VERSION >=
0x050700
#if QT_VERSION >=
QT_VERSION_CHECK(5, 7, 0)
m_oceanianCountries
<<
QLocale
::
TuvaluCountry
<<
QLocale
::
OutlyingOceania
;
#else
m_oceanianCountries
<<
QLocale
::
Tuvalu
;
...
...
src/lib/marble/TextureTile.h
View file @
8ba3eee2
...
...
@@ -96,7 +96,7 @@ inline Blending const * TextureTile::blending() const
inline
int
TextureTile
::
byteCount
()
const
{
#if QT_VERSION >=
0x051000
#if QT_VERSION >=
QT_VERSION_CHECK(5, 10, 0)
return
m_image
.
sizeInBytes
();
#else
return
m_image
.
byteCount
();
...
...
src/lib/marble/geodata/data/GeoDataContainer.cpp
View file @
8ba3eee2
...
...
@@ -231,25 +231,7 @@ void GeoDataContainer::remove(int index, int count)
int
GeoDataContainer
::
removeAll
(
GeoDataFeature
*
feature
)
{
Q_D
(
GeoDataContainer
);
#if QT_VERSION >= 0x050400
return
d
->
m_vector
.
removeAll
(
feature
);
#else
int
count
=
0
;
QVector
<
GeoDataFeature
*>
&
vector
=
d
->
m_vector
;
QVector
<
GeoDataFeature
*>::
iterator
it
=
vector
.
begin
();
while
(
it
!=
vector
.
end
())
{
if
(
*
it
==
feature
)
{
it
=
vector
.
erase
(
it
);
++
count
;
}
else
{
++
it
;
}
}
return
count
;
#endif
}
void
GeoDataContainer
::
removeAt
(
int
index
)
...
...
@@ -273,20 +255,7 @@ void GeoDataContainer::removeLast()
bool
GeoDataContainer
::
removeOne
(
GeoDataFeature
*
feature
)
{
Q_D
(
GeoDataContainer
);
#if QT_VERSION >= 0x050400
return
d
->
m_vector
.
removeOne
(
feature
);
#else
QVector
<
GeoDataFeature
*>
&
vector
=
d
->
m_vector
;
const
int
i
=
vector
.
indexOf
(
feature
);
if
(
i
<
0
)
{
return
false
;
}
vector
.
remove
(
i
);
return
true
;
#endif
}
int
GeoDataContainer
::
size
()
const
...
...
src/lib/marble/geodata/data/GeoDataLineString.cpp
View file @
8ba3eee2
...
...
@@ -421,14 +421,7 @@ void GeoDataLineString::append(const QVector<GeoDataCoordinates>& values)
d
->
m_dirtyRange
=
true
;
d
->
m_dirtyBox
=
true
;
#if QT_VERSION >= 0x050500
d
->
m_vector
.
append
(
values
);
#else
d
->
m_vector
.
reserve
(
d
->
m_vector
.
size
()
+
values
.
size
());
for
(
const
GeoDataCoordinates
&
coordinates
:
values
)
{
d
->
m_vector
.
append
(
coordinates
);
}
#endif
}
GeoDataLineString
&
GeoDataLineString
::
operator
<<
(
const
GeoDataCoordinates
&
value
)
...
...
src/lib/marble/geodata/data/GeoDataPlaylist.cpp
View file @
8ba3eee2
...
...
@@ -82,7 +82,7 @@ void GeoDataPlaylist::swapPrimitives( int positionA, int positionB )
{
if
(
qMin
(
positionA
,
positionB
)
>=
0
&&
qMax
(
positionA
,
positionB
)
<
m_primitives
.
size
()
)
{
#if QT_VERSION >=
0x051300
#if QT_VERSION >=
QT_VERSION_CHECK(5, 13, 0)
m_primitives
.
swapItemsAt
(
positionA
,
positionB
);
#else
m_primitives
.
swap
(
positionA
,
positionB
);
...
...
src/lib/marble/geodata/data/GeoDataRelation.cpp
View file @
8ba3eee2
...
...
@@ -170,7 +170,7 @@ QSet<qint64> GeoDataRelation::memberIds() const
bool
GeoDataRelation
::
containsAnyOf
(
const
QSet
<
qint64
>
&
memberIds
)
const
{
Q_D
(
const
GeoDataRelation
);
#if QT_VERSION >=
0x050600 // intersects was introduced in Qt 5.6.
#if QT_VERSION >=
QT_VERSION_CHECK(5, 6, 0)
return
d
->
m_memberIds
.
intersects
(
memberIds
);
#else
for
(
auto
memberId
:
memberIds
)
{
...
...
src/lib/marble/geodata/data/LonLatParser.cpp
View file @
8ba3eee2
...
...
@@ -65,10 +65,17 @@ void LonLatParser::initAll()
// use a set to remove duplicates
QSet
<
QString
>
dirs
=
QSet
<
QString
>
()
<<
m_north
<<
m_east
<<
m_south
<<
m_west
;
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
dirs
+=
QSet
<
QString
>
(
m_northLocale
.
begin
(),
m_northLocale
.
end
()
);
dirs
+=
QSet
<
QString
>
(
m_eastLocale
.
begin
(),
m_eastLocale
.
end
()
);
dirs
+=
QSet
<
QString
>
(
m_southLocale
.
begin
(),
m_southLocale
.
end
()
);
dirs
+=
QSet
<
QString
>
(
m_westLocale
.
begin
(),
m_westLocale
.
end
()
);
#else
dirs
+=
m_northLocale
.
toSet
();
dirs
+=
m_eastLocale
.
toSet
();
dirs
+=
m_southLocale
.
toSet
();
dirs
+=
m_westLocale
.
toSet
();
#endif
QString
fullNamesExp
;
QString
simpleLetters
;
...
...
src/lib/marble/kbihash_p.h
View file @
8ba3eee2
...
...
@@ -61,11 +61,7 @@ class KBiAssociativeContainer
{
/* implicit */
_iterator_impl_ctor
(
const
typename
QHash
<
T
,
U
>::
iterator
it
)
// Using internals here because I was too lazy to write my own iterator.
#if QT_VERSION < 0x050000
:
QHash
<
T
,
U
>::
iterator
(
reinterpret_cast
<
void
*>
(
static_cast
<
QHashNode
<
T
,
U
>
*>
(
it
)))
#else
:
QHash
<
T
,
U
>::
iterator
(
it
)
#endif
{
}
...
...
@@ -76,11 +72,7 @@ class KBiAssociativeContainer
{
/* implicit */
_iterator_impl_ctor
(
const
typename
QMap
<
T
,
U
>::
iterator
it
)
// Using internals here because I was too lazy to write my own iterator.
#if QT_VERSION < 0x050000
:
QMap
<
T
,
U
>::
iterator
(
static_cast
<
QMapData
::
Node
*>
(
it
))
#else
:
QMap
<
T
,
U
>::
iterator
(
it
)
#endif
{
}
...
...
src/lib/marble/routing/RoutingProfilesModel.cpp
View file @
8ba3eee2
...
...
@@ -77,7 +77,7 @@ bool RoutingProfilesModel::moveUp( int row )
Q_ASSERT
(
false
);
return
false
;
}
#if QT_VERSION >=
0x051300
#if QT_VERSION >=
QT_VERSION_CHECK(5, 13, 0)
m_profiles
.
swapItemsAt
(
row
,
row
-
1
);
#else
m_profiles
.
swap
(
row
,
row
-
1
);
...
...
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