Various formating changes in src/internet

This commit is contained in:
Krzysztof Sobiecki 2014-12-17 19:02:21 +01:00
parent ad4bc3b88b
commit ff62032568
149 changed files with 1697 additions and 677 deletions

View File

@ -1,3 +1,21 @@
/* This file is part of Clementine.
Copyright 2013-2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "boxservice.h"
#include <qjson/parser.h>
@ -27,7 +45,7 @@ static const int kRootFolderId = 0;
static const char* kFileContent = "https://api.box.com/2.0/files/%1/content";
static const char* kEvents = "https://api.box.com/2.0/events";
}
} // namespace
BoxService::BoxService(Application* app, InternetModel* parent)
: CloudFileService(app, parent, kServiceName, kSettingsGroup,
@ -263,7 +281,7 @@ void BoxService::UpdateFilesFromCursor(const QString& cursor) {
}
void BoxService::FetchEventsFinished(QNetworkReply* reply) {
// TODO: Page through events.
// TODO(John Maguire): Page through events.
reply->deleteLater();
QJson::Parser parser;
QVariantMap response = parser.parse(reply).toMap();

View File

@ -1,5 +1,23 @@
#ifndef BOXSERVICE_H
#define BOXSERVICE_H
/* This file is part of Clementine.
Copyright 2013-2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_BOXSERVICE_H_
#define INTERNET_BOXSERVICE_H_
#include "cloudfileservice.h"
@ -11,6 +29,7 @@ class QNetworkRequest;
class BoxService : public CloudFileService {
Q_OBJECT
public:
BoxService(Application* app, InternetModel* parent);
@ -24,7 +43,7 @@ class BoxService : public CloudFileService {
void Connect();
void ForgetCredentials();
signals:
signals:
void Connected();
private slots:
@ -52,4 +71,4 @@ signals:
QDateTime expiry_time_;
};
#endif // BOXSERVICE_H
#endif // INTERNET_BOXSERVICE_H_

View File

@ -1,5 +1,6 @@
/* This file is part of Clementine.
Copyright 2013, John Maguire <john.maguire@gmail.com>
Copyright 2013-2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,6 @@
/* This file is part of Clementine.
Copyright 2013, John Maguire <john.maguire@gmail.com>
Copyright 2013-2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +16,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef BOXSETTINGSPAGE_H
#define BOXSETTINGSPAGE_H
#ifndef INTERNET_BOXSETTINGSPAGE_H_
#define INTERNET_BOXSETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -30,7 +31,7 @@ class BoxSettingsPage : public SettingsPage {
Q_OBJECT
public:
BoxSettingsPage(SettingsDialog* parent = nullptr);
explicit BoxSettingsPage(SettingsDialog* parent = nullptr);
~BoxSettingsPage();
void Load();
@ -50,4 +51,4 @@ class BoxSettingsPage : public SettingsPage {
BoxService* service_;
};
#endif // BOXSETTINGSPAGE_H
#endif // INTERNET_BOXSETTINGSPAGE_H_

View File

@ -1,3 +1,21 @@
/* This file is part of Clementine.
Copyright 2013-2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "boxurlhandler.h"
#include "boxservice.h"

View File

@ -1,5 +1,23 @@
#ifndef BOXURLHANDLER_H
#define BOXURLHANDLER_H
/* This file is part of Clementine.
Copyright 2013, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_BOXURLHANDLER_H_
#define INTERNET_BOXURLHANDLER_H_
#include "core/urlhandler.h"
@ -7,8 +25,9 @@ class BoxService;
class BoxUrlHandler : public UrlHandler {
Q_OBJECT
public:
BoxUrlHandler(BoxService* service, QObject* parent = nullptr);
explicit BoxUrlHandler(BoxService* service, QObject* parent = nullptr);
QString scheme() const { return "box"; }
QIcon icon() const { return QIcon(":/providers/box.png"); }
@ -18,4 +37,4 @@ class BoxUrlHandler : public UrlHandler {
BoxService* service_;
};
#endif // BOXURLHANDLER_H
#endif // INTERNET_BOXURLHANDLER_H_

View File

@ -1,16 +1,17 @@
/* This file is part of Clementine.
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
@ -20,18 +21,11 @@
#include "internet/internetmodel.h"
CloudFileSearchProvider::CloudFileSearchProvider(
LibraryBackendInterface* backend,
const QString& id,
const QIcon& icon,
LibraryBackendInterface* backend, const QString& id, const QIcon& icon,
CloudFileService* service)
: LibrarySearchProvider(backend,
service->name(),
id,
icon,
true,
service->model()->app(),
service),
service_(service) {
: LibrarySearchProvider(backend, service->name(), id, icon, true,
service->model()->app(), service),
service_(service) {
SetHint(CanShowConfig);
}
@ -39,9 +33,7 @@ bool CloudFileSearchProvider::IsLoggedIn() {
return service_->has_credentials();
}
void CloudFileSearchProvider::ShowConfig() {
service_->ShowSettingsDialog();
}
void CloudFileSearchProvider::ShowConfig() { service_->ShowSettingsDialog(); }
InternetService* CloudFileSearchProvider::internet_service() {
return service_;

View File

@ -1,22 +1,23 @@
/* This file is part of Clementine.
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CLOUDFILESEARCHPROVIDER_H
#define CLOUDFILESEARCHPROVIDER_H
#ifndef INTERNET_CLOUDFILESEARCHPROVIDER_H_
#define INTERNET_CLOUDFILESEARCHPROVIDER_H_
#include "globalsearch/librarysearchprovider.h"
@ -24,10 +25,8 @@ class CloudFileService;
class CloudFileSearchProvider : public LibrarySearchProvider {
public:
CloudFileSearchProvider(LibraryBackendInterface* backend,
const QString& id,
const QIcon& icon,
CloudFileService* service);
CloudFileSearchProvider(LibraryBackendInterface* backend, const QString& id,
const QIcon& icon, CloudFileService* service);
virtual bool IsLoggedIn();
virtual void ShowConfig();
@ -37,4 +36,4 @@ class CloudFileSearchProvider : public LibrarySearchProvider {
CloudFileService* service_;
};
#endif // CLOUDFILESEARCHPROVIDER_H
#endif // INTERNET_CLOUDFILESEARCHPROVIDER_H_

View File

@ -1,3 +1,23 @@
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2013, Martin Brodbeck <martin@brodbeck-online.de>
Copyright 2013-2014, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cloudfileservice.h"
#include <QMenu>
@ -129,35 +149,34 @@ void CloudFileService::MaybeAddFileToDatabase(const Song& metadata,
}
if (indexing_task_id_ == -1) {
indexing_task_id_ =
task_manager_->StartTask(tr("Indexing %1").arg(name()));
indexing_task_id_ = task_manager_->StartTask(tr("Indexing %1").arg(name()));
indexing_task_progress_ = 0;
indexing_task_max_ = 0;
}
indexing_task_max_ ++;
task_manager_->SetTaskProgress(
indexing_task_id_, indexing_task_progress_, indexing_task_max_);
indexing_task_max_++;
task_manager_->SetTaskProgress(indexing_task_id_, indexing_task_progress_,
indexing_task_max_);
TagReaderClient::ReplyType* reply = app_->tag_reader_client()->ReadCloudFile(
download_url, metadata.title(), metadata.filesize(), mime_type,
authorisation);
NewClosure(reply, SIGNAL(Finished(bool)), this,
SLOT(ReadTagsFinished(TagReaderClient::ReplyType*, Song)),
reply, metadata);
SLOT(ReadTagsFinished(TagReaderClient::ReplyType*, Song)), reply,
metadata);
}
void CloudFileService::ReadTagsFinished(TagReaderClient::ReplyType* reply,
const Song& metadata) {
reply->deleteLater();
indexing_task_progress_ ++;
indexing_task_progress_++;
if (indexing_task_progress_ == indexing_task_max_) {
task_manager_->SetTaskFinished(indexing_task_id_);
indexing_task_id_ = -1;
emit AllIndexingTasksFinished();
} else {
task_manager_->SetTaskProgress(
indexing_task_id_, indexing_task_progress_, indexing_task_max_);
task_manager_->SetTaskProgress(indexing_task_id_, indexing_task_progress_,
indexing_task_max_);
}
const pb::tagreader::ReadCloudFileResponse& message =

View File

@ -1,5 +1,24 @@
#ifndef CLOUDFILESERVICE_H
#define CLOUDFILESERVICE_H
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, David Sansome <me@davidsansome.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_CLOUDFILESERVICE_H_
#define INTERNET_CLOUDFILESERVICE_H_
#include "internetservice.h"
@ -19,6 +38,7 @@ class PlaylistManager;
class CloudFileService : public InternetService {
Q_OBJECT
public:
CloudFileService(Application* app, InternetModel* parent,
const QString& service_name, const QString& service_id,
@ -76,4 +96,4 @@ class CloudFileService : public InternetService {
int indexing_task_max_;
};
#endif // CLOUDFILESERVICE_H
#endif // INTERNET_CLOUDFILESERVICE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -44,13 +46,13 @@ DigitallyImportedClient::DigitallyImportedClient(const QString& service_name,
network_(new NetworkAccessManager(this)),
service_name_(service_name) {}
void DigitallyImportedClient::SetAuthorisationHeader(QNetworkRequest* req)
const {
req->setRawHeader("Authorization",
"Basic " + QString("%1:%2")
.arg(kApiUsername, kApiPassword)
.toAscii()
.toBase64());
void DigitallyImportedClient::SetAuthorisationHeader(
QNetworkRequest* req) const {
req->setRawHeader("Authorization", "Basic " +
QString("%1:%2")
.arg(kApiUsername, kApiPassword)
.toAscii()
.toBase64());
}
QNetworkReply* DigitallyImportedClient::Auth(const QString& username,

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIGITALLYIMPORTEDCLIENT_H
#define DIGITALLYIMPORTEDCLIENT_H
#ifndef INTERNET_DIGITALLYIMPORTEDCLIENT_H_
#define INTERNET_DIGITALLYIMPORTEDCLIENT_H_
#include <QDateTime>
#include <QObject>
@ -31,7 +33,7 @@ class DigitallyImportedClient : public QObject {
Q_OBJECT
public:
DigitallyImportedClient(const QString& service_name, QObject* parent = nullptr);
explicit DigitallyImportedClient(const QString& service_name, QObject* parent = nullptr);
static const char* kApiUsername;
static const char* kApiPassword;
@ -84,4 +86,4 @@ QDataStream& operator>>(QDataStream& in,
DigitallyImportedClient::Channel& channel);
Q_DECLARE_METATYPE(DigitallyImportedClient::Channel)
#endif // DIGITALLYIMPORTEDCLIENT_H
#endif // INTERNET_DIGITALLYIMPORTEDCLIENT_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2011-2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -249,16 +252,14 @@ SkyFmService::SkyFmService(Application* app, InternetModel* model,
JazzRadioService::JazzRadioService(Application* app, InternetModel* model,
QObject* parent)
: DigitallyImportedServiceBase(
"JazzRadio", "JAZZRADIO.com", QUrl("http://www.jazzradio.com"),
QIcon(":/providers/jazzradio.png"), "jazzradio", app, model, true,
parent) {
}
: DigitallyImportedServiceBase("JazzRadio", "JAZZRADIO.com",
QUrl("http://www.jazzradio.com"),
QIcon(":/providers/jazzradio.png"),
"jazzradio", app, model, true, parent) {}
RockRadioService::RockRadioService(Application* app, InternetModel* model,
QObject* parent)
: DigitallyImportedServiceBase(
"RockRadio", "ROCKRADIO.com", QUrl("http://www.rockradio.com"),
QIcon(":/providers/rockradio.png"), "rockradio", app, model, false,
parent) {
}
: DigitallyImportedServiceBase("RockRadio", "ROCKRADIO.com",
QUrl("http://www.rockradio.com"),
QIcon(":/providers/rockradio.png"),
"rockradio", app, model, false, parent) {}

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIGITALLYIMPORTEDSERVICEBASE_H
#define DIGITALLYIMPORTEDSERVICEBASE_H
#ifndef INTERNET_DIGITALLYIMPORTEDSERVICEBASE_H_
#define INTERNET_DIGITALLYIMPORTEDSERVICEBASE_H_
#include <memory>
@ -38,8 +40,7 @@ class DigitallyImportedServiceBase : public InternetService {
const QUrl& homepage_url, const QIcon& icon,
const QString& api_service_name,
Application* app, InternetModel* model,
bool has_premium,
QObject* parent = nullptr);
bool has_premium, QObject* parent = nullptr);
~DigitallyImportedServiceBase();
static const char* kSettingsGroup;
@ -66,7 +67,7 @@ class DigitallyImportedServiceBase : public InternetService {
public slots:
void ShowSettingsDialog();
signals:
signals:
void StreamsChanged();
private slots:
@ -98,7 +99,7 @@ signals:
int premium_audio_type_;
QString username_;
QString listen_hash_;
bool has_premium_; // Does the service has premium features?
bool has_premium_; // Does the service has premium features?
QStandardItem* root_;
@ -118,7 +119,8 @@ class DigitallyImportedService : public DigitallyImportedServiceBase {
class SkyFmService : public DigitallyImportedServiceBase {
public:
SkyFmService(Application* app, InternetModel* model, QObject* parent = nullptr);
SkyFmService(Application* app, InternetModel* model,
QObject* parent = nullptr);
};
class JazzRadioService : public DigitallyImportedServiceBase {
@ -133,4 +135,4 @@ class RockRadioService : public DigitallyImportedServiceBase {
QObject* parent = nullptr);
};
#endif // DIGITALLYIMPORTEDSERVICEBASE_H
#endif // INTERNET_DIGITALLYIMPORTEDSERVICEBASE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIGITALLYIMPORTEDSETTINGSPAGE_H
#define DIGITALLYIMPORTEDSETTINGSPAGE_H
#ifndef INTERNET_DIGITALLYIMPORTEDSETTINGSPAGE_H_
#define INTERNET_DIGITALLYIMPORTEDSETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -29,7 +31,7 @@ class DigitallyImportedSettingsPage : public SettingsPage {
Q_OBJECT
public:
DigitallyImportedSettingsPage(SettingsDialog* dialog);
explicit DigitallyImportedSettingsPage(SettingsDialog* dialog);
~DigitallyImportedSettingsPage();
void Load();
@ -51,4 +53,4 @@ class DigitallyImportedSettingsPage : public SettingsPage {
DigitallyImportedClient* client_;
};
#endif // DIGITALLYIMPORTEDSETTINGSPAGE_H
#endif // INTERNET_DIGITALLYIMPORTEDSETTINGSPAGE_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2012, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DIGITALLYIMPORTEDURLHANDLER_H
#define DIGITALLYIMPORTEDURLHANDLER_H
#ifndef INTERNET_DIGITALLYIMPORTEDURLHANDLER_H_
#define INTERNET_DIGITALLYIMPORTEDURLHANDLER_H_
#include "core/urlhandler.h"
@ -43,4 +45,4 @@ class DigitallyImportedUrlHandler : public UrlHandler {
QUrl last_original_url_;
};
#endif // DIGITALLYIMPORTEDURLHANDLER_H
#endif // INTERNET_DIGITALLYIMPORTEDURLHANDLER_H_

View File

@ -1,3 +1,21 @@
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dropboxauthenticator.h"
#include <time.h>
@ -61,7 +79,7 @@ QMap<QString, QString> ParseParamList(const QString& params) {
}
return ret;
}
}
} // namespace
void DropboxAuthenticator::RequestTokenFinished(QNetworkReply* reply) {
reply->deleteLater();

View File

@ -1,5 +1,23 @@
#ifndef DROPBOXAUTHENTICATOR_H
#define DROPBOXAUTHENTICATOR_H
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_DROPBOXAUTHENTICATOR_H_
#define INTERNET_DROPBOXAUTHENTICATOR_H_
#include <QObject>
#include <QTcpServer>
@ -10,6 +28,7 @@ class QNetworkReply;
class DropboxAuthenticator : public QObject {
Q_OBJECT
public:
explicit DropboxAuthenticator(QObject* parent = nullptr);
void StartAuthorisation();
@ -22,7 +41,7 @@ class DropboxAuthenticator : public QObject {
static QByteArray GenerateAuthorisationHeader(const QString& token,
const QString& secret);
signals:
signals:
void Finished();
private slots:
@ -54,4 +73,4 @@ signals:
QString name_;
};
#endif // DROPBOXAUTHENTICATOR_H
#endif // INTERNET_DROPBOXAUTHENTICATOR_H_

View File

@ -1,3 +1,22 @@
/* This file is part of Clementine.
Copyright 2012-2014, John Maguire <john.maguire@gmail.com>
Copyright 2013, Martin Brodbeck <martin@brodbeck-online.de>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dropboxservice.h"
#include <QFileInfo>

View File

@ -1,5 +1,23 @@
#ifndef DROPBOXSERVICE_H
#define DROPBOXSERVICE_H
/* This file is part of Clementine.
Copyright 2012-2013, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_DROPBOXSERVICE_H_
#define INTERNET_DROPBOXSERVICE_H_
#include "internet/cloudfileservice.h"
@ -11,6 +29,7 @@ class QNetworkReply;
class DropboxService : public CloudFileService {
Q_OBJECT
public:
DropboxService(Application* app, InternetModel* parent);
@ -21,7 +40,7 @@ class DropboxService : public CloudFileService {
QUrl GetStreamingUrlFromSongId(const QUrl& url);
signals:
signals:
void Connected();
public slots:
@ -46,4 +65,4 @@ signals:
NetworkAccessManager* network_;
};
#endif // DROPBOXSERVICE_H
#endif // INTERNET_DROPBOXSERVICE_H_

View File

@ -1,5 +1,6 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,6 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +16,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DROPBOXSETTINGSPAGE_H
#define DROPBOXSETTINGSPAGE_H
#ifndef INTERNET_DROPBOXSETTINGSPAGE_H_
#define INTERNET_DROPBOXSETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -31,7 +32,7 @@ class DropboxSettingsPage : public SettingsPage {
Q_OBJECT
public:
DropboxSettingsPage(SettingsDialog* parent = nullptr);
explicit DropboxSettingsPage(SettingsDialog* parent = nullptr);
~DropboxSettingsPage();
void Load();
@ -51,4 +52,4 @@ class DropboxSettingsPage : public SettingsPage {
DropboxService* service_;
};
#endif // DROPBOXSETTINGSPAGE_H
#endif // INTERNET_DROPBOXSETTINGSPAGE_H_

View File

@ -1,3 +1,21 @@
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "dropboxurlhandler.h"
#include "internet/dropboxservice.h"

View File

@ -1,5 +1,23 @@
#ifndef DROPBOXURLHANDLER_H
#define DROPBOXURLHANDLER_H
/* This file is part of Clementine.
Copyright 2012, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_DROPBOXURLHANDLER_H_
#define INTERNET_DROPBOXURLHANDLER_H_
#include "core/urlhandler.h"
@ -8,7 +26,7 @@ class DropboxService;
class DropboxUrlHandler : public UrlHandler {
Q_OBJECT
public:
DropboxUrlHandler(DropboxService* service, QObject* parent = nullptr);
explicit DropboxUrlHandler(DropboxService* service, QObject* parent = nullptr);
QString scheme() const { return "dropbox"; }
QIcon icon() const { return QIcon(":providers/dropbox.png"); }
@ -18,4 +36,4 @@ class DropboxUrlHandler : public UrlHandler {
DropboxService* service_;
};
#endif
#endif // INTERNET_DROPBOXURLHANDLER_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FIXLASTFM_H
#define FIXLASTFM_H
#ifndef INTERNET_FIXLASTFM_H_
#define INTERNET_FIXLASTFM_H_
// Include this before <lastfm/Track> to fix a compile error in release mode
@ -27,4 +29,4 @@
QDebug& operator<<(QDebug&, const QUrl&);
#endif
#endif
#endif // INTERNET_FIXLASTFM_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GEOLOCATOR_H
#define GEOLOCATOR_H
#ifndef INTERNET_GEOLOCATOR_H_
#define INTERNET_GEOLOCATOR_H_
#include <QObject>
@ -24,6 +26,7 @@
class Geolocator : public QObject {
Q_OBJECT
public:
explicit Geolocator(QObject* parent = nullptr);
@ -47,7 +50,7 @@ class Geolocator : public QObject {
int lng_e6_;
};
signals:
signals:
void Finished(Geolocator::LatLng latlng);
private slots:
@ -62,4 +65,4 @@ signals:
QDebug operator<<(QDebug dbg, const Geolocator::LatLng& ll);
Q_DECLARE_METATYPE(Geolocator::LatLng);
#endif // GEOLOCATOR_H
#endif // INTERNET_GEOLOCATOR_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2012, 2014, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -44,7 +46,7 @@ static const char* kOAuthScope =
"https://www.googleapis.com/auth/userinfo.email";
static const char* kClientId = "679260893280.apps.googleusercontent.com";
static const char* kClientSecret = "l3cWb8efUZsrBI4wmY3uKl6i";
}
} // namespace
QStringList File::parent_ids() const {
QStringList ret;
@ -201,7 +203,7 @@ void Client::ListChangesFinished(ListChangesResponse* response,
QJson::Parser parser;
bool ok = false;
// TODO: Put this on a separate thread as the response could be large.
// TODO(John Maguire): Put this on a separate thread as the response could be large.
QVariantMap result = parser.parse(reply, &ok).toMap();
if (!ok) {
qLog(Error) << "Failed to fetch changes" << response->cursor();

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GOOGLEDRIVECLIENT_H
#define GOOGLEDRIVECLIENT_H
#ifndef INTERNET_GOOGLEDRIVECLIENT_H_
#define INTERNET_GOOGLEDRIVECLIENT_H_
#include <QDateTime>
#include <QList>
@ -37,7 +39,7 @@ class Client;
// Holds the metadata for a file on Google Drive.
class File {
public:
File(const QVariantMap& data = QVariantMap()) : data_(data) {}
explicit File(const QVariantMap& data = QVariantMap()) : data_(data) {}
static const char* kFolderMimeType;
@ -46,7 +48,7 @@ class File {
QString title() const { return data_["title"].toString(); }
QString mime_type() const { return data_["mimeType"].toString(); }
QString description() const { return data_["description"].toString(); }
long size() const { return data_["fileSize"].toUInt(); }
qint64 size() const { return data_["fileSize"].toUInt(); }
QUrl download_url() const { return data_["downloadUrl"].toUrl(); }
QUrl alternate_link() const { return data_["alternateLink"].toUrl(); }
@ -85,11 +87,11 @@ class ConnectResponse : public QObject {
const QString& refresh_token() const { return refresh_token_; }
const QString& user_email() const { return user_email_; }
signals:
signals:
void Finished();
private:
ConnectResponse(QObject* parent);
explicit ConnectResponse(QObject* parent);
QString refresh_token_;
QString user_email_;
};
@ -102,7 +104,7 @@ class GetFileResponse : public QObject {
const QString& file_id() const { return file_id_; }
const File& file() const { return file_; }
signals:
signals:
void Finished();
private:
@ -119,7 +121,7 @@ class ListChangesResponse : public QObject {
const QString& cursor() const { return cursor_; }
const QString& next_cursor() const { return next_cursor_; }
signals:
signals:
void FilesFound(const QList<google_drive::File>& files);
void FilesDeleted(const QList<QUrl>& files);
void Finished();
@ -134,7 +136,7 @@ class Client : public QObject {
Q_OBJECT
public:
Client(QObject* parent = nullptr);
explicit Client(QObject* parent = nullptr);
bool is_authenticated() const;
const QString& access_token() const { return access_token_; }
@ -145,7 +147,7 @@ class Client : public QObject {
GetFileResponse* GetFile(const QString& file_id);
ListChangesResponse* ListChanges(const QString& cursor);
signals:
signals:
void Authenticated();
private slots:
@ -166,6 +168,6 @@ signals:
QDateTime expiry_time_;
};
} // namespace
} // namespace google_drive
#endif // GOOGLEDRIVECLIENT_H
#endif // INTERNET_GOOGLEDRIVECLIENT_H_

View File

@ -1,3 +1,22 @@
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2012, 2014, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "googledriveservice.h"
#include <QDesktopServices>
@ -92,9 +111,8 @@ void GoogleDriveService::ListChangesFinished(
if (is_indexing()) {
// Only save the cursor after all the songs have been indexed - that way if
// Clementine is closed it'll resume next time.
NewClosure(this, SIGNAL(AllIndexingTasksFinished()),
this, SLOT(SaveCursor(QString)),
cursor);
NewClosure(this, SIGNAL(AllIndexingTasksFinished()), this,
SLOT(SaveCursor(QString)), cursor);
} else {
SaveCursor(cursor);
}
@ -198,12 +216,12 @@ void GoogleDriveService::ShowContextMenu(const QPoint& global_pos) {
QIcon(":/providers/googledrive.png"), tr("Open in Google Drive"), this,
SLOT(OpenWithDrive()));
context_menu_->addSeparator();
update_action_ = context_menu_->addAction(
IconLoader::Load("view-refresh"), tr("Check for updates"),
this, SLOT(CheckForUpdates()));
update_action_ = context_menu_->addAction(IconLoader::Load("view-refresh"),
tr("Check for updates"), this,
SLOT(CheckForUpdates()));
full_rescan_action_ = context_menu_->addAction(
IconLoader::Load("view-refresh"), tr("Do a full rescan..."),
this, SLOT(ConfirmFullRescan()));
IconLoader::Load("view-refresh"), tr("Do a full rescan..."), this,
SLOT(ConfirmFullRescan()));
context_menu_->addSeparator();
context_menu_->addAction(IconLoader::Load("download"), tr("Cover Manager"),
this, SLOT(ShowCoverManager()));
@ -246,15 +264,14 @@ void GoogleDriveService::OpenWithDrive() {
void GoogleDriveService::ConfirmFullRescan() {
QMessageBox* message_box = new QMessageBox(
QMessageBox::Warning,
tr("Do a full rescan"),
QMessageBox::Warning, tr("Do a full rescan"),
tr("Doing a full rescan will lose any metadata you've saved in "
"Clementine such as cover art, play counts and ratings. Clementine "
"will rescan all your music in Google Drive which may take some "
"time."),
QMessageBox::NoButton);
QPushButton* button = message_box->addButton(
tr("Do a full rescan"), QMessageBox::DestructiveRole);
QPushButton* button = message_box->addButton(tr("Do a full rescan"),
QMessageBox::DestructiveRole);
connect(button, SIGNAL(clicked()), SLOT(DoFullRescan()));
message_box->addButton(QMessageBox::Cancel);

View File

@ -1,5 +1,24 @@
#ifndef GOOGLEDRIVESERVICE_H
#define GOOGLEDRIVESERVICE_H
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2012, 2014, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_GOOGLEDRIVESERVICE_H_
#define INTERNET_GOOGLEDRIVESERVICE_H_
#include "cloudfileservice.h"
@ -13,6 +32,7 @@ class ListChangesResponse;
class GoogleDriveService : public CloudFileService {
Q_OBJECT
public:
GoogleDriveService(Application* app, InternetModel* parent);
@ -31,7 +51,7 @@ class GoogleDriveService : public CloudFileService {
void Connect();
void ForgetCredentials();
signals:
signals:
void Connected();
private slots:
@ -58,4 +78,4 @@ signals:
QAction* full_rescan_action_;
};
#endif
#endif // INTERNET_GOOGLEDRIVESERVICE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2013-2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GOOGLEDRIVESETTINGSPAGE_H
#define GOOGLEDRIVESETTINGSPAGE_H
#ifndef INTERNET_GOOGLEDRIVESETTINGSPAGE_H_
#define INTERNET_GOOGLEDRIVESETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -30,7 +32,7 @@ class GoogleDriveSettingsPage : public SettingsPage {
Q_OBJECT
public:
GoogleDriveSettingsPage(SettingsDialog* parent = nullptr);
explicit GoogleDriveSettingsPage(SettingsDialog* parent = nullptr);
~GoogleDriveSettingsPage();
void Load();
@ -50,4 +52,4 @@ class GoogleDriveSettingsPage : public SettingsPage {
GoogleDriveService* service_;
};
#endif // GOOGLEDRIVESETTINGSPAGE_H
#endif // INTERNET_GOOGLEDRIVESETTINGSPAGE_H_

View File

@ -1,3 +1,21 @@
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "googledriveurlhandler.h"
#include "googledriveservice.h"

View File

@ -1,5 +1,23 @@
#ifndef GOOGLEDRIVEURLHANDLER_H
#define GOOGLEDRIVEURLHANDLER_H
/* This file is part of Clementine.
Copyright 2012, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_GOOGLEDRIVEURLHANDLER_H_
#define INTERNET_GOOGLEDRIVEURLHANDLER_H_
#include "core/urlhandler.h"
@ -7,8 +25,9 @@ class GoogleDriveService;
class GoogleDriveUrlHandler : public UrlHandler {
Q_OBJECT
public:
GoogleDriveUrlHandler(GoogleDriveService* service, QObject* parent = nullptr);
explicit GoogleDriveUrlHandler(GoogleDriveService* service, QObject* parent = nullptr);
QString scheme() const { return "googledrive"; }
QIcon icon() const { return QIcon(":providers/googledrive.png"); }
@ -18,4 +37,4 @@ class GoogleDriveUrlHandler : public UrlHandler {
GoogleDriveService* service_;
};
#endif
#endif // INTERNET_GOOGLEDRIVEURLHANDLER_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,20 +17,19 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROOVESHARKRADIO_H
#define GROOVESHARKRADIO_H
#ifndef INTERNET_GROOVESHARKRADIO_H_
#define INTERNET_GROOVESHARKRADIO_H_
#include "smartplaylists/generator.h"
class GroovesharkService;
class GroovesharkRadio : public smart_playlists::Generator {
public:
// Start Grooveshark radio for a particular type of music
GroovesharkRadio(GroovesharkService* service, int tag_id);
// Start Grooveshark radio based on last artists and songs you listen to
GroovesharkRadio(GroovesharkService* service);
explicit GroovesharkRadio(GroovesharkService* service);
QString type() const { return "Grooveshark"; }
void Load(const QByteArray& data);
@ -48,4 +49,4 @@ class GroovesharkRadio : public smart_playlists::Generator {
QVariantMap autoplay_state_;
};
#endif // GROOVESHARKRADIO_H
#endif // INTERNET_GROOVESHARKRADIO_H_

View File

@ -1,5 +1,10 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011-2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011-2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, HYPNOTOAD <hypnotoad@clementine.org>
Copyright 2011-2012, David Sansome <me@davidsansome.com>
Copyright 2014, Antonio Nicolás Pina <antonio@antonionicolaspina.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -118,7 +123,6 @@ GroovesharkService::GroovesharkService(Application* app, InternetModel* parent)
task_popular_id_(0),
task_playlists_id_(0),
task_search_id_(0) {
app_->player()->RegisterUrlHandler(url_handler_);
search_delay_->setInterval(kSearchDelayMsec);
@ -442,7 +446,8 @@ void GroovesharkService::RemoveItems() {
playlists_.clear();
subscribed_playlists_parent_ = nullptr;
subscribed_playlists_.clear();
// Cancel any pending requests and mark tasks as finished, in case they weren't
// Cancel any pending requests and mark tasks as finished, in case they
// weren't
// finished yet.
pending_retrieve_playlists_.clear();
app_->task_manager()->SetTaskFinished(task_playlists_id_);
@ -719,7 +724,8 @@ void GroovesharkService::UserPlaylistsRetrieved(QNetworkReply* reply) {
}
void GroovesharkService::PlaylistSongsRetrieved(QNetworkReply* reply,
int playlist_id, int request_id) {
int playlist_id,
int request_id) {
reply->deleteLater();
if (!pending_retrieve_playlists_.remove(request_id)) {
@ -1273,9 +1279,9 @@ void GroovesharkService::RefreshPlaylist(int playlist_id) {
parameters << Param("playlistID", playlist_id);
QNetworkReply* reply = CreateRequest("getPlaylistSongs", parameters);
int id = next_pending_playlist_retrieve_id_++;
NewClosure(reply, SIGNAL(finished()),
this, SLOT(PlaylistSongsRetrieved(QNetworkReply*, int, int)),
reply, playlist_id, id);
NewClosure(reply, SIGNAL(finished()), this,
SLOT(PlaylistSongsRetrieved(QNetworkReply*, int, int)), reply,
playlist_id, id);
pending_retrieve_playlists_.insert(id);
}
@ -1468,9 +1474,8 @@ void GroovesharkService::UserLibrarySongAdded(QNetworkReply* reply,
void GroovesharkService::RemoveCurrentFromPlaylist() {
const QModelIndexList& indexes(model()->selected_indexes());
QMap<int, QList<int> > playlists_songs_ids;
QMap<int, QList<int>> playlists_songs_ids;
for (const QModelIndex& index : indexes) {
if (index.parent().data(InternetModel::Role_Type).toInt() !=
InternetModel::Type_UserPlaylist) {
continue;
@ -1483,7 +1488,7 @@ void GroovesharkService::RemoveCurrentFromPlaylist() {
}
}
for (QMap<int, QList<int> >::const_iterator it =
for (QMap<int, QList<int>>::const_iterator it =
playlists_songs_ids.constBegin();
it != playlists_songs_ids.constEnd(); ++it) {
RemoveFromPlaylist(it.key(), it.value());
@ -1508,7 +1513,6 @@ void GroovesharkService::RemoveCurrentFromFavorites() {
const QModelIndexList& indexes(model()->selected_indexes());
QList<int> songs_ids;
for (const QModelIndex& index : indexes) {
if (index.parent().data(Role_PlaylistType).toInt() != UserFavorites) {
continue;
}
@ -1561,7 +1565,6 @@ void GroovesharkService::RemoveCurrentFromLibrary() {
QList<int> songs_ids;
for (const QModelIndex& index : indexes) {
if (index.parent().data(Role_PlaylistType).toInt() != UserLibrary) {
continue;
}
@ -1619,7 +1622,6 @@ void GroovesharkService::SongsRemovedFromLibrary(QNetworkReply* reply,
QNetworkReply* GroovesharkService::CreateRequest(const QString& method_name,
const QList<Param>& params,
bool use_https) {
QVariantMap request_params;
request_params.insert("method", method_name);
@ -1650,9 +1652,8 @@ QNetworkReply* GroovesharkService::CreateRequest(const QString& method_name,
url.setScheme("https");
}
url.setQueryItems(
QList<QPair<QString, QString> >()
<< QPair<QString, QString>(
"sig", Utilities::HmacMd5(api_key_, post_params).toHex()));
QList<QPair<QString, QString>>() << QPair<QString, QString>(
"sig", Utilities::HmacMd5(api_key_, post_params).toHex()));
QNetworkRequest req(url);
QNetworkReply* reply = network_->post(req, post_params);
@ -1723,11 +1724,12 @@ bool CompareSongs(const QVariant& song1, const QVariant& song2) {
int song2_sort = song2_map["Sort"].toInt();
if (song1_sort == song2_sort) {
// Favorite songs have a "TSFavorited" and (currently) no "Sort" field
return song1_map["TSFavorited"].toString() < song2_map["TSFavorited"].toString();
return song1_map["TSFavorited"].toString() <
song2_map["TSFavorited"].toString();
}
return song1_sort < song2_sort;
}
}
} // namespace
SongList GroovesharkService::ExtractSongs(const QVariantMap& result) {
QVariantList result_songs = result["songs"].toList();

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011-2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011-2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +18,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROOVESHARKSERVICE_H
#define GROOVESHARKSERVICE_H
#ifndef INTERNET_GROOVESHARKSERVICE_H_
#define INTERNET_GROOVESHARKSERVICE_H_
#include "internetmodel.h"
#include "internetservice.h"
@ -35,6 +38,7 @@ class QSortFilterProxyModel;
class GroovesharkService : public InternetService {
Q_OBJECT
public:
GroovesharkService(Application* app, InternetModel* parent);
~GroovesharkService();
@ -123,7 +127,7 @@ class GroovesharkService : public InternetService {
static const char* kServiceName;
static const char* kSettingsGroup;
signals:
signals:
void LoginFinished(bool success);
void SimpleSearchResults(int id, SongList songs);
// AlbumSearchResult emits the search id and the Grooveshark ids of the
@ -222,7 +226,7 @@ signals:
// If need_authentication is true, add session_id to params.
// Returns the reply object created
QNetworkReply* CreateRequest(const QString& method_name,
const QList<QPair<QString, QVariant> >& params,
const QList<QPair<QString, QVariant>>& params,
bool use_https = false);
// Convenient function which block until 'reply' replies, or timeout after 10
// seconds. Returns false if reply has timeouted
@ -332,4 +336,4 @@ signals:
static const char* kApiSecret;
};
#endif // GROOVESHARKSERVICE_H
#endif // INTERNET_GROOVESHARKSERVICE_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011, 2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROOVESHARKSETTINGSPAGE_H
#define GROOVESHARKSETTINGSPAGE_H
#ifndef INTERNET_GROOVESHARKSETTINGSPAGE_H_
#define INTERNET_GROOVESHARKSETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -28,7 +30,7 @@ class GroovesharkSettingsPage : public SettingsPage {
Q_OBJECT
public:
GroovesharkSettingsPage(SettingsDialog* dialog);
explicit GroovesharkSettingsPage(SettingsDialog* dialog);
~GroovesharkSettingsPage();
void Load();
@ -51,4 +53,4 @@ class GroovesharkSettingsPage : public SettingsPage {
QString original_password_;
};
#endif // GROOVESHARKSETTINGSPAGE_H
#endif // INTERNET_GROOVESHARKSETTINGSPAGE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GROOVESHARKURLHANDLER_H
#define GROOVESHARKURLHANDLER_H
#ifndef INTERNET_GROOVESHARKURLHANDLER_H_
#define INTERNET_GROOVESHARKURLHANDLER_H_
#include "core/urlhandler.h"
@ -47,4 +49,4 @@ class GroovesharkUrlHandler : public UrlHandler {
QString last_stream_key_;
};
#endif // GROOVESHARKURLHANDLER_H
#endif // INTERNET_GROOVESHARKURLHANDLER_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <davidsansome@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2012, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, 2012, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICECASTBACKEND_H
#define ICECASTBACKEND_H
#ifndef INTERNET_ICECASTBACKEND_H_
#define INTERNET_ICECASTBACKEND_H_
#include "core/song.h"
@ -29,7 +31,7 @@ class IcecastBackend : public QObject {
Q_OBJECT
public:
IcecastBackend(QObject* parent = nullptr);
explicit IcecastBackend(QObject* parent = nullptr);
void Init(Database* db);
static const char* kTableName;
@ -58,11 +60,11 @@ class IcecastBackend : public QObject {
bool IsEmpty();
signals:
signals:
void DatabaseReset();
private:
Database* db_;
};
#endif // ICECASTBACKEND_H
#endif // INTERNET_ICECASTBACKEND_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICECASTFILTERWIDGET_H
#define ICECASTFILTERWIDGET_H
#ifndef INTERNET_ICECASTFILTERWIDGET_H_
#define INTERNET_ICECASTFILTERWIDGET_H_
#include "icecastmodel.h"
@ -33,7 +35,7 @@ class IcecastFilterWidget : public QWidget {
Q_OBJECT
public:
IcecastFilterWidget(QWidget* parent = nullptr);
explicit IcecastFilterWidget(QWidget* parent = nullptr);
~IcecastFilterWidget();
static const char* kSettingsGroup;
@ -60,4 +62,4 @@ class IcecastFilterWidget : public QWidget {
QSignalMapper* sort_mode_mapper_;
};
#endif // ICECASTFILTERWIDGET_H
#endif // INTERNET_ICECASTFILTERWIDGET_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,22 +17,27 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICECASTITEM_H
#define ICECASTITEM_H
#ifndef INTERNET_ICECASTITEM_H_
#define INTERNET_ICECASTITEM_H_
#include "icecastbackend.h"
#include "core/simpletreeitem.h"
class IcecastItem : public SimpleTreeItem<IcecastItem> {
public:
enum Type { Type_Root, Type_Genre, Type_Station, Type_Divider, };
enum Type {
Type_Root,
Type_Genre,
Type_Station,
Type_Divider,
};
IcecastItem(SimpleTreeModel<IcecastItem>* model)
: SimpleTreeItem<IcecastItem>(Type_Root, model) {}
IcecastItem(Type type, IcecastItem* parent = nullptr)
: SimpleTreeItem<IcecastItem>(type, parent) {}
explicit IcecastItem(SimpleTreeModel<IcecastItem>* model)
: SimpleTreeItem<IcecastItem>(Type_Root, model) {}
explicit IcecastItem(Type type, IcecastItem* parent = nullptr)
: SimpleTreeItem<IcecastItem>(type, parent) {}
IcecastBackend::Station station;
};
#endif // ICECASTITEM_H
#endif // INTERNET_ICECASTITEM_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICECASTMODEL_H
#define ICECASTMODEL_H
#ifndef INTERNET_ICECASTMODEL_H_
#define INTERNET_ICECASTMODEL_H_
#include "icecastitem.h"
#include "core/simpletreemodel.h"
@ -30,7 +32,7 @@ class IcecastModel : public SimpleTreeModel<IcecastItem> {
Q_OBJECT
public:
IcecastModel(IcecastBackend* backend, QObject* parent = nullptr);
explicit IcecastModel(IcecastBackend* backend, QObject* parent = nullptr);
~IcecastModel();
// These values get saved in QSettings - don't change them
@ -40,7 +42,9 @@ class IcecastModel : public SimpleTreeModel<IcecastItem> {
SortMode_StationAlphabetical = 2,
};
enum Role { Role_IsDivider = LibraryModel::Role_IsDivider, };
enum Role {
Role_IsDivider = LibraryModel::Role_IsDivider,
};
IcecastBackend* backend() const { return backend_; }
@ -81,4 +85,4 @@ class IcecastModel : public SimpleTreeModel<IcecastItem> {
QIcon station_icon_;
};
#endif // ICECASTMODEL_H
#endif // INTERNET_ICECASTMODEL_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2010, 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,6 +19,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "icecastservice.h"
#include <algorithm>
#include <QDesktopServices>
@ -28,7 +34,6 @@
#include "icecastbackend.h"
#include "icecastfilterwidget.h"
#include "icecastmodel.h"
#include "icecastservice.h"
#include "internetmodel.h"
#include "core/application.h"
#include "core/closure.h"
@ -134,7 +139,7 @@ void IcecastService::DownloadDirectoryFinished(QNetworkReply* reply) {
namespace {
template <typename T>
struct GenreSorter {
GenreSorter(const QMultiHash<QString, T>& genres) : genres_(genres) {}
explicit GenreSorter(const QMultiHash<QString, T>& genres) : genres_(genres) {}
bool operator()(const QString& a, const QString& b) const {
return genres_.count(a) > genres_.count(b);
@ -184,7 +189,7 @@ QStringList FilterGenres(const QStringList& genres) {
}
return ret;
}
}
} // namespace
void IcecastService::ParseDirectoryFinished(
QFuture<IcecastBackend::StationList> future) {

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2010, 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,13 +18,14 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ICECASTSERVICE_H
#define ICECASTSERVICE_H
#ifndef INTERNET_ICECASTSERVICE_H_
#define INTERNET_ICECASTSERVICE_H_
#include "internetservice.h"
#include <QXmlStreamReader>
#include "icecastbackend.h"
#include "internetservice.h"
class IcecastFilterWidget;
class IcecastModel;
@ -33,6 +37,7 @@ class QNetworkReply;
class IcecastService : public InternetService {
Q_OBJECT
public:
IcecastService(Application* app, InternetModel* parent);
~IcecastService();
@ -41,7 +46,10 @@ class IcecastService : public InternetService {
static const char* kDirectoryUrl;
static const char* kHomepage;
enum ItemType { Type_Stream = 3000, Type_Genre, };
enum ItemType {
Type_Stream = 3000,
Type_Genre,
};
QStandardItem* CreateRootItem();
void LazyPopulate(QStandardItem* item);
@ -73,4 +81,4 @@ class IcecastService : public InternetService {
int load_directory_task_id_;
};
#endif
#endif // INTERNET_ICECASTSERVICE_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2011, David Sansome <davidsansome@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +18,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETMIMEDATA_H
#define INTERNETMIMEDATA_H
#ifndef INTERNET_INTERNETMIMEDATA_H_
#define INTERNET_INTERNETMIMEDATA_H_
#include "core/mimedata.h"
@ -29,10 +32,10 @@ class InternetMimeData : public MimeData {
Q_OBJECT
public:
InternetMimeData(const InternetModel* _model) : model(_model) {}
explicit InternetMimeData(const InternetModel* _model) : model(_model) {}
const InternetModel* model;
QModelIndexList indexes;
};
#endif // INTERNETMIMEDATA_H
#endif // INTERNET_INTERNETMIMEDATA_H_

View File

@ -1,5 +1,13 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2014, David Sansome <me@davidsansome.com>
Copyright 2010, 2012-2014, John Maguire <john.maguire@gmail.com>
Copyright 2011-2012, 2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2011-2013, Alan Briolat <alan.briolat@gmail.com>
Copyright 2014, Maltsev Vlad <shedwardx@gmail.com>
Copyright 2014, Chocobozzz <florian.bigard@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,10 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2012, David Sansome <me@davidsansome.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011-2012, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Chocobozzz <florian.bigard@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +20,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETMODEL_H
#define INTERNETMODEL_H
#ifndef INTERNET_INTERNETMODEL_H_
#define INTERNET_INTERNETMODEL_H_
#include "core/song.h"
#include "library/librarymodel.h"
@ -42,7 +47,7 @@ class InternetModel : public QStandardItemModel {
Q_OBJECT
public:
InternetModel(Application* app, QObject* parent = nullptr);
explicit InternetModel(Application* app, QObject* parent = nullptr);
enum Role {
// Services can use this role to distinguish between different types of
@ -169,7 +174,7 @@ class InternetModel : public QStandardItemModel {
return shown_services_;
}
signals:
signals:
void StreamError(const QString& message);
void StreamMetadataFound(const QUrl& original_url, const Song& song);
@ -193,4 +198,4 @@ signals:
QModelIndex current_index_;
};
#endif // INTERNETMODEL_H
#endif // INTERNET_INTERNETMODEL_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2011, David Sansome <davidsansome@gmail.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2011, David Sansome <davidsansome@gmail.com>
Copyright 2010, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +19,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETPLAYLISTITEM_H
#define INTERNETPLAYLISTITEM_H
#ifndef INTERNET_INTERNETPLAYLISTITEM_H_
#define INTERNET_INTERNETPLAYLISTITEM_H_
#include "core/song.h"
#include "playlist/playlistitem.h"
@ -27,7 +31,7 @@ class InternetService;
class InternetPlaylistItem : public PlaylistItem {
public:
InternetPlaylistItem(const QString& type);
explicit InternetPlaylistItem(const QString& type);
InternetPlaylistItem(InternetService* service, const Song& metadata);
Options options() const;
@ -55,4 +59,4 @@ class InternetPlaylistItem : public PlaylistItem {
Song metadata_;
};
#endif // INTERNETPLAYLISTITEM_H
#endif // INTERNET_INTERNETPLAYLISTITEM_H_

View File

@ -1,5 +1,10 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2012, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2012, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,10 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2012, David Sansome <me@davidsansome.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011-2012, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +20,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETSERVICE_H
#define INTERNETSERVICE_H
#ifndef INTERNET_INTERNETSERVICE_H_
#define INTERNET_INTERNETSERVICE_H_
#include <QObject>
#include <QList>
@ -74,7 +79,7 @@ class InternetService : public QObject {
virtual QString Icon() { return QString(); }
signals:
signals:
void StreamError(const QString& message);
void StreamMetadataFound(const QUrl& original_url, const Song& song);
@ -134,4 +139,4 @@ signals:
Q_DECLARE_METATYPE(InternetService*);
#endif // INTERNETSERVICE_H
#endif // INTERNET_INTERNETSERVICE_H_

View File

@ -1,5 +1,6 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2014, Chocobozzz <florian.bigard@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,6 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2014, Chocobozzz <florian.bigard@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +16,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETSHOWSETTINGSPAGE_H
#define INTERNETSHOWSETTINGSPAGE_H
#ifndef INTERNET_INTERNETSHOWSETTINGSPAGE_H_
#define INTERNET_INTERNETSHOWSETTINGSPAGE_H_
#include "ui/settingspage.h"
#include "ui_internetshowsettingspage.h"
@ -30,7 +31,7 @@ class InternetShowSettingsPage : public SettingsPage {
Q_OBJECT
public:
InternetShowSettingsPage(SettingsDialog* dialog);
explicit InternetShowSettingsPage(SettingsDialog* dialog);
void Load();
void Save();
@ -39,4 +40,4 @@ class InternetShowSettingsPage : public SettingsPage {
std::unique_ptr<Ui_InternetShowSettingsPage> ui_;
};
#endif // INTERNETSHOWSETTINGSPAGE_H
#endif // INTERNET_INTERNETSHOWSETTINGSPAGE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETSONGMIMEDATA_H
#define INTERNETSONGMIMEDATA_H
#ifndef INTERNET_INTERNETSONGMIMEDATA_H_
#define INTERNET_INTERNETSONGMIMEDATA_H_
#include "core/mimedata.h"
#include "core/song.h"
@ -27,10 +29,10 @@ class InternetSongMimeData : public MimeData {
Q_OBJECT
public:
InternetSongMimeData(InternetService* _service) : service(_service) {}
explicit InternetSongMimeData(InternetService* _service) : service(_service) {}
InternetService* service;
SongList songs;
};
#endif // INTERNETSONGMIMEDATA_H
#endif // INTERNET_INTERNETSONGMIMEDATA_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2010, 2012, David Sansome <me@davidsansome.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2010, David Sansome <davidsansome@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +18,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETVIEW_H
#define INTERNETVIEW_H
#ifndef INTERNET_INTERNETVIEW_H_
#define INTERNET_INTERNETVIEW_H_
#include "widgets/autoexpandingtreeview.h"
@ -24,7 +27,7 @@ class InternetView : public AutoExpandingTreeView {
Q_OBJECT
public:
InternetView(QWidget* parent = nullptr);
explicit InternetView(QWidget* parent = nullptr);
// QWidget
void contextMenuEvent(QContextMenuEvent* e);
@ -33,8 +36,8 @@ class InternetView : public AutoExpandingTreeView {
void currentChanged(const QModelIndex& current, const QModelIndex& previous);
void setModel(QAbstractItemModel* model);
signals:
signals:
void CurrentIndexChanged(const QModelIndex& index);
};
#endif // INTERNETVIEW_H
#endif // INTERNET_INTERNETVIEW_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNETVIEWCONTAINER_H
#define INTERNETVIEWCONTAINER_H
#ifndef INTERNET_INTERNETVIEWCONTAINER_H_
#define INTERNET_INTERNETVIEWCONTAINER_H_
#include <QWidget>
#include <QMap>
@ -34,7 +36,7 @@ class InternetViewContainer : public QWidget {
Q_OBJECT
public:
InternetViewContainer(QWidget* parent = nullptr);
explicit InternetViewContainer(QWidget* parent = nullptr);
~InternetViewContainer();
static const int kAnimationDuration;
@ -72,4 +74,4 @@ class InternetViewContainer : public QWidget {
QMap<QWidget*, HeaderData> headers_;
};
#endif // INTERNETVIEWCONTAINER_H
#endif // INTERNET_INTERNETVIEWCONTAINER_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <davidsansome@gmail.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +18,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef JAMENDODYNAMICPLAYLIST_H
#define JAMENDODYNAMICPLAYLIST_H
#ifndef INTERNET_JAMENDODYNAMICPLAYLIST_H_
#define INTERNET_JAMENDODYNAMICPLAYLIST_H_
#include "smartplaylists/generator.h"
@ -36,7 +39,10 @@ class JamendoDynamicPlaylist : public smart_playlists::Generator {
};
// These values are persisted - only add to the end
enum OrderDirection { Order_Ascending = 0, Order_Descending = 1, };
enum OrderDirection {
Order_Ascending = 0,
Order_Descending = 1,
};
JamendoDynamicPlaylist();
JamendoDynamicPlaylist(const QString& name, OrderBy order_by);
@ -73,4 +79,4 @@ class JamendoDynamicPlaylist : public smart_playlists::Generator {
QDataStream& operator<<(QDataStream& s, const JamendoDynamicPlaylist& p);
QDataStream& operator>>(QDataStream& s, JamendoDynamicPlaylist& p);
#endif
#endif // INTERNET_JAMENDODYNAMICPLAYLIST_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,19 +17,19 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef JAMENDOPLAYLISTITEM_H
#define JAMENDOPLAYLISTITEM_H
#ifndef INTERNET_JAMENDOPLAYLISTITEM_H_
#define INTERNET_JAMENDOPLAYLISTITEM_H_
#include "library/libraryplaylistitem.h"
class JamendoPlaylistItem : public LibraryPlaylistItem {
public:
JamendoPlaylistItem(const QString& type);
JamendoPlaylistItem(const Song& song);
explicit JamendoPlaylistItem(const QString& type);
explicit JamendoPlaylistItem(const Song& song);
bool InitFromQuery(const SqlRow& query);
QUrl Url() const;
};
#endif // JAMENDOPLAYLISTITEM_H
#endif // INTERNET_JAMENDOPLAYLISTITEM_H_

View File

@ -1,5 +1,11 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2013, David Sansome <me@davidsansome.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2014, Chocobozzz <florian.bigard@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -116,12 +122,11 @@ JamendoService::JamendoService(Application* app, InternetModel* parent)
<< GeneratorPtr(new JamendoDynamicPlaylist(
tr("Jamendo Most Listened Tracks"),
JamendoDynamicPlaylist::OrderBy_Listened)))
<< (LibraryModel::GeneratorList()
<< GeneratorPtr(new QueryGenerator(
tr("Dynamic random mix"),
Search(Search::Type_All, Search::TermList(),
Search::Sort_Random, SearchTerm::Field_Title),
true))));
<< (LibraryModel::GeneratorList() << GeneratorPtr(new QueryGenerator(
tr("Dynamic random mix"),
Search(Search::Type_All, Search::TermList(), Search::Sort_Random,
SearchTerm::Field_Title),
true))));
library_sort_model_->setSourceModel(library_model_);
library_sort_model_->setSortRole(LibraryModel::Role_SortText);
@ -197,9 +202,10 @@ void JamendoService::DownloadDirectory() {
}
void JamendoService::DownloadDirectoryProgress(qint64 received, qint64 total) {
float progress = float(received) / total;
float progress = static_cast<float>(received) / total;
app_->task_manager()->SetTaskProgress(load_database_task_id_,
int(progress * 100), 100);
static_cast<int>(progress * 100),
100);
}
void JamendoService::DownloadDirectoryFinished() {
@ -209,7 +215,7 @@ void JamendoService::DownloadDirectoryFinished() {
app_->task_manager()->SetTaskFinished(load_database_task_id_);
load_database_task_id_ = 0;
// TODO: Not leak reply.
// TODO(John Maguire): Not leak reply.
QtIOCompressor* gzip = new QtIOCompressor(reply);
gzip->setStreamFormat(QtIOCompressor::GzipFormat);
if (!gzip->open(QIODevice::ReadOnly)) {

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +19,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef JAMENDOSERVICE_H
#define JAMENDOSERVICE_H
#ifndef INTERNET_JAMENDOSERVICE_H_
#define INTERNET_JAMENDOSERVICE_H_
#include "internetservice.h"
@ -37,6 +41,7 @@ class QSortFilterProxyModel;
class JamendoService : public InternetService {
Q_OBJECT
public:
JamendoService(Application* app, InternetModel* parent);
~JamendoService();
@ -118,4 +123,4 @@ class JamendoService : public InternetService {
bool accepted_download_;
};
#endif
#endif // INTERNET_JAMENDOSERVICE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012-2013, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -30,8 +32,9 @@ bool ParseQuery(const QByteArray& data, XmlQuery* query,
const bool ret = query->parse(data);
if (connection_problems) {
*connection_problems = !ret && query->parseError().enumValue() ==
lastfm::ws::MalformedResponse;
*connection_problems =
!ret &&
query->parseError().enumValue() == lastfm::ws::MalformedResponse;
}
return ret;
@ -65,15 +68,13 @@ bool ParseQuery(const QByteArray& data, XmlQuery* query,
return false;
}
#endif // Q_OS_WIN32
}
catch (lastfm::ws::ParseError e) {
} catch (lastfm::ws::ParseError e) {
qLog(Error) << "Last.fm parse error: " << e.enumValue();
if (connection_problems) {
*connection_problems = e.enumValue() == lastfm::ws::MalformedResponse;
}
return false;
}
catch (std::runtime_error& e) {
} catch (std::runtime_error& e) {
qLog(Error) << e.what();
return false;
}
@ -98,8 +99,7 @@ bool ParseUserList(QNetworkReply* reply, QList<User>* users) {
return false;
}
#endif // Q_OS_WIN32
}
catch (std::runtime_error& e) {
} catch (std::runtime_error& e) {
qLog(Error) << e.what();
return false;
}
@ -109,5 +109,5 @@ bool ParseUserList(QNetworkReply* reply, QList<User>* users) {
uint ScrobbleTimeMin() { return ScrobblePoint::kScrobbleMinLength; }
#endif // HAVE_LIBLASTFM1
}
}
} // namespace compat
} // namespace lastfm

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LASTFMCOMPAT_H
#define LASTFMCOMPAT_H
#ifndef INTERNET_LASTFMCOMPAT_H_
#define INTERNET_LASTFMCOMPAT_H_
#include "config.h"
#include "fixlastfm.h"
@ -58,7 +60,7 @@ typedef lastfm::User AuthenticatedUser;
typedef ::ScrobbleCache ScrobbleCache;
typedef lastfm::AuthenticatedUser AuthenticatedUser;
#endif
}
}
} // namespace compat
} // namespace lastfm
#endif // LASTFMCOMPAT_H
#endif // INTERNET_LASTFMCOMPAT_H_

View File

@ -1,5 +1,12 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2013, David Sansome <me@davidsansome.com>
Copyright 2010-2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2012, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2012, Kacper "mattrick" Banasik <mattrick@jabster.pl>
Copyright 2012, Harald Sitter <sitter@kde.org>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -339,7 +346,7 @@ void LastFMService::NowPlaying(const Song& song) {
return;
}
#else
// TODO: validity was removed from liblastfm1 but might reappear, it should have
// TODO(John Maguire): validity was removed from liblastfm1 but might reappear, it should have
// no impact as we get a different error when actually trying to scrobble.
#endif

View File

@ -1,5 +1,10 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2013, David Sansome <me@davidsansome.com>
Copyright 2010-2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2012, Kacper "mattrick" Banasik <mattrick@jabster.pl>
Copyright 2012, Harald Sitter <sitter@kde.org>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +20,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LASTFMSERVICE_H
#define LASTFMSERVICE_H
#ifndef INTERNET_LASTFMSERVICE_H_
#define INTERNET_LASTFMSERVICE_H_
#include <memory>
@ -41,7 +46,7 @@ class LastFMService : public Scrobbler {
Q_OBJECT
public:
LastFMService(Application* app, QObject* parent = nullptr);
explicit LastFMService(Application* app, QObject* parent = nullptr);
~LastFMService();
static const char* kServiceName;
@ -75,7 +80,7 @@ class LastFMService : public Scrobbler {
void ShowConfig();
void ToggleScrobbling();
signals:
signals:
void AuthenticationComplete(bool success, const QString& error_message);
void ScrobblingEnabledChanged(bool value);
void ButtonVisibilityChanged(bool value);
@ -122,4 +127,4 @@ signals:
Application* app_;
};
#endif // LASTFMSERVICE_H
#endif // INTERNET_LASTFMSERVICE_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2011, 2013, David Sansome <me@davidsansome.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2011, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2012, Kacper "mattrick" Banasik <mattrick@jabster.pl>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2009-2011, 2013, David Sansome <me@davidsansome.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +18,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LASTFMSETTINGSPAGE_H
#define LASTFMSETTINGSPAGE_H
#ifndef INTERNET_LASTFMSETTINGSPAGE_H_
#define INTERNET_LASTFMSETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -27,7 +30,7 @@ class LastFMSettingsPage : public SettingsPage {
Q_OBJECT
public:
LastFMSettingsPage(SettingsDialog* dialog);
explicit LastFMSettingsPage(SettingsDialog* dialog);
~LastFMSettingsPage();
void Load();
@ -47,4 +50,4 @@ class LastFMSettingsPage : public SettingsPage {
void RefreshControls(bool authenticated);
};
#endif // LASTFMSETTINGSPAGE_H
#endif // INTERNET_LASTFMSETTINGSPAGE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LASTFMURLHANDLER_H
#define LASTFMURLHANDLER_H
#ifndef INTERNET_LASTFMURLHANDLER_H_
#define INTERNET_LASTFMURLHANDLER_H_
#include "core/urlhandler.h"
@ -40,4 +42,4 @@ class LastFMUrlHandler : public UrlHandler {
LastFMService* service_;
};
#endif // LASTFMURLHANDLER_H
#endif // INTERNET_LASTFMURLHANDLER_H_

View File

@ -1,3 +1,21 @@
/* This file is part of Clementine.
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "localredirectserver.h"
#include <QApplication>

View File

@ -1,5 +1,23 @@
#ifndef LOCALREDIRECTSERVER_H
#define LOCALREDIRECTSERVER_H
/* This file is part of Clementine.
Copyright 2012, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_LOCALREDIRECTSERVER_H_
#define INTERNET_LOCALREDIRECTSERVER_H_
#include <QByteArray>
#include <QObject>
@ -10,8 +28,9 @@ class QTcpSocket;
class LocalRedirectServer : public QObject {
Q_OBJECT
public:
LocalRedirectServer(QObject* parent = nullptr);
explicit LocalRedirectServer(QObject* parent = nullptr);
// Causes the server to listen for _one_ request.
void Listen();
@ -22,7 +41,7 @@ class LocalRedirectServer : public QObject {
// Returns the URL requested by the OAuth redirect.
const QUrl& request_url() const { return request_url_; }
signals:
signals:
void Finished();
private slots:
@ -39,4 +58,4 @@ signals:
QUrl request_url_;
};
#endif // LOCALREDIRECTSERVER_H
#endif // INTERNET_LOCALREDIRECTSERVER_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, 2012, David Sansome <me@davidsansome.com>
Copyright 2011-2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -227,7 +229,7 @@ void MagnatuneDownloadDialog::DownloadFinished() {
}
void MagnatuneDownloadDialog::DownloadProgress(qint64 received, qint64 total) {
int percent = float(received) / total * 100;
int percent = static_cast<float>(received) / total * 100;
ui_->albums->topLevelItem(next_row_)->setData(1, Qt::DisplayRole, percent);
}

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAGNATUNEDOWNLOADDIALOG_H
#define MAGNATUNEDOWNLOADDIALOG_H
#ifndef INTERNET_MAGNATUNEDOWNLOADDIALOG_H_
#define INTERNET_MAGNATUNEDOWNLOADDIALOG_H_
#include <memory>
@ -34,13 +36,14 @@ class QXmlStreamReader;
class MagnatuneDownloadDialog : public QDialog {
Q_OBJECT
public:
MagnatuneDownloadDialog(MagnatuneService* service, QWidget* parent = nullptr);
explicit MagnatuneDownloadDialog(MagnatuneService* service, QWidget* parent = nullptr);
~MagnatuneDownloadDialog();
void Show(const SongList& songs);
signals:
signals:
void Finished(const QStringList& albums);
public slots:
@ -76,4 +79,4 @@ signals:
int next_row_;
};
#endif // MAGNATUNEDOWNLOADDIALOG_H
#endif // INTERNET_MAGNATUNEDOWNLOADDIALOG_H_

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <davidsansome@gmail.com>
Copyright 2010, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010, John Maguire <john.maguire@gmail.com>
Copyright 2010, David Sansome <davidsansome@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,19 +17,19 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAGNATUNEPLAYLISTITEM_H
#define MAGNATUNEPLAYLISTITEM_H
#ifndef INTERNET_MAGNATUNEPLAYLISTITEM_H_
#define INTERNET_MAGNATUNEPLAYLISTITEM_H_
#include "library/libraryplaylistitem.h"
class MagnatunePlaylistItem : public LibraryPlaylistItem {
public:
MagnatunePlaylistItem(const QString& type);
MagnatunePlaylistItem(const Song& song);
explicit MagnatunePlaylistItem(const QString& type);
explicit MagnatunePlaylistItem(const Song& song);
bool InitFromQuery(const SqlRow& query);
QUrl Url() const;
};
#endif // MAGNATUNEPLAYLISTITEM_H
#endif // INTERNET_MAGNATUNEPLAYLISTITEM_H_

View File

@ -1,5 +1,11 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2013, David Sansome <me@davidsansome.com>
Copyright 2011, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2013, Alan Briolat <alan.briolat@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -159,7 +165,7 @@ void MagnatuneService::ReloadDatabaseFinished() {
load_database_task_id_ = 0;
if (reply->error() != QNetworkReply::NoError) {
// TODO: Error handling
// TODO(David Sansome): Error handling
qLog(Error) << reply->errorString();
return;
}
@ -238,7 +244,7 @@ Song MagnatuneService::ReadTrack(QXmlStreamReader& reader) {
return song;
}
// TODO: Replace with readElementText(SkipChildElements) in Qt 4.6
// TODO(David Sansome): Replace with readElementText(SkipChildElements) in Qt 4.6
QString MagnatuneService::ReadElementText(QXmlStreamReader& reader) {
int level = 1;
QString ret;

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAGNATUNESERVICE_H
#define MAGNATUNESERVICE_H
#ifndef INTERNET_MAGNATUNESERVICE_H_
#define INTERNET_MAGNATUNESERVICE_H_
#include <QXmlStreamReader>
@ -86,7 +88,7 @@ class MagnatuneService : public InternetService {
QUrl ModifyUrl(const QUrl& url) const;
signals:
signals:
void DownloadFinished(const QStringList& albums);
private slots:
@ -127,4 +129,4 @@ signals:
QNetworkAccessManager* network_;
};
#endif // MAGNATUNESERVICE_H
#endif // INTERNET_MAGNATUNESERVICE_H_

View File

@ -1,5 +1,9 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Andrea Decorte <adecorte@gmail.com>
Copyright 2011, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2011, David Sansome <me@davidsansome.com>
Copyright 2011, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAGNATUNESETTINGSPAGE_H
#define MAGNATUNESETTINGSPAGE_H
#ifndef INTERNET_MAGNATUNESETTINGSPAGE_H_
#define INTERNET_MAGNATUNESETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -29,7 +31,7 @@ class Ui_MagnatuneSettingsPage;
class MagnatuneSettingsPage : public SettingsPage {
Q_OBJECT
public:
MagnatuneSettingsPage(SettingsDialog* dialog);
explicit MagnatuneSettingsPage(SettingsDialog* dialog);
~MagnatuneSettingsPage();
void Load();
@ -52,4 +54,4 @@ class MagnatuneSettingsPage : public SettingsPage {
bool logged_in_;
};
#endif // MAGNATUNESETTINGSPAGE_H
#endif // INTERNET_MAGNATUNESETTINGSPAGE_H_

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,7 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2011, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +17,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAGNATUNEURLHANDLER_H
#define MAGNATUNEURLHANDLER_H
#ifndef INTERNET_MAGNATUNEURLHANDLER_H_
#define INTERNET_MAGNATUNEURLHANDLER_H_
#include "core/urlhandler.h"
@ -34,4 +36,4 @@ class MagnatuneUrlHandler : public UrlHandler {
MagnatuneService* service_;
};
#endif // MAGNATUNEURLHANDLER_H
#endif // INTERNET_MAGNATUNEURLHANDLER_H_

View File

@ -1,3 +1,23 @@
/* This file is part of Clementine.
Copyright 2012-2014, John Maguire <john.maguire@gmail.com>
Copyright 2012, 2014, David Sansome <me@davidsansome.com>
Copyright 2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "oauthenticator.h"
#include <QDesktopServices>
@ -10,7 +30,8 @@
#include "core/logging.h"
#include "internet/localredirectserver.h"
const char* OAuthenticator::kRemoteURL = "https://clementine-data.appspot.com/skydrive";
const char* OAuthenticator::kRemoteURL =
"https://clementine-data.appspot.com/skydrive";
OAuthenticator::OAuthenticator(const QString& client_id,
const QString& client_secret,
@ -73,8 +94,7 @@ void OAuthenticator::RequestAccessToken(const QByteArray& code,
const QUrl& url) {
typedef QPair<QString, QString> Param;
QList<Param> parameters;
parameters << Param("code", code)
<< Param("client_id", client_id_)
parameters << Param("code", code) << Param("client_id", client_id_)
<< Param("client_secret", client_secret_)
<< Param("grant_type", "authorization_code")
// Even though we don't use this URI anymore, it must match the

View File

@ -1,5 +1,25 @@
#ifndef OAUTHENTICATOR_H
#define OAUTHENTICATOR_H
/* This file is part of Clementine.
Copyright 2012, David Sansome <me@davidsansome.com>
Copyright 2012, 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_OAUTHENTICATOR_H_
#define INTERNET_OAUTHENTICATOR_H_
#include <QDateTime>
#include <QObject>
@ -11,6 +31,7 @@ class QTcpSocket;
class OAuthenticator : public QObject {
Q_OBJECT
public:
enum class RedirectStyle {
// Redirect to localhost immediately.
@ -40,7 +61,7 @@ class OAuthenticator : public QObject {
const QDateTime& expiry_time() const { return expiry_time_; }
signals:
signals:
void Finished();
private slots:
@ -67,4 +88,4 @@ signals:
RedirectStyle redirect_style_;
};
#endif
#endif // INTERNET_OAUTHENTICATOR_H_

View File

@ -1,5 +1,10 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2011, Paweł Bara <keirangtp@gmail.com>
Copyright 2014, Arnaud Bienner <arnaud.bienner@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by

View File

@ -1,5 +1,8 @@
/* This file is part of Clementine.
Copyright 2010, David Sansome <me@davidsansome.com>
Copyright 2010-2012, David Sansome <me@davidsansome.com>
Copyright 2011, Tyler Rhodes <tyler.s.rhodes@gmail.com>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -15,8 +18,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SAVEDRADIO_H
#define SAVEDRADIO_H
#ifndef INTERNET_SAVEDRADIO_H_
#define INTERNET_SAVEDRADIO_H_
#include <memory>
@ -33,11 +36,13 @@ class SavedRadio : public InternetService {
SavedRadio(Application* app, InternetModel* parent);
~SavedRadio();
enum ItemType { Type_Stream = 2000, };
enum ItemType {
Type_Stream = 2000,
};
struct Stream {
Stream(const QUrl& url, const QString& name = QString())
: url_(url), name_(name) {}
explicit Stream(const QUrl& url, const QString& name = QString())
: url_(url), name_(name) {}
// For QList::contains
bool operator==(const Stream& other) const { return url_ == other.url_; }
@ -59,7 +64,7 @@ class SavedRadio : public InternetService {
StreamList Streams() const { return streams_; }
signals:
signals:
void ShowAddStreamDialog();
void StreamsChanged();
@ -84,4 +89,4 @@ signals:
std::unique_ptr<AddStreamDialog> edit_dialog_;
};
#endif // SAVEDRADIO_H
#endif // INTERNET_SAVEDRADIO_H_

View File

@ -1,5 +1,23 @@
#ifndef SCROBBLER_H
#define SCROBBLER_H
/* This file is part of Clementine.
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INTERNET_SCROBBLER_H_
#define INTERNET_SCROBBLER_H_
#include <QObject>
@ -9,7 +27,7 @@ class Scrobbler : public QObject {
Q_OBJECT
public:
Scrobbler(QObject* parent = nullptr) {}
explicit Scrobbler(QObject* parent = nullptr) {}
virtual bool IsAuthenticated() const = 0;
virtual bool IsScrobblingEnabled() const = 0;
@ -24,7 +42,7 @@ class Scrobbler : public QObject {
virtual void ToggleScrobbling() = 0;
virtual void ShowConfig() = 0;
signals:
signals:
void AuthenticationComplete(bool success, const QString& error_message);
void ScrobblingEnabledChanged(bool value);
void ButtonVisibilityChanged(bool value);
@ -33,4 +51,4 @@ signals:
void ScrobbleError(int value);
};
#endif // SCROBBLER_H
#endif // INTERNET_SCROBBLER_H_

View File

@ -1,3 +1,23 @@
/* This file is part of Clementine.
Copyright 2014, Chocobozzz <djidane14ff@hotmail.fr>
Copyright 2014, Krzysztof Sobiecki <sobkas@gmail.com>
Copyright 2014, David Sansome <me@davidsansome.com>
Copyright 2014, John Maguire <john.maguire@gmail.com>
Clementine is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#include "seafileservice.h"
#include <cmath>
@ -26,7 +46,7 @@ static const char* kFileUrl = "/api2/repos/%1/file/";
static const char* kFileContentUrl = "/api2/repos/%1/file/detail/";
static const int kMaxTries = 10;
}
} // namespace
SeafileService::SeafileService(Application* app, InternetModel* parent)
: CloudFileService(app, parent, kServiceName, kSettingsGroup,
@ -212,9 +232,8 @@ void SeafileService::UpdateLibrariesInProgress(
SeafileTree::Entry(library.value(), library.key(),
SeafileTree::Entry::LIBRARY),
"/");
}
// If not, we can destroy the library from the tree
else {
} else {
// If the library was not in the tree, it's not a problem because
// DeleteEntry won't do anything
DeleteEntry(library.key(), "/",
@ -531,8 +550,7 @@ void SeafileService::DeleteEntry(const QString& library, const QString& path,
bool SeafileService::CheckReply(QNetworkReply** reply, int tries) {
if (!(*reply)) {
return false;
}
else if (tries > kMaxTries) {
} else if (tries > kMaxTries) {
(*reply)->deleteLater();
return false;
}

Some files were not shown because too many files have changed in this diff Show More