summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 19:59:17 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 19:59:17 (GMT)
commit1cd0bb269744013083a9c0ce8699842729cfcc30 (patch)
tree43641e5b15563ba64fa9419d6e407637838bced3
parent2eb0e01796de7a7e54568e9355e7b92f6c50e511 (diff)
Ignore mimetypes without known globbing patterns
-rw-r--r--shell/shell.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 459b6a4..65997b4 100644
--- a/shell/shell.cpp
+++ b/shell/shell.cpp
@@ -439,9 +439,14 @@ void Shell::fileOpen()
QMap<QString, QStringList> namedGlobs;
foreach ( const QString &mimeName, m_fileformats ) {
QMimeType mimeType = mimeDatabase.mimeTypeForName( mimeName );
- globPatterns.unite( mimeType.globPatterns().toSet() ) ;
+ const QStringList globs( mimeType.globPatterns() );
+ if ( globs.isEmpty() ) {
+ continue;
+ }
+
+ globPatterns.unite( globs.toSet() ) ;
- namedGlobs[ mimeType.comment() ].append( mimeType.globPatterns() );
+ namedGlobs[ mimeType.comment() ].append( globs );
}
QStringList namePatterns;