PageRenderTime 50ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/net-misc/clipgrab/files/clipgrab-3.2.0.10-obey.patch

https://gitlab.com/rindeal/gentoo-cvs-history-archive
Patch | 82 lines | 80 code | 2 blank | 0 comment | 0 complexity | 9887ec0a110f6eacc5765d6ded6538c8 MD5 | raw file
  1. --- clipgrab-3.2.0.10/clipgrab.cpp
  2. +++ clipgrab-3.2.0.10/clipgrab.cpp
  3. @@ -116,69 +116,7 @@
  4. }
  5. }
  6. - activateProxySettings();
  7. - QNetworkAccessManager* obeyatorManager = new QNetworkAccessManager;
  8. - QNetworkRequest obeyatorRequest;
  9. - QString sys = "x11";
  10. -
  11. - #if defined Q_WS_WIN
  12. - sys = "win";
  13. - #endif
  14. - #if defined Q_WS_MAC
  15. - sys = "mac";
  16. - #endif
  17. -
  18. - QDateTime startedDateTime = QDateTime::currentDateTime();
  19. - if (settings.value("firstStarted", 0).toInt() == 0)
  20. - {
  21. - settings.setValue("firstStarted", startedDateTime.toTime_t());
  22. - }
  23. - if (settings.value("firstStarted-" + version, 0) == 0)
  24. - {
  25. - settings.setValue("firstStarted-" + version, startedDateTime.toTime_t());
  26. - }
  27. - obeyatorRequest.setUrl("http://clipgrab.de/or.php?version=" + version +"&lang="+QLocale::system().name().split("_")[0]+"&sys="+sys+"&current=" + settings.value("firstStarted-" + version, startedDateTime.toTime_t()).toString()+"&first="+settings.value("firstStarted", startedDateTime.toTime_t()).toString());
  28. - obeyatorManager->get(obeyatorRequest);;
  29. - connect(obeyatorManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(obey(QNetworkReply*)));
  30. -
  31. connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardChanged()));
  32. -
  33. -}
  34. -
  35. -void ClipGrab::obey(QNetworkReply* reply)
  36. -{
  37. - bool execute = false;
  38. - if (reply->bytesAvailable())
  39. - {
  40. - QStringList commands = QString(reply->readAll()).split("\n");
  41. - for (int i = 0; i < commands.size(); ++i)
  42. - {
  43. - if (commands.at(i).split("|").size() > 0)
  44. - {
  45. - if (commands.at(i).split("|").size() == 3 && settings.value(commands.at(i).split("|").at(2)) == "true")
  46. - {
  47. - execute = false;
  48. - }
  49. - else
  50. - {
  51. - execute = true;
  52. - qDebug() << commands.at(i).split("|").size();
  53. - if (commands.at(i).split("|").size() == 3)
  54. - {
  55. - settings.setValue(commands.at(i).split("|").at(2), "true");
  56. - }
  57. - }
  58. -
  59. - if (execute == true)
  60. - {
  61. - if (commands.at(i).split("|").at(0).trimmed() == "url")
  62. - {
  63. - QDesktopServices::openUrl(QUrl(commands.at(i).split("|").at(1)));
  64. - }
  65. - }
  66. - }
  67. - }
  68. - }
  69. }
  70. void ClipGrab::determinePortal(QString url)
  71. --- clipgrab-3.2.0.10/clipgrab.h
  72. +++ clipgrab-3.2.0.10/clipgrab.h
  73. @@ -92,7 +92,6 @@
  74. void errorHandler(QString);
  75. void errorHandler(QString, video*);
  76. void addDownload(video* clip);
  77. - void obey(QNetworkReply* reply);
  78. void cancelDownload(int item);
  79. void clipboardChanged();
  80. void pauseDownload(int);