Fix errors, cherry picked make format fixes

This commit is contained in:
Krzysztof Sobiecki 2014-12-10 22:13:01 +01:00
parent 8cbe742d9f
commit 3bdf765e3d
3 changed files with 19 additions and 25 deletions

View File

@ -41,7 +41,6 @@ PodcastDeleter::PodcastDeleter(Application* app, QObject* parent)
backend_(app_->podcast_backend()),
delete_after_secs_(0),
auto_delete_timer_(new QTimer(this)) {
ReloadSettings();
auto_delete_timer_->setSingleShot(true);
AutoDelete();

View File

@ -38,12 +38,12 @@
const char* PodcastDownloader::kSettingsGroup = "Podcasts";
Task::Task(PodcastEpisode episode, QFile* file, PodcastBackend* backend)
: file_(file),
episode_(episode),
req_(QNetworkRequest(episode.url())),
backend_(backend),
network_(new NetworkAccessManager(this)),
repl(new RedirectFollower(network_->get(req_))) {
: file_(file),
episode_(episode),
req_(QNetworkRequest(episode.url())),
backend_(backend),
network_(new NetworkAccessManager(this)),
repl(new RedirectFollower(network_->get(req_))) {
connect(repl.get(), SIGNAL(readyRead()), SLOT(reading()));
connect(repl.get(), SIGNAL(finished()), SLOT(finishedInternal()));
connect(repl.get(), SIGNAL(downloadProgress(qint64, qint64)),
@ -51,9 +51,7 @@ Task::Task(PodcastEpisode episode, QFile* file, PodcastBackend* backend)
emit ProgressChanged(episode_, PodcastDownload::Downloading, 0);
}
const PodcastEpisode Task::episode() {
return episode_;
}
const PodcastEpisode Task::episode() { return episode_; }
void Task::reading() {
qint64 bytes = 0;
@ -84,7 +82,7 @@ void Task::finishedInternal() {
episode.set_local_url(QUrl::fromLocalFile(file_->fileName()));
backend_->UpdateEpisodes(PodcastEpisodeList() << episode);
Podcast podcast =
backend_->GetSubscriptionById(episode.podcast_database_id());
backend_->GetSubscriptionById(episode.podcast_database_id());
Song song = episode_.ToSong(podcast);
emit ProgressChanged(episode_, PodcastDownload::Finished, 0);
@ -171,7 +169,7 @@ QString PodcastDownloader::FilenameForEpisode(const QString& directory,
}
void PodcastDownloader::DownloadEpisode(const PodcastEpisode& episode) {
for ( Task* tas : list_tasks_ ) {
for (Task* tas : list_tasks_) {
if (tas->episode().database_id() == episode.database_id()) {
return;
}

View File

@ -192,11 +192,9 @@ void PodcastService::LazyPopulate(QStandardItem* parent) {
void PodcastService::PopulatePodcastList(QStandardItem* parent) {
// Do this here since the downloader won't be created yet in the ctor.
connect(
app_->podcast_downloader(),
SIGNAL(ProgressChanged(PodcastEpisode, PodcastDownload::State, int)),
SLOT(DownloadProgressChanged(PodcastEpisode, PodcastDownload::State,
int)));
connect(app_->podcast_downloader(),
SIGNAL(ProgressChanged(PodcastEpisode, PodcastDownload::State, int)),
SLOT(DownloadProgressChanged(PodcastEpisode, PodcastDownload::State, int)));
if (default_icon_.isNull()) {
default_icon_ = QIcon(":providers/podcast16.png");
@ -260,7 +258,7 @@ void PodcastService::UpdateEpisodeText(QStandardItem* item,
tooltip = tr("Download queued");
break;
case PodcastDownload::Downloading:
case PodcastDownload::Downloading:
if (downloading_icon_.isNull()) {
downloading_icon_ = IconLoader::Load("go-down");
}
@ -270,8 +268,8 @@ void PodcastService::UpdateEpisodeText(QStandardItem* item,
QString("[ %1% ] %2").arg(QString::number(percent), episode.title());
break;
case PodcastDownload::Finished:
case PodcastDownload::NotDownloading:
case PodcastDownload::Finished:
case PodcastDownload::NotDownloading:
break;
}
@ -283,8 +281,7 @@ void PodcastService::UpdateEpisodeText(QStandardItem* item,
void PodcastService::UpdatePodcastText(QStandardItem* item,
PodcastDownload::State state,
int percent) {
const Podcast podcast =
item->data(Role_Podcast).value<Podcast>();
const Podcast podcast = item->data(Role_Podcast).value<Podcast>();
QString tooltip;
QIcon icon;
@ -300,7 +297,7 @@ void PodcastService::UpdatePodcastText(QStandardItem* item,
tooltip = tr("Download queued");
break;
case PodcastDownload::Downloading:
case PodcastDownload::Downloading:
if (downloading_icon_.isNull()) {
downloading_icon_ = IconLoader::Load("go-down");
}
@ -309,8 +306,8 @@ void PodcastService::UpdatePodcastText(QStandardItem* item,
tooltip = tr("Downloading (%1%)...").arg(percent);
break;
case PodcastDownload::Finished:
case PodcastDownload::NotDownloading:
case PodcastDownload::Finished:
case PodcastDownload::NotDownloading:
if (podcast.ImageUrlSmall().isValid()) {
icon_loader_->LoadIcon(podcast.ImageUrlSmall().toString(), QString(), item);
} else {