comparison hgrunner.cpp @ 213:90e70a9024f3

* Make findInPath return empty string if not found -- previous hopelessly fragile behaviour failed in situations where it was called with an absolute path
author Chris Cannam
date Wed, 05 Jan 2011 16:08:37 +0000
parents c5fceb3fe5b4
children e2f2c6e3c01b
comparison
equal deleted inserted replaced
212:4c5993d860f3 213:90e70a9024f3
81 if (extpath != "" && QFile(extpath).exists()) return extpath; 81 if (extpath != "" && QFile(extpath).exists()) return extpath;
82 82
83 extpath = unbundled; 83 extpath = unbundled;
84 if (extpath == "") { 84 if (extpath == "") {
85 extpath = findInPath("easyhg.py", m_myDirPath, false); 85 extpath = findInPath("easyhg.py", m_myDirPath, false);
86 if (extpath == "easyhg.py") {
87 extpath = "";
88 }
89 } 86 }
90 87
91 settings.setValue("extensionpath", extpath); 88 settings.setValue("extensionpath", extpath);
92 return extpath; 89 return extpath;
93 } 90 }
184 settings.beginGroup("Locations"); 181 settings.beginGroup("Locations");
185 QString hg = settings.value("hgbinary", "").toString(); 182 QString hg = settings.value("hgbinary", "").toString();
186 if (hg == "") { 183 if (hg == "") {
187 hg = findInPath("hg", m_myDirPath, true); 184 hg = findInPath("hg", m_myDirPath, true);
188 } 185 }
189 if (hg != "hg") { 186 if (hg != "") {
190 settings.setValue("hgbinary", hg); 187 settings.setValue("hgbinary", hg);
191 } 188 }
192 return hg; 189 return hg;
193 } 190 }
194 191