forked from qt-creator/qt-creator
Merge branch '0.9.1-beta' of git@scm.dev.nokia.troll.no:creator/mainline into 0.9.1-beta
This commit is contained in:
@@ -73,6 +73,7 @@ ClassNamePage::ClassNamePage(const QString &sourceSuffix,
|
||||
m_newClassWidget->setBaseClassEditable(true);
|
||||
m_newClassWidget->setFormInputVisible(false);
|
||||
m_newClassWidget->setNamespacesEnabled(true);
|
||||
m_newClassWidget->setAllowDirectories(true);
|
||||
|
||||
connect(m_newClassWidget, SIGNAL(validChanged()),
|
||||
this, SLOT(slotValidChanged()));
|
||||
|
||||
@@ -40,13 +40,13 @@ using namespace CPlusPlus;
|
||||
using namespace CppTools::Internal;
|
||||
|
||||
SearchSymbols::SearchSymbols():
|
||||
symbolsToSearchFor(ClassesMethodsFunctionsAndEnums)
|
||||
symbolsToSearchFor(Classes | Functions | Enums)
|
||||
{
|
||||
}
|
||||
|
||||
void SearchSymbols::setSymbolsToSearchFor(SymbolType type)
|
||||
void SearchSymbols::setSymbolsToSearchFor(SymbolTypes types)
|
||||
{
|
||||
symbolsToSearchFor = type;
|
||||
symbolsToSearchFor = types;
|
||||
}
|
||||
|
||||
QList<ModelItemInfo> SearchSymbols::operator()(Document::Ptr doc, const QString &scope)
|
||||
@@ -69,7 +69,7 @@ QString SearchSymbols::switchScope(const QString &scope)
|
||||
|
||||
bool SearchSymbols::visit(Enum *symbol)
|
||||
{
|
||||
if (symbolsToSearchFor != ClassesMethodsFunctionsAndEnums)
|
||||
if (!(symbolsToSearchFor & Enums))
|
||||
return false;
|
||||
|
||||
QString name = symbolName(symbol);
|
||||
@@ -89,7 +89,7 @@ bool SearchSymbols::visit(Enum *symbol)
|
||||
|
||||
bool SearchSymbols::visit(Function *symbol)
|
||||
{
|
||||
if (symbolsToSearchFor != ClassesMethodsFunctionsAndEnums)
|
||||
if (!(symbolsToSearchFor & Functions))
|
||||
return false;
|
||||
|
||||
QString name = symbolName(symbol);
|
||||
@@ -131,6 +131,9 @@ bool SearchSymbols::visit(Declaration *symbol)
|
||||
|
||||
bool SearchSymbols::visit(Class *symbol)
|
||||
{
|
||||
if (!(symbolsToSearchFor & Classes))
|
||||
return false;
|
||||
|
||||
QString name = symbolName(symbol);
|
||||
QString previousScope = switchScope(name);
|
||||
QIcon icon = icons.iconForSymbol(symbol);
|
||||
|
||||
@@ -80,15 +80,16 @@ class SearchSymbols: public std::unary_function<CPlusPlus::Document::Ptr, QList<
|
||||
protected CPlusPlus::SymbolVisitor
|
||||
{
|
||||
public:
|
||||
// TODO: Probably should use QFlags
|
||||
enum SymbolType {
|
||||
Classes,
|
||||
ClassesMethodsFunctionsAndEnums
|
||||
Classes = 0x1,
|
||||
Functions = 0x2,
|
||||
Enums = 0x4
|
||||
};
|
||||
Q_DECLARE_FLAGS(SymbolTypes, SymbolType)
|
||||
|
||||
SearchSymbols();
|
||||
|
||||
void setSymbolsToSearchFor(SymbolType type);
|
||||
void setSymbolsToSearchFor(SymbolTypes types);
|
||||
|
||||
QList<ModelItemInfo> operator()(CPlusPlus::Document::Ptr doc)
|
||||
{ return operator()(doc, QString()); }
|
||||
@@ -117,9 +118,11 @@ private:
|
||||
CPlusPlus::Overview overview;
|
||||
CPlusPlus::Icons icons;
|
||||
QList<ModelItemInfo> items;
|
||||
SymbolType symbolsToSearchFor;
|
||||
SymbolTypes symbolsToSearchFor;
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(SearchSymbols::SymbolTypes)
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace CppTools
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ FormClassWizardPage::FormClassWizardPage(QWidget * parent) :
|
||||
|
||||
m_ui->newClassWidget->setBaseClassInputVisible(false);
|
||||
m_ui->newClassWidget->setNamespacesEnabled(true);
|
||||
m_ui->newClassWidget->setAllowDirectories(true);
|
||||
|
||||
connect(m_ui->newClassWidget, SIGNAL(validChanged()), this, SLOT(slotValidChanged()));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user