get rid of a boost::signals::connection

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21695 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2007-11-21 21:15:23 +00:00
parent a37a73e3c9
commit 02a7584d5a
2 changed files with 8 additions and 17 deletions

View File

@ -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) GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & lv)
: buffer_view_(new BufferView(buffer)), lyx_view_(&lv), : buffer_view_(new BufferView(buffer)), lyx_view_(&lv),
cursor_visible_(false), cursor_timeout_(400), cursor_visible_(false),
need_resize_(false), schedule_redraw_(false), need_resize_(false), schedule_redraw_(false),
preedit_lines_(1) preedit_lines_(1)
{ {
buffer.workAreaManager().add(this); buffer.workAreaManager().add(this);
// Setup the signals // Setup the signals
timecon = cursor_timeout_.timeout cursor_timeout_.setInterval(400);
.connect(boost::bind(&GuiWorkArea::toggleCursor, this)); connect(&cursor_timeout_, SIGNAL(timeout()),
this, SLOT(toggleCursor()));
cursor_timeout_.start(); cursor_timeout_.start();
@ -292,7 +285,7 @@ void GuiWorkArea::stopBlinkingCursor()
void GuiWorkArea::startBlinkingCursor() void GuiWorkArea::startBlinkingCursor()
{ {
showCursor(); showCursor();
cursor_timeout_.restart(); cursor_timeout_.start();
} }
@ -467,8 +460,6 @@ void GuiWorkArea::toggleCursor()
// to the rest of LyX. // to the rest of LyX.
ForkedcallsController & fcc = ForkedcallsController::get(); ForkedcallsController & fcc = ForkedcallsController::get();
fcc.handleCompletedProcesses(); fcc.handleCompletedProcesses();
cursor_timeout_.restart();
} }

View File

@ -140,6 +140,8 @@ private Q_SLOTS:
void adjustViewWithScrollBar(int action = 0); void adjustViewWithScrollBar(int action = 0);
/// timer to limit triple clicks /// timer to limit triple clicks
void doubleClickTimeout(); void doubleClickTimeout();
/// toggle the cursor's visibility
void toggleCursor();
/// close this work area. /// close this work area.
/// Slot for Buffer::closing signal. /// Slot for Buffer::closing signal.
@ -195,8 +197,6 @@ private:
void hideCursor(); void hideCursor();
/// show the cursor if it is not visible /// show the cursor if it is not visible
void showCursor(); void showCursor();
/// toggle the cursor's visibility
void toggleCursor();
/// ///
void updateScrollbar(); void updateScrollbar();
@ -208,7 +208,7 @@ private:
bool cursor_visible_; bool cursor_visible_;
/// ///
Timeout cursor_timeout_; QTimer cursor_timeout_;
/// ///
SyntheticMouseEvent synthetic_mouse_event_; SyntheticMouseEvent synthetic_mouse_event_;
/// ///