|
55 | 55 | const int PLUGIN_DATA_ROLE=Qt::UserRole;
|
56 | 56 | const int PLUGIN_LIBRARY_ROLE=Qt::UserRole + 1;
|
57 | 57 | const int PLUGIN_LIBRARY_NAME_ROLE=Qt::UserRole + 2;
|
58 |
| -const int PLUGIN_FILTER_ROLE=Qt::UserRole + 3; |
59 | 58 |
|
60 | 59 | QgsPluginManager::QgsPluginManager(QgsPythonUtils* pythonUtils, QWidget * parent, Qt::WFlags fl)
|
61 | 60 | : QDialog(parent, fl)
|
@@ -146,12 +145,12 @@ void QgsPluginManager::getPythonPluginDescriptions()
|
146 | 145 |
|
147 | 146 | if (pluginName == "???" || description == "???" || version == "???") continue;
|
148 | 147 |
|
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); |
150 | 151 | QString myLibraryName = "python:" + packageName;;
|
151 | 152 | mypDetailItem->setData(myLibraryName, PLUGIN_LIBRARY_ROLE); //for loading libs later
|
152 | 153 | 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 |
155 | 154 | mypDetailItem->setCheckable(false);
|
156 | 155 | mypDetailItem->setEditable(false);
|
157 | 156 | // setData in the delegate with a variantised QgsDetailedItemData
|
@@ -296,7 +295,9 @@ sharedLibExtension = "*.so*";
|
296 | 295 | }
|
297 | 296 |
|
298 | 297 | 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()); |
300 | 301 | mypDetailItem->setData(myLibraryName,PLUGIN_LIBRARY_ROLE);
|
301 | 302 | mypDetailItem->setData(pName(), PLUGIN_LIBRARY_NAME_ROLE); //for matching in registry later
|
302 | 303 | QgsDetailedItemData myData;
|
@@ -422,7 +423,7 @@ std::vector < QgsPluginItem > QgsPluginManager::getSelectedPlugins()
|
422 | 423 | // QString type=0,
|
423 | 424 | // bool python=false);
|
424 | 425 | 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 |
426 | 427 | library, 0, pythonic));
|
427 | 428 | }
|
428 | 429 |
|
|
0 commit comments