Skip to content

Commit 40dbc06

Browse files
committedDec 16, 2017
Hide file extensions for qpt, python and qgs files in the browser
These have distinct icons identifying them, and the full file name with extension shown in the tooltip
1 parent a33946b commit 40dbc06

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/app/qgsappbrowserproviders.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ QgsDataItem *QgsQptDataItemProvider::createDataItem( const QString &path, QgsDat
100100

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

243243
if ( fileInfo.suffix().compare( QStringLiteral( "py" ), Qt::CaseInsensitive ) == 0 )
244244
{
245-
return new QgsPyDataItem( parentItem, fileInfo.fileName(), path );
245+
return new QgsPyDataItem( parentItem, fileInfo.baseName(), path );
246246
}
247247
return nullptr;
248248
}

‎src/core/qgsdataitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ QVector<QgsDataItem *> QgsDirectoryItem::createChildren()
797797

798798
if ( fileInfo.suffix() == QLatin1String( "qgs" ) )
799799
{
800-
QgsDataItem *item = new QgsProjectItem( this, name, path );
800+
QgsDataItem *item = new QgsProjectItem( this, fileInfo.baseName(), path );
801801
children.append( item );
802802
continue;
803803
}

0 commit comments

Comments
 (0)
Please sign in to comment.