forked from qt-creator/qt-creator
Utils/ProjectExplorer: Add IDevice::searchInPath
Change-Id: Ibc7cc7bd6bf3a7776681f7cd2fff051525b19f60 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
#include "algorithm.h"
|
||||
#include "commandline.h"
|
||||
#include "environment.h"
|
||||
#include "qtcassert.h"
|
||||
|
||||
#include <QDataStream>
|
||||
@@ -1277,6 +1278,26 @@ FilePath FilePath::onDevice(const FilePath &deviceTemplate) const
|
||||
return res;
|
||||
}
|
||||
|
||||
/*!
|
||||
Searched a binary corresponding to this object in the PATH of
|
||||
the device implied by this object's scheme and host.
|
||||
|
||||
Example usage:
|
||||
\code
|
||||
binary = FilePath::fromUrl("docker://123/./make);
|
||||
fullPath = binary.onDeviceSearchInPath();
|
||||
assert(fullPath == FilePath::fromUrl("docker://123/usr/bin/make"))
|
||||
\endcode
|
||||
*/
|
||||
FilePath FilePath::onDeviceSearchInPath() const
|
||||
{
|
||||
if (needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.searchInPath, return {});
|
||||
return s_deviceHooks.searchInPath(*this);
|
||||
}
|
||||
return Environment::systemEnvironment().searchInPath(path());
|
||||
}
|
||||
|
||||
FilePath FilePath::pathAppended(const QString &path) const
|
||||
{
|
||||
FilePath fn = *this;
|
||||
|
||||
Reference in New Issue
Block a user