summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-31 12:40:07 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-07-31 12:40:07 -0500
commit9d3eb438ccf08435248243b7bd249063bfe29fe5 (patch)
tree39dba9b5a9e2f49f7ed0edd52678974c0e6de6e0
parent50e86769ece0ef738bdf2ad8ebffe0a3fcb5110e (diff)
downloadkerberostray-9d3eb438ccf08435248243b7bd249063bfe29fe5.tar.gz
kerberostray-9d3eb438ccf08435248243b7bd249063bfe29fe5.zip
Avoid crash due to reentrancy in KDirWatch dirty/created/deleted signals
m---------admin0
-rw-r--r--src/toplevel.cpp17
-rw-r--r--src/toplevel.h2
3 files changed, 15 insertions, 4 deletions
diff --git a/admin b/admin
-Subproject 65ecce459d54e772303052de50d08557ba9cc7e
+Subproject 4027b878fb556a51ed29affd578e78aa7099748
diff --git a/src/toplevel.cpp b/src/toplevel.cpp
index ae2cd4d..beb0006 100644
--- a/src/toplevel.cpp
+++ b/src/toplevel.cpp
@@ -59,7 +59,7 @@
#include "toplevel.h"
#include "toplevel.moc"
-TopLevel::TopLevel() : KSystemTray(), ticketWatch(0), m_refreshTimer(0), notifyExpiryMinutes(0)
+TopLevel::TopLevel() : KSystemTray(), ticketWatch(0), m_refreshTimer(0), m_requestUpdateTimer(0), notifyExpiryMinutes(0)
{
setBackgroundMode(X11ParentRelative); // what for?
@@ -145,6 +145,15 @@ void TopLevel::setupTimers() {
connect(m_refreshTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateTicketList()));
m_refreshTimer->start(10*1000, false);
}
+
+ if (!m_requestUpdateTimer) {
+ m_requestUpdateTimer = new TQTimer(this);
+ connect(m_requestUpdateTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(updateTicketList()));
+ }
+}
+
+void TopLevel::requestTicketListUpdate() {
+ m_requestUpdateTimer->start(0, TRUE);
}
void TopLevel::updateTicketList() {
@@ -154,9 +163,9 @@ void TopLevel::updateTicketList() {
if (!ticketWatch) {
ticketWatch = new KDirWatch();
- connect(ticketWatch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(updateTicketList()));
- connect(ticketWatch, TQT_SIGNAL(created(const TQString&)), this, TQT_SLOT(updateTicketList()));
- connect(ticketWatch, TQT_SIGNAL(deleted(const TQString&)), this, TQT_SLOT(updateTicketList()));
+ connect(ticketWatch, TQT_SIGNAL(dirty(const TQString&)), this, TQT_SLOT(requestTicketListUpdate()));
+ connect(ticketWatch, TQT_SIGNAL(created(const TQString&)), this, TQT_SLOT(requestTicketListUpdate()));
+ connect(ticketWatch, TQT_SIGNAL(deleted(const TQString&)), this, TQT_SLOT(requestTicketListUpdate()));
ticketWatch->addFile(m_ticketFile);
ticketWatch->startScan();
}
diff --git a/src/toplevel.h b/src/toplevel.h
index 640b937..02261c3 100644
--- a/src/toplevel.h
+++ b/src/toplevel.h
@@ -64,6 +64,7 @@ private slots:
void setToolTip(const TQString &text, bool force=false);
void setupTimers();
+ void requestTicketListUpdate();
void updateTicketList();
void updateMenu();
void getNewTGT();
@@ -92,6 +93,7 @@ private:
TQString m_ticketFile;
KDirWatch *ticketWatch;
TQTimer *m_refreshTimer;
+ TQTimer *m_requestUpdateTimer;
bool autostart;
bool notifyExpiry;