Diffstat (limited to 'core/applets/clipboardapplet/clipboard.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/applets/clipboardapplet/clipboard.cpp | 15 |
1 files changed, 12 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 | |||
@@ -119,28 +119,37 @@ static const char * paste_xpm[] = { | |||
119 | ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) | 119 | ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) |
120 | { | 120 | { |
121 | setFixedWidth ( 14 ); | 121 | setFixedWidth ( 14 ); |
122 | setFixedHeight ( 18 ); | 122 | setFixedHeight ( 18 ); |
123 | m_clipboardPixmap = QPixmap ( paste_xpm ); | 123 | m_clipboardPixmap = QPixmap ( paste_xpm ); |
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 | ||
132 | m_menu = 0; | 133 | m_menu = 0; |
133 | m_dirty = true; | 134 | m_dirty = true; |
134 | m_lasttext = QString::null; | 135 | m_lasttext = QString::null; |
135 | } | 136 | } |
136 | 137 | ||
137 | ClipboardApplet::~ClipboardApplet ( ) | 138 | ClipboardApplet::~ClipboardApplet ( ) |
138 | { | 139 | { |
139 | } | 140 | } |
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 *) |
142 | { | 151 | { |
143 | if ( m_dirty ) { | 152 | if ( m_dirty ) { |
144 | delete m_menu; | 153 | delete m_menu; |
145 | 154 | ||
146 | m_menu = new QPopupMenu ( this ); | 155 | m_menu = new QPopupMenu ( this ); |