| 90 | } |
| 91 | |
| 92 | QString GetParentPathUnix(const QString& path) |
| 93 | { |
| 94 | if (path == "/") |
| 95 | return path; |
| 96 | |
| 97 | QString parentPath = path; |
| 98 | if (!parentPath.endsWith('/')) |
| 99 | parentPath += '/'; |
| 100 | |
| 101 | if (parentPath.count('/') == 2) |
| 102 | return "/"; |
| 103 | |
| 104 | int lastBackslashIndex = parentPath.lastIndexOf('/'); |
| 105 | int secondLastBackslashIndex = parentPath.lastIndexOf('/', lastBackslashIndex - 1); |
| 106 | |
| 107 | if (secondLastBackslashIndex != -1) |
| 108 | return parentPath.left(secondLastBackslashIndex); |
| 109 | |
| 110 | return path; |
| 111 | } |
| 112 | |
| 113 | QIcon GetFileSystemIcon(int type, bool used) |
| 114 | { |
no test coverage detected