diff --git a/CMakeLists.txt b/CMakeLists.txt index 443c43b4f..2fb1a617b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,11 +187,6 @@ optional_component(GOOGLE_DRIVE ON "Google Drive support" DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999" ) -optional_component(UBUNTU_ONE ON "Ubuntu One file support" - DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS - DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999" -) - optional_component(DROPBOX ON "Dropbox support" DEPENDS "Google sparsehash" SPARSEHASH_INCLUDE_DIRS DEPENDS "Taglib 1.8" "TAGLIB_VERSION VERSION_GREATER 1.7.999" diff --git a/ext/libclementine-tagreader/cloudstream.cpp b/ext/libclementine-tagreader/cloudstream.cpp index e6dd26f8b..503cd6652 100644 --- a/ext/libclementine-tagreader/cloudstream.cpp +++ b/ext/libclementine-tagreader/cloudstream.cpp @@ -114,11 +114,6 @@ TagLib::ByteVector CloudStream::readBlock(ulong length) { QString("bytes=%1-%2").arg(start).arg(end).toUtf8()); request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); - // The Ubuntu One server applies the byte range to the gzipped data, rather - // than the raw data so we must disable compression. - if (url_.host() == "files.one.ubuntu.com") { - request.setRawHeader("Accept-Encoding", "identity"); - } QNetworkReply* reply = network_->get(request); connect(reply, SIGNAL(sslErrors(QList)), diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 53939f3a9..b5e50dbb3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1085,22 +1085,6 @@ optional_source(HAVE_GOOGLE_DRIVE internet/googledrivesettingspage.ui ) -# Ubuntu One file support -optional_source(HAVE_UBUNTU_ONE - SOURCES - internet/ubuntuoneauthenticator.cpp - internet/ubuntuoneservice.cpp - internet/ubuntuonesettingspage.cpp - internet/ubuntuoneurlhandler.cpp - HEADERS - internet/ubuntuoneauthenticator.h - internet/ubuntuoneservice.h - internet/ubuntuonesettingspage.h - internet/ubuntuoneurlhandler.h - UI - internet/ubuntuonesettingspage.ui -) - # Dropbox support optional_source(HAVE_DROPBOX SOURCES diff --git a/src/config.h.in b/src/config.h.in index f6648f522..bcce6858d 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -41,7 +41,6 @@ #cmakedefine HAVE_SKYDRIVE #cmakedefine HAVE_SPARKLE #cmakedefine HAVE_SPOTIFY_DOWNLOADER -#cmakedefine HAVE_UBUNTU_ONE #cmakedefine HAVE_VK #cmakedefine HAVE_WIIMOTEDEV #cmakedefine IMOBILEDEVICE_USES_UDIDS diff --git a/src/internet/internetmodel.cpp b/src/internet/internetmodel.cpp index 46e23bdda..55a1eb766 100644 --- a/src/internet/internetmodel.cpp +++ b/src/internet/internetmodel.cpp @@ -41,9 +41,6 @@ #ifdef HAVE_GOOGLE_DRIVE #include "googledriveservice.h" #endif -#ifdef HAVE_UBUNTU_ONE -#include "ubuntuoneservice.h" -#endif #ifdef HAVE_DROPBOX #include "dropboxservice.h" #endif @@ -101,9 +98,6 @@ InternetModel::InternetModel(Application* app, QObject* parent) #ifdef HAVE_SKYDRIVE AddService(new SkydriveService(app, this)); #endif -#ifdef HAVE_UBUNTU_ONE - AddService(new UbuntuOneService(app, this)); -#endif #ifdef HAVE_VK AddService(new VkService(app, this)); #endif diff --git a/src/internet/ubuntuoneauthenticator.cpp b/src/internet/ubuntuoneauthenticator.cpp deleted file mode 100644 index da957f81b..000000000 --- a/src/internet/ubuntuoneauthenticator.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include "ubuntuoneauthenticator.h" - -#include - -#include -#include -#include -#include - -#include - -#include "core/closure.h" -#include "core/logging.h" -#include "core/network.h" -#include "core/timeconstants.h" - -namespace { -static const char* kUbuntuOneEndpoint = - "https://login.ubuntu.com/api/1.0/authentications"; -static const char* kTokenNameTemplate = "Ubuntu One @ %1 [%2]"; -static const char* kOAuthSSOFinishedEndpoint = - "https://one.ubuntu.com/oauth/sso-finished-so-get-tokens/"; -static const char* kOAuthHeaderPrefix = "OAuth realm=\"\", "; -} - -UbuntuOneAuthenticator::UbuntuOneAuthenticator(QObject* parent) - : QObject(parent), - network_(new NetworkAccessManager(this)), - success_(false) {} - -void UbuntuOneAuthenticator::StartAuthorisation(const QString& email, - const QString& password) { - QUrl url(kUbuntuOneEndpoint); - url.addQueryItem("ws.op", "authenticate"); - QString token_name = QString(kTokenNameTemplate).arg( - QHostInfo::localHostName(), QCoreApplication::applicationName()); - url.addQueryItem("token_name", token_name); - - QByteArray authentication = - QString(email + ":" + password).toAscii().toBase64(); - QString authorisation = - QString("Basic %1").arg(QString::fromAscii(authentication)); - - QNetworkRequest request(url); - request.setRawHeader("Authorization", authorisation.toAscii()); - request.setRawHeader("Accept", "application/json"); - - QNetworkReply* reply = network_->get(request); - NewClosure(reply, SIGNAL(finished()), this, - SLOT(AuthorisationFinished(QNetworkReply*)), reply); - - qLog(Debug) << url; - qLog(Debug) << authorisation; -} - -void UbuntuOneAuthenticator::AuthorisationFinished(QNetworkReply* reply) { - reply->deleteLater(); - - QByteArray data = reply->readAll(); - qLog(Debug) << data; - - QJson::Parser parser; - bool ok = false; - QVariant json = parser.parse(data, &ok); - if (!ok) { - qLog(Error) << "Failed to authenticate to Ubuntu One:" - << parser.errorString(); - emit Finished(); - return; - } - - QVariantMap auth_info = json.toMap(); - consumer_key_ = auth_info["consumer_key"].toString(); - consumer_secret_ = auth_info["consumer_secret"].toString(); - token_ = auth_info["token"].toString(); - token_secret_ = auth_info["token_secret"].toString(); - - CopySSOTokens(); -} - -QByteArray UbuntuOneAuthenticator::GenerateAuthorisationHeader( - const QString& consumer_key, const QString& consumer_secret, - const QString& token, const QString& token_secret) { - typedef QPair Param; - QString timestamp = QString::number(time(nullptr)); - QList parameters; - parameters << Param("oauth_nonce", QString::number(qrand())) - << Param("oauth_timestamp", timestamp) - << Param("oauth_version", "1.0") - << Param("oauth_consumer_key", consumer_key) - << Param("oauth_token", token) - << Param("oauth_signature_method", "PLAINTEXT"); - qSort(parameters.begin(), parameters.end()); - QStringList encoded_params; - for (const Param& p : parameters) { - encoded_params << QString("%1=%2").arg(p.first, p.second); - } - - QString signing_key = consumer_secret + "&" + token_secret; - QByteArray signature = QUrl::toPercentEncoding(signing_key); - - // Construct authorisation header - parameters << Param("oauth_signature", signature); - QStringList header_params; - for (const Param& p : parameters) { - header_params << QString("%1=\"%2\"").arg(p.first, p.second); - } - QString authorisation_header = header_params.join(", "); - authorisation_header.prepend(kOAuthHeaderPrefix); - - return authorisation_header.toAscii(); -} - -QByteArray UbuntuOneAuthenticator::GenerateAuthorisationHeader() { - return GenerateAuthorisationHeader(consumer_key_, consumer_secret_, token_, - token_secret_); -} - -void UbuntuOneAuthenticator::CopySSOTokens() { - QUrl url(kOAuthSSOFinishedEndpoint); - QNetworkRequest request(url); - request.setRawHeader("Authorization", GenerateAuthorisationHeader()); - request.setRawHeader("Accept", "application/json"); - - QNetworkReply* reply = network_->get(request); - NewClosure(reply, SIGNAL(finished()), this, - SLOT(CopySSOTokensFinished(QNetworkReply*)), reply); -} - -void UbuntuOneAuthenticator::CopySSOTokensFinished(QNetworkReply* reply) { - reply->deleteLater(); - qLog(Debug) << reply->readAll(); - success_ = true; - emit Finished(); -} diff --git a/src/internet/ubuntuoneauthenticator.h b/src/internet/ubuntuoneauthenticator.h deleted file mode 100644 index 6ac777127..000000000 --- a/src/internet/ubuntuoneauthenticator.h +++ /dev/null @@ -1,49 +0,0 @@ -#ifndef UBUNTUONEAUTHENTICATOR_H -#define UBUNTUONEAUTHENTICATOR_H - -#include - -class QNetworkReply; -class NetworkAccessManager; - -class UbuntuOneAuthenticator : public QObject { - Q_OBJECT - public: - explicit UbuntuOneAuthenticator(QObject* parent = nullptr); - void StartAuthorisation(const QString& email, const QString& password); - - bool success() const { return success_; } - QString consumer_key() const { return consumer_key_; } - QString consumer_secret() const { return consumer_secret_; } - QString token() const { return token_; } - QString token_secret() const { return token_secret_; } - - static QByteArray GenerateAuthorisationHeader(const QString& consumer_key, - const QString& consumer_secret, - const QString& token, - const QString& token_secret); - -signals: - void Finished(); - - private slots: - void AuthorisationFinished(QNetworkReply* reply); - void CopySSOTokensFinished(QNetworkReply* reply); - - private: - void CopySSOTokens(); - QByteArray GenerateAuthorisationHeader(); - - private: - NetworkAccessManager* network_; - - bool success_; - - QString consumer_key_; - QString consumer_secret_; - - QString token_; - QString token_secret_; -}; - -#endif // UBUNTUONEAUTHENTICATOR_H diff --git a/src/internet/ubuntuoneservice.cpp b/src/internet/ubuntuoneservice.cpp deleted file mode 100644 index 9ee1e2e03..000000000 --- a/src/internet/ubuntuoneservice.cpp +++ /dev/null @@ -1,183 +0,0 @@ -#include "ubuntuoneservice.h" - -#include -#include -#include - -#include - -#include "core/application.h" -#include "core/closure.h" -#include "core/database.h" -#include "core/logging.h" -#include "core/mergedproxymodel.h" -#include "core/network.h" -#include "core/player.h" -#include "core/timeconstants.h" -#include "core/utilities.h" -#include "globalsearch/globalsearch.h" -#include "globalsearch/librarysearchprovider.h" -#include "internet/internetmodel.h" -#include "internet/ubuntuoneauthenticator.h" -#include "internet/ubuntuoneurlhandler.h" -#include "library/librarybackend.h" -#include "playlist/playlist.h" -#include "ui/iconloader.h" - -const char* UbuntuOneService::kServiceName = "Ubuntu One"; -const char* UbuntuOneService::kSettingsGroup = "Ubuntu One"; - -namespace { -static const char* kFileStorageEndpoint = - "https://one.ubuntu.com/api/file_storage/v1"; -static const char* kVolumesEndpoint = - "https://one.ubuntu.com/api/file_storage/v1/volumes"; -static const char* kContentRoot = "https://files.one.ubuntu.com"; -static const char* kServiceId = "ubuntu_one"; -} - -UbuntuOneService::UbuntuOneService(Application* app, InternetModel* parent) - : CloudFileService(app, parent, kServiceName, kServiceId, - QIcon(":/providers/ubuntuone.png"), - SettingsDialog::Page_UbuntuOne) { - app_->player()->RegisterUrlHandler(new UbuntuOneUrlHandler(this, this)); - - QSettings s; - s.beginGroup(kSettingsGroup); - if (s.contains("consumer_key")) { - consumer_key_ = s.value("consumer_key").toString(); - consumer_secret_ = s.value("consumer_secret").toString(); - token_ = s.value("token").toString(); - token_secret_ = s.value("token_secret").toString(); - } -} - -bool UbuntuOneService::has_credentials() const { - return !consumer_key_.isEmpty(); -} - -void UbuntuOneService::Connect() { - if (has_credentials()) { - RequestVolumeList(); - } else { - ShowSettingsDialog(); - } -} - -QByteArray UbuntuOneService::GenerateAuthorisationHeader() { - return UbuntuOneAuthenticator::GenerateAuthorisationHeader( - consumer_key_, consumer_secret_, token_, token_secret_); -} - -void UbuntuOneService::AuthenticationFinished( - UbuntuOneAuthenticator* authenticator) { - authenticator->deleteLater(); - if (!authenticator->success()) { - return; - } - - consumer_key_ = authenticator->consumer_key(); - consumer_secret_ = authenticator->consumer_secret(); - token_ = authenticator->token(); - token_secret_ = authenticator->token_secret(); - - QSettings s; - s.beginGroup(kSettingsGroup); - s.setValue("consumer_key", consumer_key_); - s.setValue("consumer_secret", consumer_secret_); - s.setValue("token", token_); - s.setValue("token_secret", token_secret_); - - RequestVolumeList(); -} - -QNetworkReply* UbuntuOneService::SendRequest(const QUrl& url) { - QNetworkRequest request(url); - request.setRawHeader("Authorization", GenerateAuthorisationHeader()); - request.setRawHeader("Accept", "application/json"); - - return network_->get(request); -} - -void UbuntuOneService::RequestVolumeList() { - QUrl volumes_url(kVolumesEndpoint); - QNetworkReply* reply = SendRequest(volumes_url); - NewClosure(reply, SIGNAL(finished()), this, - SLOT(VolumeListRequestFinished(QNetworkReply*)), reply); -} - -void UbuntuOneService::VolumeListRequestFinished(QNetworkReply* reply) { - reply->deleteLater(); - - QJson::Parser parser; - QVariantList result = parser.parse(reply).toList(); - for (const QVariant& v : result) { - RequestFileList(v.toMap()["node_path"].toString()); - } -} - -void UbuntuOneService::RequestFileList(const QString& path) { - QUrl files_url(QString(kFileStorageEndpoint) + path); - files_url.addQueryItem("include_children", "true"); - - qLog(Debug) << "Sending files request" << files_url; - QNetworkReply* files_reply = SendRequest(files_url); - NewClosure(files_reply, SIGNAL(finished()), this, - SLOT(FileListRequestFinished(QNetworkReply*)), files_reply); -} - -void UbuntuOneService::FileListRequestFinished(QNetworkReply* reply) { - reply->deleteLater(); - QJson::Parser parser; - QVariantMap result = parser.parse(reply).toMap(); - - QVariantList children = result["children"].toList(); - for (const QVariant& c : children) { - QVariantMap child = c.toMap(); - if (child["kind"].toString() == "file") { - QString content_path = child["content_path"].toString(); - QUrl content_url(kContentRoot); - content_url.setPath(content_path); - QUrl service_url; - service_url.setScheme("ubuntuonefile"); - service_url.setPath(content_path); - - Song metadata; - metadata.set_url(service_url); - metadata.set_etag(child["hash"].toString()); - metadata.set_mtime(QDateTime::fromString(child["when_changed"].toString(), - Qt::ISODate).toTime_t()); - metadata.set_ctime(QDateTime::fromString(child["when_created"].toString(), - Qt::ISODate).toTime_t()); - metadata.set_filesize(child["size"].toInt()); - metadata.set_title(child["path"].toString().mid(1)); - MaybeAddFileToDatabase( - metadata, GuessMimeTypeForFile(child["path"].toString().mid(1)), - content_url, GenerateAuthorisationHeader()); - } else { - RequestFileList(child["resource_path"].toString()); - } - } -} - -QUrl UbuntuOneService::GetStreamingUrlFromSongId(const QString& song_id) { - QUrl url(kContentRoot); - url.setPath(song_id); - url.setFragment(GenerateAuthorisationHeader()); - return url; -} - -void UbuntuOneService::ShowCoverManager() { - if (!cover_manager_) { - cover_manager_.reset(new AlbumCoverManager(app_, library_backend_)); - cover_manager_->Init(); - connect(cover_manager_.get(), SIGNAL(AddToPlaylist(QMimeData*)), - SLOT(AddToPlaylist(QMimeData*))); - } - cover_manager_->show(); -} - -void UbuntuOneService::AddToPlaylist(QMimeData* mime) { - playlist_manager_->current()->dropMimeData(mime, Qt::CopyAction, -1, 0, - QModelIndex()); -} diff --git a/src/internet/ubuntuoneservice.h b/src/internet/ubuntuoneservice.h deleted file mode 100644 index c832e9ae8..000000000 --- a/src/internet/ubuntuoneservice.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef UBUNTUONESERVICE_H -#define UBUNTUONESERVICE_H - -#include "internet/cloudfileservice.h" - -#include "core/tagreaderclient.h" - -class QNetworkReply; -class UbuntuOneAuthenticator; - -class UbuntuOneService : public CloudFileService { - Q_OBJECT - public: - UbuntuOneService(Application* app, InternetModel* parent); - - static const char* kServiceName; - static const char* kSettingsGroup; - - QUrl GetStreamingUrlFromSongId(const QString& song_id); - - private slots: - void AuthenticationFinished(UbuntuOneAuthenticator* authenticator); - void FileListRequestFinished(QNetworkReply* reply); - void ShowCoverManager(); - void AddToPlaylist(QMimeData* mime); - void VolumeListRequestFinished(QNetworkReply* reply); - - private: - void Connect(); - QNetworkReply* SendRequest(const QUrl& url); - void RequestVolumeList(); - void RequestFileList(const QString& path); - bool has_credentials() const; - - private: - QByteArray GenerateAuthorisationHeader(); - - QString consumer_key_; - QString consumer_secret_; - QString token_; - QString token_secret_; -}; - -#endif // UBUNTUONESERVICE_H diff --git a/src/internet/ubuntuonesettingspage.cpp b/src/internet/ubuntuonesettingspage.cpp deleted file mode 100644 index 2a7ed3783..000000000 --- a/src/internet/ubuntuonesettingspage.cpp +++ /dev/null @@ -1,86 +0,0 @@ -#include "ubuntuonesettingspage.h" - -#include "ui_ubuntuonesettingspage.h" - -#include "core/application.h" -#include "core/closure.h" -#include "core/logging.h" -#include "internet/internetmodel.h" -#include "internet/ubuntuoneauthenticator.h" -#include "internet/ubuntuoneservice.h" - -#include - -UbuntuOneSettingsPage::UbuntuOneSettingsPage(SettingsDialog* parent) - : SettingsPage(parent), - ui_(new Ui::UbuntuOneSettingsPage), - service_(dialog()->app()->internet_model()->Service()), - authenticated_(false) { - ui_->setupUi(this); - - ui_->login_state->AddCredentialField(ui_->username); - ui_->login_state->AddCredentialField(ui_->password); - ui_->login_state->AddCredentialGroup(ui_->login_container); - - connect(ui_->login_state, SIGNAL(LogoutClicked()), SLOT(LogoutClicked())); - connect(ui_->login_state, SIGNAL(LoginClicked()), SLOT(LoginClicked())); - connect(ui_->login_button, SIGNAL(clicked()), SLOT(LoginClicked())); -} - -void UbuntuOneSettingsPage::Load() { - QSettings s; - s.beginGroup(UbuntuOneService::kSettingsGroup); - - const QString user_email = s.value("user_email").toString(); - if (!user_email.isEmpty()) { - ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedIn, user_email); - ui_->username->setText(user_email); - } -} - -void UbuntuOneSettingsPage::Save() {} - -void UbuntuOneSettingsPage::LoginClicked() { - const QString username = ui_->username->text(); - const QString password = ui_->password->text(); - ui_->password->clear(); - - UbuntuOneAuthenticator* authenticator = new UbuntuOneAuthenticator; - authenticator->StartAuthorisation(username, password); - NewClosure(authenticator, SIGNAL(Finished()), this, - SLOT(Connected(UbuntuOneAuthenticator*)), authenticator); - NewClosure(authenticator, SIGNAL(Finished()), service_, - SLOT(AuthenticationFinished(UbuntuOneAuthenticator*)), - authenticator); - - ui_->login_state->SetLoggedIn(LoginStateWidget::LoginInProgress); -} - -void UbuntuOneSettingsPage::LogoutClicked() { - QSettings s; - s.beginGroup(UbuntuOneService::kSettingsGroup); - s.remove("user_email"); - s.remove("consumer_key"); - s.remove("consumer_secret"); - s.remove("token"); - s.remove("token_secret"); - - ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedOut); -} - -void UbuntuOneSettingsPage::Connected(UbuntuOneAuthenticator* authenticator) { - if (!authenticator->success()) { - ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedOut); - QMessageBox::warning(this, tr("Authentication failed"), - tr("Your username or password was incorrect.")); - return; - } - - ui_->login_state->SetLoggedIn(LoginStateWidget::LoggedIn, - ui_->username->text()); - authenticated_ = true; - - QSettings s; - s.beginGroup(UbuntuOneService::kSettingsGroup); - s.setValue("user_email", ui_->username->text()); -} diff --git a/src/internet/ubuntuonesettingspage.h b/src/internet/ubuntuonesettingspage.h deleted file mode 100644 index 0dc702849..000000000 --- a/src/internet/ubuntuonesettingspage.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef UBUNTUONESETTINGSPAGE_H -#define UBUNTUONESETTINGSPAGE_H - -#include "ui/settingspage.h" - -class UbuntuOneAuthenticator; -class UbuntuOneService; -class Ui_UbuntuOneSettingsPage; - -class UbuntuOneSettingsPage : public SettingsPage { - Q_OBJECT - public: - UbuntuOneSettingsPage(SettingsDialog* parent = nullptr); - - void Load(); - void Save(); - - private slots: - void LoginClicked(); - void LogoutClicked(); - void Connected(UbuntuOneAuthenticator* authenticator); - - private: - Ui_UbuntuOneSettingsPage* ui_; - UbuntuOneService* service_; - - bool authenticated_; -}; - -#endif // UBUNTUONESETTINGSPAGE_H diff --git a/src/internet/ubuntuonesettingspage.ui b/src/internet/ubuntuonesettingspage.ui deleted file mode 100644 index 4d25549c8..000000000 --- a/src/internet/ubuntuonesettingspage.ui +++ /dev/null @@ -1,120 +0,0 @@ - - - UbuntuOneSettingsPage - - - - 0 - 0 - 569 - 491 - - - - Ubuntu One - - - - :/providers/ubuntuone.png:/providers/ubuntuone.png - - - - - - Clementine can play music that you have uploaded to Ubuntu One - - - true - - - - - - - - - - Account details - - - - - - Ubuntu One username - - - - - - - - - - - - Login - - - - - - - - - Ubuntu One password - - - - - - - QLineEdit::Password - - - - - - - <a href="https://one.ubuntu.com/auth/login">Create a new account or reset your password</a> - - - true - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - LoginStateWidget - QWidget -
widgets/loginstatewidget.h
- 1 -
-
- - username - password - login_button - - - - - -
diff --git a/src/internet/ubuntuoneurlhandler.cpp b/src/internet/ubuntuoneurlhandler.cpp deleted file mode 100644 index ed939b28b..000000000 --- a/src/internet/ubuntuoneurlhandler.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "ubuntuoneurlhandler.h" - -#include "ubuntuoneservice.h" - -UbuntuOneUrlHandler::UbuntuOneUrlHandler(UbuntuOneService* service, - QObject* parent) - : UrlHandler(parent), service_(service) {} - -UrlHandler::LoadResult UbuntuOneUrlHandler::StartLoading(const QUrl& url) { - QString file_id = url.path(); - QUrl real_url = service_->GetStreamingUrlFromSongId(file_id); - return LoadResult(url, LoadResult::TrackAvailable, real_url); -} diff --git a/src/internet/ubuntuoneurlhandler.h b/src/internet/ubuntuoneurlhandler.h deleted file mode 100644 index a4e9a39bf..000000000 --- a/src/internet/ubuntuoneurlhandler.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef UBUNTUONEURLHANDLER_H -#define UBUNTUONEURLHANDLER_H - -#include "core/urlhandler.h" - -class UbuntuOneService; - -class UbuntuOneUrlHandler : public UrlHandler { - Q_OBJECT - public: - UbuntuOneUrlHandler(UbuntuOneService* service, QObject* parent = nullptr); - - QString scheme() const { return "ubuntuonefile"; } - QIcon icon() const { return QIcon(":providers/ubuntuone.png"); } - LoadResult StartLoading(const QUrl& url); - - private: - UbuntuOneService* service_; -}; - -#endif // UBUNTUONEURLHANDLER_H diff --git a/src/ui/settingsdialog.cpp b/src/ui/settingsdialog.cpp index c5cabf61d..8a6c1e70e 100644 --- a/src/ui/settingsdialog.cpp +++ b/src/ui/settingsdialog.cpp @@ -41,7 +41,6 @@ #include "internet/soundcloudsettingspage.h" #include "internet/spotifysettingspage.h" #include "internet/subsonicsettingspage.h" -#include "internet/ubuntuonesettingspage.h" #include "library/librarysettingspage.h" #include "playlist/playlistview.h" #include "podcasts/podcastsettingspage.h" @@ -64,10 +63,6 @@ #include "internet/googledrivesettingspage.h" #endif -#ifdef HAVE_UBUNTU_ONE -#include "internet/ubuntuonesettingspage.h" -#endif - #ifdef HAVE_DROPBOX #include "internet/dropboxsettingspage.h" #endif @@ -169,10 +164,6 @@ SettingsDialog::SettingsDialog(Application* app, BackgroundStreams* streams, AddPage(Page_GoogleDrive, new GoogleDriveSettingsPage(this), providers); #endif -#ifdef HAVE_UBUNTU_ONE - AddPage(Page_UbuntuOne, new UbuntuOneSettingsPage(this), providers); -#endif - #ifdef HAVE_DROPBOX AddPage(Page_Dropbox, new DropboxSettingsPage(this), providers); #endif diff --git a/src/ui/settingsdialog.h b/src/ui/settingsdialog.h index b8f918652..2880a5423 100644 --- a/src/ui/settingsdialog.h +++ b/src/ui/settingsdialog.h @@ -81,7 +81,6 @@ class SettingsDialog : public QDialog { Page_Subsonic, Page_Podcasts, Page_GoogleDrive, - Page_UbuntuOne, Page_Dropbox, Page_Skydrive, Page_Box,