Core: Add more HostOS related information to MacroExpander

* Add HostOS:PathListSeparator
* Add HostOS:ExecutableSuffix

Both should be useful e.g. for External Tools.

Change-Id: I2a807b189eb2ace5ac093e50ff406ebcd3e497a1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Tobias Hunger
2018-05-29 11:32:52 +02:00
parent 449a749dd7
commit 7ad738d236

View File

@@ -187,6 +187,12 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
tr("Is %1 running on any unix-based platform?") tr("Is %1 running on any unix-based platform?")
.arg(Constants::IDE_DISPLAY_NAME), .arg(Constants::IDE_DISPLAY_NAME),
[]() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); }); []() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); });
expander->registerVariable("HostOs:PathListSeparator",
tr("Return the path list separator for the platform."),
[]() { return QString(Utils::HostOsInfo::pathListSeparator()); });
expander->registerVariable("HostOs:ExecutableSuffix",
tr("Return the platform executable suffix."),
[]() { return QString(Utils::HostOsInfo::withExecutableSuffix("")); });
expander->registerVariable("IDE:ResourcePath", expander->registerVariable("IDE:ResourcePath",
tr("The directory where %1 finds its pre-installed resources.") tr("The directory where %1 finds its pre-installed resources.")
.arg(Constants::IDE_DISPLAY_NAME), .arg(Constants::IDE_DISPLAY_NAME),