RipCDDialog: References to pointers in function args.

This commit is contained in:
Lukas Prediger 2022-01-25 22:02:11 +02:00 committed by John Maguire
parent 794c1b8c92
commit a504c1d391
2 changed files with 9 additions and 9 deletions

View File

@ -217,16 +217,16 @@ void RipCDDialog::ClickedRipButton() {
connect(cancel_button_, SIGNAL(clicked()), ripper, SLOT(Cancel()));
connect(ripper, &Ripper::Finished, this, [this, ripper]() {
this->Finished(*ripper, /*progress_to_display = */ 1.0f);
this->Finished(ripper, /*progress_to_display = */ 1.0f);
});
connect(ripper, &Ripper::Cancelled, this, [this, ripper]() {
this->Finished(*ripper, /*progress_to_display = */ 0.0f);
this->Finished(ripper, /*progress_to_display = */ 0.0f);
});
ui_->progress_bar->setRange(0, 100);
transcoding_progress_timer_connection_ =
connect(&transcoding_progress_timer_, &QTimer::timeout, this,
[this, ripper]() { this->TranscodingProgressTimeout(*ripper); });
[this, ripper]() { this->TranscodingProgressTimeout(ripper); });
// Add tracks and album information to the ripper.
ripper->ClearTracks();
@ -351,9 +351,9 @@ void RipCDDialog::DeviceSelected(int device_index) {
SLOT(SongsLoaded(SongList)));
}
void RipCDDialog::Finished(Ripper& ripper, float progress_to_display) {
void RipCDDialog::Finished(Ripper* ripper, float progress_to_display) {
SetWorking(false);
ripper.deleteLater();
ripper->deleteLater();
transcoding_progress_timer_.stop();
disconnect(transcoding_progress_timer_connection_);
@ -531,10 +531,10 @@ void RipCDDialog::UpdateMetadataFromGUI() {
UpdateFileNamePreviews();
}
void RipCDDialog::TranscodingProgressTimeout(Ripper& ripper) {
void RipCDDialog::TranscodingProgressTimeout(Ripper* ripper) {
if (working_) {
int progress =
qBound(0, static_cast<int>(ripper.GetProgress() * 100.0f), 100);
qBound(0, static_cast<int>(ripper->GetProgress() * 100.0f), 100);
ui_->progress_bar->setValue(progress);
}
}

View File

@ -56,7 +56,7 @@ class RipCDDialog : public QDialog {
void SelectNone();
void InvertSelection();
void DeviceSelected(int device_index);
void Finished(Ripper& ripper, float progress_to_display);
void Finished(Ripper* ripper, float progress_to_display);
void SongsLoaded(const SongList& songs);
void DiscChanged();
void FormatStringUpdated();
@ -65,7 +65,7 @@ class RipCDDialog : public QDialog {
void YearEditChanged(const QString& year_string);
void UpdateMetadataEdits();
void UpdateMetadataFromGUI();
void TranscodingProgressTimeout(Ripper& ripper);
void TranscodingProgressTimeout(Ripper* ripper);
private:
static const char* kSettingsGroup;