Ejemplo n.º 1
0
 def openDirectory(self, path=None):
     """
     Opens a folder. If None, opes the document folder if any, or else
     the current working directory in the default KDE file manager.
     """
     if path is None:
         d = self.mainwin.currentDocument()
         if d.url().isEmpty():
             if d.localFileManager():
                 path = d.localFileManager().directory
             else:
                 path = self.mainwin.app.defaultDirectory() or os.getcwd()
         else:
             path = d.url().resolved(KUrl('.'))
     url = KUrl(path)
     url.adjustPath(KUrl.RemoveTrailingSlash)
     sip.transferto(KRun(url, self.mainwin), None) # C++ will delete it