[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/klipper
From:       Esben Mose Hansen <kde () mosehansen ! dk>
Date:       2004-11-23 21:11:21
Message-ID: 20041123211121.2142618D23 () office ! kde ! org
[Download RAW message or body]

CVS commit by esben: 

Fix regression: When the user selects a item from the history,
check the item in the menu.


  M +7 -1      history.cpp   1.5
  M +12 -0     history.h   1.5
  M +8 -0      klipperpopup.cpp   1.8


--- kdebase/klipper/history.cpp  #1.4:1.5
@@ -28,5 +28,6 @@
 History::History( QWidget* parent, const char* name )
     : QObject( parent,  name ),
-      m_popup( new KlipperPopup( this, parent, "main_widget" ) )
+      m_popup( new KlipperPopup( this, parent, "main_widget" ) ),
+      m_topIsUserSelected( false )
 {
     connect( this, SIGNAL( changed() ), m_popup,  SLOT( slotHistoryChanged() ) );
@@ -47,4 +48,6 @@ void History::insert( const HistoryItem*
         return;
 
+    m_topIsUserSelected = false;
+
     // Optimisation: Compare with top item.
     if ( !itemList.isEmpty() && *itemList.first() == *item ) {
@@ -102,4 +105,7 @@ void History::slotMoveToTop(int pos ) {
         return;
     }
+
+    m_topIsUserSelected = true;
+
     itemList.first();
     for ( ; pos; pos-- ) {

--- kdebase/klipper/history.h  #1.4:1.5
@@ -105,4 +105,11 @@ public:
     unsigned max_size() const { return m_max_size; }
 
+    /**
+     * returns true if the user has selected the top item
+     */
+    bool topIsUserSelected() {
+        return m_topIsUserSelected;
+    }
+
 public slots:
     /**
@@ -144,4 +151,9 @@ private:
     unsigned m_max_size;
 
+    /**
+     * True if the top is selected by the user
+     */
+    bool m_topIsUserSelected;
+
 };
 

--- kdebase/klipper/klipperpopup.cpp  #1.7:1.8
@@ -200,5 +200,13 @@ void KlipperPopup::rebuild( const QStrin
         }
         n_history_items++;
+    } else {
+        if ( history()->topIsUserSelected() ) {
+            int id = idAt( TOP_HISTORY_ITEM_INDEX );
+            if ( id != -1 ) {
+                setItemChecked( id,true );
+            }
     }
+    }
+
 
     m_dirty = false;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic