Anonymous avatar Anonymous committed 63cef89

Finally resolved the crash-at-logout bug. Though the resolution feels wrong...

Comments (0)

Files changed (2)

 tray icon, maybe to fix the logout crash                     | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:293b1816684a65819949e22404f6459d61cdd164, time:1353145473.39
-crashes on logout                                            | owner:Arne Babenhauserheide <bab@draketo.de>, open:True, id:e5f978936418c58cc3db5590c1efbf0a64592fcc, time:1353145451.8
+crashes on logout                                            | owner:Arne Babenhauserheide <bab@draketo.de>, open:False, id:e5f978936418c58cc3db5590c1efbf0a64592fcc, time:1353145451.8
 - items arranged clockwise. -done
 - Edit dialog should show the icon graphically. A click on the item should show the edit dialog we have when editing the K-Menu. -done
 - Edit dialog should have a radio button for the action: "create folder". -done
-- register a global shortcut / gesture in KDE from within the program -> usable as soon as it's installed. -partial (keyboard)
+- register a global shortcut / gesture in KDE from within the program -> usable as soon as it's installed. -partial (keyboard: Alt-F6)
 - make it show faster. -done
 - add option --only-daemon to only start the daemon without showing the GUI -done
-- right-click on center opens a general config dialog. -todo
+- right-click on center opens a general config dialog. -done
 - a general config dialog. -done
 - first run of new version shows image as usage guide. -todo
 """
 
 # SIGNALs and SLOTs for a clean shutdown. 
 from PyQt4.QtCore import SIGNAL, SLOT
+from PyQt4 import QtGui
 
 # and exiting.
 from sys import exit as exit_
         self.statusnotifier.setCategory(0) # 0 = ApplicationStatus
         self.statusnotifier.setIconByName(programIcon())
         
-        self.connect(self, SIGNAL("shutDown()"), self.quit)
-        self.connect(self, SIGNAL("quit()"), self.quit)
-        self.connect(self.rad, SIGNAL("queryClose()"), self.close)
+        #self.connect(self, SIGNAL("shutDown()"), self.quit)
+        #self.connect(self, SIGNAL("quit()"), self.quit)
+        #self.connect(QtGui.qApp, SIGNAL("quit()"), self.quit)
+        #self.connect(self.rad, SIGNAL("queryClose()"), self.close)
 
     def quit(self):
         """Quit the program: close the rad, then quit."""
         self.close()
+        del self.rad
         super(KUniqueCaller, self).quit()
 
     def close(self):
         # if we get the quit arg ("pyrad.py --quit"), we close and shutdown
         args = KCmdLineArgs.parsedArgs()
         if args.isSet("quit") or args.isSet("kill"):
-            self.rad.close()
             self.quit()
             return 0
         elif args.isSet("daemon") or args.isSet("start"): 
     return app
 
 def run():
-    """Start and run the PyRad"""
-    # First we need to compile the commandline args for KDE programs
-    #KCmdLineArgs.init (argv, aboutData)
-    # Then do basic initializing
-    #app = KApplication()
+    """Start and run the PyRad - and let it die"""
+    # first we 
     app = initKApp()
-    #rad.close()
-    # Finally we execute the program - and return the exit code from the program.
-    return app.exec_()
+    # Now we execute the program
+    res = app.exec_()
+    # Afterwards we quit explicitely. This closes and deletes the rad
+    # to avoid crashing on quit and logout. FIXME: This feels wrong...
+    app.quit()
+    # finally return the exit code from the program.
+    return res
 
 
 ### Self Test == Run the Program ###
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.