forked from qt-creator/qt-creator
Utils: Introduce a helper function to prepend or set paths
This is meant for cases where we get a raw ':'/';' separated list of directories. Change-Id: I9ef8888f71700d553213949a867f62dec763054c Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -149,6 +149,11 @@ void Environment::prependOrSetPath(const FilePath &value)
|
||||
prependOrSet("PATH", value.nativePath(), OsSpecificAspects::pathListSeparator(osType()));
|
||||
}
|
||||
|
||||
void Environment::prependOrSetPath(const QString &directories)
|
||||
{
|
||||
prependOrSet("PATH", directories, OsSpecificAspects::pathListSeparator(osType()));
|
||||
}
|
||||
|
||||
void Environment::appendOrSet(const QString &key, const QString &value, const QString &sep)
|
||||
{
|
||||
addItem(Item{std::in_place_index_t<AppendOrSet>(), key, value, sep});
|
||||
|
@@ -48,6 +48,7 @@ public:
|
||||
|
||||
void appendOrSetPath(const FilePath &value);
|
||||
void prependOrSetPath(const FilePath &value);
|
||||
void prependOrSetPath(const QString &directories); // Could be several ':'/';' separated entries.
|
||||
|
||||
void prependOrSetLibrarySearchPath(const FilePath &value);
|
||||
void prependOrSetLibrarySearchPaths(const FilePaths &values);
|
||||
|
Reference in New Issue
Block a user