Fix all errors reported by cpplint.py

This commit is contained in:
Krzysztof A. Sobiecki 2014-02-07 20:34:34 +01:00
parent 96aabc3ac5
commit 171529c5b6
35 changed files with 107 additions and 107 deletions

View File

@ -70,7 +70,7 @@ void AddPodcastByUrl::RequestFinished(PodcastUrlLoaderReply* reply) {
switch (reply->result_type()) {
case PodcastUrlLoaderReply::Type_Podcast:
foreach(const Podcast & podcast, reply->podcast_results()) {
for (const Podcast & podcast : reply->podcast_results()) {
model()->appendRow(model()->CreatePodcastItem(podcast));
}
break;
@ -89,7 +89,7 @@ void AddPodcastByUrl::Show() {
}
const QClipboard* clipboard = QApplication::clipboard();
foreach(const QString & contents,
for (const QString & contents :
QStringList() << clipboard->text(QClipboard::Clipboard)
<< clipboard->text(QClipboard::Selection)) {
if (contents.contains("://")) {

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADDPODCASTBYURL_H
#define ADDPODCASTBYURL_H
#ifndef PODCASTS_ADDPODCASTBYURL_H_
#define PODCASTS_ADDPODCASTBYURL_H_
#include "addpodcastpage.h"
@ -49,4 +49,4 @@ class AddPodcastByUrl : public AddPodcastPage {
PodcastUrlLoader* loader_;
};
#endif // ADDPODCASTBYURL_H
#endif // PODCASTS_ADDPODCASTBYURL_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADDPODCASTDIALOG_H
#define ADDPODCASTDIALOG_H
#ifndef PODCASTS_ADDPODCASTDIALOG_H_
#define PODCASTS_ADDPODCASTDIALOG_H_
#include "podcast.h"
@ -82,4 +82,4 @@ class AddPodcastDialog : public QDialog {
QString last_opml_path_;
};
#endif // ADDPODCASTDIALOG_H
#endif // PODCASTS_ADDPODCASTDIALOG_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ADDPODCASTPAGE_H
#define ADDPODCASTPAGE_H
#ifndef PODCASTS_ADDPODCASTPAGE_H_
#define PODCASTS_ADDPODCASTPAGE_H_
#include <QWidget>
@ -34,7 +34,7 @@ class AddPodcastPage : public QWidget {
virtual bool has_visible_widget() const { return true; }
virtual void Show() {}
signals:
signals:
void Busy(bool busy);
protected:
@ -44,4 +44,4 @@ signals:
PodcastDiscoveryModel* model_;
};
#endif // ADDPODCASTPAGE_H
#endif // PODCASTS_ADDPODCASTPAGE_H_

View File

@ -56,7 +56,7 @@ void FixedOpmlPage::LoadFinished(PodcastUrlLoaderReply* reply) {
switch (reply->result_type()) {
case PodcastUrlLoaderReply::Type_Podcast:
foreach(const Podcast & podcast, reply->podcast_results()) {
for (const Podcast & podcast : reply->podcast_results()) {
model()->appendRow(model()->CreatePodcastItem(podcast));
}
break;

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FIXEDOPMLPAGE_H
#define FIXEDOPMLPAGE_H
#ifndef PODCASTS_FIXEDOPMLPAGE_H_
#define PODCASTS_FIXEDOPMLPAGE_H_
#include "addpodcastpage.h"
@ -45,4 +45,4 @@ class FixedOpmlPage : public AddPodcastPage {
bool done_initial_load_;
};
#endif // FIXEDOPMLPAGE_H
#endif // PODCASTS_FIXEDOPMLPAGE_H_

View File

@ -41,7 +41,7 @@ GPodderSearchPage::~GPodderSearchPage() {
void GPodderSearchPage::SearchClicked() {
emit Busy(true);
mygpo::PodcastListPtr list(api_->search(ui_->query->text()));
auto list(api_->search(ui_->query->text()));
NewClosure(list, SIGNAL(finished()), this,
SLOT(SearchFinished(mygpo::PodcastListPtr)), list);
NewClosure(list, SIGNAL(parseError()), this,
@ -55,7 +55,7 @@ void GPodderSearchPage::SearchFinished(mygpo::PodcastListPtr list) {
model()->clear();
foreach(mygpo::PodcastPtr gpo_podcast, list->list()) {
for (auto gpo_podcast : list->list()) {
Podcast podcast;
podcast.InitFromGpo(gpo_podcast.data());

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPODDERSEARCHPAGE_H
#define GPODDERSEARCHPAGE_H
#ifndef PODCASTS_GPODDERSEARCHPAGE_H_
#define PODCASTS_GPODDERSEARCHPAGE_H_
#include "addpodcastpage.h"
@ -47,4 +47,4 @@ class GPodderSearchPage : public AddPodcastPage {
mygpo::ApiRequest* api_;
};
#endif // GPODDERSEARCHPAGE_H
#endif // PODCASTS_GPODDERSEARCHPAGE_H_

View File

@ -168,11 +168,11 @@ void GPodderSync::DeviceUpdatesFinished(mygpo::DeviceUpdatesPtr reply) {
// Remember episode actions for each podcast, so when we add a new podcast
// we can apply the actions immediately.
QMap<QUrl, QList<mygpo::EpisodePtr> > episodes_by_podcast;
foreach(mygpo::EpisodePtr episode, reply->updateList()) {
for (auto episode : reply->updateList()) {
episodes_by_podcast[episode->podcastUrl()].append(episode);
}
foreach(mygpo::PodcastPtr podcast, reply->addList()) {
for (auto podcast : reply->addList()) {
const QUrl url(podcast->url());
// Are we subscribed to this podcast already?
@ -195,7 +195,7 @@ void GPodderSync::DeviceUpdatesFinished(mygpo::DeviceUpdatesPtr reply) {
}
// Unsubscribe from podcasts that were removed.
foreach(const QUrl & url, reply->removeList()) {
for (const QUrl & url : reply->removeList()) {
backend_->Unsubscribe(backend_->GetSubscriptionByUrl(url));
}
@ -223,7 +223,7 @@ void GPodderSync::NewPodcastLoaded(PodcastUrlLoaderReply* reply,
}
// Apply the actions to the episodes in the podcast.
foreach(Podcast podcast, reply->podcast_results()) {
for (Podcast podcast : reply->podcast_results()) {
ApplyActions(actions, podcast.mutable_episodes());
// Add the subscription
@ -237,7 +237,7 @@ void GPodderSync::ApplyActions(
for (PodcastEpisodeList::iterator it = episodes->begin();
it != episodes->end(); ++it) {
// Find an action for this episode
foreach(mygpo::EpisodePtr action, actions) {
for (auto action : actions) {
if (action->url() != it->url()) continue;
switch (action->status()) {
@ -284,7 +284,7 @@ void WriteContainer(const T& container, QSettings* s, const char* array_name,
const char* item_name) {
s->beginWriteArray(array_name, container.count());
int index = 0;
foreach(const typename T::value_type & item, container) {
for (const typename T::value_type & item : container) {
s->setArrayIndex(index++);
s->setValue(item_name, item);
}
@ -302,7 +302,7 @@ void ReadContainer(T* container, QSettings* s, const char* array_name,
}
s->endArray();
}
}
} // namespace
void GPodderSync::SaveQueue() {
QSettings s;
@ -332,7 +332,7 @@ void GPodderSync::FlushUpdateQueue() {
if (all_urls.isEmpty()) return;
flushing_queue_ = true;
mygpo::AddRemoveResultPtr reply(api_->addRemoveSubscriptions(
auto reply(api_->addRemoveSubscriptions(
username_, DeviceId(), queued_add_subscriptions_.toList(),
queued_remove_subscriptions_.toList()));
@ -357,7 +357,7 @@ void GPodderSync::AddRemoveFinished(mygpo::AddRemoveResultPtr reply,
flushing_queue_ = false;
// Remove the URLs from the queue.
foreach(const QUrl & url, affected_urls) {
for (const QUrl & url : affected_urls) {
queued_add_subscriptions_.remove(url);
queued_remove_subscriptions_.remove(url);
}
@ -379,7 +379,7 @@ void GPodderSync::DoInitialSync() {
// Send our complete list of subscriptions
queued_remove_subscriptions_.clear();
queued_add_subscriptions_.clear();
foreach(const Podcast & podcast, backend_->GetAllSubscriptions()) {
for(const Podcast & podcast : backend_->GetAllSubscriptions()) {
queued_add_subscriptions_.insert(podcast.url());
}

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPODDERSYNC_H
#define GPODDERSYNC_H
#ifndef PODCASTS_GPODDERSYNC_H_
#define PODCASTS_GPODDERSYNC_H_
#include "podcastepisode.h"
@ -115,4 +115,4 @@ class GPodderSync : public QObject {
bool flushing_queue_;
};
#endif // GPODDERSYNC_H
#endif // PODCASTS_GPODDERSYNC_H_

View File

@ -55,7 +55,7 @@ void GPodderTopTagsModel::fetchMore(const QModelIndex& parent) {
// Create a little Loading... item.
itemFromIndex(parent)->appendRow(CreateLoadingIndicator());
mygpo::PodcastListPtr list(api_->podcastsOfTag(
auto list(api_->podcastsOfTag(
GPodderTopTagsPage::kMaxTagCount, parent.data().toString()));
NewClosure(list, SIGNAL(finished()), this,
@ -79,7 +79,7 @@ void GPodderTopTagsModel::PodcastsOfTagFinished(const QModelIndex& parent,
parent_item->removeRow(0);
}
foreach(mygpo::PodcastPtr gpo_podcast, list->list()) {
for (auto gpo_podcast : list->list()) {
Podcast podcast;
podcast.InitFromGpo(gpo_podcast.data());

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPODDERTOPTAGSMODEL_H
#define GPODDERTOPTAGSMODEL_H
#ifndef PODCASTS_GPODDERTOPTAGSMODEL_H_
#define PODCASTS_GPODDERTOPTAGSMODEL_H_
#include "podcastdiscoverymodel.h"
@ -50,4 +50,4 @@ class GPodderTopTagsModel : public PodcastDiscoveryModel {
mygpo::ApiRequest* api_;
};
#endif // GPODDERTOPTAGSMODEL_H
#endif // PODCASTS_GPODDERTOPTAGSMODEL_H_

View File

@ -43,7 +43,7 @@ void GPodderTopTagsPage::Show() {
emit Busy(true);
done_initial_load_ = true;
mygpo::TagListPtr tag_list(api_->topTags(kMaxTagCount));
auto tag_list(api_->topTags(kMaxTagCount));
NewClosure(tag_list, SIGNAL(finished()), this,
SLOT(TagListLoaded(mygpo::TagListPtr)), tag_list);
NewClosure(tag_list, SIGNAL(parseError()), this,
@ -56,7 +56,7 @@ void GPodderTopTagsPage::Show() {
void GPodderTopTagsPage::TagListLoaded(mygpo::TagListPtr tag_list) {
emit Busy(false);
foreach(mygpo::TagPtr tag, tag_list->list()) {
for (auto tag : tag_list->list()) {
model()->appendRow(model()->CreateFolder(tag->tag()));
}
}

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GPODDERTOPTAGSPAGE_H
#define GPODDERTOPTAGSPAGE_H
#ifndef PODCASTS_GPODDERTOPTAGSPAGE_H_
#define PODCASTS_GPODDERTOPTAGSPAGE_H_
#include <QScopedPointer>
@ -49,4 +49,4 @@ class GPodderTopTagsPage : public AddPodcastPage {
bool done_initial_load_;
};
#endif // GPODDERTOPTAGSPAGE_H
#endif // PODCASTS_GPODDERTOPTAGSPAGE_H_

View File

@ -83,7 +83,7 @@ void ITunesSearchPage::SearchFinished(QNetworkReply* reply) {
return;
}
foreach(const QVariant & result_variant, data.toMap()["results"].toList()) {
for (const QVariant & result_variant : data.toMap()["results"].toList()) {
QVariantMap result(result_variant.toMap());
if (result["kind"].toString() != "podcast") {
continue;

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef ITUNESSEARCHPAGE_H
#define ITUNESSEARCHPAGE_H
#ifndef PODCASTS_ITUNESSEARCHPAGE_H_
#define PODCASTS_ITUNESSEARCHPAGE_H_
#include "addpodcastpage.h"
@ -46,4 +46,4 @@ class ITunesSearchPage : public AddPodcastPage {
QNetworkAccessManager* network_;
};
#endif // ITUNESSEARCHPAGE_H
#endif // PODCASTS_ITUNESSEARCHPAGE_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPMLCONTAINER_H
#define OPMLCONTAINER_H
#ifndef PODCASTS_OPMLCONTAINER_H_
#define PODCASTS_OPMLCONTAINER_H_
#include "podcast.h"
@ -32,4 +32,4 @@ class OpmlContainer {
Q_DECLARE_METATYPE(OpmlContainer)
#endif // OPMLCONTAINER_H
#endif // PODCASTS_OPMLCONTAINER_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCAST_H
#define PODCAST_H
#ifndef PODCASTS_PODCAST_H_
#define PODCASTS_PODCAST_H_
#include "podcastepisode.h"
@ -107,4 +107,4 @@ Q_DECLARE_METATYPE(Podcast)
typedef QList<Podcast> PodcastList;
Q_DECLARE_METATYPE(QList<Podcast>)
#endif // PODCAST_H
#endif // PODCASTS_PODCAST_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTBACKEND_H
#define PODCASTBACKEND_H
#ifndef PODCASTS_PODCASTBACKEND_H_
#define PODCASTS_PODCASTBACKEND_H_
#include <QObject>
@ -70,7 +70,7 @@ class PodcastBackend : public QObject {
// local_url) on episodes that must already exist in the database.
void UpdateEpisodes(const PodcastEpisodeList& episodes);
signals:
signals:
void SubscriptionAdded(const Podcast& podcast);
void SubscriptionRemoved(const Podcast& podcast);
@ -90,4 +90,4 @@ signals:
Database* db_;
};
#endif // PODCASTBACKEND_H
#endif // PODCASTS_PODCASTBACKEND_H_

View File

@ -79,12 +79,12 @@ QStandardItem* PodcastDiscoveryModel::CreateOpmlContainerItem(
void PodcastDiscoveryModel::CreateOpmlContainerItems(
const OpmlContainer& container, QStandardItem* parent) {
foreach(const OpmlContainer & child, container.containers) {
for (const OpmlContainer & child : container.containers) {
QStandardItem* child_item = CreateOpmlContainerItem(child);
parent->appendRow(child_item);
}
foreach(const Podcast & child, container.feeds) {
for (const Podcast & child : container.feeds) {
QStandardItem* child_item = CreatePodcastItem(child);
parent->appendRow(child_item);
}

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTDISCOVERYMODEL_H
#define PODCASTDISCOVERYMODEL_H
#ifndef PODCASTS_PODCASTDISCOVERYMODEL_H_
#define PODCASTS_PODCASTDISCOVERYMODEL_H_
#include "covers/albumcoverloaderoptions.h"
@ -64,4 +64,4 @@ class PodcastDiscoveryModel : public QStandardItemModel {
QIcon folder_icon_;
};
#endif // PODCASTDISCOVERYMODEL_H
#endif // PODCASTS_PODCASTDISCOVERYMODEL_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTDOWNLOADER_H
#define PODCASTDOWNLOADER_H
#ifndef PODCASTS_PODCASTDOWNLOADER_H_
#define PODCASTS_PODCASTDOWNLOADER_H_
#include "podcast.h"
#include "podcastepisode.h"
@ -58,7 +58,7 @@ class PodcastDownloader : public QObject {
// Deletes downloaded data for this episode
void DeleteEpisode(const PodcastEpisode& episode);
signals:
signals:
void ProgressChanged(const PodcastEpisode& episode,
PodcastDownloader::State state, int percent);
@ -105,4 +105,4 @@ signals:
QTimer* auto_delete_timer_;
};
#endif // PODCASTDOWNLOADER_H
#endif // PODCASTS_PODCASTDOWNLOADER_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTEPISODE_H
#define PODCASTEPISODE_H
#ifndef PODCASTS_PODCASTEPISODE_H_
#define PODCASTS_PODCASTEPISODE_H_
#include "core/song.h"
@ -87,4 +87,4 @@ Q_DECLARE_METATYPE(PodcastEpisode)
typedef QList<PodcastEpisode> PodcastEpisodeList;
Q_DECLARE_METATYPE(QList<PodcastEpisode>)
#endif // PODCASTEPISODE_H
#endif // PODCASTS_PODCASTEPISODE_H_

View File

@ -38,7 +38,7 @@ PodcastInfoWidget::PodcastInfoWidget(QWidget* parent)
label_palette.setColor(QPalette::WindowText,
light ? color.darker(150) : color.lighter(125));
foreach(QLabel * label, findChildren<QLabel*>()) {
for (QLabel * label : findChildren<QLabel*>()) {
if (label->property("field_label").toBool()) {
label->setPalette(label_palette);
}
@ -67,7 +67,7 @@ void SetText(const QString& value, T* label, QLabel* buddy_label = nullptr) {
label->setText(value);
}
}
}
} // namespace
void PodcastInfoWidget::SetPodcast(const Podcast& podcast) {
if (image_id_) {

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTINFOWIDGET_H
#define PODCASTINFOWIDGET_H
#ifndef PODCASTS_PODCASTINFOWIDGET_H_
#define PODCASTS_PODCASTINFOWIDGET_H_
#include "podcast.h"
#include "covers/albumcoverloaderoptions.h"
@ -32,14 +32,14 @@ class PodcastInfoWidget : public QWidget {
Q_OBJECT
public:
PodcastInfoWidget(QWidget* parent = 0);
explicit PodcastInfoWidget(QWidget* parent = 0);
~PodcastInfoWidget();
void SetApplication(Application* app);
void SetPodcast(const Podcast& podcast);
signals:
signals:
void LoadingFinished();
private slots:
@ -55,4 +55,4 @@ signals:
quint64 image_id_;
};
#endif // PODCASTINFOWIDGET_H
#endif // PODCASTS_PODCASTINFOWIDGET_H_

View File

@ -40,7 +40,7 @@ bool PodcastParser::SupportsContentType(const QString& content_type) const {
return true;
}
foreach(const QString & mime_type, supported_mime_types()) {
for (const QString & mime_type : supported_mime_types()) {
if (content_type.contains(mime_type)) {
return true;
}

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTPARSER_H
#define PODCASTPARSER_H
#ifndef PODCASTS_PODCASTPARSER_H_
#define PODCASTS_PODCASTPARSER_H_
#include <QStringList>
@ -64,4 +64,4 @@ class PodcastParser {
QStringList supported_mime_types_;
};
#endif // PODCASTPARSER_H
#endif // PODCASTS_PODCASTPARSER_H_

View File

@ -43,7 +43,7 @@ const char* PodcastService::kSettingsGroup = "Podcasts";
class PodcastSortProxyModel : public QSortFilterProxyModel {
public:
PodcastSortProxyModel(QObject* parent = nullptr);
explicit PodcastSortProxyModel(QObject* parent = nullptr);
protected:
bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
@ -464,7 +464,7 @@ void PodcastService::ReloadSettings() {
s.beginGroup(LibraryView::kSettingsGroup);
use_pretty_covers_ = s.value("pretty_covers", true).toBool();
// TODO: reload the podcast icons that are already loaded?
// TODO(hatstand): reload the podcast icons that are already loaded?
}
void PodcastService::EnsureAddPodcastDialogCreated() {

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTSERVICE_H
#define PODCASTSERVICE_H
#ifndef PODCASTS_PODCASTSERVICE_H_
#define PODCASTS_PODCASTSERVICE_H_
#include "podcastdownloader.h"
#include "internet/internetmodel.h"
@ -148,4 +148,4 @@ class PodcastService : public InternetService {
QScopedPointer<AddPodcastDialog> add_podcast_dialog_;
};
#endif // PODCASTSERVICE_H
#endif // PODCASTS_PODCASTSERVICE_H_

View File

@ -26,7 +26,7 @@ QMimeData* PodcastServiceModel::mimeData(const QModelIndexList& indexes) const {
SongMimeData* data = new SongMimeData;
QList<QUrl> urls;
foreach(const QModelIndex & index, indexes) {
for (const QModelIndex & index : indexes) {
switch (index.data(InternetModel::Role_Type).toInt()) {
case PodcastService::Type_Episode:
MimeDataForEpisode(index, data, &urls);

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTSERVICEMODEL_H
#define PODCASTSERVICEMODEL_H
#ifndef PODCASTS_PODCASTSERVICEMODEL_H_
#define PODCASTS_PODCASTSERVICEMODEL_H_
#include <QStandardItemModel>
@ -26,7 +26,7 @@ class PodcastServiceModel : public QStandardItemModel {
Q_OBJECT
public:
PodcastServiceModel(QObject* parent = 0);
explicit PodcastServiceModel(QObject* parent = 0);
QMimeData* mimeData(const QModelIndexList& indexes) const;
@ -37,4 +37,4 @@ class PodcastServiceModel : public QStandardItemModel {
QList<QUrl>* urls) const;
};
#endif // PODCASTSERVICEMODEL_H
#endif // PODCASTS_PODCASTSERVICEMODEL_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTSETTINGSPAGE_H
#define PODCASTSETTINGSPAGE_H
#ifndef PODCASTS_PODCASTSETTINGSPAGE_H_
#define PODCASTS_PODCASTSETTINGSPAGE_H_
#include "ui/settingspage.h"
@ -28,7 +28,7 @@ class PodcastSettingsPage : public SettingsPage {
Q_OBJECT
public:
PodcastSettingsPage(SettingsDialog* dialog);
explicit PodcastSettingsPage(SettingsDialog* dialog);
~PodcastSettingsPage();
static const char* kSettingsGroup;
@ -47,4 +47,4 @@ class PodcastSettingsPage : public SettingsPage {
Ui_PodcastSettingsPage* ui_;
};
#endif // PODCASTSETTINGSPAGE_H
#endif // PODCASTS_PODCASTSETTINGSPAGE_H_

View File

@ -112,7 +112,7 @@ void PodcastUpdater::UpdatePodcastNow(const Podcast& podcast) {
}
void PodcastUpdater::UpdateAllPodcastsNow() {
foreach(const Podcast & podcast,
for (const Podcast & podcast :
app_->podcast_backend()->GetAllSubscriptions()) {
PodcastUrlLoaderReply* reply = loader_->Load(podcast.url());
NewClosure(reply, SIGNAL(Finished(bool)), this,
@ -151,15 +151,15 @@ void PodcastUpdater::PodcastLoaded(PodcastUrlLoaderReply* reply,
// Get the episode URLs we had for this podcast already.
QSet<QUrl> existing_urls;
foreach(const PodcastEpisode & episode,
for (const PodcastEpisode & episode :
app_->podcast_backend()->GetEpisodes(podcast.database_id())) {
existing_urls.insert(episode.url());
}
// Add any new episodes
PodcastEpisodeList new_episodes;
foreach(const Podcast & reply_podcast, reply->podcast_results()) {
foreach(const PodcastEpisode & episode, reply_podcast.episodes()) {
for (const Podcast & reply_podcast : reply->podcast_results()) {
for (const PodcastEpisode & episode : reply_podcast.episodes()) {
if (!existing_urls.contains(episode.url())) {
PodcastEpisode episode_copy(episode);
episode_copy.set_podcast_database_id(podcast.database_id());

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTUPDATER_H
#define PODCASTUPDATER_H
#ifndef PODCASTS_PODCASTUPDATER_H_
#define PODCASTS_PODCASTUPDATER_H_
#include <QDateTime>
#include <QObject>
@ -64,4 +64,4 @@ class PodcastUpdater : public QObject {
int pending_replies_;
};
#endif // PODCASTUPDATER_H
#endif // PODCASTS_PODCASTUPDATER_H_

View File

@ -15,8 +15,8 @@
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PODCASTURLLOADER_H
#define PODCASTURLLOADER_H
#ifndef PODCASTS_PODCASTURLLOADER_H_
#define PODCASTS_PODCASTURLLOADER_H_
#include <QObject>
#include <QRegExp>
@ -50,7 +50,7 @@ class PodcastUrlLoaderReply : public QObject {
void SetFinished(const PodcastList& results);
void SetFinished(const OpmlContainer& results);
signals:
signals:
void Finished(bool success);
private:
@ -67,7 +67,7 @@ class PodcastUrlLoader : public QObject {
Q_OBJECT
public:
PodcastUrlLoader(QObject* parent = 0);
explicit PodcastUrlLoader(QObject* parent = 0);
~PodcastUrlLoader();
static const int kMaxRedirects;
@ -109,4 +109,4 @@ class PodcastUrlLoader : public QObject {
QRegExp html_link_href_re_;
};
#endif // PODCASTURLLOADER_H
#endif // PODCASTS_PODCASTURLLOADER_H_