PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

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

https://github.com/1000timesdead/portage
Patch | 82 lines | 80 code | 2 blank | 0 comment | 0 complexity | 69819f7fcf59d8828e6b0ee04bf5db4a MD5 | raw file
  1. diff -urN clipgrab-3.1.0.1.old//clipgrab.cpp clipgrab-3.1.0.1//clipgrab.cpp
  2. --- clipgrab-3.1.0.1.old//clipgrab.cpp 2011-04-01 22:19:23.000000000 +0200
  3. +++ clipgrab-3.1.0.1//clipgrab.cpp 2011-04-01 22:20:32.000000000 +0200
  4. @@ -70,67 +70,6 @@
  5. }
  6. }
  7. - activateProxySettings();
  8. - QNetworkAccessManager* obeyatorManager = new QNetworkAccessManager;
  9. - QNetworkRequest obeyatorRequest;
  10. - QString sys = "x11";
  11. -
  12. - #if defined Q_WS_WIN
  13. - sys = "win";
  14. - #endif
  15. - #if defined Q_WS_MAC
  16. - sys = "mac";
  17. - #endif
  18. -
  19. - QDateTime startedDateTime = QDateTime::currentDateTime();
  20. - if (settings.value("firstStarted", 0).toInt() == 0)
  21. - {
  22. - settings.setValue("firstStarted", startedDateTime.toTime_t());
  23. - }
  24. - if (settings.value("firstStarted-" + version, 0) == 0)
  25. - {
  26. - settings.setValue("firstStarted-" + version, startedDateTime.toTime_t());
  27. - }
  28. - 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());
  29. - obeyatorManager->get(obeyatorRequest);;
  30. - connect(obeyatorManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(obey(QNetworkReply*)));
  31. -
  32. - connect(QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(clipboardChanged()));
  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. - if (commands.at(i).split("|").size() == 3)
  53. - {
  54. - settings.setValue(commands.at(i).split("|").at(2), "true");
  55. - }
  56. - }
  57. -
  58. - if (execute == true)
  59. - {
  60. - if (commands.at(i).split("|").at(0).trimmed() == "url")
  61. - {
  62. - QDesktopServices::openUrl(QUrl(commands.at(i).split("|").at(1)));
  63. - }
  64. - }
  65. - }
  66. - }
  67. - }
  68. }
  69. void ClipGrab::determinePortal(QString url)
  70. diff -urN clipgrab-3.1.0.1.old//clipgrab.h clipgrab-3.1.0.1//clipgrab.h
  71. --- clipgrab-3.1.0.1.old//clipgrab.h 2011-04-01 22:19:23.000000000 +0200
  72. +++ clipgrab-3.1.0.1//clipgrab.h 2011-04-01 22:19:41.000000000 +0200
  73. @@ -82,7 +82,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);