From 02a7584d5a830c7198000297f0cb263207eb9b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Wed, 21 Nov 2007 21:15:23 +0000 Subject: [PATCH] get rid of a boost::signals::connection git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21695 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiWorkArea.cpp | 19 +++++-------------- src/frontends/qt4/GuiWorkArea.h | 6 +++--- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index adecdfdd9f..ac6df65716 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -191,24 +191,17 @@ SyntheticMouseEvent::SyntheticMouseEvent() -// All the below connection objects are needed because of a bug in some -// versions of GCC (<=2.96 are on the suspects list.) By having and assigning -// to these connections we avoid a segfault upon startup, and also at exit. -// (Lgb) - -static boost::signals::connection timecon; - - GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & lv) : buffer_view_(new BufferView(buffer)), lyx_view_(&lv), - cursor_visible_(false), cursor_timeout_(400), + cursor_visible_(false), need_resize_(false), schedule_redraw_(false), preedit_lines_(1) { buffer.workAreaManager().add(this); // Setup the signals - timecon = cursor_timeout_.timeout - .connect(boost::bind(&GuiWorkArea::toggleCursor, this)); + cursor_timeout_.setInterval(400); + connect(&cursor_timeout_, SIGNAL(timeout()), + this, SLOT(toggleCursor())); cursor_timeout_.start(); @@ -292,7 +285,7 @@ void GuiWorkArea::stopBlinkingCursor() void GuiWorkArea::startBlinkingCursor() { showCursor(); - cursor_timeout_.restart(); + cursor_timeout_.start(); } @@ -467,8 +460,6 @@ void GuiWorkArea::toggleCursor() // to the rest of LyX. ForkedcallsController & fcc = ForkedcallsController::get(); fcc.handleCompletedProcesses(); - - cursor_timeout_.restart(); } diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index 5c2db3ed7c..fe014d1dc9 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -140,6 +140,8 @@ private Q_SLOTS: void adjustViewWithScrollBar(int action = 0); /// timer to limit triple clicks void doubleClickTimeout(); + /// toggle the cursor's visibility + void toggleCursor(); /// close this work area. /// Slot for Buffer::closing signal. @@ -195,8 +197,6 @@ private: void hideCursor(); /// show the cursor if it is not visible void showCursor(); - /// toggle the cursor's visibility - void toggleCursor(); /// void updateScrollbar(); @@ -208,7 +208,7 @@ private: bool cursor_visible_; /// - Timeout cursor_timeout_; + QTimer cursor_timeout_; /// SyntheticMouseEvent synthetic_mouse_event_; ///