loading = true;
QUrl url("http://gdata.youtube.com/feeds/api/users/" + userId);
- url.addQueryItem("v", "2");
+#if QT_VERSION >= 0x050000
+ {
+ QUrl &u = url;
+ QUrlQuery url;
+#endif
+ url.addQueryItem("v", "2");
+#if QT_VERSION >= 0x050000
+ u.setQuery(url);
+ }
+#endif
QObject *reply = The::http()->get(url);
connect(reply, SIGNAL(data(QByteArray)), SLOT(parseResponse(QByteArray)));
connect(reply, SIGNAL(error(QNetworkReply*)), SLOT(requestError(QNetworkReply*)));
if (thumbnailUrl.isEmpty()) return;
loadingThumbnail = true;
-#ifdef Q_WS_WIN
+#ifdef Q_OS_WIN
thumbnailUrl.replace(QLatin1String("https://"), QLatin1String("http://"));
#endif
}
const QString & YTUser::getThumbnailDir() {
- static const QString thumbDir = QDesktopServices::storageLocation(
- QDesktopServices::DataLocation) + "/channels/";
+ static const QString thumbDir =
+ #if QT_VERSION >= 0x050000
+ QStandardPaths::writableLocation(QStandardPaths::DataLocation)
+ #else
+ QDesktopServices::storageLocation(QDesktopServices::DataLocation)
+ #endif
+ + "/channels/";
return thumbDir;
}
return getThumbnailDir() + userId;
}
+void YTUser::unsubscribe() {
+ YTUser::unsubscribe(userId);
+}
+
void YTUser::storeThumbnail(QByteArray bytes) {
thumbnail.loadFromData(bytes);
static const int maxWidth = 88;
uint now = QDateTime::currentDateTime().toTime_t();
watched = now;
notifyCount = 0;
+ emit notifyCountChanged();
QSqlDatabase db = Database::instance().getConnection();
QSqlQuery query(db);
}
void YTUser::storeNotifyCount(int count) {
+ if (notifyCount != count)
+ emit notifyCountChanged();
notifyCount = count;
QSqlDatabase db = Database::instance().getConnection();