summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp15
-rw-r--r--core/applets/clipboardapplet/clipboard.h4
-rw-r--r--core/launcher/desktop.cpp6
3 files changed, 22 insertions, 3 deletions
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index 5848d0f..4fbdf6f 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -124,8 +124,9 @@ ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget(
- QTimer *timer = new QTimer ( this );
+ m_timer = new QTimer ( this );
connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( )));
- connect ( timer, SIGNAL( timeout ( )), this, SLOT( newData ( )));
+ connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( )));
+ connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( )));
- timer-> start ( 1000 );
+ m_timer-> start ( 1500 );
@@ -140,2 +141,10 @@ ClipboardApplet::~ClipboardApplet ( )
+void ClipboardApplet::shutdown ( )
+{
+ // the timer has to be stopped, or Qt/E will hang on quit()
+ // see launcher/desktop.cpp
+
+ m_timer-> stop ( );
+}
+
void ClipboardApplet::mousePressEvent ( QMouseEvent *)
diff --git a/core/applets/clipboardapplet/clipboard.h b/core/applets/clipboardapplet/clipboard.h
index 84743d9..ec87d39 100644
--- a/core/applets/clipboardapplet/clipboard.h
+++ b/core/applets/clipboardapplet/clipboard.h
@@ -26,2 +26,4 @@
+class QTimer;
+
class ClipboardApplet : public QWidget
@@ -40,2 +42,3 @@ private slots:
void newData ( );
+ void shutdown ( );
@@ -46,2 +49,3 @@ private:
QString m_lasttext;
+ QTimer * m_timer;
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index e58b08c..f90da1a 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -688,2 +688,8 @@ void DesktopApplication::shutdown( ShutdownImpl::Type t )
prepareForTermination(FALSE);
+
+ // This is a workaround for a Qt bug
+ // clipboard applet has to stop its poll timer, or Qt/E
+ // will hang on quit() right before it emits aboutToQuit()
+ emit aboutToQuit ( );
+
quit();