-rw-r--r-- | core/applets/clipboardapplet/clipboard.cpp | 15 | ||||
-rw-r--r-- | core/applets/clipboardapplet/clipboard.h | 4 |
2 files changed, 16 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( | |||
124 | 124 | ||
125 | QTimer *timer = new QTimer ( this ); | 125 | m_timer = new QTimer ( this ); |
126 | 126 | ||
127 | connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( ))); | 127 | connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( ))); |
128 | connect ( timer, SIGNAL( timeout ( )), this, SLOT( newData ( ))); | 128 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( ))); |
129 | connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( ))); | ||
129 | 130 | ||
130 | timer-> start ( 1000 ); | 131 | m_timer-> start ( 1500 ); |
131 | 132 | ||
@@ -140,2 +141,10 @@ ClipboardApplet::~ClipboardApplet ( ) | |||
140 | 141 | ||
142 | void ClipboardApplet::shutdown ( ) | ||
143 | { | ||
144 | // the timer has to be stopped, or Qt/E will hang on quit() | ||
145 | // see launcher/desktop.cpp | ||
146 | |||
147 | m_timer-> stop ( ); | ||
148 | } | ||
149 | |||
141 | void ClipboardApplet::mousePressEvent ( QMouseEvent *) | 150 | 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 @@ | |||
26 | 26 | ||
27 | class QTimer; | ||
28 | |||
27 | class ClipboardApplet : public QWidget | 29 | class ClipboardApplet : public QWidget |
@@ -40,2 +42,3 @@ private slots: | |||
40 | void newData ( ); | 42 | void newData ( ); |
43 | void shutdown ( ); | ||
41 | 44 | ||
@@ -46,2 +49,3 @@ private: | |||
46 | QString m_lasttext; | 49 | QString m_lasttext; |
50 | QTimer * m_timer; | ||
47 | 51 | ||