comparison mainwindow.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 4c5993d860f3
children cb8ccbff8f84 05255f23f2af
comparison
equal deleted inserted replaced
212:4c5993d860f3 213:90e70a9024f3
510 #endif 510 #endif
511 bases << "kompare" << "kdiff3" << "meld"; 511 bases << "kompare" << "kdiff3" << "meld";
512 bool found = false; 512 bool found = false;
513 foreach (QString base, bases) { 513 foreach (QString base, bases) {
514 diff = findInPath(base, m_myDirPath, true); 514 diff = findInPath(base, m_myDirPath, true);
515 if (diff != base && diff != base + ".exe") { 515 if (diff != "") {
516 found = true; 516 found = true;
517 break; 517 break;
518 } 518 }
519 } 519 }
520 if (found) { 520 if (found) {
541 #endif 541 #endif
542 bases << "meld" << "diffuse" << "kdiff3"; 542 bases << "meld" << "diffuse" << "kdiff3";
543 bool found = false; 543 bool found = false;
544 foreach (QString base, bases) { 544 foreach (QString base, bases) {
545 merge = findInPath(base, m_myDirPath, true); 545 merge = findInPath(base, m_myDirPath, true);
546 if (merge != base && merge != base + ".exe") { 546 if (merge != "") {
547 found = true; 547 found = true;
548 break; 548 break;
549 } 549 }
550 } 550 }
551 if (found) { 551 if (found) {
575 #endif 575 #endif
576 ; 576 ;
577 bool found = false; 577 bool found = false;
578 foreach (QString base, bases) { 578 foreach (QString base, bases) {
579 editor = findInPath(base, m_myDirPath, true); 579 editor = findInPath(base, m_myDirPath, true);
580 if (editor != base && editor != base + ".exe") { 580 if (editor != "") {
581 found = true; 581 found = true;
582 break; 582 break;
583 } 583 }
584 } 584 }
585 if (found) { 585 if (found) {