Utils: Add some description of FilePath::onDevice

Change-Id: I92f2a9b387b026e128b5a733211aec0d9c443d4f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2021-04-27 15:08:03 +02:00
parent 43636e3cb3
commit 7f61347757

View File

@@ -1195,6 +1195,18 @@ QString FilePath::calcRelativePath(const QString &absolutePath, const QString &a
return relativePath;
}
/*!
Returns a path corresponding to the current object on the
same device as \a deviceTemplate.
Example usage:
\code
localDir = FilePath::fromString("/tmp/workingdir");
executable = FilePath::fromUrl("docker://123/bin/ls")
realDir = localDir.onDevice(executable)
assert(realDir == FilePath::fromUrl("docker://123/tmp/workingdir"))
\endcode
*/
FilePath FilePath::onDevice(const FilePath &deviceTemplate) const
{
FilePath res = *this;