summaryrefslogtreecommitdiff
path: root/extra/k3b/fix-crash-with-qt-4.7.0.patch
blob: a99b5c639caed8e2ecfe5bbcbf178059ebe981ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Index: src/option/k3bpluginoptiontab.cpp
===================================================================
--- src/option/k3bpluginoptiontab.cpp	(revision 1168967)
+++ src/option/k3bpluginoptiontab.cpp	(working copy)
@@ -43,12 +43,28 @@
     layout->addWidget( label );
     layout->addWidget( pluginSelector );
 
+    // find all categories
+    QHash<QString, QString> categoryNames;
+
     foreach( K3b::Plugin* plugin, k3bcore->pluginManager()->plugins() ) {
-        kDebug() << "Adding plugin" << plugin->pluginInfo().name();
-        pluginSelector->addPlugins( QList<KPluginInfo>() << plugin->pluginInfo(),
+        categoryNames[ plugin->category() ] = plugin->categoryName();
+    }
+
+    // add all plugins in each category
+    foreach( const QString &category, categoryNames.keys() ) {
+        QList<KPluginInfo> plugins;
+
+        foreach( K3b::Plugin* plugin, k3bcore->pluginManager()->plugins() ) {
+            if ( plugin->category() == category ) {
+                plugins << plugin->pluginInfo();
+                kDebug() << "Adding plugin" << plugin->pluginInfo().name();
+            }
+        }
+        pluginSelector->addPlugins( plugins,
                                     KPluginSelector::ReadConfigFile,
-                                    plugin->categoryName(),
-                                    plugin->category() );
+                                    categoryNames[ category ],
+                                    category
+                                  );
     }
 }