diff --git a/src/AccountFactoryWrapper.cpp b/src/AccountFactoryWrapper.cpp index 0065508c6..862239fa8 100644 --- a/src/AccountFactoryWrapper.cpp +++ b/src/AccountFactoryWrapper.cpp @@ -30,7 +30,6 @@ AccountFactoryWrapper::AccountFactoryWrapper( AccountFactory* factory, QWidget* : QDialog( parent, Qt::Sheet ) , m_factory( factory ) , m_ui( new Ui_AccountFactoryWrapper ) - , m_createAccount( false ) { m_ui->setupUi( this ); @@ -110,9 +109,7 @@ AccountFactoryWrapper::buttonClicked( QAbstractButton* button ) { if ( button == m_addButton ) { - m_createAccount = true; - emit createAccount( m_factory ); - return; + TomahawkUtils::createAccountFromFactory( m_factory, this ); } else reject(); diff --git a/src/AccountFactoryWrapper.h b/src/AccountFactoryWrapper.h index 10223e0bc..e69cf7166 100644 --- a/src/AccountFactoryWrapper.h +++ b/src/AccountFactoryWrapper.h @@ -42,11 +42,6 @@ public: explicit AccountFactoryWrapper( Tomahawk::Accounts::AccountFactory* factory, QWidget* parent = 0 ); - bool doCreateAccount() const { return m_createAccount; } - -signals: - void createAccount( Tomahawk::Accounts::AccountFactory* factory ); - public slots: void openAccountConfig( Tomahawk::Accounts::Account* ); void removeAccount( Tomahawk::Accounts::Account* ); @@ -59,7 +54,6 @@ private: Tomahawk::Accounts::AccountFactory* m_factory; Ui_AccountFactoryWrapper* m_ui; QPushButton* m_addButton; - bool m_createAccount; }; #endif // ACCOUNTFACTORYWRAPPER_H diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index c1bce31b8..62e03e36f 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -366,14 +366,10 @@ SettingsDialog::openAccountFactoryConfig( AccountFactory* factory ) AccountFactoryWrapper dialog( factory, this ); QWeakPointer< AccountFactoryWrapper > watcher( &dialog ); - int ret = dialog.exec(); - if ( !watcher.isNull() && dialog.doCreateAccount() ) - createAccountFromFactory( factory ); + dialog.exec(); #else // on osx a sheet needs to be non-modal AccountFactoryWrapper* dialog = new AccountFactoryWrapper( factory, this ); - connect( dialog, SIGNAL( createAccount( Tomahawk::Accounts::AccountFactory* ) ), this, SLOT( createAccountFromFactory( Tomahawk::Accounts::AccountFactory* ) ) ); - dialog->show(); #endif } @@ -393,7 +389,6 @@ SettingsDialog::openAccountConfig( Account* account, bool showDelete ) } - void SettingsDialog::installFromFile() {