Skip to content
Snippets Groups Projects
Commit 228e9ba3 authored by Alexandre Lision's avatar Alexandre Lision
Browse files

accountmodel: add selection getter

Change-Id: I9ca1fb7ac8cbd5254c97fc107c7a433a01c31eab
Tuleap: #338
parent 463c22bc
No related branches found
No related tags found
No related merge requests found
...@@ -237,6 +237,11 @@ QItemSelectionModel* AccountModel::selectionModel() const ...@@ -237,6 +237,11 @@ QItemSelectionModel* AccountModel::selectionModel() const
return d_ptr->m_pSelectionModel; return d_ptr->m_pSelectionModel;
} }
Account* AccountModel::selectedAccount() const
{
return AccountModel::instance().getAccountByModelIndex(d_ptr->m_pSelectionModel->currentIndex());
}
/** /**
* The client have a different point of view when it come to the account * The client have a different point of view when it come to the account
* state. All the different errors are also handled elsewhere * state. All the different errors are also handled elsewhere
......
...@@ -80,6 +80,7 @@ public: ...@@ -80,6 +80,7 @@ public:
bool isIP2IPSupported ( ) const; bool isIP2IPSupported ( ) const;
bool isRingSupported ( ) const; bool isRingSupported ( ) const;
EditState editState ( ) const; EditState editState ( ) const;
Account* selectedAccount ( ) const;
QItemSelectionModel* selectionModel ( ) const; QItemSelectionModel* selectionModel ( ) const;
...@@ -156,4 +157,3 @@ Q_SIGNALS: ...@@ -156,4 +157,3 @@ Q_SIGNALS:
void editStateChanged(const EditState state, const EditState previous) const; void editStateChanged(const EditState state, const EditState previous) const;
}; };
Q_DECLARE_METATYPE(AccountModel*) Q_DECLARE_METATYPE(AccountModel*)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment