1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

Now without sender

This commit is contained in:
Krzysztof Sobiecki 2014-12-13 20:05:45 +01:00
parent 1922d51780
commit a7e8c927f4
2 changed files with 7 additions and 8 deletions

View File

@ -70,7 +70,7 @@ void Task::finishedPublic() {
emit ProgressChanged(episode_, PodcastDownload::NotDownloading, 0);
// Delete the file
file_->remove();
emit finished();
emit finished(this);
}
void Task::finishedInternal() {
@ -79,7 +79,7 @@ void Task::finishedInternal() {
emit ProgressChanged(episode_, PodcastDownload::NotDownloading, 0);
// Delete the file
file_->remove();
emit finished();
emit finished(this);
return;
}
@ -99,7 +99,7 @@ void Task::finishedInternal() {
// I didn't ecountered even a single podcast with a corect metadata
TagReaderClient::Instance()->SaveFileBlocking(file_->fileName(), song);
emit finished();
emit finished(this);
}
void Task::downloadProgressInternal(qint64 received, qint64 total) {
@ -208,15 +208,14 @@ void PodcastDownloader::DownloadEpisode(const PodcastEpisode& episode) {
list_tasks_ << task;
qLog(Info) << "Downloading" << task->episode().url() << "to" << filepath;
connect(task, SIGNAL(finished()), SLOT(ReplyFinished()));
connect(task, SIGNAL(finished(Task*)), SLOT(ReplyFinished(Task*)));
connect(task, SIGNAL(ProgressChanged(const PodcastEpisode&,
PodcastDownload::State, int)),
SIGNAL(ProgressChanged(const PodcastEpisode&,
PodcastDownload::State, int)));
}
void PodcastDownloader::ReplyFinished() {
Task* task = qobject_cast<Task*>(sender());
void PodcastDownloader::ReplyFinished(Task* task) {
list_tasks_.removeAll(task);
delete task;
}

View File

@ -57,7 +57,7 @@ class Task : public QObject {
signals:
void ProgressChanged(const PodcastEpisode& episode,
PodcastDownload::State state, int percent);
void finished();
void finished(Task* task);
public slots:
void finishedPublic();
@ -101,7 +101,7 @@ class PodcastDownloader : public QObject {
void SubscriptionAdded(const Podcast& podcast);
void EpisodesAdded(const PodcastEpisodeList& episodes);
void ReplyFinished();
void ReplyFinished(Task* task);
private:
QString FilenameForEpisode(const QString& directory,