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

List:       kde-devel
Subject:    RE: Removing unusable icons from URL bar
From:       Simon MacMullen <simon.macmullen () aspectgroup ! co ! uk>
Date:       2002-05-23 12:04:25
[Download RAW message or body]

OK, here's another version of the patch that doesn't break BC. I will commit
tomorrow if no-one objects.

Simon


["urlbar.diff" (application/octet-stream)]

Index: kio/kfile/kurlbar.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kurlbar.cpp,v
retrieving revision 1.26
diff -u -3 -p -r1.26 kurlbar.cpp
--- kio/kfile/kurlbar.cpp	2002/05/02 17:33:10	1.26
+++ kio/kfile/kurlbar.cpp	2002/05/23 11:43:29
@@ -296,8 +296,8 @@ void KURLBar::setListBox( KURLBarListBox
     setPalette( pal );
     m_listBox->viewport()->setBackgroundMode( PaletteMid );
 
-    connect( m_listBox, SIGNAL( clicked( QListBoxItem * ) ),
-             SLOT( slotSelected( QListBoxItem * )));
+    connect( m_listBox, SIGNAL( mouseButtonClicked( int, QListBoxItem *, const QPoint & ) ),
+             SLOT( slotSelected( int, QListBoxItem * )));
     connect( m_listBox, SIGNAL( dropped( QDropEvent * )),
              this, SLOT( slotDropped( QDropEvent * )));
     connect( m_listBox, SIGNAL( contextMenuRequested( QListBoxItem *,
@@ -376,6 +376,13 @@ QSize KURLBar::minimumSizeHint() const
     return QSize( w, h );
 }
 
+void KURLBar::slotSelected( int button, QListBoxItem *item )
+{
+    if (button != Qt::LeftButton) return;
+
+    slotSelected(item);
+}
+
 void KURLBar::slotSelected( QListBoxItem *item )
 {
     if ( item && item != m_activeItem ) {
@@ -552,10 +559,6 @@ void KURLBar::slotContextMenuRequested( 
     static const int AddItem    = 20;
     static const int EditItem   = 30;
     static const int RemoveItem = 40;
-
-    // also emit activated(), as the item will be painted as "current" anyway
-    if ( item )
-        slotSelected( item );
 
     bool smallIcons = m_iconSize < KIcon::SizeMedium;
     QPopupMenu *popup = new QPopupMenu();
Index: kio/kfile/kurlbar.h
===================================================================
RCS file: /home/kde/kdelibs/kio/kfile/kurlbar.h,v
retrieving revision 1.12
diff -u -3 -p -r1.12 kurlbar.h
--- kio/kfile/kurlbar.h	2002/04/27 17:26:46	1.12
+++ kio/kfile/kurlbar.h	2002/05/23 11:43:29
@@ -393,6 +393,9 @@ protected slots:
      * signal.
      */
     virtual void slotSelected( QListBoxItem * );
+    
+    void slotSelected( int button, QListBoxItem * );
+    
     /**
      * Called when a url was dropped onto the bar to show a
      * @ref KURLBarItemDialog.

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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