comparison installer.cpp @ 83:66a22cdbb50c

Don't show completed dialog when installation was cancelled!
author Chris Cannam
date Wed, 19 Feb 2020 17:32:20 +0000
parents 11661e61fed0
children e77bcf5caedd
comparison
equal deleted inserted replaced
82:11661e61fed0 83:66a22cdbb50c
908 auto info = getLibraryInfo(*rdfStore, libraries); 908 auto info = getLibraryInfo(*rdfStore, libraries);
909 909
910 vector<LibraryInfo> toInstall = 910 vector<LibraryInfo> toInstall =
911 getUserApprovedPluginLibraries(info, target); 911 getUserApprovedPluginLibraries(info, target);
912 912
913 if (!toInstall.empty()) { 913 if (toInstall.empty()) { // Cancelled, or nothing selected
914 if (!QDir(target).exists()) { 914 return 0;
915 QDir().mkpath(target); 915 }
916 } 916
917 if (!QDir(target).exists()) {
918 QDir().mkpath(target);
917 } 919 }
918 920
919 QProgressDialog progress(QObject::tr("Installing..."), 921 QProgressDialog progress(QObject::tr("Installing..."),
920 QObject::tr("Stop"), 0, toInstall.size() + 1); 922 QObject::tr("Stop"), 0, toInstall.size() + 1);
921 progress.setMinimumDuration(0); 923 progress.setMinimumDuration(0);
964 QObject::tr("Installation was not complete. Exiting"), 966 QObject::tr("Installation was not complete. Exiting"),
965 QMessageBox::Ok, 967 QMessageBox::Ok,
966 QMessageBox::Ok); 968 QMessageBox::Ok);
967 } 969 }
968 970
969 return 0; 971 return (complete ? 0 : 2);
970 } 972 }