]> git.lyx.org Git - lyx.git/commitdiff
Remove key event pruning code. This has always been disabled without anyone complaining.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 25 Nov 2006 22:35:09 +0000 (22:35 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 25 Nov 2006 22:35:09 +0000 (22:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16046 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiWorkArea.C
src/frontends/qt4/GuiWorkArea.h

index 7c9bca4d800d0988e16bcb8319c138c6d3f6fdda..81edd42be5eb9c3ad77369554e1ba9db5ba59d5f 100644 (file)
 #include <boost/bind.hpp>
 #include <boost/current_function.hpp>
 
 #include <boost/bind.hpp>
 #include <boost/current_function.hpp>
 
-// Abdel (26/06/2006):
-// On windows-XP the UserGuide PageDown scroll test is faster without event pruning (16 s)
-// than with it (23 s).
 #ifdef Q_WS_WIN
 int const CursorWidth = 2;
 #ifdef Q_WS_WIN
 int const CursorWidth = 2;
- #define USE_EVENT_PRUNING 0
 #else
 int const CursorWidth = 1;
 #else
 int const CursorWidth = 1;
- #define USE_EVENT_PRUNING 0
 #endif
 
 
 #endif
 
 
@@ -197,20 +192,6 @@ GuiWorkArea::GuiWorkArea(int w, int h, int id, LyXView & lyx_view)
                << "\n viewport height\t" << viewport()->height()
                << endl;
 
                << "\n viewport height\t" << viewport()->height()
                << endl;
 
-       if (USE_EVENT_PRUNING) {
-               // This is the keyboard buffering stuff...
-               // I don't see any need for this under windows. The keyboard is reactive
-               // enough...
-
-               if ( !QObject::connect(&step_timer_, SIGNAL(timeout()),
-                       this, SLOT(keyeventTimeout())) )
-                       lyxerr[Debug::GUI] << "ERROR: keyeventTimeout cannot connect!" << endl;
-
-               // Start the timer, one-shot.
-               step_timer_.setSingleShot(true);
-               step_timer_.start(50);
-       }
-
        // Enables input methods for asian languages.
        // Must be set when creating custom text editing widgets.
        setAttribute(Qt::WA_InputMethodEnabled, true);
        // Enables input methods for asian languages.
        // Must be set when creating custom text editing widgets.
        setAttribute(Qt::WA_InputMethodEnabled, true);
@@ -438,51 +419,9 @@ void GuiWorkArea::keyPressEvent(QKeyEvent * e)
                << " key=" << e->key()
                << endl;
 
                << " key=" << e->key()
                << endl;
 
-       if (USE_EVENT_PRUNING) {
-               keyeventQueue_.push(boost::shared_ptr<QKeyEvent>(new QKeyEvent(*e)));
-       }
-       else {
-               boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
-               sym->set(e);
-               processKeySym(sym, q_key_state(e->modifiers()));
-       }
-}
-
-
-// This is used only if USE_EVENT_PRUNING is defined...
-void GuiWorkArea::keyeventTimeout()
-{
-       bool handle_autos = true;
-
-       while (!keyeventQueue_.empty()) {
-               boost::shared_ptr<QKeyEvent> ev = keyeventQueue_.front();
-
-               // We never handle more than one auto repeated
-               // char in a list of queued up events.
-               if (!handle_autos && ev->isAutoRepeat()) {
-                       keyeventQueue_.pop();
-                       continue;
-               }
-
-               boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
-               sym->set(ev.get());
-
-               lyxerr[Debug::GUI] << BOOST_CURRENT_FUNCTION
-                                  << " count=" << ev->count()
-                                  << " text=" <<  fromqstr(ev->text())
-                                  << " isAutoRepeat=" << ev->isAutoRepeat()
-                                  << " key=" << ev->key()
-                                  << endl;
-
-               processKeySym(sym, q_key_state(ev->modifiers()));
-               keyeventQueue_.pop();
-
-               handle_autos = false;
-       }
-
-       // Restart the timer.
-       step_timer_.setSingleShot(true);
-       step_timer_.start(25);
+       boost::shared_ptr<QLyXKeySym> sym(new QLyXKeySym);
+       sym->set(e);
+       processKeySym(sym, q_key_state(e->modifiers()));
 }
 
 
 }
 
 
index ab62eeae95c3150bd19eabca4056dc9a45cad4ba..208414f3f2c08c78b8ed74b08399907768d52307 100644 (file)
@@ -146,10 +146,6 @@ private:
        void inputMethodEvent(QInputMethodEvent * ev);
 
 public Q_SLOTS:
        void inputMethodEvent(QInputMethodEvent * ev);
 
 public Q_SLOTS:
-       /// Timeout event Slot for keyboard bufferring.
-       /// \todo This is not used currently in the code, remove?
-       void keyeventTimeout();
-
        /// Adjust the LyX buffer view with the position of the scrollbar.
        /**
        * The action argument is not used in the the code, it is there
        /// Adjust the LyX buffer view with the position of the scrollbar.
        /**
        * The action argument is not used in the the code, it is there
@@ -164,10 +160,6 @@ private:
 
        ///
        SyntheticMouseEvent synthetic_mouse_event_;
 
        ///
        SyntheticMouseEvent synthetic_mouse_event_;
-       /// \todo remove
-       QTimer step_timer_;
-       /// \todo remove
-       std::queue<boost::shared_ptr<QKeyEvent> > keyeventQueue_;
        ///
        double_click dc_event_;
 
        ///
        double_click dc_event_;