[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:05:14 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-contact-list.git;a=commitdiff;h=780a8db

The following commit has been merged in the master branch:
commit 780a8dbc8cc5197d242c332ccdd2cc033f1b41b2
Author: Martin Klapetek <martin.klapetek at gmail.com>
Date:   Fri Mar 4 10:53:12 2011 +0100

    Added new button which toggles showing/hiding offline users. Plus some minor changes here and there.
---
 accountfiltermodel.cpp |  4 +++-
 accountfiltermodel.h   |  6 +++++-
 main-widget.cpp        | 14 +++++++++++++-
 main-widget.ui         | 16 ++++++++++++++--
 main.cpp               |  6 ++----
 5 files changed, 37 insertions(+), 9 deletions(-)

diff --git a/accountfiltermodel.cpp b/accountfiltermodel.cpp
index bcd702f..4334c49 100644
--- a/accountfiltermodel.cpp
+++ b/accountfiltermodel.cpp
@@ -31,6 +31,7 @@ AccountFilterModel::AccountFilterModel(QObject *parent)
 void AccountFilterModel::filterOfflineUsers(bool filterOfflineUsers)
 {
     m_filterOfflineUsers = filterOfflineUsers;
+    invalidateFilter();
 }
 
 bool AccountFilterModel::filterOfflineUsers() const
@@ -47,7 +48,8 @@ bool AccountFilterModel::filterAcceptsRow(int source_row, const QModelIndex &sou
                 == Tp::ConnectionPresenceTypeOffline) ||
             (source_parent.child(source_row, 0).data(AccountsModel::PresenceTypeRole).toUInt()
                 == Tp::ConnectionPresenceTypeUnknown)) {
-            return false;
+            
+                return false;
         }
     }
 
diff --git a/accountfiltermodel.h b/accountfiltermodel.h
index c650c28..8810b02 100644
--- a/accountfiltermodel.h
+++ b/accountfiltermodel.h
@@ -25,11 +25,15 @@
 
 class AccountFilterModel : public QSortFilterProxyModel
 {
+    Q_OBJECT
+    
 public:
     AccountFilterModel(QObject *parent=0);
 
-    void filterOfflineUsers(bool filterOfflineUsers);
     bool filterOfflineUsers() const;
+    
+public slots:
+    void filterOfflineUsers(bool filterOfflineUsers);
 
 protected:
     bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
diff --git a/main-widget.cpp b/main-widget.cpp
index 282cdef..5a395ba 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -57,8 +57,17 @@ MainWidget::MainWidget(QWidget *parent)
     setupUi(this);
     setWindowIcon(KIcon("telepathy"));
     m_actionAdd_contact->setIcon(KIcon("list-add-user"));
+    m_actionAdd_contact->setText(QString());
+    m_actionAdd_contact->setToolTip(i18n("Add new contacts.."));
+    
     m_actionGroup_contacts->setIcon(KIcon("user-group-properties"));
+    m_actionGroup_contacts->setText(QString());
+    //TODO: Toggle the tooltip with the button? eg. once its Show, after click its Hide .. ?
+    m_actionGroup_contacts->setToolTip(i18n("Show/Hide groups"));
     
+    m_actionHide_offline->setIcon(KIcon("meeting-attending-tentative"));
+    m_actionHide_offline->setText(QString());
+    m_actionHide_offline->setToolTip(i18n("Show/Hide offline users"));
     
     // Start setting up the Telepathy AccountManager.
     Tp::AccountFactoryPtr  accountFactory = Tp::AccountFactory::create(QDBusConnection::sessionBus(),
@@ -144,7 +153,10 @@ void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)
     m_contactsListView->setSortingEnabled(true);
     m_contactsListView->sortByColumn(0, Qt::AscendingOrder);
 
-
+    connect(m_actionHide_offline, SIGNAL(toggled(bool)),
+            m_modelFilter, SLOT(filterOfflineUsers(bool)));
+    
+    
     QList<Tp::AccountPtr> accounts = m_accountManager->allAccounts();
     foreach (Tp::AccountPtr account, accounts) 
     {
diff --git a/main-widget.ui b/main-widget.ui
index 5b86f60..403da2d 100644
--- a/main-widget.ui
+++ b/main-widget.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>310</width>
-    <height>600</height>
+    <width>324</width>
+    <height>618</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -24,6 +24,7 @@
      </property>
      <addaction name="m_actionAdd_contact"/>
      <addaction name="m_actionGroup_contacts"/>
+     <addaction name="m_actionHide_offline"/>
     </widget>
    </item>
    <item>
@@ -49,6 +50,17 @@
     <string>Group contacts</string>
    </property>
   </action>
+  <action name="m_actionHide_offline">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Hide offline</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections/>
diff --git a/main.cpp b/main.cpp
index c271943..8793c2c 100644
--- a/main.cpp
+++ b/main.cpp
@@ -31,8 +31,6 @@ extern "C"
 #include <KDebug>
 #include <KApplication>
 
-#include <Nepomuk/ResourceManager>
-
 #include <TelepathyQt4/Types>
 #include <TelepathyQt4/Debug>
 
@@ -52,8 +50,8 @@ namespace
 
 int main(int argc, char *argv[])
 {
-    KAboutData aboutData("telepathy-contactslist-prototype", 0, ki18n("Telepathy Nepomuk Enabled Contact List Prototype"), "0.1",
-                         ki18n("VoIP client for KDE"), KAboutData::License_GPL,
+    KAboutData aboutData("telepathy-kde-contactslist", 0, ki18n("Telepathy KDE Contact List"), "0.1",
+                         ki18n("Telepathy KDE Contact List"), KAboutData::License_GPL,
                          ki18n("(C) 2011, Martin Klapetek"));
     
     aboutData.addAuthor(ki18nc("@info:credit", "Martin Klapetek"), KLocalizedString(),

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list