CppEditor: add more sections (protected, ...) for declaration (refactoring)

You can write definition of function, type Alt+Enter, as usual,
and select not only public but also other possible sections
like private, public slots and so on.

Change-Id: I2faefc3833c6f05c9e2e5a2a41328bcdbe17ba14
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Andrey M. Tokarev
2013-04-10 19:37:25 +04:00
committed by Nikolai Kosjar
parent f0f406bacb
commit 72e0ded3c4
7 changed files with 119 additions and 10 deletions

View File

@@ -118,11 +118,13 @@ struct ContentLessThan
} // Anonymous
BasicProposalItemListModel::BasicProposalItemListModel()
: m_isSortingAllowed(false)
{}
BasicProposalItemListModel::BasicProposalItemListModel(const QList<BasicProposalItem *> &items)
: m_currentItems(items)
, m_originalItems(items)
, m_isSortingAllowed(true)
{
mapPersistentIds();
}
@@ -139,6 +141,16 @@ void BasicProposalItemListModel::loadContent(const QList<BasicProposalItem *> &i
mapPersistentIds();
}
void BasicProposalItemListModel::setSortingAllowed(bool isAllowed)
{
m_isSortingAllowed = isAllowed;
}
bool BasicProposalItemListModel::isSortingAllowed() const
{
return m_isSortingAllowed;
}
void BasicProposalItemListModel::mapPersistentIds()
{
for (int i = 0; i < m_originalItems.size(); ++i)
@@ -258,6 +270,8 @@ bool BasicProposalItemListModel::isSortable(const QString &prefix) const
{
Q_UNUSED(prefix);
if (!isSortingAllowed())
return false;
if (m_currentItems.size() < kMaxSort)
return true;
return false;