Guest User

Untitled

a guest
May 22nd, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.68 KB | None | 0 0
  1. diff --git utils/qapt-batch/qaptbatch.cpp utils/qapt-batch/qaptbatch.cpp
  2. index 2e17504..f3f0737 100644
  3. --- utils/qapt-batch/qaptbatch.cpp
  4. +++ utils/qapt-batch/qaptbatch.cpp
  5. @@ -262,7 +262,7 @@ void QAptBatch::questionOccurred(int code, const QVariantMap &args)
  6.              KMessageBox::information(this, text, title);
  7.              response["MediaChanged"] = true;
  8.              m_worker->answerWorkerQuestion(response);
  9. -        }
  10. +        }   break;
  11.          case QApt::InstallUntrusted: {
  12.              QStringList untrustedItems = args["UntrustedItems"].toStringList();
  13.  
  14. @@ -277,19 +277,10 @@ void QAptBatch::questionOccurred(int code, const QVariantMap &args)
  15.                          "security risk, as the presence of unverifiable software "
  16.                          "can be a sign of tampering.</warning> Do you wish to continue?",
  17.                          untrustedItems.size());
  18. -            int result = KMessageBox::Cancel;
  19. -            bool installUntrusted = false;
  20. -
  21. -            result = KMessageBox::warningContinueCancelList(this, text,
  22. +            int result = KMessageBox::warningContinueCancelList(this, text,
  23.                                                              untrustedItems, title);
  24. -            switch (result) {
  25. -                case KMessageBox::Continue:
  26. -                    installUntrusted = true;
  27. -                    break;
  28. -                case KMessageBox::Cancel:
  29. -                    installUntrusted = false;
  30. -                    break;
  31. -            }
  32. +            
  33. +            bool installUntrusted = result==KMessageBox::Continue;
  34.  
  35.              response["InstallUntrusted"] = installUntrusted;
  36.              m_worker->answerWorkerQuestion(response);
  37. @@ -321,14 +312,14 @@ void QAptBatch::workerEvent(int code)
  38.              break;
  39.          case QApt::CacheUpdateFinished:
  40.              setWindowTitle(i18nc("@title:window", "Refresh Complete"));
  41. -            if (m_warningStack.size() > 0) {
  42. +            if (!m_warningStack.isEmpty()) {
  43.                  showQueuedWarnings();
  44.              }
  45. -            if (m_errorStack.size() > 0) {
  46. +            if (!m_errorStack.isEmpty()) {
  47.                  showQueuedErrors();
  48.              }
  49.  
  50. -            if (m_errorStack.size() > 0) {
  51. +            if (!m_errorStack.isEmpty()) {
  52.                  setLabelText(i18nc("@info:status", "Refresh completed with errors"));
  53.              } else {
  54.                  setLabelText(i18nc("@label", "Package information successfully refreshed"));
  55. @@ -362,16 +353,16 @@ void QAptBatch::workerEvent(int code)
  56.              show(); // In case no download was necessary
  57.              break;
  58.          case QApt::CommitChangesFinished:
  59. -            if (m_warningStack.size() > 0) {
  60. +            if (!m_warningStack.isEmpty()) {
  61.                  showQueuedWarnings();
  62.              }
  63. -            if (m_errorStack.size() > 0) {
  64. +            if (!m_errorStack.isEmpty()) {
  65.                  showQueuedErrors();
  66.              }
  67.              if (m_mode == "install") {
  68.                  setWindowTitle(i18nc("@title:window", "Installation Complete"));
  69.  
  70. -                if (m_errorStack.size() > 0) {
  71. +                if (!m_errorStack.isEmpty()) {
  72.                      setLabelText(i18nc("@label",
  73.                                         "Package installation finished with errors."));
  74.                  } else {
  75. @@ -382,7 +373,7 @@ void QAptBatch::workerEvent(int code)
  76.              } else if (m_mode == "uninstall") {
  77.                  setWindowTitle(i18nc("@title:window", "Removal Complete"));
  78.  
  79. -                if (m_errorStack.size() > 0) {
  80. +                if (!m_errorStack.isEmpty()) {
  81.                      setLabelText(i18nc("@label",
  82.                                         "Package removal finished with errors."));
  83.                  } else {
Add Comment
Please, Sign In to add comment