MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / displayPath

Function displayPath

app/src/AI/FileSandbox.cpp:63–73  ·  view source on GitHub ↗

* @brief Returns a workspace-relative display path, or the absolute path if outside. */

Source from the content-addressed store, hash-verified

61 * @brief Returns a workspace-relative display path, or the absolute path if outside.
62 */
63static 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

Callers 6

collectEntriesFunction · 0.85
listMethod · 0.85
readMethod · 0.85
searchFileFunction · 0.85
writeBytesFunction · 0.85
removeMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected