Skip to content

Commit f540a51

Browse files
author
Anton Krug
committed
${eclipse_home} macro can be used in binary path
1 parent 51c3428 commit f540a51

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

com.googlecode.cppcheclipse.core/src/com/googlecode/cppcheclipse/core/Checker.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public Checker(IConsole console, IPreferenceStore projectPreferences,
7474
}
7575

7676
String binaryPath = CppcheclipsePlugin.getConfigurationPreferenceStore()
77-
.getString(IPreferenceConstants.P_BINARY_PATH);
77+
.getString(IPreferenceConstants.P_BINARY_PATH)
78+
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));
7879

7980
command = new CppcheckCommand(console, binaryPath, settingsPreferences,
8081
projectPreferences, toolchainSettings.getUserIncludes(), toolchainSettings.getSystemIncludes(), symbols);

com.googlecode.cppcheclipse.core/src/com/googlecode/cppcheclipse/core/CppcheclipsePlugin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ public boolean removeChangeListener(IPropertyChangeListener listener) {
157157
private synchronized ProblemProfile getInternalNewProblemProfile(IConsole console, IPreferenceStore store) throws CloneNotSupportedException, XPathExpressionException, IOException, InterruptedException, ParserConfigurationException, SAXException, ProcessExecutionException {
158158
if (profile == null) {
159159
String binaryPath = CppcheclipsePlugin.getConfigurationPreferenceStore()
160-
.getString(IPreferenceConstants.P_BINARY_PATH);
160+
.getString(IPreferenceConstants.P_BINARY_PATH)
161+
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));
161162
profile = new ProblemProfile(console, binaryPath);
162163
registerChangeListener();
163164
addChangeListener(profile);

com.googlecode.cppcheclipse.ui/src/com/googlecode/cppcheclipse/ui/UpdateCheck.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ public static boolean startUpdateCheck() {
9494
// do not start another update check, if one is already running
9595
if (UpdateCheck.needUpdateCheck()) {
9696
String binaryPath = CppcheclipsePlugin.getConfigurationPreferenceStore()
97-
.getString(IPreferenceConstants.P_BINARY_PATH);
97+
.getString(IPreferenceConstants.P_BINARY_PATH)
98+
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));
9899
new UpdateCheck(true).check(binaryPath);
99100
return true;
100101
}

com.googlecode.cppcheclipse.ui/src/com/googlecode/cppcheclipse/ui/preferences/BinaryPathPreferencePage.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ protected boolean checkState() {
116116
if (super.checkState()) {
117117
// check if it is valid cppcheck binary
118118
try {
119-
String path = getTextControl().getText();
119+
String path = getTextControl().getText()
120+
.replace("${eclipse_home}", System.getProperty("eclipse.home.location").replace("file:/", ""));
121+
120122
VersionCommand versionCommand = new VersionCommand(
121123
Console.getInstance(), path);
122124
Version version = versionCommand

0 commit comments

Comments
 (0)