Skip to content
Browse files

Few fixes.

  • Loading branch information...
1 parent 5b07bf8 commit 9179f7e2acc3408fda396179c0f805f5bf0c2abb @nico-izo committed Apr 5, 2012
View
3 core/src/corelayers/servicechooser/pluginchooserwidget.cpp
@@ -50,6 +50,7 @@ PluginChooserWidget::PluginChooserWidget() :
m_proxymodel = new SimpleFilterProxyModel(this);
m_proxymodel->setSourceModel(m_model);
m_proxymodel->setFilterKeyColumn(-1);
+ m_proxymodel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->treeView->setModel(m_proxymodel);
ui->treeView->setItemDelegate(new ItemDelegate(ui->treeView));
ui->treeView->setIndentation(0);
@@ -171,7 +172,7 @@ void PluginChooserWidget::onItemClicked(QModelIndex index)
void PluginChooserWidget::filterPlugins(const QString& pluginname)
{
- m_proxymodel->setFilterRegExp(QRegExp(pluginname, Qt::CaseInsensitive, QRegExp::Wildcard));
+ m_proxymodel->setFilterWildcard(pluginname);
}
}
View
3 core/src/corelayers/servicechooser/servicechooserwidget.cpp
@@ -50,6 +50,7 @@ ServiceChooserWidget::ServiceChooserWidget() :
m_proxymodel->setComplexHandling(true);
m_proxymodel->setSourceModel(m_model);
m_proxymodel->setFilterKeyColumn(-1);
+ m_proxymodel->setFilterCaseSensitivity(Qt::CaseInsensitive);
ui->treeView->setModel(m_proxymodel);
ui->treeView->setItemDelegate(new ItemDelegate(ui->treeView));
ui->treeView->setAnimated(false);
@@ -167,7 +168,7 @@ void ServiceChooserWidget::onItemClicked(QModelIndex index)
void ServiceChooserWidget::filterServices(const QString &servicename)
{
- m_proxymodel->setFilterRegExp(QRegExp(servicename, Qt::CaseInsensitive, QRegExp::Wildcard));
+ m_proxymodel->setFilterWildcard(servicename);
}
}
View
8 core/src/corelayers/servicechooser/simplefilterproxymodel.cpp
@@ -30,21 +30,23 @@
namespace Core
{
SimpleFilterProxyModel::SimpleFilterProxyModel(QObject *parent)
- : QSortFilterProxyModel(parent)
+ : QSortFilterProxyModel(parent), m_complexHandling(false)
{
}
bool SimpleFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
- if(!m_complexHandling)
+ if(!m_complexHandling) {
return (sourceModel()->data(index0, qutim_sdk_0_3::DescriptionRole).toString().contains(filterRegExp())
|| sourceModel()->data(index0).toString().contains(filterRegExp()));
+ }
if(index0.child(0, 0).isValid()) {
for(int i = 0; index0.child(i, 0).isValid(); ++i) {
if(sourceModel()->data(index0.child(i, 0)).toString().contains(filterRegExp())
- || sourceModel()->data(index0.child(i, 0), qutim_sdk_0_3::DescriptionRole).toString().contains(filterRegExp()))
+ || sourceModel()->data(index0.child(i, 0), qutim_sdk_0_3::DescriptionRole)
+ .toString().contains(filterRegExp()))
return true;
}
} else {
View
5 core/src/corelayers/servicechooser/simplefilterproxymodel.h
@@ -40,11 +40,12 @@ class SimpleFilterProxyModel : public QSortFilterProxyModel
SimpleFilterProxyModel(QObject *parent = 0);
void setComplexHandling(bool handle);
+protected:
+ bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
+
private:
bool m_complexHandling;
-protected:
- bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
};
}

0 comments on commit 9179f7e

Please sign in to comment.
Something went wrong with that request. Please try again.