mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
clean up from refactor
This commit is contained in:
parent
6cbc8a9539
commit
f4603e0cad
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user