aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2017-01-09 11:27:47 +0100
committerKarsten Heimrich <karsten.heimrich@qt.io>2017-01-09 11:08:54 +0000
commit5ac441634c20f1c775e586aa32f79db1d69d9f88 (patch)
tree5c1d01ff167b16220badf495c758dde7e7158da4
parent12d6dfe3f9e0f9ad5b9db488e5d2e7399132173b (diff)
Reuse the already existing fullPath variable
Change-Id: Ibcaa841b3daabcd7512104622775bebe256ae721 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/qtprojectlib/QtProject.cs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qtprojectlib/QtProject.cs b/src/qtprojectlib/QtProject.cs
index 78388c19..6f9ccb1d 100644
--- a/src/qtprojectlib/QtProject.cs
+++ b/src/qtprojectlib/QtProject.cs
@@ -943,15 +943,16 @@ namespace QtProjectLib
public bool IsMoccedFileIncluded(VCFile vcFile)
{
var fullPath = vcFile.FullPath;
- if (HelperFunctions.IsHeaderFile(vcFile.FullPath))
- fullPath = Path.ChangeExtension(vcFile.FullPath, ".cpp");
+ if (HelperFunctions.IsHeaderFile(fullPath))
+ fullPath = Path.ChangeExtension(fullPath, ".cpp");
if (HelperFunctions.IsSourceFile(fullPath)) {
vcFile = GetFileFromProject(fullPath);
if (vcFile == null)
return false;
- var mocFile = "moc_" + Path.GetFileNameWithoutExtension(vcFile.FullPath) + ".cpp";
+ fullPath = vcFile.FullPath;
+ var mocFile = "moc_" + Path.GetFileNameWithoutExtension(fullPath) + ".cpp";
#if TODO
// TODO: Newly created projects need a manual solution rescan if we access the
@@ -975,7 +976,7 @@ namespace QtProjectLib
CxxStreamReader cxxStream = null;
try {
var line = string.Empty;
- cxxStream = new CxxStreamReader(vcFile.FullPath);
+ cxxStream = new CxxStreamReader(fullPath);
while ((line = cxxStream.ReadLine()) != null) {
if (Regex.IsMatch(line, "#include *(<|\")" + mocFile + "(\"|>)"))
return true;