comparison settingsdialog.cpp @ 240:53ad43d5a463

* Small tidy
author Chris Cannam
date Mon, 10 Jan 2011 15:23:53 +0000
parents 661f5808aa0a
children 8fd71f570884
comparison
equal deleted inserted replaced
239:661f5808aa0a 240:53ad43d5a463
223 if (hg != "") { 223 if (hg != "") {
224 settings.setValue("hgbinary", hg); 224 settings.setValue("hgbinary", hg);
225 } 225 }
226 } 226 }
227 227
228 QString
229 SettingsDialog::getUnbundledExtensionFileName()
230 {
231 QString home = QDir::homePath();
232 QString target = QString("%1/.easyhg").arg(home);
233 QString extpath = QString("%1/easyhg.py").arg(target);
234 return extpath;
235 }
236
228 void 237 void
229 SettingsDialog::findExtension() 238 SettingsDialog::findExtension()
230 { 239 {
231 QSettings settings; 240 QSettings settings;
232 settings.beginGroup("Locations"); 241 settings.beginGroup("Locations");
233 242
234 QString extpath = settings.value("extensionpath", "").toString(); 243 QString extpath = settings.value("extensionpath", "").toString();
235 if (extpath != "" || !QFile(extpath).exists()) { 244 if (extpath != "" || !QFile(extpath).exists()) {
236 245
237 //!!! bad: this is a dupe with hgrunner 246 extpath = getUnbundledExtensionFileName();
238
239 QString home = QDir::homePath();
240 QString target = QString("%1/.easyhg").arg(home);
241 extpath = QString("%1/easyhg.py").arg(target);
242 247
243 if (!QFile(extpath).exists()) { 248 if (!QFile(extpath).exists()) {
244 extpath = findInPath("easyhg.py", m_installPath, false); 249 extpath = findInPath("easyhg.py", m_installPath, false);
245 } 250 }
246 } 251 }