Changeset 439a88ea1679…
Parent 6c497e41d523…
by
Changes to one file · Browse files at 439a88ea1679 Showing diff from parent 6c497e41d523 Diff from another changeset...
@@ -64,10 +64,35 @@ chm = os.path.join(paths.bin_path, 'doc', 'TortoiseHg.chm')
if os.path.exists(chm):
fullurl = (r'mk:@MSITStore:%s::/' % chm) + url
- QDesktopServices.openUrl(QUrl.fromLocalFile(fullurl))
+ openlocalurl(fullurl)
return
QDesktopServices.openUrl(QUrl(fullurl))
+def startswith(strQstring, startstr):
+ '''calls startsWith of QString or startswith for others
+
+ takes st, unicode or QString as strQstring'''
+
+ if isinstance(strQstring, QString):
+ return strQstring.startsWith(startstr)
+ else:
+ return strQstring.startswith(startstr)
+
+def openlocalurl(path):
+ '''open the given path with the default application
+
+ takes str, unicode or QString as argument'''
+
+ if isinstance(path, str):
+ path = hglib.tounicode(path)
+ if os.name == 'nt' and startswith(path, '\\\\'):
+ # network share, special handling because of qt bug 13359
+ # see http://bugreports.qt.nokia.com/browse/QTBUG-13359
+ qurl = QUrl().setUrl(QDir.toNativeSeparators(path))
+ else:
+ qurl = QUrl.fromLocalFile(path)
+ return QDesktopServices.openUrl(qurl)
+
def editfiles(repo, files, lineno=None, search=None, parent=None):
if len(files) == 1:
path = repo.wjoin(files[0])
|
Loading...