From 178bd471d12a88862fb4ac1a17842ea0fd63c160 Mon Sep 17 00:00:00 2001 From: sandman Date: Wed, 28 Aug 2002 23:18:58 +0000 Subject: Workaround for a possible race condition in the QWS server (mostly OZ) (clipboard handling in Qt/E is a mess) --- (limited to 'core/applets') diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp index 4fbdf6f..3099a84 100644 --- a/core/applets/clipboardapplet/clipboard.cpp +++ b/core/applets/clipboardapplet/clipboard.cpp @@ -128,11 +128,11 @@ ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( ))); connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( ))); - m_timer-> start ( 1500 ); - m_menu = 0; m_dirty = true; m_lasttext = QString::null; + + m_timer-> start ( 0, true ); } ClipboardApplet::~ClipboardApplet ( ) @@ -228,6 +228,15 @@ void ClipboardApplet::paintEvent ( QPaintEvent* ) void ClipboardApplet::newData ( ) { + static bool excllock = false; + + if ( excllock ) + return; + else + excllock = true; + + m_timer-> stop ( ); + QCString type = "plain"; QString txt = QApplication::clipboard ( )-> text ( type ); @@ -239,4 +248,8 @@ void ClipboardApplet::newData ( ) m_dirty = true; } + + m_timer-> start ( 1500, true ); + + excllock = false; } -- cgit v0.9.0.2