| 37 | |
| 38 | |
| 39 | QString GetRootPathWindows(const QString& path) |
| 40 | { |
| 41 | if (path.startsWith("\\\\") && path.count("\\") == 2) |
| 42 | return path; |
| 43 | |
| 44 | if (path.startsWith("\\\\")) { |
| 45 | int secondSlash = path.indexOf('\\', 2); |
| 46 | if (secondSlash != -1) { |
| 47 | return path.left(secondSlash); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | int firstSlash = path.indexOf('\\'); |
| 52 | if (firstSlash != -1) { |
| 53 | return path.left(firstSlash); |
| 54 | } |
| 55 | |
| 56 | return path; |
| 57 | } |
| 58 | |
| 59 | QString GetRootPathUnix(const QString& path) |
| 60 | { |
no test coverage detected