comparison src/hgrunner.cpp @ 406:c567fed39559

Add ability to configure the ssh client; default to TortoisePlink on Windows
author Chris Cannam <chris.cannam@eecs.qmul.ac.uk>
date Thu, 26 May 2011 15:48:11 +0100
parents 5cc0d897eb26
children b45e6cd9f1d4
comparison
equal deleted inserted replaced
405:46267ab70ef3 406:c567fed39559
156 QString HgRunner::getHgBinaryName() 156 QString HgRunner::getHgBinaryName()
157 { 157 {
158 QSettings settings; 158 QSettings settings;
159 settings.beginGroup("Locations"); 159 settings.beginGroup("Locations");
160 return settings.value("hgbinary", "").toString(); 160 return settings.value("hgbinary", "").toString();
161 }
162
163 QString HgRunner::getSshBinaryName()
164 {
165 QSettings settings;
166 settings.beginGroup("Locations");
167 return settings.value("sshbinary", "").toString();
161 } 168 }
162 169
163 QString HgRunner::getExtensionLocation() 170 QString HgRunner::getExtensionLocation()
164 { 171 {
165 QSettings settings; 172 QSettings settings;
395 settings.beginGroup("General"); 402 settings.beginGroup("General");
396 403
397 if (executable == "") { 404 if (executable == "") {
398 // This is a Hg command 405 // This is a Hg command
399 executable = getHgBinaryName(); 406 executable = getHgBinaryName();
407 if (executable == "") executable = "hg";
408
409 QString ssh = getSshBinaryName();
410 if (ssh != "") {
411 params.push_front(QString("ui.ssh=\"%1\"").arg(ssh));
412 params.push_front("--config");
413 }
400 414
401 if (action.mayBeInteractive()) { 415 if (action.mayBeInteractive()) {
402 params.push_front("ui.interactive=true"); 416 params.push_front("ui.interactive=true");
403 params.push_front("--config"); 417 params.push_front("--config");
404 418
405 if (settings.value("useextension", true).toBool()) { 419 if (settings.value("useextension", true).toBool()) {
406 QString extpath = getExtensionLocation(); 420 QString extpath = getExtensionLocation();
407 params.push_front(QString("extensions.easyhg=%1").arg(extpath)); 421 params.push_front(QString("extensions.easyhg=\"%1\"").arg(extpath));
408 params.push_front("--config"); 422 params.push_front("--config");
409 } 423 }
410 interactive = true; 424 interactive = true;
411 } 425 }
412 426