@@ -111,8 +111,7 @@ QVariant QgsFavoritesItem::sortKey() const
111111
112112QIcon QgsZipItem::iconZip ()
113113{
114- return QgsApplication::getThemeIcon ( QStringLiteral ( " /mIconZip.png" ) );
115- // icon from http://www.softicons.com/free-icons/application-icons/mega-pack-icons-1-by-nikolay-verin/winzip-folder-icon
114+ return QgsApplication::getThemeIcon ( QStringLiteral ( " /mIconZip.svg" ) );
116115}
117116
118117QgsAnimatedIcon *QgsDataItem::sPopulatingIcon = nullptr ;
@@ -802,14 +801,16 @@ QVector<QgsDataItem *> QgsDirectoryItem::createChildren()
802801 QString path = dir.absoluteFilePath ( name );
803802 QFileInfo fileInfo ( path );
804803
805- if ( fileInfo.suffix () == QLatin1String ( " qgs" ) || fileInfo.suffix () == QLatin1String ( " qgz" ) )
804+ if ( fileInfo.suffix ().compare ( QLatin1String ( " qgs" ), Qt::CaseInsensitive ) == 0 ||
805+ fileInfo.suffix ().compare ( QLatin1String ( " qgz" ), Qt::CaseInsensitive ) == 0 )
806806 {
807807 QgsDataItem *item = new QgsProjectItem ( this , fileInfo.completeBaseName (), path );
808808 children.append ( item );
809809 continue ;
810810 }
811811
812- if ( fileInfo.suffix () == QLatin1String ( " zip" ) )
812+ if ( fileInfo.suffix ().compare ( QLatin1String ( " zip" ), Qt::CaseInsensitive ) == 0 ||
813+ fileInfo.suffix ().compare ( QLatin1String ( " tar" ), Qt::CaseInsensitive ) == 0 )
813814 {
814815 QgsDataItem *item = QgsZipItem::itemFromPath ( this , path, name, mPath + ' /' + name );
815816 if ( item )
@@ -1280,12 +1281,12 @@ QgsZipItem::QgsZipItem( QgsDataItem *parent, const QString &name, const QString
12801281void QgsZipItem::init ()
12811282{
12821283 mType = Collection; // Zip??
1283- mIconName = QStringLiteral ( " /mIconZip.png " );
1284+ mIconName = QStringLiteral ( " /mIconZip.svg " );
12841285 mVsiPrefix = vsiPrefix ( mFilePath );
12851286
12861287 if ( sProviderNames .isEmpty () )
12871288 {
1288- sProviderNames << QStringLiteral ( " OGR" ) << QStringLiteral ( " OGR " );
1289+ sProviderNames << QStringLiteral ( " OGR" ) << QStringLiteral ( " GDAL " );
12891290 }
12901291}
12911292
@@ -1408,13 +1409,12 @@ QgsDataItem *QgsZipItem::itemFromPath( QgsDataItem *parent, const QString &fileP
14081409 }
14091410
14101411 // only display if has children or if is not populated
1411- if ( zipItem && ( !populated || zipItem->rowCount () > 1 ) )
1412+ if ( zipItem && ( !populated || zipItem->rowCount () > 0 ) )
14121413 {
14131414 QgsDebugMsgLevel ( " returning zipItem" , 3 );
14141415 return zipItem;
14151416 }
14161417
1417- // if 1 or 0 child found, let provider(s) create individual items
14181418 return nullptr ;
14191419}
14201420
0 commit comments