summaryrefslogtreecommitdiff
authorsandman <sandman>2002-07-28 00:44:43 (UTC)
committer sandman <sandman>2002-07-28 00:44:43 (UTC)
commit72081cbfef03a69ed6f9ca7826854b6cf10dc2fe (patch) (unidiff)
tree43e67bdc7cbb972f431b3912e2f068df3d2c97bf
parent4baf36396739502c5471950e29f18954cca4517b (diff)
downloadopie-72081cbfef03a69ed6f9ca7826854b6cf10dc2fe.zip
opie-72081cbfef03a69ed6f9ca7826854b6cf10dc2fe.tar.gz
opie-72081cbfef03a69ed6f9ca7826854b6cf10dc2fe.tar.bz2
Workaround for a weird Qt/E bug, resulting in qpe hanging if clipboard
applet is loaded and qpe is terminated via shutdown applet.
Diffstat (more/less context) (show 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(
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
142void 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
141void ClipboardApplet::mousePressEvent ( QMouseEvent *) 150void 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
27class QTimer;
28
27class ClipboardApplet : public QWidget 29class 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
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 )
688 prepareForTermination(FALSE); 688 prepareForTermination(FALSE);
689
690 // This is a workaround for a Qt bug
691 // clipboard applet has to stop its poll timer, or Qt/E
692 // will hang on quit() right before it emits aboutToQuit()
693 emit aboutToQuit ( );
694
689 quit(); 695 quit();