Skip to content

Commit

Permalink
Hide file extensions for qpt, python and qgs files in the browser
Browse files Browse the repository at this point in the history
These have distinct icons identifying them, and the full file name
with extension shown in the tooltip
  • Loading branch information
nyalldawson committed Dec 16, 2017
1 parent a33946b commit 40dbc06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/app/qgsappbrowserproviders.cpp
Expand Up @@ -100,7 +100,7 @@ QgsDataItem *QgsQptDataItemProvider::createDataItem( const QString &path, QgsDat

if ( fileInfo.suffix().compare( QStringLiteral( "qpt" ), Qt::CaseInsensitive ) == 0 )
{
return new QgsQptDataItem( parentItem, fileInfo.fileName(), path );
return new QgsQptDataItem( parentItem, fileInfo.baseName(), path );
}
return nullptr;
}
Expand Down Expand Up @@ -242,7 +242,7 @@ QgsDataItem *QgsPyDataItemProvider::createDataItem( const QString &path, QgsData

if ( fileInfo.suffix().compare( QStringLiteral( "py" ), Qt::CaseInsensitive ) == 0 )
{
return new QgsPyDataItem( parentItem, fileInfo.fileName(), path );
return new QgsPyDataItem( parentItem, fileInfo.baseName(), path );
}
return nullptr;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataitem.cpp
Expand Up @@ -797,7 +797,7 @@ QVector<QgsDataItem *> QgsDirectoryItem::createChildren()

if ( fileInfo.suffix() == QLatin1String( "qgs" ) )
{
QgsDataItem *item = new QgsProjectItem( this, name, path );
QgsDataItem *item = new QgsProjectItem( this, fileInfo.baseName(), path );
children.append( item );
continue;
}
Expand Down

0 comments on commit 40dbc06

Please sign in to comment.