summaryrefslogtreecommitdiff
path: root/libre/minitube/remove_unfree_recommendations.patch
blob: 98f3b06a8d3007a85dfe3f81871a35f31bba4399 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
diff -aurN minitube-2.8.orig/minitube.pro minitube-2.8/minitube.pro
--- minitube-2.8.orig/minitube.pro	2017-07-24 10:05:55.000000000 -0300
+++ minitube-2.8/minitube.pro	2017-09-04 12:38:11.228677768 -0300
@@ -103,7 +103,6 @@
     src/exlineedit.h \
     src/channellistview.h \
     src/httputils.h \
-    src/appwidget.h \
     src/clickablelabel.h
 SOURCES += src/main.cpp \
     src/searchlineedit.cpp \
@@ -174,7 +173,6 @@
     src/exlineedit.cpp \
     src/channellistview.cpp \
     src/httputils.cpp \
-    src/appwidget.cpp \
     src/clickablelabel.cpp
 RESOURCES += resources.qrc
 DESTDIR = build/target/
diff -aurN minitube-2.8.orig/src/aboutview.cpp minitube-2.8/src/aboutview.cpp
--- minitube-2.8.orig/src/aboutview.cpp	2017-07-24 10:05:55.000000000 -0300
+++ minitube-2.8/src/aboutview.cpp	2017-09-04 12:37:56.485294782 -0300
@@ -32,7 +32,6 @@
 #endif
 #include "fontutils.h"
 #include "iconutils.h"
-#include "appwidget.h"
 #include "clickablelabel.h"
 #include "mainwindow.h"
 
@@ -116,8 +115,6 @@
     buttonLayout->addWidget(closeButton);
 
     layout->addLayout(buttonLayout);
