Skip to content
Permalink
Browse files

Fix some build warnings

  • Loading branch information
nyalldawson committed Sep 9, 2018
1 parent e4c69ff commit 69a5de1cdbe68c080be755a8af5826777339cb1f
Showing with 13 additions and 10 deletions.
  1. +8 −8 src/core/qgsbrowsermodel.cpp
  2. +0 −2 src/core/qgsdataitem.cpp
  3. +5 −0 src/core/qgsproject.cpp
@@ -335,7 +335,7 @@ QModelIndex QgsBrowserModel::findPath( QAbstractItemModel *model, const QString
if ( matchFlag == Qt::MatchStartsWith )
return index;

QgsDebugMsgLevel( "path not found", 4 );
QgsDebugMsgLevel( QStringLiteral( "path not found" ), 4 );
return QModelIndex(); // not found
}

@@ -391,13 +391,13 @@ void QgsBrowserModel::beginInsertItems( QgsDataItem *parent, int first, int last
QModelIndex idx = findItem( parent );
if ( !idx.isValid() )
return;
QgsDebugMsgLevel( "valid", 3 );
QgsDebugMsgLevel( QStringLiteral( "valid" ), 3 );
beginInsertRows( idx, first, last );
QgsDebugMsgLevel( "end", 3 );
QgsDebugMsgLevel( QStringLiteral( "end" ), 3 );
}
void QgsBrowserModel::endInsertItems()
{
QgsDebugMsgLevel( "Entered", 3 );
QgsDebugMsgLevel( QStringLiteral( "Entered" ), 3 );
endInsertRows();
}
void QgsBrowserModel::beginRemoveItems( QgsDataItem *parent, int first, int last )
@@ -410,12 +410,12 @@ void QgsBrowserModel::beginRemoveItems( QgsDataItem *parent, int first, int last
}
void QgsBrowserModel::endRemoveItems()
{
QgsDebugMsgLevel( "Entered", 3 );
QgsDebugMsgLevel( QStringLiteral( "Entered" ), 3 );
endRemoveRows();
}
void QgsBrowserModel::itemDataChanged( QgsDataItem *item )
{
QgsDebugMsgLevel( "Entered", 3 );
QgsDebugMsgLevel( QStringLiteral( "Entered" ), 3 );
QModelIndex idx = findItem( item );
if ( !idx.isValid() )
return;
@@ -428,7 +428,7 @@ void QgsBrowserModel::itemStateChanged( QgsDataItem *item, QgsDataItem::State ol
QModelIndex idx = findItem( item );
if ( !idx.isValid() )
return;
QgsDebugMsgLevel( QString( "item %1 state changed %2 -> %3" ).arg( item->path() ).arg( oldState ).arg( item->state() ), 4 );
QgsDebugMsgLevel( QStringLiteral( "item %1 state changed %2 -> %3" ).arg( item->path() ).arg( oldState ).arg( item->state() ), 4 );
emit stateChanged( idx, oldState );
}

@@ -486,7 +486,7 @@ bool QgsBrowserModel::dropMimeData( const QMimeData *data, Qt::DropAction action
QgsDataItem *destItem = dataItem( parent );
if ( !destItem )
{
QgsDebugMsgLevel( "DROP PROBLEM!", 4 );
QgsDebugMsgLevel( QStringLiteral( "DROP PROBLEM!" ), 4 );
return false;
}

@@ -685,8 +685,6 @@ QgsMimeDataUtils::Uri QgsLayerItem::mimeUri() const
case QgsMapLayer::PluginLayer:
u.layerType = QStringLiteral( "plugin" );
break;
default:
return u; // invalid URI
}

u.providerKey = providerKey();
@@ -2460,19 +2460,24 @@ void QgsProject::setNonIdentifiableLayers( const QList<QgsMapLayer *> &layers )
it.value()->setFlags( it.value()->flags() | QgsMapLayer::Identifiable );
}

Q_NOWARN_DEPRECATED_PUSH
emit nonIdentifiableLayersChanged( nonIdentifiableLayers() );
Q_NOWARN_DEPRECATED_POP
}

void QgsProject::setNonIdentifiableLayers( const QStringList &layerIds )
{
QList<QgsMapLayer *> nonIdentifiableLayers;
nonIdentifiableLayers.reserve( layerIds.count() );
for ( const QString &layerId : layerIds )
{
QgsMapLayer *layer = mapLayer( layerId );
if ( layer )
nonIdentifiableLayers << layer;
}
Q_NOWARN_DEPRECATED_PUSH
setNonIdentifiableLayers( nonIdentifiableLayers );
Q_NOWARN_DEPRECATED_POP
}

QStringList QgsProject::nonIdentifiableLayers() const

0 comments on commit 69a5de1

Please sign in to comment.
You can’t perform that action at this time.