Mercurial > hg > easyhg
comparison mainwindow.cpp @ 195:ff0d76dcb3b8
* Don't close proc input on finished() -- causes crash on program failure on Windows
* Use merge binary from settings, even if empty -- sometimes user may wish to set an empty string to avoid having an external merge program
* Revert labels to line edits in settings dialog, for a similar reason (permit setting empty value)
* Avoid showing hard hyphens on Windows, they don't look right
* Use preformatted text for merge outcome dialog (but format3 would be better)
author | Chris Cannam |
---|---|
date | Fri, 24 Dec 2010 13:14:45 +0000 |
parents | 5ca49523892f |
children | dbc8d97caaf4 |
comparison
equal
deleted
inserted
replaced
194:5ca49523892f | 195:ff0d76dcb3b8 |
---|---|
439 | 439 |
440 QString MainWindow::findMergeBinaryName() | 440 QString MainWindow::findMergeBinaryName() |
441 { | 441 { |
442 QSettings settings; | 442 QSettings settings; |
443 settings.beginGroup("Locations"); | 443 settings.beginGroup("Locations"); |
444 QString merge = settings.value("mergebinary", "").toString(); | 444 QVariant v = settings.value("mergebinary"); |
445 if (merge == "") { | 445 if (v != QVariant()) { |
446 QStringList bases; | 446 return v.toString(); // even if empty: user may have specified no external tool |
447 bases << "fmdiff3" << "meld" << "diffuse" << "kdiff3"; | 447 } |
448 bool found = false; | 448 QString merge; |
449 foreach (QString base, bases) { | 449 QStringList bases; |
450 merge = findInPath(base, m_myDirPath, true); | 450 bases << "fmdiff3" << "meld" << "diffuse" << "kdiff3"; |
451 if (merge != base) { | 451 bool found = false; |
452 found = true; | 452 foreach (QString base, bases) { |
453 break; | 453 merge = findInPath(base, m_myDirPath, true); |
454 } | 454 if (merge != base && merge != base + ".exe") { |
455 } | 455 found = true; |
456 if (found) { | 456 break; |
457 settings.setValue("mergebinary", merge); | 457 } |
458 } else { | 458 } |
459 merge = ""; | 459 if (found) { |
460 } | 460 settings.setValue("mergebinary", merge); |
461 } else { | |
462 merge = ""; | |
461 } | 463 } |
462 return merge; | 464 return merge; |
463 } | 465 } |
464 | 466 |
465 QString MainWindow::findEditorBinaryName() | 467 QString MainWindow::findEditorBinaryName() |