-
-    verticalLayout->addWidget(new AppsWidget());
 }
 
 void AboutView::appear() {
diff -aurN minitube-2.8.orig/src/appwidget.cpp minitube-2.8/src/appwidget.cpp
--- minitube-2.8.orig/src/appwidget.cpp	2017-07-24 10:05:55.000000000 -0300
+++ minitube-2.8/src/appwidget.cpp	1969-12-31 21:00:00.000000000 -0300
@@ -1,111 +0,0 @@
-#include "appwidget.h"
-#include "constants.h"
-#include "http.h"
-#ifdef APP_EXTRA
-#include "updatedialog.h"
-#endif
-
-AppsWidget::AppsWidget(QWidget *parent) : QWidget(parent) {
-    const int padding = 30;
-
-    QBoxLayout *layout = new QHBoxLayout(this);
-    layout->setMargin(padding);
-    layout->setSpacing(padding*2);
-    layout->setAlignment(Qt::AlignCenter);
-
-#ifdef APP_MAC
-    const QString ext = "dmg";
-#elif defined APP_WIN
-    const QString ext = "exe";
-#else
-    const QString ext = "deb";
-#endif
-
-    setupApp("Finetune", "finetune." + ext);
-    setupApp("Musictube", "musictube." + ext);
-    setupApp("Musique", "musique." + ext);
-}
-
-void AppsWidget::setupApp(const QString &name, const QString &code) {
-    AppWidget *w = new AppWidget(name, code);
-    layout()->addWidget(w);
-}
-
-void AppsWidget::paintEvent(QPaintEvent *e) {
-    Q_UNUSED(e);
-    QStyleOption o;
-    o.initFrom(this);
-    QPainter p(this);
-    style()->drawPrimitive(QStyle::PE_Widget, &o, &p, this);
-}
-
-AppWidget::AppWidget(const QString &name, const QString &code, QWidget *parent) : QWidget(parent), icon(0), name(name), downloadButton(0) {
-    const QString unixName = code.left(code.lastIndexOf('.'));
-    const QString baseUrl = QLatin1String("http://") + Constants::ORG_DOMAIN;
-    const QString filesUrl = baseUrl + QLatin1String("/files/");
-    url = filesUrl + unixName + QLatin1String("/") + code;
-    webPage = baseUrl + QLatin1String("/") +  unixName;
-
-    QBoxLayout *layout = new QVBoxLayout(this);
-    layout->setMargin(0);
-    layout->setAlignment(Qt::AlignHCenter);
-
-    icon = new QLabel();
-    layout->addWidget(icon);
-    const QString iconUrl = filesUrl + QLatin1String("products/") + unixName + QLatin1String(".png");
-    QObject *reply = Http::instance().get(iconUrl);
-    connect(reply, SIGNAL(data(QByteArray)), SLOT(iconDownloaded(QByteArray)));
-
-    QLabel *appTitle = new QLabel(name);
-    appTitle->setAlignment(Qt::AlignHCenter);
-    layout->addWidget(appTitle);
-
-#ifdef APP_EXTRA
-#if !defined(APP_UBUNTU) && !defined(APP_MAC_STORE)
-    downloadButton = new QPushButton(tr("Download"));
-    downloadButton->setAttribute(Qt::WA_MacSmallSize);
-    downloadButton->setCursor(Qt::ArrowCursor);
-    QSizePolicy sp = downloadButton->sizePolicy();
-    sp.setHorizontalPolicy(QSizePolicy::Fixed);
-    sp.setRetainSizeWhenHidden(true);
-    downloadButton->setSizePolicy(sp);
-    connect(downloadButton, SIGNAL(clicked(bool)), SLOT(downloadApp()));
-    layout->addWidget(downloadButton, Qt::AlignHCenter);
-    layout->setAlignment(downloadButton, Qt::AlignHCenter);
-    downloadButton->hide();
-#endif
-#endif
-
-    setCursor(Qt::PointingHandCursor);
-}
-
-void AppWidget::enterEvent(QEvent *e) {
-    Q_UNUSED(e);
-    if (downloadButton) downloadButton->show();
-}
-
-void AppWidget::leaveEvent(QEvent *e) {
-    Q_UNUSED(e);
-    if (downloadButton) downloadButton->hide();
-}
-
-void AppWidget::mouseReleaseEvent(QMouseEvent *e) {
-    if (e->button() == Qt::LeftButton) {
-        QDesktopServices::openUrl(webPage);
-    }
-}
-
-void AppWidget::iconDownloaded(const QByteArray &bytes) {
-    QPixmap pixmap;
-    pixmap.loadFromData(bytes, "PNG");
-    icon->setPixmap(pixmap);
-}
-
-void AppWidget::downloadApp() {
-#ifdef APP_EXTRA
-    if (!icon) return;
-    UpdateDialog *dialog = new UpdateDialog(icon->pixmap(), name, QString(), url, this);
-    dialog->downloadUpdate();
-    dialog->show();
-#endif
-}
diff -aurN minitube-2.8.orig/src/appwidget.h minitube-2.8/src/appwidget.h
--- minitube-2.8.orig/src/appwidget.h	2017-07-24 10:05:55.000000000 -0300
+++ minitube-2.8/src/appwidget.h	1969-12-31 21:00:00.000000000 -0300
@@ -1,46 +0,0 @@
-#ifndef APPWIDGET_H
-#define APPWIDGET_H
-
-#include <QtWidgets>
-
-
-class AppWidget : public QWidget {
-
-    Q_OBJECT
-
-public:
-    AppWidget(const QString &name, const QString &code, QWidget *parent = 0);
-    QLabel *icon;
-
-protected:
-    void enterEvent(QEvent *e);
-    void leaveEvent(QEvent *e);
-    void mouseReleaseEvent(QMouseEvent *e);
-
-private slots:
-    void iconDownloaded(const QByteArray &bytes);
-    void downloadApp();
-
-private:
-    QPushButton *downloadButton;
-    QString name;
-    QString url;
-    QString webPage;
-};
-
-class AppsWidget : public QWidget {
-
-    Q_OBJECT
-
-public:
-    AppsWidget(QWidget *parent = 0);
-
-protected:
-    void paintEvent(QPaintEvent *e);
-
-private:
-    void setupApp(const QString &name, const QString &code);
-
-};
-
-#endif // APPWIDGET_H