[Kde-bindings] KDE/kdelibs/kdeui
Stephen Kelly
steveire at gmail.com
Mon May 24 17:06:12 UTC 2010
SVN commit 1130182 by skelly:
API change to KBreadcrumbSelectionModel
Better enum than Forward, backward.
CCMAIL: kde-bindings at kde.org
M +7 -7 itemviews/kbreadcrumbselectionmodel.cpp
M +4 -4 itemviews/kbreadcrumbselectionmodel.h
M +1 -1 tests/proxymodeltestapp/breadcrumbdirectionwidget.cpp
M +1 -1 tests/proxymodeltestapp/breadcrumbnavigationwidget.cpp
--- trunk/KDE/kdelibs/kdeui/itemviews/kbreadcrumbselectionmodel.cpp #1130181:1130182
@@ -29,7 +29,7 @@
Q_DECLARE_PUBLIC(KBreadcrumbSelectionModel)
KBreadcrumbSelectionModel * const q_ptr;
public:
- KBreadcrumbSelectionModelPrivate(KBreadcrumbSelectionModel *breadcrumbSelector, QItemSelectionModel *selectionModel, KBreadcrumbSelectionModel::Direction direction)
+ KBreadcrumbSelectionModelPrivate(KBreadcrumbSelectionModel *breadcrumbSelector, QItemSelectionModel *selectionModel, KBreadcrumbSelectionModel::BreadcrumbTarget direction)
: q_ptr(breadcrumbSelector),
m_includeActualSelection(true),
m_selectionDepth(-1),
@@ -57,21 +57,21 @@
int m_selectionDepth;
bool m_showHiddenAscendantData;
QItemSelectionModel *m_selectionModel;
- KBreadcrumbSelectionModel::Direction m_direction;
+ KBreadcrumbSelectionModel::BreadcrumbTarget m_direction;
bool m_ignoreCurrentChanged;
};
KBreadcrumbSelectionModel::KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, QObject* parent)
: QItemSelectionModel(const_cast<QAbstractItemModel *>(selectionModel->model()), parent),
- d_ptr(new KBreadcrumbSelectionModelPrivate(this, selectionModel, Reverse))
+ d_ptr(new KBreadcrumbSelectionModelPrivate(this, selectionModel, MakeBreadcrumbSelectionInSelf))
{
}
-KBreadcrumbSelectionModel::KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, Direction direction, QObject* parent)
+KBreadcrumbSelectionModel::KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, BreadcrumbTarget direction, QObject* parent)
: QItemSelectionModel(const_cast<QAbstractItemModel *>(selectionModel->model()), parent),
d_ptr(new KBreadcrumbSelectionModelPrivate(this, selectionModel, direction))
{
- if ( direction != Reverse)
+ if ( direction != MakeBreadcrumbSelectionInSelf)
connect(selectionModel, SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)),
this, SLOT(sourceSelectionChanged(const QItemSelection&,const QItemSelection&)));
}
@@ -185,7 +185,7 @@
d->m_ignoreCurrentChanged = false;
return;
}
- if ( d->m_direction == Forward )
+ if ( d->m_direction == MakeBreadcrumbSelectionInOther )
{
d->m_selectionModel->select(d->getBreadcrumbSelection(index), command);
QItemSelectionModel::select(index, command);
@@ -199,7 +199,7 @@
{
Q_D(KBreadcrumbSelectionModel);
QItemSelection bcc = d->getBreadcrumbSelection(selection);
- if ( d->m_direction == Forward )
+ if ( d->m_direction == MakeBreadcrumbSelectionInOther )
{
d->m_selectionModel->select(selection, command);
QItemSelectionModel::select(bcc, command);
--- trunk/KDE/kdelibs/kdeui/itemviews/kbreadcrumbselectionmodel.h #1130181:1130182
@@ -110,14 +110,14 @@
{
Q_OBJECT
public:
- enum Direction
+ enum BreadcrumbTarget
{
- Forward,
- Reverse
+ MakeBreadcrumbSelectionInOther,
+ MakeBreadcrumbSelectionInSelf
};
explicit KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, QObject* parent = 0);
- KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, Direction direction, QObject* parent = 0);
+ KBreadcrumbSelectionModel(QItemSelectionModel *selectionModel, BreadcrumbTarget target, QObject* parent = 0);
virtual ~KBreadcrumbSelectionModel();
/**
--- trunk/KDE/kdelibs/kdeui/tests/proxymodeltestapp/breadcrumbdirectionwidget.cpp #1130181:1130182
@@ -93,7 +93,7 @@
view1->setSelectionModel(breadcrumbSelection1);
KBreadcrumbSelectionModel *breadcrumbSelection2 = new KBreadcrumbSelectionModel(view3->selectionModel(),
- KBreadcrumbSelectionModel::Forward, this);
+ KBreadcrumbSelectionModel::MakeBreadcrumbSelectionInOther, this);
view4->setSelectionModel(breadcrumbSelection2);
}
--- trunk/KDE/kdelibs/kdeui/tests/proxymodeltestapp/breadcrumbnavigationwidget.cpp #1130181:1130182
@@ -248,7 +248,7 @@
dynamicTree->treeView()->setSelectionModel(rootSelectionModel);
- KBreadcrumbSelectionModel *breadcrumbOnlyProxySelector2 = new KBreadcrumbSelectionModel(rootSelectionModel, KBreadcrumbSelectionModel::Forward, this);
+ KBreadcrumbSelectionModel *breadcrumbOnlyProxySelector2 = new KBreadcrumbSelectionModel(rootSelectionModel, KBreadcrumbSelectionModel::MakeBreadcrumbSelectionInOther, this);
SON(breadcrumbOnlyProxySelector2);
breadcrumbOnlyProxySelector2->setActualSelectionIncluded(false);
More information about the Kde-bindings
mailing list