commit 4586c9188a8693e9e60803a102d5f92b89ffecea
Author: Martin Gansser <mgansser(a)online.de>
Date: Mon May 13 14:53:52 2019 +0200
Update to 3.8.3
.gitignore | 1 +
clipgrab-qt5-3.7.2.patch | 650 +++++++++++++++++++++++++++++++++++++++++++++++
clipgrab.spec | 13 +-
sources | 2 +-
4 files changed, 662 insertions(+), 4 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 96bf503..860a435 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,3 +13,4 @@ clipgrab-3.5.5.tar.gz
/clipgrab-3.8.0.tar.gz
/clipgrab-3.8.1.tar.gz
/clipgrab-3.8.2.tar.gz
+/clipgrab-3.8.3.tar.gz
diff --git a/clipgrab-qt5-3.7.2.patch b/clipgrab-qt5-3.7.2.patch
new file mode 100644
index 0000000..0127eba
--- /dev/null
+++ b/clipgrab-qt5-3.7.2.patch
@@ -0,0 +1,650 @@
+diff -Naur -x '.git*' clipgrab-main/clipgrab.cpp clipgrab-qt5/clipgrab.cpp
+--- clipgrab-main/clipgrab.cpp 2018-10-10 11:45:58.383957000 +0200
++++ clipgrab-qt5/clipgrab.cpp 2018-11-20 16:24:03.108664000 +0100
+@@ -23,6 +23,13 @@
+
+ #include "clipgrab.h"
+
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
++#include <QMessageBox>
++#else
++#include <QtWidgets/QMessageBox>
++#include <QUrlQuery>
++#endif
++
+ ClipGrab::ClipGrab()
+ {
+ //*
+@@ -286,16 +293,25 @@
+
+ QString firstStarted = settings.value("firstStarted",
"").toString();
+
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QUrl
updateInfoRequestUrl("https://clipgrab.org/update/" + sys +
"/");
++#else
++ QUrlQuery
updateInfoRequestUrl("https://clipgrab.org/update/" + sys +
"/");
++#endif
+ updateInfoRequestUrl.addQueryItem("v", this->version);
+ updateInfoRequestUrl.addQueryItem("l",
QLocale::system().name().split("_")[0]);
+ if (!firstStarted.isEmpty())
+ {
+ updateInfoRequestUrl.addQueryItem("t", firstStarted);
+ }
+-
+ QNetworkRequest updateInfoRequest;
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ updateInfoRequest.setUrl(updateInfoRequestUrl);
++#else
++ QUrl url;
++ url.setQuery(updateInfoRequestUrl);
++ updateInfoRequest.setUrl(url);
++#endif
+ QNetworkAccessManager* updateInfoNAM = new QNetworkAccessManager;
+ updateInfoNAM->get(updateInfoRequest);
+ connect(updateInfoNAM, SIGNAL(finished(QNetworkReply*)), this,
SLOT(parseUpdateInfo(QNetworkReply*)));
+diff -Naur -x '.git*' clipgrab-main/clipgrab.h clipgrab-qt5/clipgrab.h
+--- clipgrab-main/clipgrab.h 2018-10-10 11:45:58.384140000 +0200
++++ clipgrab-qt5/clipgrab.h 2018-11-20 16:24:03.108854000 +0100
+@@ -29,6 +29,10 @@
+ #include <QtXml>
+ #include <QtDebug>
+
++#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
++#include <QtWidgets/QSystemTrayIcon>
++#endif
++
+ #include "video.h"
+ #include "video_youtube.h"
+ #include "video_vimeo.h"
+diff -Naur -x '.git*' clipgrab-main/clipgrab.pro clipgrab-qt5/clipgrab.pro
+--- clipgrab-main/clipgrab.pro 2018-11-20 16:24:54.613391000 +0100
++++ clipgrab-qt5/clipgrab.pro 2018-11-20 16:24:03.109025000 +0100
+@@ -1,16 +1,24 @@
+ # #####################################################################
+ # Automatically generated by qmake (2.01a) Mo 26. Okt 18:26:00 2009
+ # #####################################################################
++CONFIG += debug_and_release
+ TEMPLATE = app
+-TARGET = clipgrab
+-DEPENDPATH += . \
+- release
+-INCLUDEPATH += .
++QT += core
++QT += gui
+ QT += network
+-QT += webkit
+ QT += xml
+-
++lessThan(QT_MAJOR_VERSION, 5) {
++ QT += webkit
++} else {
++ QT += webkitwidgets
++}
++INCLUDEPATH += .
+ # Input
++FORMS += mainwindow.ui \
++ metadata-dialog.ui \
++ update_message.ui \
++ message_dialog.ui \
++ login_dialog.ui
+ HEADERS += clipgrab.h \
+ converter.h \
+ converter_copy.h \
+@@ -26,11 +34,6 @@
+ http_handler.h \
+ notifications.h \
+ message_dialog.h
+-FORMS += mainwindow.ui \
+- metadata-dialog.ui \
+- update_message.ui \
+- message_dialog.ui \
+- login_dialog.ui
+ SOURCES += clipgrab.cpp \
+ converter.cpp \
+ converter_copy.cpp \
+@@ -79,6 +82,7 @@
+ clipgrab_vi.ts \
+ clipgrab_zh.ts \
+ clipgrab_strings.ts
++TARGET = clipgrab
+ CODECFORTR = UTF-8
+ win32:RC_FILE = windows_icon.rc
+ macx {
+diff -Naur -x '.git*' clipgrab-main/http_handler.cpp
clipgrab-qt5/http_handler.cpp
+--- clipgrab-main/http_handler.cpp 2018-10-10 11:45:58.384600000 +0200
++++ clipgrab-qt5/http_handler.cpp 2018-11-20 16:24:03.109299000 +0100
+@@ -45,14 +45,22 @@
+ QNetworkReply* http_handler::addDownload(QString url, bool chunked, QByteArray postData,
QStringList segments)
+ {
+ download* newDownload = new download;
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QNetworkRequest request = createRequest(QUrl::fromEncoded(url.toAscii()));
++#else
++ QNetworkRequest request = createRequest(QUrl::fromEncoded(url.toLatin1()));
++#endif
+ newDownload->tempFile = new QTemporaryFile(QDir::tempPath() +
"/clipgrab-download-XXXXXX");
+ newDownload->size = 0;
+ newDownload->redirectLevel = 0;
+ newDownload->chunked = chunked;
+ if (newDownload->chunked)
+ {
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ request.setRawHeader("Range",
QString("bytes=0-1397760").toAscii());
++#else
++ request.setRawHeader("Range",
QString("bytes=0-1397760").toLatin1());
++#endif
+ }
+ if (!segments.isEmpty())
+ {
+@@ -121,7 +129,11 @@
+ //If more parts need to be downloaded
+ else
+ {
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ request.setRawHeader("Range", QString("bytes=" +
QString::number(dl->getProgress()) + "-" +
QString::number(targetBytes)).toAscii());
++#else
++ request.setRawHeader("Range", QString("bytes=" +
QString::number(dl->getProgress()) + "-" +
QString::number(targetBytes)).toLatin1());
++#endif
+ }
+ }
+
+@@ -133,7 +145,11 @@
+ dl->currentProgress = 0;
+ dl->redirectLevel = 0;
+ qint64 targetBytes = dl->size;
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ request.setRawHeader("Range", QString("bytes=" +
QString::number(dl->getProgress()) + "-" +
QString::number(targetBytes)).toAscii());
++#else
++ request.setRawHeader("Range", QString("bytes=" +
QString::number(dl->getProgress()) + "-" +
QString::number(targetBytes)).toLatin1());
++#endif
+ }
+
+
+@@ -227,7 +243,11 @@
+
+ dl->redirectLevel = 0;
+ dl->segmentPosition++;
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QNetworkRequest request =
createRequest(QUrl::fromEncoded(dl->segments.at(dl->segmentPosition).toAscii()));
++#else
++ QNetworkRequest request =
createRequest(QUrl::fromEncoded(dl->segments.at(dl->segmentPosition).toLatin1()));
++#endif
+ dl->progress = dl->getProgress();
+ dl->currentProgress = 0;
+ dl->reply = this->networkAccessManager->get(request);
+@@ -381,8 +401,16 @@
+ QList<QNetworkCookie> cookies;
+ for (int i = 0; i < serializedCookies.length(); i++)
+ {
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QString cookieString =
QUrl::fromPercentEncoding(serializedCookies.at(i).toAscii());
++#else
++ QString cookieString =
QUrl::fromPercentEncoding(serializedCookies.at(i).toLatin1());
++#endif
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QList<QNetworkCookie> parsedCookies =
QNetworkCookie::parseCookies(cookieString.toAscii());
++#else
++ QList<QNetworkCookie> parsedCookies =
QNetworkCookie::parseCookies(cookieString.toLatin1());
++#endif
+ for (int j = 0; j < parsedCookies.length(); j++)
+ {
+ cookies.append(parsedCookies.at(j));
+diff -Naur -x '.git*' clipgrab-main/main.cpp clipgrab-qt5/main.cpp
+--- clipgrab-main/main.cpp 2018-10-10 11:45:58.384773000 +0200
++++ clipgrab-qt5/main.cpp 2018-11-20 16:24:03.109454000 +0100
+@@ -19,9 +19,14 @@
+ along with ClipGrab. If not, see <
http://www.gnu.org/licenses/>.
+ */
+
+-
+-
++#include <qglobal.h>
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ #include <QtGui/QApplication>
++#include <QSplashScreen>
++#else
++#include <QtWidgets/QApplication>
++#include <QtWidgets/QSplashScreen>
++#endif
+ #include <QTranslator>
+ #include "mainwindow.h"
+ #include "clipgrab.h"
+@@ -39,8 +44,8 @@
+ QCoreApplication::setApplicationName("ClipGrab");
+
QCoreApplication::setApplicationVersion(QString(STRINGIZE_VALUE_OF(CLIPGRAB_VERSION)).replace("\"",
""));
+ QSplashScreen splash(QPixmap(":/img/splash.png"),
Qt::FramelessWindowHint);
+- QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
+- QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
++// QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
++// QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
+ QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
+
+ splash.setMask(QPixmap(":/img/splash.png").mask());
+@@ -69,10 +74,22 @@
+ }
+
+ MainWindow w;
++ splash.finish(&w);
+ w.cg = &cg;
+ w.init();
+- w.show();
+- splash.finish(w.centralWidget());
++ if ("" != settings.value("x", ""))
++ {
++ w.move(settings.value("x").toInt(),
settings.value("y").toInt());
++ w.resize(settings.value("width").toInt(),
settings.value("height").toInt());
++ }
++ if (settings.value("isMaximized", false).toBool())
++ {
++ w.showMaximized();
++ }
++ else
++ {
++ w.show();
++ }
+ cg.getUpdateInfo();
+ return app.exec();
+ }
+diff -Naur -x '.git*' clipgrab-main/mainwindow.cpp clipgrab-qt5/mainwindow.cpp
+--- clipgrab-main/mainwindow.cpp 2018-11-20 16:24:54.614012000 +0100
++++ clipgrab-qt5/mainwindow.cpp 2018-11-20 16:24:03.109934000 +0100
+@@ -23,7 +23,23 @@
+
+ #include "mainwindow.h"
+
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
++#include <QSystemTrayIcon>
++#include <QShortcut>
++#include <QFileDialog>
++#include <QMessageBox>
++#else
++#include <QtWidgets/QSystemTrayIcon>
++#include <QtWidgets/QShortcut>
++#include <QtWidgets/QFileDialog>
++#include <QtWidgets/QMessageBox>
++#endif
++
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
++#else
++MainWindow::MainWindow(QWidget *parent, Qt::WindowFlags flags)
++#endif
+ : QMainWindow(parent, flags)
+ {
+ ui.setupUi(this);
+@@ -34,6 +50,14 @@
+
+ MainWindow::~MainWindow()
+ {
++ QSettings settings;
++ settings.setValue("isMaximized", isMaximized());
++ if (!isMaximized()) { // the position and size is only valid if not maximized
++ settings.setValue("x", x());
++ settings.setValue("y", y());
++ settings.setValue("width", width());
++ settings.setValue("height", height());
++ }
+ }
+
+ void MainWindow::init()
+@@ -64,9 +88,14 @@
+ connect(ui.downloadLineEdit, SIGNAL(textChanged(QString)), cg,
SLOT(determinePortal(QString)));
+ connect(this, SIGNAL(itemToRemove(int)), cg, SLOT(removeDownload(int)));
+ //connect(ui.downloadTree, SIGNAL(doubleClicked(QModelIndex)), this,
openFinishedVideo(QModelIndex));
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ ui.downloadTree->header()->setResizeMode(1, QHeaderView::Stretch);
+- ui.downloadTree->header()->setStretchLastSection(false);
+ ui.downloadTree->header()->setResizeMode(3, QHeaderView::ResizeToContents);
++#else
++ ui.downloadTree->header()->setSectionResizeMode(1, QHeaderView::Stretch);
++ ui.downloadTree->header()->setSectionResizeMode(3,
QHeaderView::ResizeToContents);
++#endif
++ ui.downloadTree->header()->setStretchLastSection(false);
+ ui.downloadLineEdit->setFocus(Qt::OtherFocusReason);
+
+ int lastFormat = cg->settings.value("LastFormat", 0).toInt();
+@@ -100,7 +129,11 @@
+ connect(this->ui.settingsRadioNotificationsNever, SIGNAL(toggled(bool)), this,
SLOT(settingsNotifications_toggled(bool)));
+
+
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+
this->ui.settingsSavedPath->setText(cg->settings.value("savedPath",
QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)).toString());
++#else
++
this->ui.settingsSavedPath->setText(cg->settings.value("savedPath",
QStandardPaths::standardLocations(QStandardPaths::DesktopLocation)).toString());
++#endif
+
this->ui.settingsSaveLastPath->setChecked(cg->settings.value("saveLastPath",
true).toBool());
+
ui.settingsNeverAskForPath->setChecked(cg->settings.value("NeverAskForPath",
false).toBool());
+
+@@ -239,7 +272,11 @@
+
+ void MainWindow::startDownload()
+ {
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QString targetDirectory = cg->settings.value("savedPath",
QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)).toString();
++#else
++ QString targetDirectory = cg->settings.value("savedPath",
QStandardPaths::standardLocations(QStandardPaths::DesktopLocation)).toString();
++#endif
+ QString fileName = currentVideo->getSaveTitle();
+
+ if (cg->settings.value("NeverAskForPath", false).toBool() == false)
+@@ -566,6 +603,7 @@
+ if (exitBox->exec() == QMessageBox::Yes)
+ {
+ cg->cancelAll();
++ systemTrayIcon.hide();
+ event->accept();
+ }
+ else
+@@ -575,6 +613,7 @@
+ }
+ else
+ {
++ systemTrayIcon.hide();
+ event->accept();;
+ }
+ }
+@@ -668,9 +707,17 @@
+ if (downloadProgress.first != 0 && downloadProgress.second != 0)
+ {
+ #ifdef Q_WS_X11
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ systemTrayIcon.setToolTip("<strong
style=\"font-size:14px\">" + tr("ClipGrab") +
"</strong><br /><span style=\"font-size:13px\">" +
QString::number(downloadProgress.first*100/downloadProgress.second) + "
%</span><br />" +
QString::number((double)downloadProgress.first/1024/1024,
QLocale::system().decimalPoint().toAscii(), 1) + tr(" MiB") + "/" +
QString::number((double)downloadProgress.second/1024/1024,
QLocale::system().decimalPoint().toAscii(), 1) + tr(" MiB"));
++#else
++ systemTrayIcon.setToolTip("<strong
style=\"font-size:14px\">" + tr("ClipGrab") +
"</strong><br /><span style=\"font-size:13px\">" +
QString::number(downloadProgress.first*100/downloadProgress.second) + "
%</span><br />" +
QString::number((double)downloadProgress.first/1024/1024,
QLocale::system().decimalPoint().toLatin1(), 1) + tr(" MiB") + "/" +
QString::number((double)downloadProgress.second/1024/1024,
QLocale::system().decimalPoint().toLatin1(), 1) + tr(" MiB"));
++#endif
+ #else
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ systemTrayIcon.setToolTip(tr("ClipGrab") + " - " +
QString::number(downloadProgress.first*100/downloadProgress.second) + " % - " +
QString::number((double)downloadProgress.first/1024/1024,
QLocale::system().decimalPoint().toAscii(), 1) + tr(" MiB") + "/" +
QString::number((double)downloadProgress.second/1024/1024,
QLocale::system().decimalPoint().toAscii(), 1) + tr(" KiB"));
++#else
++ systemTrayIcon.setToolTip(tr("ClipGrab") + " - " +
QString::number(downloadProgress.first*100/downloadProgress.second) + " % - " +
QString::number((double)downloadProgress.first/1024/1024,
QLocale::system().decimalPoint().toLatin1(), 1) + tr(" MiB") + "/" +
QString::number((double)downloadProgress.second/1024/1024,
QLocale::system().decimalPoint().toLatin1(), 1) + tr(" KiB"));
++#endif
+ #endif
+ setWindowTitle("ClipGrab - " +
QString::number(downloadProgress.first*100/downloadProgress.second) + " %");
+ }
+diff -Naur -x '.git*' clipgrab-main/mainwindow.h clipgrab-qt5/mainwindow.h
+--- clipgrab-main/mainwindow.h 2018-10-10 11:45:58.385468000 +0200
++++ clipgrab-qt5/mainwindow.h 2018-11-20 16:24:03.110129000 +0100
+@@ -24,10 +24,14 @@
+ #ifndef MAINWINDOW_H
+ #define MAINWINDOW_H
+
+-#include <QtGui/QMainWindow>
+ #include <QSignalMapper>
+ #include <QtXml>
+ #include <QUrl>
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
++#include <QMainWindow>
++#else
++#include <QtWidgets/QMainWindow>
++#endif
+ #include "ui_mainwindow.h"
+ #include "ui_metadata-dialog.h"
+ #include "clipgrab.h"
+@@ -43,7 +47,11 @@
+ Q_OBJECT
+
+ public:
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ MainWindow(QWidget *parent = 0, Qt::WFlags flags = 0);
++#else
++ MainWindow(QWidget *parent = 0, Qt::WindowFlags flags = 0);
++#endif
+ ~MainWindow();
+ void init();
+
+diff -Naur -x '.git*' clipgrab-main/message_dialog.h
clipgrab-qt5/message_dialog.h
+--- clipgrab-main/message_dialog.h 2018-10-10 11:45:58.385612000 +0200
++++ clipgrab-qt5/message_dialog.h 2018-11-20 16:24:03.110256000 +0100
+@@ -1,9 +1,14 @@
+ #ifndef MESSAGE_DIALOG_H
+ #define MESSAGE_DIALOG_H
+
++#include <QtGui/QDesktopServices>
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ #include <QDialog>
+ #include <QWebPage>
+-#include <QDesktopServices>
++#else
++#include <QtWidgets/QDialog>
++#include <QtWebKitWidgets/QWebPage>
++#endif
+
+ namespace Ui {
+ class messageDialog;
+diff -Naur -x '.git*' clipgrab-main/notifications.h clipgrab-qt5/notifications.h
+--- clipgrab-main/notifications.h 2018-10-10 11:45:58.385983000 +0200
++++ clipgrab-qt5/notifications.h 2018-11-20 16:24:03.110601000 +0100
+@@ -25,6 +25,11 @@
+ #define FOO_H
+
+ #include <QtGui>
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
++#include <QSystemTrayIcon>
++#else
++#include <QtWidgets/QSystemTrayIcon>
++#endif
+
+ #ifdef Q_WS_MAC64
+ #include "notifications_mac.h"
+diff -Naur -x '.git*' clipgrab-main/video_dailymotion.cpp
clipgrab-qt5/video_dailymotion.cpp
+--- clipgrab-main/video_dailymotion.cpp 2018-11-20 16:24:54.614595000 +0100
++++ clipgrab-qt5/video_dailymotion.cpp 2018-11-20 16:24:03.111287000 +0100
+@@ -22,6 +22,9 @@
+
+
+ #include "video_dailymotion.h"
++#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
++ #include <QtWebKitWidgets/QtWebKitWidgets>
++#endif
+
+ video_dailymotion::video_dailymotion()
+ {
+diff -Naur -x '.git*' clipgrab-main/video_dailymotion.h
clipgrab-qt5/video_dailymotion.h
+--- clipgrab-main/video_dailymotion.h 2018-10-10 11:57:23.970774000 +0200
++++ clipgrab-qt5/video_dailymotion.h 2018-11-20 16:24:03.111456000 +0100
+@@ -23,8 +23,9 @@
+
+ #ifndef VIDEO_DAILYMOTION_H
+ #define VIDEO_DAILYMOTION_H
++
++#include <QtWebKit/QtWebKit>
+ #include "video.h"
+-#include "QtWebKit"
+
+ struct dailymotion_quality
+ {
+diff -Naur -x '.git*' clipgrab-main/video_facebook.cpp
clipgrab-qt5/video_facebook.cpp
+--- clipgrab-main/video_facebook.cpp 2018-10-10 11:45:58.387121000 +0200
++++ clipgrab-qt5/video_facebook.cpp 2018-11-20 16:24:03.111687000 +0100
+@@ -22,6 +22,10 @@
+
+
+ #include "video_facebook.h"
++#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
++ #include <QtWebKitWidgets/QtWebKitWidgets>
++ #include <QUrlQuery>
++#endif
+
+ video_facebook::video_facebook()
+ {
+@@ -152,6 +156,7 @@
+
+ QString playerLink = "https://www.facebook.com/video/tahoe/async/" +
videoIDRegExp.cap(1) + "/?payloadtype=primary";
+
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QUrl postData;
+ postData.addQueryItem("__a", "1");
+ postData.addQueryItem("__user", userID);
+@@ -159,6 +164,15 @@
+
+ qDebug() << "Downloading player ..." << playerLink
<< postData.encodedQuery();
+ handler->addDownload(playerLink, false, postData.encodedQuery());
++#else
++ QUrlQuery postData;
++ postData.addQueryItem("__a", "1");
++ postData.addQueryItem("__user", userID);
++ postData.addQueryItem("fb_dtsg", dtsg);
++
++ qDebug() << "Downloading player ..." << playerLink
<< postData.query(QUrl::FullyEncoded).toUtf8();
++ handler->addDownload(playerLink, false,
postData.query(QUrl::FullyEncoded).toUtf8());
++#endif
+ return;
+ }
+
+diff -Naur -x '.git*' clipgrab-main/video_facebook.h
clipgrab-qt5/video_facebook.h
+--- clipgrab-main/video_facebook.h 2018-10-10 11:45:58.387308000 +0200
++++ clipgrab-qt5/video_facebook.h 2018-11-20 16:24:03.111846000 +0100
+@@ -24,9 +24,9 @@
+ #ifndef VIDEO_FACEBOOK_H
+ #define VIDEO_FACEBOOK_H
+
++#include <QtWebKit/QtWebKit>
+ #include "video.h"
+ #include "ui_login_dialog.h"
+-#include "QtWebKit"
+
+ class video_facebook : public video
+ {
+diff -Naur -x '.git*' clipgrab-main/video_heuristic.cpp
clipgrab-qt5/video_heuristic.cpp
+--- clipgrab-main/video_heuristic.cpp 2018-10-10 11:45:58.387486000 +0200
++++ clipgrab-qt5/video_heuristic.cpp 2018-11-20 16:24:03.112245000 +0100
+@@ -124,7 +124,11 @@
+ {
+ videoQuality newQuality;
+ newQuality.containerName = expression.cap(2).prepend(".");
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ newQuality.videoUrl =
QUrl::fromPercentEncoding(expression.cap(1).toAscii());
++#else
++ newQuality.videoUrl =
QUrl::fromPercentEncoding(expression.cap(1).toLatin1());
++#endif
+ newQuality.quality = tr("normal");
+ _supportedQualities.append(newQuality);
+ emit analysingFinished();
+@@ -138,7 +142,11 @@
+ {
+ videoQuality newQuality;
+ newQuality.containerName = expression.cap(2).prepend(".");
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ newQuality.videoUrl =
QUrl::fromPercentEncoding(expression.cap(1).toAscii());
++#else
++ newQuality.videoUrl =
QUrl::fromPercentEncoding(expression.cap(1).toLatin1());
++#endif
+ newQuality.quality = tr("normal");
+ _supportedQualities.append(newQuality);
+ emit analysingFinished();
+diff -Naur -x '.git*' clipgrab-main/video_vimeo.h clipgrab-qt5/video_vimeo.h
+--- clipgrab-main/video_vimeo.h 2018-10-10 11:45:58.387671000 +0200
++++ clipgrab-qt5/video_vimeo.h 2018-11-20 16:24:03.112383000 +0100
+@@ -24,10 +24,15 @@
+ #ifndef video_vimeo_H
+ #define video_vimeo_H
+
++#include <qglobal.h>
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
++#include <QWebPage>
++#include <QWebFrame>
++#include <QWebElement>
++#else
++#include <QtWebKitWidgets/QtWebKitWidgets>
++#endif
+ #include "video.h"
+-#include "QWebPage"
+-#include "QWebFrame"
+-#include "QWebElement"
+ #include "ui_login_dialog.h"
+
+ class video_vimeo : public video
+diff -Naur -x '.git*' clipgrab-main/video_youtube.cpp
clipgrab-qt5/video_youtube.cpp
+--- clipgrab-main/video_youtube.cpp 2018-11-20 16:24:54.615056000 +0100
++++ clipgrab-qt5/video_youtube.cpp 2018-11-20 16:24:03.112721000 +0100
+@@ -22,7 +22,11 @@
+
+
+ #include "video_youtube.h"
++
+ #include "QMutableListIterator"
++#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
++ #include <QtWebKitWidgets/QtWebKitWidgets>
++#endif
+
+ video_youtube::video_youtube()
+ {
+@@ -103,7 +107,11 @@
+
+ if (clen0.indexIn(link) == -1 && urlExpression.indexIn(link) > -1)
+ {
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ QString url =
QUrl::fromEncoded(QUrl::fromEncoded(urlExpression.cap(1).toAscii()).toString().toAscii()).toString();
++#else
++ QString url =
QUrl::fromPercentEncoding(QUrl::fromPercentEncoding(urlExpression.cap(1).toUtf8()).toUtf8());
++#endif
+
+ QRegExp sigExpression;
+ sigExpression = QRegExp("(?:^|[^a-zA-Z])[,]?s(ig)?=([^,]+)");
+@@ -673,7 +681,11 @@
+ {
+ videoQuality newQuality;
+ newQuality.quality = tr("normal");
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ newQuality.videoUrl =
QUrl::fromEncoded(QString("http://www.youtube.com/get_video?video_id... +
expression2.cap(1) + "&t=" +
expression.cap(1)).toAscii()).toString(QUrl::None);
++#else
++ newQuality.videoUrl =
QUrl::fromEncoded(QString("http://www.youtube.com/get_video?video_id... +
expression2.cap(1) + "&t=" +
expression.cap(1)).toLatin1()).toString(QUrl::None);
++#endif
+ _supportedQualities.append(newQuality);
+ }
+ else
+diff -Naur -x '.git*' clipgrab-main/video_youtube.h clipgrab-qt5/video_youtube.h
+--- clipgrab-main/video_youtube.h 2018-10-10 11:45:58.388234000 +0200
++++ clipgrab-qt5/video_youtube.h 2018-11-20 16:24:03.112885000 +0100
+@@ -24,13 +24,17 @@
+ #ifndef video_YOUTUBE_H
+ #define video_YOUTUBE_H
+
+-#include "video.h"
+-#include "QtWebKit"
++#include <qglobal.h>
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
++#include <QtWebKit>
++#else
++#include <QtWebKit/QtWebKit>
++#endif
+ #include <QtGui>
+-#include "QDomDocument"
++#include <QFile>
++#include <QDomDocument>
+ #include "ui_login_dialog.h"
+-
+-#include "QFile"
++#include "video.h"
+
+ struct fmtQuality
+ {
+diff -Naur -x '.git*' clipgrab-main/video.cpp clipgrab-qt5/video.cpp
+--- clipgrab-main/video.cpp 2018-11-20 16:24:54.614334000 +0100
++++ clipgrab-qt5/video.cpp 2018-11-20 16:24:03.110835000 +0100
+@@ -195,7 +195,11 @@
+ this->_progressBar->setFormat("%p%");
+ this->_progressBar->setMaximum(bytesTotal);
+ this->_progressBar->setValue(bytesReceived);
++#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
+ setToolTip("<strong>" + tr("Downloading ...") +
"</strong><br />" +
QString::number((double)(bytesReceived)/1024/1024,
QLocale::system().decimalPoint().toAscii(), 1) + tr(" MiB") + "/" +
QString::number((double)bytesTotal/1024/1024, QLocale::system().decimalPoint().toAscii(),
1) + tr(" MiB"));
++#else
++ setToolTip("<strong>" + tr("Downloading ...") +
"</strong><br />" +
QString::number((double)(bytesReceived)/1024/1024,
QLocale::system().decimalPoint().toLatin1(), 1) + tr(" MiB") + "/" +
QString::number((double)bytesTotal/1024/1024, QLocale::system().decimalPoint().toLatin1(),
1) + tr(" MiB"));
++#endif
+ }
+ }
+ else
+diff -Naur -x '.git*' clipgrab-main/video.h clipgrab-qt5/video.h
+--- clipgrab-main/video.h 2018-10-10 11:45:58.386404000 +0200
++++ clipgrab-qt5/video.h 2018-11-20 16:24:03.111085000 +0100
+@@ -26,6 +26,10 @@
+
+ #include <QtGui>
+ #include <QtNetwork>
++#if QT_VERSION >= QT_VERSION_CHECK(5,0,0)
++#include <QtWidgets/QTreeWidgetItem>
++#include <QtWidgets/QProgressBar>
++#endif
+ #include "converter.h"
+ #include "converter_ffmpeg.h"
+ #include "http_handler.h"
diff --git a/clipgrab.spec b/clipgrab.spec
index eb98a03..633a717 100644
--- a/clipgrab.spec
+++ b/clipgrab.spec
@@ -1,5 +1,5 @@
Name: clipgrab
-Version: 3.8.2
+Version: 3.8.3
Release: 1%{?dist}
License: GPLv3 and Non-Commercial Use Only (Artwork and Trademark)
@@ -7,8 +7,9 @@ Summary: A free video downloader and converter
URL:
http://clipgrab.de/en
Source0:
https://download.clipgrab.org/%{name}-%{version}.tar.gz
Source1: %{name}.desktop
+Patch0:
https://gitlab.com/kikadf/clipgrab-qt5/raw/patches/patches/clipgrab-qt5-3...
-ExcludeArch: ppc64le ppc64
+ExcludeArch: ppc64le ppc64 aarch64
BuildRequires: ImageMagick
BuildRequires: desktop-file-utils
@@ -24,8 +25,11 @@ ClipGrab is a free downloader and converter for YouTube, Vimeo,
Dailymotion
and many other online video sites.
%prep
-%setup -q
+#setup -q
+%autosetup -p 1 -n %{name}-%{version}
chmod 0644 *.cpp *.h icon.png COPYING README license.odt
+# Fix build with Qt 5.12:
https://aur.archlinux.org/packages/clipgrab-qt5/
+sed -i 's|QtWebKit/QWebView|QtWebKitWidgets/QWebView|' mainwindow.ui
%build
%{qmake_qt5} clipgrab.pro QMAKE_CXXFLAGS="%{optflags}"
@@ -45,6 +49,9 @@ desktop-file-install --dir %{buildroot}%{_datadir}/applications
%{SOURCE1}
%{_datadir}/applications/clipgrab.desktop
%changelog
+* Mon May 13 2019 Martin Gansser <martinkg(a)fedoraproject.org> - 3.8.3-1
+- Update to 3.8.3
+
* Mon Mar 11 2019 Martin Gansser <martinkg(a)fedoraproject.org> - 3.8.2-1
- Update to 3.8.2
diff --git a/sources b/sources
index 6976cfa..248e654 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-76e51811853839397bd52563ecac6347 clipgrab-3.8.2.tar.gz
+5f63b8cc431867921114fe2e32c05325 clipgrab-3.8.3.tar.gz