[Marble-commits] KDE/kdeedu/marble/src/lib
Dennis Nienhüser
earthwings at gentoo.org
Wed Jul 28 22:41:09 CEST 2010
SVN commit 1156288 by nienhueser:
Fix some compiler warnings (unused variables, init order, missing brackets)
M +3 -0 DownloadQueueSet.cpp
M +7 -4 GeoDataTreeModel.cpp
M +3 -3 MarbleRunnerManager.cpp
M +1 -0 gps/PositionTracking.cpp
M +4 -4 routing/AlternativeRoutesModel.cpp
M +2 -1 routing/RouteAnnotator.cpp
--- trunk/KDE/kdeedu/marble/src/lib/DownloadQueueSet.cpp #1156287:1156288
@@ -177,8 +177,10 @@
{
const bool disconnected = job->disconnect();
Q_ASSERT( disconnected );
+ Q_UNUSED( disconnected ); // for Q_ASSERT in release mode
const bool removed = m_activeJobs.removeOne( job );
Q_ASSERT( removed );
+ Q_UNUSED( removed ); // for Q_ASSERT in release mode
}
bool DownloadQueueSet::jobIsActive( QString const & destinationFileName ) const
@@ -237,6 +239,7 @@
{
HttpJob * const job = m_jobs.pop();
bool const removed = m_jobsContent.remove( job->destinationFileName() );
+ Q_UNUSED( removed ); // for Q_ASSERT in release mode
Q_ASSERT( removed );
return job;
}
--- trunk/KDE/kdeedu/marble/src/lib/GeoDataTreeModel.cpp #1156287:1156288
@@ -199,12 +199,15 @@
else if ( role == Qt::CheckStateRole
&& index.column() == 0 ) {
GeoDataFeature *feature = dynamic_cast<GeoDataFeature*>( object );
- if ( feature )
- if ( feature->isVisible() )
+ if ( feature ) {
+ if ( feature->isVisible() ) {
return QVariant( Qt::Checked );
- else
+ }
+ else {
return QVariant( Qt::Unchecked );
}
+ }
+ }
else if ( role == Qt::DecorationRole
&& index.column() == 0 ) {
GeoDataFeature *feature = dynamic_cast<GeoDataFeature*>( object );
@@ -314,7 +317,7 @@
return QModelIndex();
}
-int GeoDataTreeModel::columnCount( const QModelIndex &index ) const
+int GeoDataTreeModel::columnCount( const QModelIndex & ) const
{
return 4;
}
--- trunk/KDE/kdeedu/marble/src/lib/MarbleRunnerManager.cpp #1156287:1156288
@@ -52,11 +52,11 @@
MarbleRunnerManagerPrivate::MarbleRunnerManagerPrivate( PluginManager* pluginManager ) :
m_map( 0 ),
m_model( new MarblePlacemarkModel ),
+ m_searchTasks( 0 ),
+ m_routeSkeleton( 0 ),
m_celestialBodyId( "earth" ),
m_workOffline( false ),
- m_pluginManager( pluginManager ),
- m_routeSkeleton( 0 ),
- m_searchTasks( 0 )
+ m_pluginManager( pluginManager )
{
m_model->setPlacemarkContainer( &m_placemarkContainer );
qRegisterMetaType<GeoDataPlacemark>( "GeoDataPlacemark" );
--- trunk/KDE/kdeedu/marble/src/lib/gps/PositionTracking.cpp #1156287:1156288
@@ -56,6 +56,7 @@
void PositionTracking::setPosition( GeoDataCoordinates position,
GeoDataAccuracy accuracy )
{
+ Q_UNUSED( accuracy );
if ( m_positionProvider && m_positionProvider->status() ==
PositionProviderStatusAvailable )
{
--- trunk/KDE/kdeedu/marble/src/lib/routing/AlternativeRoutesModel.cpp #1156287:1156288
@@ -269,12 +269,12 @@
delete d;
}
-int AlternativeRoutesModel::rowCount ( const QModelIndex &parent ) const
+int AlternativeRoutesModel::rowCount ( const QModelIndex & ) const
{
return d->m_routes.size();
}
-QVariant AlternativeRoutesModel::headerData ( int section, Qt::Orientation orientation, int role ) const
+QVariant AlternativeRoutesModel::headerData ( int, Qt::Orientation, int ) const
{
return QVariant();
}
@@ -299,7 +299,7 @@
return 0;
}
-void AlternativeRoutesModel::newRequest( RouteSkeleton *request )
+void AlternativeRoutesModel::newRequest( RouteSkeleton * )
{
d->m_routes.clear();
d->m_responseTime.start();
@@ -315,7 +315,7 @@
if ( !d->filter( route ) ) {
int affected = d->m_routes.size();
beginInsertRows( QModelIndex(), affected, affected );
- GeoDataDocument* base = d->m_routes.isEmpty() ? 0 : d->m_routes.first();
+// GeoDataDocument* base = d->m_routes.isEmpty() ? 0 : d->m_routes.first();
d->m_routes.push_back( route );
endInsertRows();
// RouteAnnotator* task = new RouteAnnotator( d->m_marbleModel, this, route, base );
--- trunk/KDE/kdeedu/marble/src/lib/routing/RouteAnnotator.cpp #1156287:1156288
@@ -104,11 +104,12 @@
void RouteAnnotator::retrieveGeocodeResult( const GeoDataCoordinates &coordinates, const GeoDataPlacemark &placemark )
{
+ Q_UNUSED( coordinates );
d->m_placemarks.push_back( placemark );
if ( d->m_placemarks.size() == d->m_requests ) {
QMap<QString,int> counter;
foreach( const GeoDataPlacemark &placemark, d->m_placemarks ) {
- GeoDataExtendedData extended = d->m_placemarks.first().extendedData();
+ GeoDataExtendedData extended = placemark.extendedData();
++counter[extended.value("road").value().toString()];
}
More information about the Marble-commits
mailing list