1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-05 13:47:26 +02:00

clean up from refactor

This commit is contained in:
Leo Franchi
2012-03-08 19:11:37 -05:00
parent 6cbc8a9539
commit f4603e0cad
3 changed files with 2 additions and 16 deletions

View File

@@ -30,7 +30,6 @@ AccountFactoryWrapper::AccountFactoryWrapper( AccountFactory* factory, QWidget*
: QDialog( parent, Qt::Sheet ) : QDialog( parent, Qt::Sheet )
, m_factory( factory ) , m_factory( factory )
, m_ui( new Ui_AccountFactoryWrapper ) , m_ui( new Ui_AccountFactoryWrapper )
, m_createAccount( false )
{ {
m_ui->setupUi( this ); m_ui->setupUi( this );
@@ -110,9 +109,7 @@ AccountFactoryWrapper::buttonClicked( QAbstractButton* button )
{ {
if ( button == m_addButton ) if ( button == m_addButton )
{ {
m_createAccount = true; TomahawkUtils::createAccountFromFactory( m_factory, this );
emit createAccount( m_factory );
return;
} }
else else
reject(); reject();

View File

@@ -42,11 +42,6 @@ public:
explicit AccountFactoryWrapper( Tomahawk::Accounts::AccountFactory* factory, QWidget* parent = 0 ); explicit AccountFactoryWrapper( Tomahawk::Accounts::AccountFactory* factory, QWidget* parent = 0 );
bool doCreateAccount() const { return m_createAccount; }
signals:
void createAccount( Tomahawk::Accounts::AccountFactory* factory );
public slots: public slots:
void openAccountConfig( Tomahawk::Accounts::Account* ); void openAccountConfig( Tomahawk::Accounts::Account* );
void removeAccount( Tomahawk::Accounts::Account* ); void removeAccount( Tomahawk::Accounts::Account* );
@@ -59,7 +54,6 @@ private:
Tomahawk::Accounts::AccountFactory* m_factory; Tomahawk::Accounts::AccountFactory* m_factory;
Ui_AccountFactoryWrapper* m_ui; Ui_AccountFactoryWrapper* m_ui;
QPushButton* m_addButton; QPushButton* m_addButton;
bool m_createAccount;
}; };
#endif // ACCOUNTFACTORYWRAPPER_H #endif // ACCOUNTFACTORYWRAPPER_H

View File

@@ -366,14 +366,10 @@ SettingsDialog::openAccountFactoryConfig( AccountFactory* factory )
AccountFactoryWrapper dialog( factory, this ); AccountFactoryWrapper dialog( factory, this );
QWeakPointer< AccountFactoryWrapper > watcher( &dialog ); QWeakPointer< AccountFactoryWrapper > watcher( &dialog );
int ret = dialog.exec(); dialog.exec();
if ( !watcher.isNull() && dialog.doCreateAccount() )
createAccountFromFactory( factory );
#else #else
// on osx a sheet needs to be non-modal // on osx a sheet needs to be non-modal
AccountFactoryWrapper* dialog = new AccountFactoryWrapper( factory, this ); AccountFactoryWrapper* dialog = new AccountFactoryWrapper( factory, this );
connect( dialog, SIGNAL( createAccount( Tomahawk::Accounts::AccountFactory* ) ), this, SLOT( createAccountFromFactory( Tomahawk::Accounts::AccountFactory* ) ) );
dialog->show(); dialog->show();
#endif #endif
} }
@@ -393,7 +389,6 @@ SettingsDialog::openAccountConfig( Account* account, bool showDelete )
} }
void void
SettingsDialog::installFromFile() SettingsDialog::installFromFile()
{ {