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

List:       kde-core-devel
Subject:    [PATCH] Fix deprecated warnings in klistview.cpp
From:       Ismail Donmez <kde () myrealbox ! com>
Date:       2004-11-05 6:26:47
Message-ID: 200411050826.47690.kde () myrealbox ! com
[Download RAW message or body]

Hi all,

Attached a small patch which replaces KApplication::keyboardModifiers() with 
KApplication::keyboardMouseState() in klistview.cpp to fix deprecated 
warnings.

Can someone please review?

Regards,
ismail

["klistview_deprec.patch" (text/x-diff)]

--- klistview.cpp.~1.238.~	2004-11-04 20:17:05.000000000 +0200
+++ klistview.cpp	2004-11-05 08:24:51.000000000 +0200
@@ -581,19 +581,19 @@
   if( !hasFocus() )
     setFocus();
 
-  uint keybstate = KApplication::keyboardModifiers();
+  uint keybstate = KApplication::keyboardMouseState();
 
   QListViewItem* previousItem = currentItem();
   setCurrentItem( d->pCurrentItem );
 
   if( d->pCurrentItem ) {
     //Shift pressed?
-    if( (keybstate & KApplication::ShiftModifier) ) {
+    if(keybstate == Qt::ShiftButton) {
       bool block = signalsBlocked();
       blockSignals( true );
 
       //No Ctrl? Then clear before!
-      if( !(keybstate & KApplication::ControlModifier) )
+      if(keybstate != Qt::ControlButton)
                 clearSelection();
 
       bool select = !d->pCurrentItem->isSelected();
@@ -665,12 +665,12 @@
         }
         else
         {
-            uint keybstate = KApplication::keyboardModifiers();
+	  uint keybstate = KApplication::keyboardMouseState();
 
             d->autoSelect.stop();
 
             //Donīt emit executed if in SC mode and Shift or Ctrl are pressed
-            if( !( ((keybstate & KApplication::ShiftModifier) || (keybstate & \
KApplication::ControlModifier)) ) ) { +            if( !((keybstate == \
Qt::ShiftButton) || (keybstate == Qt::ControlButton)) ) {  viewport()->unsetCursor();
                 emit executed( item );
                 emit executed( item, pos, c );



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

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