Fix-compilation-with-Qt-5.13.patch 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. From 69e17dec5add40655cd9334ec7ad4eef13fed8a4 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Jonah=20Br=C3=BCchert?= <jbb.prv@gmx.de>
  3. Date: Wed, 5 Jun 2019 13:28:44 +0200
  4. Subject: [PATCH] Fix compilation with Qt 5.13
  5. ---
  6. src/account-service-model.cpp | 14 ++++++++------
  7. 1 file changed, 8 insertions(+), 6 deletions(-)
  8. diff --git a/src/account-service-model.cpp b/src/account-service-model.cpp
  9. index 45795c5..deb157e 100644
  10. --- a/src/account-service-model.cpp
  11. +++ b/src/account-service-model.cpp
  12. @@ -183,7 +183,7 @@ AccountServiceModelPrivate::addServicesFromAccount(Accounts::Account *account)
  13. newModelItems.append(accountService);
  14. }
  15. - qSort(newModelItems.begin(), newModelItems.end(), sortFunction);
  16. + std::sort(newModelItems.begin(), newModelItems.end(), sortFunction);
  17. addItems(newModelItems);
  18. }
  19. @@ -211,7 +211,7 @@ void AccountServiceModelPrivate::addItems(const AccountServices &added)
  20. foreach (Accounts::AccountService *accountService, added) {
  21. // Find where the item should be inserted
  22. AccountServices::iterator i =
  23. - qLowerBound(modelItems.begin(), modelItems.end(),
  24. + std::lower_bound(modelItems.begin(), modelItems.end(),
  25. accountService, sortFunction);
  26. int index = i - modelItems.begin();
  27. addedIndexes[index]++;
  28. @@ -253,7 +253,7 @@ AccountServiceModelPrivate::removeItems(const AccountServices &removed)
  29. removedIndexes.append(index);
  30. }
  31. // sort the indexes from highest to lower, and start updating the list
  32. - qSort(removedIndexes.begin(), removedIndexes.end(), qGreater<int>());
  33. + std::sort(removedIndexes.begin(), removedIndexes.end(), std::greater<int>());
  34. int first = -1;
  35. int last = -1;
  36. foreach (int index, removedIndexes) {
  37. @@ -281,7 +281,7 @@ AccountServiceModelPrivate::removeItems(const AccountServices &removed)
  38. void AccountServiceModelPrivate::sortItems()
  39. {
  40. - qSort(modelItems.begin(), modelItems.end(), sortFunction);
  41. + std::sort(modelItems.begin(), modelItems.end(), sortFunction);
  42. }
  43. void AccountServiceModelPrivate::update()
  44. @@ -809,7 +809,8 @@ QVariant AccountServiceModel::data(const QModelIndex &index, int role) const
  45. ret = accountService->enabled();
  46. break;
  47. case AccountServiceRole:
  48. - qWarning("accountService role is deprecated, use accountServiceHandle");
  49. + qWarning() << "accountService role is deprecated, use accountServiceHandle";
  50. + /* FALLTHRU */
  51. case AccountServiceHandleRole:
  52. object = accountService;
  53. break;
  54. @@ -817,7 +818,8 @@ QVariant AccountServiceModel::data(const QModelIndex &index, int role) const
  55. ret = accountService->account()->id();
  56. break;
  57. case AccountRole:
  58. - qWarning("account role is deprecated, use accountHandle");
  59. + qWarning() << "account role is deprecated, use accountHandle";
  60. + /* FALLTHRU */
  61. case AccountHandleRole:
  62. object = accountService->account();
  63. break;
  64. --
  65. 2.22.2