[SCM] ktp-contact-list packaging branch, master, updated. debian/15.12.1-2-1070-g6c56f91
Maximiliano Curia
maxy at moszumanska.debian.org
Sat May 28 00:07:41 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=f8e46d5
The following commit has been merged in the master branch:
commit f8e46d57c743ef31b54fe049ce7e7b5aba5a3454
Author: Simone Daminato <daminato.simone at gmail.com>
Date: Fri Oct 7 13:37:30 2011 +0100
Use KDualAction for setting sort preference
Reviewed by: David Edmundson
---
main-widget.cpp | 14 +++++++-------
main-widget.h | 3 ++-
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/main-widget.cpp b/main-widget.cpp
index 6813c0d..6a734e3 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -128,9 +128,9 @@ MainWidget::MainWidget(QWidget *parent)
m_toolBar->addAction(m_showOfflineAction);
- m_sortByPresenceAction = new KAction(KIcon("view-sort-ascending"), i18n("Sort by presence"), this);
- m_sortByPresenceAction->setCheckable(true);
- m_sortByPresenceAction->setChecked(false);
+ m_sortByPresenceAction = new KDualAction(i18n("Sort by presence"), i18n("Sort by name"), this);
+ m_sortByPresenceAction->setActiveIcon(KIcon("user-online"));
+ m_sortByPresenceAction->setInactiveIcon(KIcon("view-sort-ascending"));
m_toolBar->addAction(m_sortByPresenceAction);
@@ -282,7 +282,7 @@ MainWidget::~MainWidget()
configGroup.writeEntry("pin_filterbar", m_searchContactAction->isChecked());
configGroup.writeEntry("use_groups", m_groupContactsAction->isChecked());
configGroup.writeEntry("show_offline", m_showOfflineAction->isChecked());
- configGroup.writeEntry("sort_by_presence", m_sortByPresenceAction->isChecked());
+ configGroup.writeEntry("sort_by_presence", m_sortByPresenceAction->isActive());
configGroup.config()->sync();
}
@@ -308,7 +308,7 @@ void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)
m_modelFilter->clearFilterString();
m_modelFilter->setFilterCaseSensitivity(Qt::CaseInsensitive);
m_modelFilter->setSortRole(Qt::DisplayRole);
- m_modelFilter->setSortByPresence(m_sortByPresenceAction->isChecked());
+ m_modelFilter->setSortByPresence(m_sortByPresenceAction->isActive());
if (m_groupContactsAction->isChecked()) {
m_modelFilter->setSourceModel(m_groupsModel);
} else {
@@ -333,7 +333,7 @@ void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)
connect(m_filterBar, SIGNAL(closeRequest()),
m_searchContactAction, SLOT(trigger()));
- connect(m_sortByPresenceAction, SIGNAL(toggled(bool)),
+ connect(m_sortByPresenceAction, SIGNAL(activeChanged(bool)),
m_modelFilter, SLOT(setSortByPresence(bool)));
connect(m_groupsModel, SIGNAL(operationFinished(Tp::PendingOperation*)),
@@ -377,7 +377,7 @@ void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)
bool sortByPresence = guiConfigGroup.readEntry("sort_by_presence", true);
m_modelFilter->setSortByPresence(sortByPresence);
- m_sortByPresenceAction->setChecked(sortByPresence);
+ m_sortByPresenceAction->setActive(sortByPresence);
}
void MainWidget::onAccountConnectionStatusChanged(Tp::ConnectionStatus status)
diff --git a/main-widget.h b/main-widget.h
index e6cff85..b04cbd0 100644
--- a/main-widget.h
+++ b/main-widget.h
@@ -31,6 +31,7 @@
#include <KXmlGuiWindow>
#include <KAction>
+#include <KDualAction>
#include "ui_main-widget.h"
class ContactDelegateCompact;
@@ -148,7 +149,7 @@ private:
KAction *m_groupContactsAction;
KAction *m_showOfflineAction;
KAction *m_searchContactAction;
- KAction *m_sortByPresenceAction;
+ KDualAction *m_sortByPresenceAction;
};
--
ktp-contact-list packaging
More information about the pkg-kde-commits
mailing list