forked from qt-creator/qt-creator
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:
committed by
Nikolai Kosjar
parent
f0f406bacb
commit
72e0ded3c4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user