Skip to content

Commit fd55c11

Browse files
author
timlinux
committedJun 6, 2008

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎src/app/qgspluginmanager.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
const int PLUGIN_DATA_ROLE=Qt::UserRole;
5656
const int PLUGIN_LIBRARY_ROLE=Qt::UserRole + 1;
5757
const int PLUGIN_LIBRARY_NAME_ROLE=Qt::UserRole + 2;
58-
const int PLUGIN_FILTER_ROLE=Qt::UserRole + 3;
5958

6059
QgsPluginManager::QgsPluginManager(QgsPythonUtils* pythonUtils, QWidget * parent, Qt::WFlags fl)
6160
: QDialog(parent, fl)
@@ -146,12 +145,12 @@ void QgsPluginManager::getPythonPluginDescriptions()
146145

147146
if (pluginName == "???" || description == "???" || version == "???") continue;
148147

149-
QStandardItem * mypDetailItem = new QStandardItem( pluginName );
148+
// filtering will be done on the display role so give it name and desription
149+
// user wont see this text since we are using a custome delegate
150+
QStandardItem * mypDetailItem = new QStandardItem( pluginName + " - " + description);
150151
QString myLibraryName = "python:" + packageName;;
151152
mypDetailItem->setData(myLibraryName, PLUGIN_LIBRARY_ROLE); //for loading libs later
152153
mypDetailItem->setData(pluginName, PLUGIN_LIBRARY_NAME_ROLE); //for matching in registry later
153-
QString mySearchText = pluginName + " - " + description;
154-
mypDetailItem->setData(mySearchText , PLUGIN_FILTER_ROLE); //for filtering later
155154
mypDetailItem->setCheckable(false);
156155
mypDetailItem->setEditable(false);
157156
// setData in the delegate with a variantised QgsDetailedItemData
@@ -296,7 +295,9 @@ sharedLibExtension = "*.so*";
296295
}
297296

298297
QString myLibraryName = pluginDir[i];
299-
QStandardItem * mypDetailItem = new QStandardItem(myLibraryName);
298+
// filtering will be done on the display role so give it name and desription
299+
// user wont see this text since we are using a custome delegate
300+
QStandardItem * mypDetailItem = new QStandardItem(pName() + " - " + pDesc());
300301
mypDetailItem->setData(myLibraryName,PLUGIN_LIBRARY_ROLE);
301302
mypDetailItem->setData(pName(), PLUGIN_LIBRARY_NAME_ROLE); //for matching in registry later
302303
QgsDetailedItemData myData;
@@ -422,7 +423,7 @@ std::vector < QgsPluginItem > QgsPluginManager::getSelectedPlugins()
422423
// QString type=0,
423424
// bool python=false);
424425
pis.push_back(QgsPluginItem(pluginName,
425-
mModelPlugins->item(row,0)->data(PLUGIN_FILTER_ROLE).toString(),
426+
mModelPlugins->item(row,0)->data(Qt::DisplayRole).toString(), //display role
426427
library, 0, pythonic));
427428
}
428429

0 commit comments

Comments
 (0)
Please sign in to comment.