summaryrefslogtreecommitdiff
blob: 910471aca6c03b9159fb1599b189ac296439ccc0 (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
Origin: other, https://sourceforge.net/p/qtscrob/patches/15/
Bug: https://sourceforge.net/p/qtscrob/patches/15/
Bug-Debian: https://bugs.debian.org/875156
Description: Port to Qt5

--- a/src/lib/gettrackinfo.cpp
+++ b/src/lib/gettrackinfo.cpp
@@ -58,7 +58,7 @@
     data += "&track=" + QUrl::toPercentEncoding(track_info.title);
     data += "&autocorrect=1";
     time.restart();
-    manager->post(request, QByteArray(data.toAscii()));
+    manager->post(request, QByteArray(data.toLatin1()));
 }
 
 void GetTrackInfo::run()
--- a/src/lib/lib.pro
+++ b/src/lib/lib.pro
@@ -13,7 +13,8 @@
 QT += core \
     network \
     xml \
-    sql
+    sql \
+    widgets
 
 QT -= gui
 LANGUAGE = C++
--- a/src/lib/parse-log.cpp
+++ b/src/lib/parse-log.cpp
@@ -153,9 +153,9 @@
                 //right number of tabs in the line
                 scrob_entry temp_entry;
 
-                temp_entry.artist = QString::fromUtf8(log_entry[0].toAscii());
-                temp_entry.album = QString::fromUtf8(log_entry[1].toAscii());
-                temp_entry.title = QString::fromUtf8(log_entry[2].toAscii());
+                temp_entry.artist = QString::fromUtf8(log_entry[0].toLatin1());
+                temp_entry.album = QString::fromUtf8(log_entry[1].toLatin1());
+                temp_entry.title = QString::fromUtf8(log_entry[2].toLatin1());
                 temp_entry.tracknum = log_entry[3].toInt();
                 temp_entry.length = log_entry[4].toInt();
                 temp_entry.played = log_entry[5][0];
--- a/src/lib/submit.cpp
+++ b/src/lib/submit.cpp
@@ -151,7 +151,7 @@
     submit_handshake.setHeader(QNetworkRequest::ContentTypeHeader,
                                "application/x-www-form-urlencoded");
 
-    QByteArray submit_data = QByteArray(data.toAscii());
+    QByteArray submit_data = QByteArray(data.toLatin1());
     nr_submit = nam_submit->post(submit_handshake, submit_data);
 }
 
@@ -251,7 +251,7 @@
     QString time_str = QString::number(QDateTime::currentDateTime().toTime_t());
 
     QCryptographicHash auth_hash(QCryptographicHash::Md5);
-    auth_hash.addData(QString(context.password_hash + time_str).toAscii());
+    auth_hash.addData(QString(context.password_hash + time_str).toLatin1());
     QString auth = QString(auth_hash.result().toHex());
 
     QUrl url_handshake = QString( "http://%1/?hs=true&p=%2&c=%3&v=%4&u=%5&t=%6&a=%7" )
--- a/src/lib/submit.h
+++ b/src/lib/submit.h
@@ -20,7 +20,6 @@
 #define SUBMIT_H
 
 #include <QtCore>
-#include <QHttp>
 #include <QNetworkAccessManager>
 #include <QNetworkProxy>
 #include <QNetworkReply>
--- a/src/qt/qt.pro
+++ b/src/qt/qt.pro
@@ -34,6 +34,7 @@
 TEMPLATE = app
 TARGET = qtscrob
 QT += gui
+QT += widgets
 LANGUAGE = C++
 INCLUDEPATH += . \
     src \
--- a/src/qt/src/about.h
+++ b/src/qt/src/about.h
@@ -22,6 +22,7 @@
 #include "ui_aboutWin.h"
 #include <QApplication>
 #include <QtGui>
+#include <QLabel>
 
 class QTScrob;
 
--- a/src/qt/src/console.h
+++ b/src/qt/src/console.h
@@ -22,6 +22,11 @@
 #include <QTimer>
 #include <QApplication>
 #include <QtGui>
+#include <QLabel> 
+#include <QTextEdit>
+#include <QDialog>
+#include <QComboBox>
+#include <QPushButton>
 
 class QTScrob;
 class QTimer;
--- a/src/qt/src/help.h
+++ b/src/qt/src/help.h
@@ -21,6 +21,9 @@
 
 #include <QApplication>
 #include <QtGui>
+#include <QLabel> 
+#include <QDialog>
+#include <QTextEdit>
 
 class QTScrob;
 
--- a/src/qt/src/progress.h
+++ b/src/qt/src/progress.h
@@ -21,6 +21,13 @@
 
 #include <QApplication>
 #include <QtGui>
+#include <QLabel>
+#include <QWidget>
+#include <QProgressBar>
+#include <QDialog>
+#include <QFormLayout>
+#include <QVBoxLayout>
+#include <QPushButton>
 
 class QTScrob;
 
--- a/src/qt/src/qtscrob.cpp
+++ b/src/qt/src/qtscrob.cpp
@@ -41,7 +41,7 @@
 	logTable->setHorizontalHeaderLabels(tableLabels);
 	logTable->setAlternatingRowColors(true);
 	logTable->setSelectionBehavior(QAbstractItemView::SelectRows);
-	logTable->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
+	logTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
     logTable->installEventFilter(this);
 
     recalc_timestamp = scrob->get_gmt();
@@ -600,7 +600,7 @@
 		case 5:
 			if (!logTable->item(r, c)->text().isEmpty())
 			{
-				char rating = logTable->item(r, c)->text().toAscii().data()[0];
+				char rating = logTable->item(r, c)->text().toLatin1().data()[0];
 				if ('L' == rating || 'S' == rating)
 					tmp.played = rating;
 			}
--- a/src/qt/src/qtscrob.h
+++ b/src/qt/src/qtscrob.h
@@ -23,12 +23,20 @@
 #include <QtGui>
 #include <QApplication>
 #include <QMainWindow>
+#include <QTableWidget>
+#include <QMenu>
+#include <QMenuBar>
+#include <QStatusBar>
+#include <QFile>
+#include <QFileDialog>
+#include <QTextEdit>
 #include <QMessageBox>
 #include <QByteArray>
 #include <QtDebug>
 #include <QSettings>
 #include <QDateTimeEdit>
 #include <QLabel>
+#include <QWidget>
 #include "libscrobble.h"
 #include "common.h"
 #include "missingtimeprogress.h"
--- a/src/qtscrob.pro
+++ b/src/qtscrob.pro
@@ -1,4 +1,4 @@
-VER = $$find(QT_VERSION, ^4\\.[6-9]+.*)
+VER = $$find(QT_VERSION, ^4\\.[6-9]+.*|^5)
 isEmpty(VER) {
     message("Qt >= 4.6 required!")
     !isEmpty(QT_VERSION) error("Qt found:" $$[QT_VERSION])
@@ -17,6 +17,7 @@
 system($$QMAKE_LUPDATE -silent language/language.pro)
 system($$QMAKE_LRELEASE -silent language/language.pro)
 
+QT += widgets
 TEMPLATE=subdirs
 SUBDIRS=lib qt cli
 CONFIG += ordered