PageRenderTime 77ms CodeModel.GetById 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

https://gitlab.com/rindeal/gentoo-cvs-history-archive
Patch | 85 lines | 81 code | 4 blank | 0 comment | 0 complexity | f4af8c4b95d43da00cfe06be69263c0a MD5 | raw file
  1. --- clipgrab-3.2.1.0/clipgrab.cpp
  2. +++ clipgrab-3.2.1.0/clipgrab.cpp
  3. @@ -128,71 +128,10 @@
  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. -void ClipGrab::obey(QNetworkReply* reply)
  34. -{
  35. - if (reply->bytesAvailable())
  36. - {
  37. - QStringList commands = QString(reply->readAll()).split("\n");
  38. - qDebug() << commands;
  39. - for (int i = 0; i < commands.size(); ++i)
  40. - {
  41. - QStringList command = commands.at(i).split("|");
  42. - if (!command.isEmpty())
  43. - {
  44. - if (command.at(0) == "url")
  45. - {
  46. - if (command.size() == 2 || (command.size() == 3 && settings.value(command.at(2)).toString() != "true"))
  47. - {
  48. - if (!(command.at(1).contains("update") && this->settings.value("DisableUpdateNotifications", false) == true))
  49. - {
  50. - QDesktopServices::openUrl(QUrl(command.at(1)));
  51. - }
  52. - if (command.size() == 3)
  53. - {
  54. - settings.setValue(command.at(2), "true");
  55. - }
  56. - }
  57. - }
  58. - else if (command.at(0) == "set" && command.size() == 3)
  59. - {
  60. - settings.setValue(command.at(1), command.at(2));
  61. - }
  62. - }
  63. - }
  64. - }
  65. - else {qDebug() << "nothing";
  66. - }
  67. -}
  68. -
  69. void ClipGrab::determinePortal(QString url)
  70. {
  71. diff -ru clipgrab-3.2.1.0.orig/clipgrab.h clipgrab-3.2.1.0/clipgrab.h
  72. --- clipgrab-3.2.1.0.orig/clipgrab.h 2013-06-20 17:01:28.000000000 +0200
  73. +++ clipgrab-3.2.1.0/clipgrab.h 2013-06-23 17:57:14.187000000 +0200
  74. @@ -92,7 +92,6 @@
  75. void errorHandler(QString);
  76. void errorHandler(QString, video*);
  77. void addDownload(video* clip);
  78. - void obey(QNetworkReply* reply);
  79. void cancelDownload(int item);
  80. void clipboardChanged();
  81. void pauseDownload(int);