[QGIS Commit] r8606 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri Jun 6 15:37:06 EDT 2008
Author: timlinux
Date: 2008-06-06 15:37:06 -0400 (Fri, 06 Jun 2008)
New Revision: 8606
Modified:
trunk/qgis/src/app/qgspluginmanager.cpp
Log:
Fix filtering bug in plugin manager
Modified: trunk/qgis/src/app/qgspluginmanager.cpp
===================================================================
--- trunk/qgis/src/app/qgspluginmanager.cpp 2008-06-06 19:27:17 UTC (rev 8605)
+++ trunk/qgis/src/app/qgspluginmanager.cpp 2008-06-06 19:37:06 UTC (rev 8606)
@@ -55,7 +55,6 @@
const int PLUGIN_DATA_ROLE=Qt::UserRole;
const int PLUGIN_LIBRARY_ROLE=Qt::UserRole + 1;
const int PLUGIN_LIBRARY_NAME_ROLE=Qt::UserRole + 2;
-const int PLUGIN_FILTER_ROLE=Qt::UserRole + 3;
QgsPluginManager::QgsPluginManager(QgsPythonUtils* pythonUtils, QWidget * parent, Qt::WFlags fl)
: QDialog(parent, fl)
@@ -146,12 +145,12 @@
if (pluginName == "???" || description == "???" || version == "???") continue;
- QStandardItem * mypDetailItem = new QStandardItem( pluginName );
+ // filtering will be done on the display role so give it name and desription
+ // user wont see this text since we are using a custome delegate
+ QStandardItem * mypDetailItem = new QStandardItem( pluginName + " - " + description);
QString myLibraryName = "python:" + packageName;;
mypDetailItem->setData(myLibraryName, PLUGIN_LIBRARY_ROLE); //for loading libs later
mypDetailItem->setData(pluginName, PLUGIN_LIBRARY_NAME_ROLE); //for matching in registry later
- QString mySearchText = pluginName + " - " + description;
- mypDetailItem->setData(mySearchText , PLUGIN_FILTER_ROLE); //for filtering later
mypDetailItem->setCheckable(false);
mypDetailItem->setEditable(false);
// setData in the delegate with a variantised QgsDetailedItemData
@@ -296,7 +295,9 @@
}
QString myLibraryName = pluginDir[i];
- QStandardItem * mypDetailItem = new QStandardItem(myLibraryName);
+ // filtering will be done on the display role so give it name and desription
+ // user wont see this text since we are using a custome delegate
+ QStandardItem * mypDetailItem = new QStandardItem(pName() + " - " + pDesc());
mypDetailItem->setData(myLibraryName,PLUGIN_LIBRARY_ROLE);
mypDetailItem->setData(pName(), PLUGIN_LIBRARY_NAME_ROLE); //for matching in registry later
QgsDetailedItemData myData;
@@ -422,7 +423,7 @@
// QString type=0,
// bool python=false);
pis.push_back(QgsPluginItem(pluginName,
- mModelPlugins->item(row,0)->data(PLUGIN_FILTER_ROLE).toString(),
+ mModelPlugins->item(row,0)->data(Qt::DisplayRole).toString(), //display role
library, 0, pythonic));
}
More information about the QGIS-commit
mailing list