Move connect out of emitter
This commit is contained in:
parent
578c9ad598
commit
b89c05048a
@ -40,7 +40,7 @@ Organise::Organise(TaskManager* task_manager,
|
||||
std::shared_ptr<MusicStorage> destination,
|
||||
const OrganiseFormat& format, bool copy, bool overwrite,
|
||||
bool mark_as_listened,
|
||||
const NewSongInfoList& songs_info, bool eject_after, QObject* caller)
|
||||
const NewSongInfoList& songs_info, bool eject_after)
|
||||
: thread_(nullptr),
|
||||
task_manager_(task_manager),
|
||||
transcoder_(new Transcoder(this)),
|
||||
@ -61,12 +61,6 @@ Organise::Organise(TaskManager* task_manager,
|
||||
for (const NewSongInfo& song_info : songs_info) {
|
||||
tasks_pending_ << Task(song_info);
|
||||
}
|
||||
connect(this, SIGNAL(FileCopied(int)), caller, SLOT(FileCopied(int)));
|
||||
}
|
||||
|
||||
Organise::~Organise()
|
||||
{
|
||||
disconnect(SIGNAL(FileCopied(int)));
|
||||
}
|
||||
|
||||
void Organise::Start() {
|
||||
|
@ -45,9 +45,8 @@ class Organise : public QObject {
|
||||
|
||||
Organise(TaskManager* task_manager, std::shared_ptr<MusicStorage> destination,
|
||||
const OrganiseFormat& format, bool copy, bool overwrite, bool mark_as_listened,
|
||||
const NewSongInfoList& songs, bool eject_after, QObject* caller);
|
||||
const NewSongInfoList& songs, bool eject_after);
|
||||
|
||||
~Organise();
|
||||
static const int kBatchSize;
|
||||
static const int kTranscodeProgressInterval;
|
||||
|
||||
|
@ -45,12 +45,12 @@ const char* OrganiseDialog::kSettingsGroup = "OrganiseDialog";
|
||||
|
||||
OrganiseDialog::OrganiseDialog(TaskManager* task_manager, QWidget* parent, QObject* caller)
|
||||
: QDialog(parent),
|
||||
caller_(caller),
|
||||
ui_(new Ui_OrganiseDialog),
|
||||
task_manager_(task_manager),
|
||||
total_size_(0),
|
||||
resized_by_user_(false) {
|
||||
ui_->setupUi(this);
|
||||
caller_=caller;
|
||||
connect(ui_->button_box->button(QDialogButtonBox::Reset), SIGNAL(clicked()),
|
||||
SLOT(Reset()));
|
||||
|
||||
@ -351,9 +351,11 @@ void OrganiseDialog::accept() {
|
||||
Organise* organise = new Organise(
|
||||
task_manager_, storage, format_, copy, ui_->overwrite->isChecked(),
|
||||
ui_->mark_as_listened->isChecked(),
|
||||
new_songs_info_, ui_->eject_after->isChecked(), caller_);
|
||||
new_songs_info_, ui_->eject_after->isChecked());
|
||||
connect(organise, SIGNAL(Finished(QStringList)),
|
||||
SLOT(OrganiseFinished(QStringList)));
|
||||
connect(organise, SIGNAL(FileCopied(int)),
|
||||
caller_, SLOT(FileCopied(int)));
|
||||
organise->Start();
|
||||
|
||||
QDialog::accept();
|
||||
|
@ -46,9 +46,10 @@ class OrganiseDialog : public QDialog {
|
||||
|
||||
static const char* kDefaultFormat;
|
||||
static const char* kSettingsGroup;
|
||||
QSize sizeHint() const;
|
||||
QObject* caller_;
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
void SetDestinationModel(QAbstractItemModel* model, bool devices = false);
|
||||
|
||||
// These functions return true if any songs were actually added to the dialog.
|
||||
|
Loading…
x
Reference in New Issue
Block a user