[SCM] ktp-text-ui packaging branch, master, updated. debian/15.12.1-1-1918-gdf4b0ec
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:22:05 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-text-ui.git;a=commitdiff;h=40eeda4
The following commit has been merged in the master branch:
commit 40eeda43d3c1e2d662c793356fbca08bade23e64
Author: Dan Vrátil <dan at progdan.cz>
Date: Fri Jul 13 19:35:07 2012 +0200
Don't select group headings in EntityView
REVIEW: 105557
BUG: 303418
---
logviewer/entity-model.cpp | 10 ++++++++++
logviewer/entity-model.h | 1 +
logviewer/log-viewer.cpp | 13 +++++++------
logviewer/log-viewer.h | 2 +-
4 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/logviewer/entity-model.cpp b/logviewer/entity-model.cpp
index 23fac74..a7b0d95 100644
--- a/logviewer/entity-model.cpp
+++ b/logviewer/entity-model.cpp
@@ -128,6 +128,16 @@ QVariant EntityModel::data(const QModelIndex &index, int role) const
return item->data(role);
}
+Qt::ItemFlags EntityModel::flags(const QModelIndex &index) const
+{
+ if (index.parent() == QModelIndex()) {
+ return QAbstractItemModel::flags(index) & ~Qt::ItemIsSelectable;
+ }
+
+ return QAbstractItemModel::flags(index);
+}
+
+
void EntityModel::onEntitiesSearchFinished(Tpl::PendingOperation *operation)
{
Tpl::PendingEntities *pendingEntities = qobject_cast<Tpl::PendingEntities*>(operation);
diff --git a/logviewer/entity-model.h b/logviewer/entity-model.h
index 344a794..205c132 100644
--- a/logviewer/entity-model.h
+++ b/logviewer/entity-model.h
@@ -65,6 +65,7 @@ public:
int rowCount(const QModelIndex &parent) const;
QVariant data(const QModelIndex &index, int role) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
diff --git a/logviewer/log-viewer.cpp b/logviewer/log-viewer.cpp
index 6007f92..a6ae6d0 100644
--- a/logviewer/log-viewer.cpp
+++ b/logviewer/log-viewer.cpp
@@ -76,7 +76,7 @@ LogViewer::LogViewer(QWidget *parent) :
//TODO parse command line args and update all views as appropriate
connect(m_accountManager->becomeReady(), SIGNAL(finished(Tp::PendingOperation*)), SLOT(onAccountManagerReady()));
- connect(ui->entityList, SIGNAL(activated(QModelIndex)), SLOT(onEntitySelected(QModelIndex)));
+ connect(ui->entityList->selectionModel(), SIGNAL(currentChanged(QModelIndex,QModelIndex)), SLOT(onEntitySelected(QModelIndex,QModelIndex)));
connect(ui->datePicker, SIGNAL(dateChanged(QDate)), SLOT(onDateSelected()));
}
@@ -92,16 +92,17 @@ void LogViewer::onAccountManagerReady()
m_entityModel->setAccountManager(m_accountManager);
}
-void LogViewer::onEntitySelected(const QModelIndex &index)
+void LogViewer::onEntitySelected(const QModelIndex ¤t, const QModelIndex &previous)
{
+ Q_UNUSED(previous);
+
/* Ignore account nodes */
- if (index.parent() == QModelIndex()) {
- ui->messageView->clear();
+ if (current.parent() == QModelIndex()) {
return;
}
- Tpl::EntityPtr entity = index.data(EntityModel::EntityRole).value<Tpl::EntityPtr>();
- Tp::AccountPtr account = index.data(EntityModel::AccountRole).value<Tp::AccountPtr>();
+ Tpl::EntityPtr entity = current.data(EntityModel::EntityRole).value<Tpl::EntityPtr>();
+ Tp::AccountPtr account = current.data(EntityModel::AccountRole).value<Tp::AccountPtr>();
ui->datePicker->setEntity(account, entity);
diff --git a/logviewer/log-viewer.h b/logviewer/log-viewer.h
index 04820fd..f9f16c5 100644
--- a/logviewer/log-viewer.h
+++ b/logviewer/log-viewer.h
@@ -40,7 +40,7 @@ public:
private Q_SLOTS:
void onAccountManagerReady();
- void onEntitySelected(const QModelIndex &index);
+ void onEntitySelected(const QModelIndex ¤t, const QModelIndex &previous);
void onDateSelected();
void updateMainView();
--
ktp-text-ui packaging
More information about the pkg-kde-commits
mailing list