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

List:       kde-release-team
Subject:    kdebase/workspace/krunner/interfaces/default  - revert commit 961314
From:       Jacopo De Simoi <wilderkde () gmail ! com>
Date:       2009-05-06 15:40:17
Message-ID: 200905061140.17956.wilderkde () gmail ! com
[Download RAW message or body]

Dear all, 
 a recent bugfix commit gives unexpected behaviour wrt the tab key & autocompletion \
in krunner (due to a long-standing issue in handling of the TAB key in krunner)  This \
is possibly a very visible bug, although I won't call it critical. I attach here a \
patch to revert the commit, the issue needs more testing and a better overall \
approach.  I am unsure if there ever will be a patch-release for 4.2.3, but if so \
please consider applying this patch. Thanks all

  Jacopo De Simoi

 


["krunner.autocompletion.patch" (text/x-patch)]

Index: interface.cpp
===================================================================
--- interface.cpp	(revision 961314)
+++ interface.cpp	(working copy)
@@ -120,13 +120,13 @@
     KLineEdit *lineEdit = new KLineEdit(m_searchTerm);
     QAction *focusEdit = new QAction(this);
     focusEdit->setShortcut(Qt::Key_F6);
-
+    
     // in therory, the widget should detect the direction from the content
     // but this is not available in Qt4.4/KDE 4.2, so the best default for this \
widget  // is LTR: as it's more or less a "command line interface"
     // FIXME remove this code when KLineEdit has automatic direction detection of \
the "paragraph"  m_searchTerm->setLayoutDirection( Qt::LeftToRight );
-
+    
     connect(focusEdit, SIGNAL(triggered(bool)), lineEdit, SLOT(setFocus()));
     addAction(focusEdit);
 
@@ -179,7 +179,7 @@
     m_resultsView->setAlignment(Qt::AlignLeft | Qt::AlignTop);
 
     //kDebug() << "size:" << m_resultsView->size() << m_resultsView->minimumSize();
-    m_resultsScene = new ResultScene(runnerManager, m_searchTerm, this);
+    m_resultsScene = new ResultScene(runnerManager, this);
     m_resultsView->setScene(m_resultsScene);
     m_resultsView->setMinimumSize(m_resultsScene->minimumSizeHint());
     connect(m_resultsScene, SIGNAL(matchCountChanged(int)), this, \
                SLOT(matchCountChanged(int)));
Index: resultscene.h
===================================================================
--- resultscene.h	(revision 961314)
+++ resultscene.h	(working copy)
@@ -45,7 +45,7 @@
     Q_OBJECT
 
     public:
-        explicit ResultScene(Plasma::RunnerManager *runnerManager, QWidget * \
focusBase, QObject *parent = 0); +        explicit ResultScene(Plasma::RunnerManager \
*runnerManager, QObject *parent = 0);  ~ResultScene();
 
         void resize(int width, int height);
@@ -80,7 +80,6 @@
     private:
         ResultItem* addQueryMatch(const Plasma::QueryMatch &match, bool useAnyId);
         void performResize(int width, int height);
-        bool canMoveItemFocus() const;
 
         Plasma::RunnerManager *m_runnerManager;
 
@@ -106,8 +105,6 @@
         uint m_currentPage;
         Plasma::FrameSvg *m_frame;
 
-        QWidget *m_focusBase;
-	
     private slots:
         void layoutIcons();
         void slotArrowResultItemPressed();
Index: resultscene.cpp
===================================================================
--- resultscene.cpp	(revision 961314)
+++ resultscene.cpp	(working copy)
@@ -41,15 +41,14 @@
 
 #include "resultitem.h"
 
-ResultScene::ResultScene(Plasma::RunnerManager *manager, QWidget * focusBase, \
QObject *parent) +ResultScene::ResultScene(Plasma::RunnerManager *manager, QObject \
*parent)  : QGraphicsScene(parent),
       m_runnerManager(manager),
       m_cIndex(0),
       m_rowStride(0),
       m_pageStride(0),
       m_pageCount(0),
-      m_currentPage(0),
-      m_focusBase(focusBase)
+      m_currentPage(0)
 {
     setItemIndexMethod(NoIndex);
 
@@ -123,15 +122,6 @@
     emit matchCountChanged(0);
 }
 
-bool ResultScene::canMoveItemFocus() const
-{
-    // We prevent a late query result from stealing the item focus from the user
-    // The item focus can be moved only if the focusBase widget (the \
                khistorycombobox)
-    // has focus (i.e. the user is still typing or waiting) or if there is no item \
                currently focused
-
-    return m_focusBase->hasFocus() || (!focusItem());
-}
-
 void ResultScene::setQueryMatches(const QList<Plasma::QueryMatch> &m)
 {
     // kDebug() << "============================" << endl << "matches retrieved: " \
<< m.count(); @@ -194,15 +184,15 @@
         item->setIndex(i);
 
         // it is vital that focus is set *after* the index
-        if (i == 0 && canMoveItemFocus()) {
+        if (i == 0) {
             setFocusItem(item);
-            emit itemHoverEnter(item);
         }
 
         ++i;
         tab = item;
     }
 
+    emit itemHoverEnter(m_items.at(0));
 }
 
 ResultItem* ResultScene::addQueryMatch(const Plasma::QueryMatch &match, bool \
useAnyId)



_______________________________________________
release-team mailing list
release-team@kde.org
https://mail.kde.org/mailman/listinfo/release-team


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

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