Changeset View
Changeset View
Standalone View
Standalone View
krusader/krservices.cpp
Show First 20 Lines • Show All 288 Lines • ▼ Show 20 Line(s) | |||||
289 | QString KrServices::urlToLocalPath(const QUrl &url) | 289 | QString KrServices::urlToLocalPath(const QUrl &url) | ||
290 | { | 290 | { | ||
291 | QUrl fileUrl = QUrl(url); | 291 | QUrl fileUrl = QUrl(url); | ||
292 | // QUrl::toLocalFile() does not work if the protocol is "file" e.g. when opening an archive | 292 | // QUrl::toLocalFile() does not work if the protocol is "file" e.g. when opening an archive | ||
293 | fileUrl.setScheme("file"); | 293 | fileUrl.setScheme("file"); | ||
294 | QString path = fileUrl.toLocalFile(); | 294 | QString path = fileUrl.toLocalFile(); | ||
295 | REPLACE_DIR_SEP2(path); | 295 | REPLACE_DIR_SEP2(path); | ||
296 | 296 | | |||
297 | #ifdef Q_WS_WIN | 297 | #ifdef Q_OS_WIN | ||
298 | if (path.startsWith(DIR_SEPARATOR)) { | 298 | if (path.startsWith(DIR_SEPARATOR)) { | ||
299 | int p = 1; | 299 | int p = 1; | ||
300 | while (p < path.length() && path[ p ] == DIR_SEPARATOR_CHAR) | 300 | while (p < path.length() && path[ p ] == DIR_SEPARATOR_CHAR) | ||
301 | p++; | 301 | p++; | ||
302 | /* /C:/Folder */ | 302 | /* /C:/Folder */ | ||
303 | if (p + 2 <= path.length() && path[ p ].isLetter() && path[ p + 1 ] == ':') { | 303 | if (p + 2 <= path.length() && path[ p ].isLetter() && path[ p + 1 ] == ':') { | ||
304 | path = path.mid(p); | 304 | path = path.mid(p); | ||
305 | } | 305 | } | ||
Show All 22 Lines |