* @brief Returns a workspace-relative display path, or the absolute path if outside. */
| 61 | * @brief Returns a workspace-relative display path, or the absolute path if outside. |
| 62 | */ |
| 63 | static QString displayPath(const QString& absolute, const QString& root) |
| 64 | { |
| 65 | if (absolute == root) |
| 66 | return QStringLiteral("."); |
| 67 | |
| 68 | const auto prefix = root + QLatin1Char('/'); |
| 69 | if (absolute.startsWith(prefix)) |
| 70 | return absolute.mid(prefix.size()); |
| 71 | |
| 72 | return absolute; |
| 73 | } |
| 74 | |
| 75 | //-------------------------------------------------------------------------------------------------- |
| 76 | // Roots |
no test coverage detected