summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjerous <jerous@gmail.com>2008-06-08 00:36:16 +0200
committerjerous <jerous@gmail.com>2008-06-08 00:36:16 +0200
commit67ce372dd41bd35158c63bbd8180cdf56e135b93 (patch)
treeaea45b65468a87ffbe1981ee3c24a09457ca6aa1
parent1ea3de14698978725d4c14f9b36c109d75d19999 (diff)
fix disconnecting
-rw-r--r--clMonty.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/clMonty.py b/clMonty.py
index 368948f..361ab78 100644
--- a/clMonty.py
+++ b/clMonty.py
@@ -75,10 +75,11 @@ class Monty(QtCore.QObject):
def disconnect(self):
"""Disconnect from MPD."""
- self._client.close()
- self._client.disconnect()
- self._client=None
- self._killTimer(self.timerID)
+ if self._client:
+ self._client.close()
+ self._client.disconnect()
+ self._client=None
+ # don't kill timer, as it'll happen in timerEvent
def isConnected(self):
"""Returns true if we're connected to MPD, false otherwise."""