mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-28 11:42:42 +01:00
Fix on/off == enabled/disabled semantics.
This commit is contained in:
parent
ef5efacade
commit
fbee760723
@ -39,15 +39,16 @@ AccountModelFactoryProxy::filterAcceptsRow( int sourceRow, const QModelIndex& so
|
||||
return true;
|
||||
|
||||
const QModelIndex idx = sourceModel()->index( sourceRow, 0, sourceParent );
|
||||
const Qt::CheckState checkState = static_cast< Qt::CheckState >( idx.data( Qt::CheckStateRole ).value< int >() );
|
||||
|
||||
qDebug() << "FILTERING";
|
||||
qDebug() << "checkState is " << checkState;
|
||||
if( checkState == Qt::Unchecked ) //if the service is not even enabled
|
||||
return false;
|
||||
|
||||
const AccountModel::RowType rowType = static_cast< AccountModel::RowType >( idx.data( AccountModel::RowTypeRole ).value< int >() );
|
||||
|
||||
if( rowType == Tomahawk::Accounts::AccountModel::TopLevelFactory )
|
||||
{
|
||||
if ( idx.data( Tomahawk::Accounts::AccountModel::ChildrenOfFactoryRole )
|
||||
.value< QList< Tomahawk::Accounts::Account* > >().isEmpty() )
|
||||
return false;
|
||||
}
|
||||
|
||||
return rowType == m_filterRowType;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "SlideSwitchButton.h"
|
||||
#include "accounts/Account.h"
|
||||
#include "accounts/AccountModel.h"
|
||||
#include "accounts/AccountManager.h"
|
||||
#include "sip/SipPlugin.h"
|
||||
#include "utils/TomahawkUtilsGui.h"
|
||||
#include "utils/AnimatedSpinner.h"
|
||||
@ -206,11 +207,11 @@ AccountWidget::changeAccountConnectionState( bool connected )
|
||||
{
|
||||
if ( connected )
|
||||
{
|
||||
account->authenticate();
|
||||
Tomahawk::Accounts::AccountManager::instance()->enableAccount( account );
|
||||
}
|
||||
else
|
||||
{
|
||||
account->deauthenticate();
|
||||
Tomahawk::Accounts::AccountManager::instance()->disableAccount( account );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user