Skip to content

Commit

Permalink
Fix some build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 9, 2018
1 parent e4c69ff commit 69a5de1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/core/qgsbrowsermodel.cpp
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 )
Expand All @@ -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;
Expand All @@ -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 );
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 0 additions & 2 deletions src/core/qgsdataitem.cpp
Expand Up @@ -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();
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsproject.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 69a5de1

Please sign in to comment.