[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:06:16 UTC 2016


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

The following commit has been merged in the master branch:
commit 7a680c668e1e93b6fcad9513de92d5875e7be22b
Author: Rémy Greinhofer <remy.greinhofer at gmail.com>
Date:   Mon May 2 23:46:31 2011 +0200

    Simplifying the pin/unpin mechanism of the filter bar.
    
    If the filter bar is shown when the user closes the contact list, the
    filter bar will get shown next time the contact list is launched and
    vice versa.
    
    REVIEW: 101190
    Reviewed by: David Edmundson
---
 filter-bar.cpp  | 29 -----------------------------
 filter-bar.h    | 30 ------------------------------
 main-widget.cpp | 12 ++++++------
 3 files changed, 6 insertions(+), 65 deletions(-)

diff --git a/filter-bar.cpp b/filter-bar.cpp
index 1d04ca8..13102f5 100644
--- a/filter-bar.cpp
+++ b/filter-bar.cpp
@@ -32,20 +32,12 @@
 FilterBar::FilterBar(QWidget* parent) :
     QWidget(parent)
 {
-    // Create the pin button
-    m_pinButton = new QToolButton(this);
-    m_pinButton->setCheckable(true);
-    m_pinButton->setToolTip(i18n("Pin the filter bar"));
-    connect(m_pinButton, SIGNAL(clicked(bool)), this, SLOT(setPinned(bool)));
-    setPinned(false);
-
     // Create close button
     QToolButton *closeButton = new QToolButton(this);
     closeButton->setAutoRaise(true);
     closeButton->setIcon(KIcon("dialog-close"));
     closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
     connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequest()));
-    connect(closeButton, SIGNAL(clicked()), this, SLOT(unpinSlot()));
 
     // Create label
     QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this);
@@ -61,7 +53,6 @@ FilterBar::FilterBar(QWidget* parent) :
     // Apply layout
     QHBoxLayout* hLayout = new QHBoxLayout(this);
     hLayout->setMargin(0);
-    hLayout->addWidget(m_pinButton);
     hLayout->addWidget(closeButton);
     hLayout->addWidget(filterLabel);
     hLayout->addWidget(m_filterInput);
@@ -102,24 +93,4 @@ void FilterBar::keyReleaseEvent(QKeyEvent* event)
     }
 }
 
-bool FilterBar::isPinned() const
-{
-    return m_pinButton->isChecked();
-}
-
-void FilterBar::setPinned(bool pinned)
-{
-    if (pinned) {
-        m_pinButton->setIcon(KIcon("dialog-ok"));
-    } else {
-        m_pinButton->setIcon(KIcon("dialog-ok-apply"));
-    }
-    m_pinButton->setChecked(pinned);
-}
-
-void FilterBar::unpinSlot()
-{
-    setPinned(false);
-}
-
 #include "filter-bar.moc"
diff --git a/filter-bar.h b/filter-bar.h
index 2acb724..4e58dda 100644
--- a/filter-bar.h
+++ b/filter-bar.h
@@ -23,7 +23,6 @@
 
 #include <QWidget>
 
-class QToolButton;
 class KLineEdit;
 
 /**
@@ -44,31 +43,10 @@ public:
      */
     void selectAll();
 
-    /**
-     * 
eturns true if the pin button is checked, false otherwise.
-     */
-    bool isPinned() const;
-
 public slots:
     /** Clears the input field. */
     void clear();
 
-    /**
-     * Sets the appearance of the pin button.
-     *
-     * Displays the pin button with a different icon according to its state
-     * (checked or unchecked).
-     *
-     * \param pinned if true, the pin button will be checked, otherwise it
-     * will be unchecked.
-     */
-    void setPinned(bool pinned);
-
-    /**
-     * Unpins the bar.
-     */
-    void unpinSlot();
-
 signals:
     /**
      * Signal that reports the name filter has been
@@ -87,14 +65,6 @@ protected:
 
 private:
     KLineEdit *m_filterInput;
-    /**
-     * Button to pin the filter bar to the contact list.
-     *
-     * The status of the button (checked or unchecked) will be written in the
-     * config file when the contact list gets closed, and the filter bar will
-     * shown or hidden accordingly next time the contact list is launched.
-     */
-    QToolButton *m_pinButton;
 };
 
 #endif
diff --git a/main-widget.cpp b/main-widget.cpp
index 31f0a57..b929572 100644
--- a/main-widget.cpp
+++ b/main-widget.cpp
@@ -224,10 +224,10 @@ MainWidget::MainWidget(QWidget *parent)
             this, SLOT(setCustomPresenceMessage(QString)));
 
     KSharedConfigPtr config = KGlobal::config();
-    KConfigGroup filterBarGroup(config, "GUI");
-    if (filterBarGroup.readEntry("pin_filterbar", QString()) == QLatin1String("true")) {
+    KConfigGroup configGroup(config, "GUI");
+    if (configGroup.readEntry("pin_filterbar", true)) {
         toggleSearchWidget(true);
-        m_filterBar->setPinned(true);
+        m_searchContactAction->setChecked(true);
     }
 }
 
@@ -235,9 +235,9 @@ MainWidget::~MainWidget()
 {
     //save the state of the filter bar, pinned or not
     KSharedConfigPtr config = KGlobal::config();
-    KConfigGroup filterBarGroup(config, "GUI");
-    filterBarGroup.writeEntry("pin_filterbar", m_filterBar->isPinned());
-    filterBarGroup.config()->sync();
+    KConfigGroup configGroup(config, "GUI");
+    configGroup.writeEntry("pin_filterbar", m_searchContactAction->isChecked());
+    configGroup.config()->sync();
 }
 
 void MainWidget::onAccountManagerReady(Tp::PendingOperation* op)

-- 
ktp-contact-list packaging



More information about the pkg-kde-commits mailing list