Merge branch '1.3' of git@scm.dev.nokia.troll.no:creator/mainline into 1.3

Conflicts:
	src/plugins/cpptools/cppfindreferences.cpp
	src/plugins/cpptools/cpptoolsplugin.cpp
	src/plugins/texteditor/basefilefind.cpp
This commit is contained in:
con
2009-10-05 17:26:13 +02:00
272 changed files with 1240 additions and 1161 deletions

View File

@@ -194,6 +194,22 @@ protected:
{ Q_ASSERT(false); } { Q_ASSERT(false); }
}; };
template <typename _Tp>
static QList<_Tp> removeDuplicates(const QList<_Tp> &results)
{
QList<_Tp> uniqueList;
QSet<_Tp> processed;
foreach (const _Tp &r, results) {
if (processed.contains(r))
continue;
processed.insert(r);
uniqueList.append(r);
}
return uniqueList;
}
} // end of anonymous namespace } // end of anonymous namespace
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@@ -212,7 +228,7 @@ QList<ResolveExpression::Result> ResolveExpression::operator()(ExpressionAST *as
{ {
const QList<Result> previousResults = switchResults(QList<Result>()); const QList<Result> previousResults = switchResults(QList<Result>());
accept(ast); accept(ast);
return switchResults(previousResults); return removeDuplicates(switchResults(previousResults));
} }
QList<ResolveExpression::Result> QList<ResolveExpression::Result>
@@ -482,7 +498,7 @@ bool ResolveExpression::visit(QualifiedNameAST *ast)
if (NamedType *namedTy = symbol->type()->asNamedType()) { if (NamedType *namedTy = symbol->type()->asNamedType()) {
const Result r(namedTy, symbol); const Result r(namedTy, symbol);
const QList<Symbol *> resolvedClasses = const QList<Symbol *> resolvedClasses =
resolveClass(r, _context); resolveClass(namedTy->name(), r, _context);
if (resolvedClasses.count()) { if (resolvedClasses.count()) {
foreach (Symbol *s, resolvedClasses) { foreach (Symbol *s, resolvedClasses) {
addResult(s->type(), s); addResult(s->type(), s);
@@ -591,7 +607,7 @@ bool ResolveExpression::visit(ArrayAccessAST *ast)
addResult(arrTy->elementType(), contextSymbol); addResult(arrTy->elementType(), contextSymbol);
} else if (NamedType *namedTy = ty->asNamedType()) { } else if (NamedType *namedTy = ty->asNamedType()) {
const QList<Symbol *> classObjectCandidates = const QList<Symbol *> classObjectCandidates =
symbolsForDotAcccess(p, _context); symbolsForDotAcccess(namedTy->name(), p, _context);
foreach (Symbol *classObject, classObjectCandidates) { foreach (Symbol *classObject, classObjectCandidates) {
const QList<Result> overloads = const QList<Result> overloads =
@@ -630,30 +646,38 @@ bool ResolveExpression::visit(MemberAccessAST *ast)
return false; return false;
} }
QList<Symbol *> ResolveExpression::resolveBaseExpression(const QList<Result> &baseResults, int accessOp) const QList<ResolveExpression::Result>
ResolveExpression::resolveBaseExpression(const QList<Result> &baseResults, int accessOp) const
{ {
QList<Symbol *> classObjectCandidates; QList<Result> results;
if (baseResults.isEmpty()) if (baseResults.isEmpty())
return classObjectCandidates; return results;
Result result = baseResults.first(); Result result = baseResults.first();
FullySpecifiedType ty = result.first.simplified();
Symbol *lastVisibleSymbol = result.second;
if (accessOp == T_ARROW) { if (accessOp == T_ARROW) {
FullySpecifiedType ty = result.first.simplified(); if (lastVisibleSymbol && ty->isClassType() && ! lastVisibleSymbol->isClass()) {
// ### remove ! lastVisibleSymbol->isClass() from the condition.
results.append(Result(ty, lastVisibleSymbol));
if (Class *classTy = ty->asClassType()) {
Symbol *symbol = result.second;
if (symbol && ! symbol->isClass())
classObjectCandidates.append(classTy);
} else if (NamedType *namedTy = ty->asNamedType()) { } else if (NamedType *namedTy = ty->asNamedType()) {
// ### This code is pretty slow. // ### This code is pretty slow.
const QList<Symbol *> candidates = _context.resolve(namedTy->name()); const QList<Symbol *> candidates = _context.resolve(namedTy->name());
foreach (Symbol *candidate, candidates) { foreach (Symbol *candidate, candidates) {
if (candidate->isTypedef()) { if (candidate->isTypedef()) {
ty = candidate->type(); FullySpecifiedType declTy = candidate->type().simplified();
const ResolveExpression::Result r(ty, candidate); const ResolveExpression::Result r(declTy, candidate);
// update the result
result = r; result = r;
// refresh the cached ty and lastVisibileSymbol.
ty = result.first.simplified();
lastVisibleSymbol = result.second;
break; break;
} }
} }
@@ -662,82 +686,49 @@ QList<Symbol *> ResolveExpression::resolveBaseExpression(const QList<Result> &ba
if (NamedType *namedTy = ty->asNamedType()) { if (NamedType *namedTy = ty->asNamedType()) {
ResolveClass resolveClass; ResolveClass resolveClass;
const QList<Symbol *> candidates = resolveClass(result, _context); const QList<Symbol *> candidates = resolveClass(namedTy->name(), result, _context);
foreach (Symbol *classObject, candidates) { foreach (Symbol *classObject, candidates) {
const QList<Result> overloads = resolveArrowOperator(result, namedTy, const QList<Result> overloads = resolveArrowOperator(result, namedTy,
classObject->asClass()); classObject->asClass());
foreach (Result r, overloads) { foreach (const Result &r, overloads) {
FullySpecifiedType ty = r.first; FullySpecifiedType typeOfOverloadFunction = r.first.simplified();
Function *funTy = ty->asFunctionType(); Symbol *lastVisibleSymbol = r.second;
Function *funTy = typeOfOverloadFunction->asFunctionType();
if (! funTy) if (! funTy)
continue; continue;
ty = funTy->returnType().simplified(); typeOfOverloadFunction = funTy->returnType().simplified();
if (PointerType *ptrTy = ty->asPointerType()) { if (PointerType *ptrTy = typeOfOverloadFunction->asPointerType()) {
if (NamedType *namedTy = ptrTy->elementType()->asNamedType()) { FullySpecifiedType elementTy = ptrTy->elementType().simplified();
const QList<Symbol *> classes =
resolveClass(namedTy, result, _context);
foreach (Symbol *c, classes) { if (elementTy->isNamedType())
if (! classObjectCandidates.contains(c)) results.append(Result(elementTy, lastVisibleSymbol));
classObjectCandidates.append(c);
}
}
} }
} }
} }
} else if (PointerType *ptrTy = ty->asPointerType()) { } else if (PointerType *ptrTy = ty->asPointerType()) {
if (NamedType *namedTy = ptrTy->elementType()->asNamedType()) { FullySpecifiedType elementTy = ptrTy->elementType().simplified();
ResolveClass resolveClass;
const QList<Symbol *> classes = resolveClass(namedTy, result, if (elementTy->isNamedType() || elementTy->isClassType())
_context); results.append(Result(elementTy, lastVisibleSymbol));
foreach (Symbol *c, classes) {
if (! classObjectCandidates.contains(c))
classObjectCandidates.append(c);
}
} else if (Class *classTy = ptrTy->elementType()->asClassType()) {
// typedef struct { int x } *Ptr;
// Ptr p;
// p->
classObjectCandidates.append(classTy);
}
} }
} else if (accessOp == T_DOT) { } else if (accessOp == T_DOT) {
FullySpecifiedType ty = result.first.simplified(); if (ty->isClassType() || ty->isNamedType())
results.append(Result(ty, lastVisibleSymbol));
NamedType *namedTy = 0; if (Function *fun = ty->asFunctionType()) {
Scope *funScope = fun->scope();
if (Class *classTy = ty->asClassType()) { if (funScope && (funScope->isBlockScope() || funScope->isNamespaceScope())) {
Symbol *symbol = result.second; FullySpecifiedType retTy = fun->returnType().simplified();
if (symbol && ! symbol->isClass()) results.append(Result(retTy, lastVisibleSymbol));
classObjectCandidates.append(classTy);
} else {
namedTy = ty->asNamedType();
if (! namedTy) {
Function *fun = ty->asFunctionType();
if (fun && fun->scope() && (fun->scope()->isBlockScope() || fun->scope()->isNamespaceScope()))
namedTy = fun->returnType()->asNamedType();
}
}
if (namedTy) {
ResolveClass resolveClass;
const QList<Symbol *> symbols = resolveClass(namedTy, result,
_context);
foreach (Symbol *symbol, symbols) {
if (classObjectCandidates.contains(symbol))
continue;
if (Class *klass = symbol->asClass())
classObjectCandidates.append(klass);
} }
} }
} }
return classObjectCandidates; return removeDuplicates(results);
} }
QList<ResolveExpression::Result> QList<ResolveExpression::Result>
@@ -745,25 +736,42 @@ ResolveExpression::resolveMemberExpression(const QList<Result> &baseResults,
unsigned accessOp, unsigned accessOp,
Name *memberName) const Name *memberName) const
{ {
ResolveClass resolveClass;
QList<Result> results; QList<Result> results;
const QList<Symbol *> classObjectCandidates = resolveBaseExpression(baseResults, accessOp); const QList<Result> classObjectResults = resolveBaseExpression(baseResults, accessOp);
foreach (Symbol *candidate, classObjectCandidates) { foreach (const Result &r, classObjectResults) {
Class *klass = candidate->asClass(); FullySpecifiedType ty = r.first;
if (! klass)
continue;
if (Class *klass = ty->asClassType())
results += resolveMember(memberName, klass); results += resolveMember(memberName, klass);
else if (NamedType *namedTy = ty->asNamedType()) {
Name *className = namedTy->name();
const QList<Symbol *> classes = resolveClass(className, r, _context);
foreach (Symbol *c, classes) {
if (Class *klass = c->asClass())
results += resolveMember(memberName, klass, className);
}
}
} }
return results; return removeDuplicates(results);
} }
QList<ResolveExpression::Result> QList<ResolveExpression::Result>
ResolveExpression::resolveMember(Name *memberName, Class *klass) const ResolveExpression::resolveMember(Name *memberName, Class *klass,
Name *className) const
{ {
QList<Result> results; QList<Result> results;
if (! className)
className = klass->name();
if (! className)
return results;
QList<Scope *> scopes; QList<Scope *> scopes;
_context.expand(klass->members(), _context.visibleScopes(), &scopes); _context.expand(klass->members(), _context.visibleScopes(), &scopes);
@@ -771,8 +779,6 @@ ResolveExpression::resolveMember(Name *memberName, Class *klass) const
foreach (Symbol *candidate, candidates) { foreach (Symbol *candidate, candidates) {
FullySpecifiedType ty = candidate->type(); FullySpecifiedType ty = candidate->type();
if (Name *className = klass->name()) {
Name *unqualifiedNameId = className; Name *unqualifiedNameId = className;
if (QualifiedNameId *q = className->asQualifiedNameId()) if (QualifiedNameId *q = className->asQualifiedNameId())
@@ -792,14 +798,11 @@ ResolveExpression::resolveMember(Name *memberName, Class *klass) const
Instantiation inst(control(), subst); Instantiation inst(control(), subst);
ty = inst(ty); ty = inst(ty);
} }
results.append(Result(ty, candidate));
} }
const Result result(ty, candidate); return removeDuplicates(results);
if (! results.contains(result))
results.append(result);
}
return results;
} }
QList<ResolveExpression::Result> QList<ResolveExpression::Result>
@@ -832,11 +835,10 @@ ResolveExpression::resolveArrowOperator(const Result &,
} }
const Result result(ty, candidate); const Result result(ty, candidate);
if (! results.contains(result))
results.append(result); results.append(result);
} }
return results; return removeDuplicates(results);
} }
QList<ResolveExpression::Result> QList<ResolveExpression::Result>
@@ -870,12 +872,10 @@ ResolveExpression::resolveArrayOperator(const Result &,
ty = inst(ty); ty = inst(ty);
} }
const Result result(ty, candidate); results.append(Result(ty, candidate));
if (! results.contains(result))
results.append(result);
} }
return results; return removeDuplicates(results);
} }
bool ResolveExpression::visit(PostIncrDecrAST *) bool ResolveExpression::visit(PostIncrDecrAST *)
@@ -894,27 +894,18 @@ bool ResolveClass::pointerAccess() const
void ResolveClass::setPointerAccess(bool pointerAccess) void ResolveClass::setPointerAccess(bool pointerAccess)
{ _pointerAccess = pointerAccess; } { _pointerAccess = pointerAccess; }
QList<Symbol *> ResolveClass::operator()(NamedType *namedTy, QList<Symbol *> ResolveClass::operator()(Name *name,
ResolveExpression::Result p, const ResolveExpression::Result &p,
const LookupContext &context) const LookupContext &context)
{ {
const QList<ResolveExpression::Result> previousBlackList = _blackList; const QList<ResolveExpression::Result> previousBlackList = _blackList;
const QList<Symbol *> symbols = resolveClass(namedTy, p, context); const QList<Symbol *> symbols = resolveClass(name, p, context);
_blackList = previousBlackList; _blackList = previousBlackList;
return symbols; return symbols;
} }
QList<Symbol *> ResolveClass::operator()(ResolveExpression::Result p, QList<Symbol *> ResolveClass::resolveClass(Name *name,
const LookupContext &context) const ResolveExpression::Result &p,
{
const QList<ResolveExpression::Result> previousBlackList = _blackList;
const QList<Symbol *> symbols = resolveClass(p, context);
_blackList = previousBlackList;
return symbols;
}
QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
ResolveExpression::Result p,
const LookupContext &context) const LookupContext &context)
{ {
QList<Symbol *> resolvedSymbols; QList<Symbol *> resolvedSymbols;
@@ -925,7 +916,7 @@ QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
_blackList.append(p); _blackList.append(p);
const QList<Symbol *> candidates = const QList<Symbol *> candidates =
context.resolve(namedTy->name(), context.visibleScopes(p)); context.resolve(name, context.visibleScopes(p));
foreach (Symbol *candidate, candidates) { foreach (Symbol *candidate, candidates) {
if (Class *klass = candidate->asClass()) { if (Class *klass = candidate->asClass()) {
@@ -936,10 +927,13 @@ QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
if (Declaration *decl = candidate->asDeclaration()) { if (Declaration *decl = candidate->asDeclaration()) {
if (_pointerAccess && decl->type()->isPointerType()) { if (_pointerAccess && decl->type()->isPointerType()) {
PointerType *ptrTy = decl->type()->asPointerType(); PointerType *ptrTy = decl->type()->asPointerType();
FullySpecifiedType elementTy = ptrTy->elementType().simplified();
if (NamedType *namedTy = elementTy->asNamedType()) {
_pointerAccess = false; _pointerAccess = false;
const ResolveExpression::Result r(ptrTy->elementType(), decl); const ResolveExpression::Result r(elementTy, decl);
resolvedSymbols += resolveClass(r, context); resolvedSymbols += resolveClass(namedTy->name(), r, context);
_pointerAccess = true; _pointerAccess = true;
}
} else if (Class *asClass = decl->type()->asClassType()) { } else if (Class *asClass = decl->type()->asClassType()) {
// typedef struct { } Point; // typedef struct { } Point;
// Point pt; // Point pt;
@@ -949,8 +943,11 @@ QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
// typedef Point Boh; // typedef Point Boh;
// Boh b; // Boh b;
// b. // b.
const ResolveExpression::Result r(decl->type(), decl); FullySpecifiedType declType = decl->type().simplified();
resolvedSymbols += resolveClass(r, context); if (NamedType *namedTy = declType->asNamedType()) {
const ResolveExpression::Result r(declType, decl);
resolvedSymbols += resolveClass(namedTy->name(), r, context);
}
} }
} }
} else if (Declaration *decl = candidate->asDeclaration()) { } else if (Declaration *decl = candidate->asDeclaration()) {
@@ -958,8 +955,11 @@ QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
// QString foo("ciao"); // QString foo("ciao");
// foo. // foo.
if (funTy->scope() && (funTy->scope()->isBlockScope() || funTy->scope()->isNamespaceScope())) { if (funTy->scope() && (funTy->scope()->isBlockScope() || funTy->scope()->isNamespaceScope())) {
const ResolveExpression::Result r(funTy->returnType(), decl); FullySpecifiedType retTy = funTy->returnType().simplified();
resolvedSymbols += resolveClass(r, context); if (NamedType *namedTy = retTy->asNamedType()) {
const ResolveExpression::Result r(retTy, decl);
resolvedSymbols += resolveClass(namedTy->name(), r, context);
}
} }
} }
} }
@@ -967,19 +967,3 @@ QList<Symbol *> ResolveClass::resolveClass(NamedType *namedTy,
return resolvedSymbols; return resolvedSymbols;
} }
QList<Symbol *> ResolveClass::resolveClass(ResolveExpression::Result p,
const LookupContext &context)
{
FullySpecifiedType ty = p.first;
if (NamedType *namedTy = ty->asNamedType()) {
return resolveClass(namedTy, p, context);
} else if (ReferenceType *refTy = ty->asReferenceType()) {
const ResolveExpression::Result e(refTy->elementType(), p.second);
return resolveClass(e, context);
}
return QList<Symbol *>();
}

View File

@@ -53,7 +53,7 @@ public:
unsigned accessOp, unsigned accessOp,
Name *memberName) const; Name *memberName) const;
QList<Result> resolveMember(Name *memberName, Class *klass) const; QList<Result> resolveMember(Name *memberName, Class *klass, Name *className = 0) const;
QList<Result> resolveArrowOperator(const Result &result, QList<Result> resolveArrowOperator(const Result &result,
NamedType *namedTy, NamedType *namedTy,
@@ -64,7 +64,7 @@ public:
Class *klass) const; Class *klass) const;
QList<Symbol *> resolveBaseExpression(const QList<Result> &baseResults, QList<Result> resolveBaseExpression(const QList<Result> &baseResults,
int accessOp) const; int accessOp) const;
protected: protected:
@@ -131,19 +131,13 @@ public:
bool pointerAccess() const; bool pointerAccess() const;
void setPointerAccess(bool pointerAccess); void setPointerAccess(bool pointerAccess);
QList<Symbol *> operator()(NamedType *namedTy, QList<Symbol *> operator()(Name *name,
ResolveExpression::Result p, const ResolveExpression::Result &p,
const LookupContext &context);
QList<Symbol *> operator()(ResolveExpression::Result p,
const LookupContext &context); const LookupContext &context);
private: private:
QList<Symbol *> resolveClass(NamedType *namedTy, QList<Symbol *> resolveClass(Name *name,
ResolveExpression::Result p, const ResolveExpression::Result &p,
const LookupContext &context);
QList<Symbol *> resolveClass(ResolveExpression::Result p,
const LookupContext &context); const LookupContext &context);
private: private:

View File

@@ -34,7 +34,6 @@
#include <QtCore/QStringList> #include <QtCore/QStringList>
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT AbstractProcess class QTCREATOR_UTILS_EXPORT AbstractProcess
@@ -75,7 +74,6 @@ private:
}; };
} //namespace Utils } //namespace Utils
} //namespace Core
#endif // ABSTRACTPROCESS_H #endif // ABSTRACTPROCESS_H

View File

@@ -31,7 +31,6 @@
#include <windows.h> #include <windows.h>
namespace Core {
namespace Utils { namespace Utils {
QStringList AbstractProcess::fixWinEnvironment(const QStringList &env) QStringList AbstractProcess::fixWinEnvironment(const QStringList &env)
@@ -114,4 +113,3 @@ QByteArray AbstractProcess::createWinEnvironment(const QStringList &env)
} }
} //namespace Utils } //namespace Utils
} //namespace Core

View File

@@ -33,7 +33,6 @@
enum { debug = 0 }; enum { debug = 0 };
namespace Core {
namespace Utils { namespace Utils {
struct BaseValidatingLineEditPrivate { struct BaseValidatingLineEditPrivate {
@@ -156,4 +155,3 @@ void BaseValidatingLineEdit::triggerChanged()
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -34,7 +34,6 @@
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
namespace Core {
namespace Utils { namespace Utils {
struct BaseValidatingLineEditPrivate; struct BaseValidatingLineEditPrivate;
@@ -98,6 +97,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // BASEVALIDATINGLINEEDIT_H #endif // BASEVALIDATINGLINEEDIT_H

View File

@@ -4,7 +4,6 @@
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
#include <QtCore/QDebug> #include <QtCore/QDebug>
namespace Core {
namespace Utils { namespace Utils {
struct CheckableMessageBoxPrivate { struct CheckableMessageBoxPrivate {
@@ -147,4 +146,3 @@ QMessageBox::StandardButton CheckableMessageBox::dialogButtonBoxToMessageBoxButt
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -7,7 +7,6 @@
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
#include <QtGui/QDialog> #include <QtGui/QDialog>
namespace Core {
namespace Utils { namespace Utils {
struct CheckableMessageBoxPrivate; struct CheckableMessageBoxPrivate;
@@ -72,6 +71,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // CHECKABLEMESSAGEBOX_H #endif // CHECKABLEMESSAGEBOX_H

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Core::Utils::CheckableMessageBox</class> <class>Utils::CheckableMessageBox</class>
<widget class="QDialog" name="Core::Utils::CheckableMessageBox"> <widget class="QDialog" name="Utils::CheckableMessageBox">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@@ -121,7 +121,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>Core::Utils::CheckableMessageBox</receiver> <receiver>Utils::CheckableMessageBox</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">
@@ -137,7 +137,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>rejected()</signal> <signal>rejected()</signal>
<receiver>Core::Utils::CheckableMessageBox</receiver> <receiver>Utils::CheckableMessageBox</receiver>
<slot>reject()</slot> <slot>reject()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@@ -34,7 +34,6 @@
#include <QtCore/QDebug> #include <QtCore/QDebug>
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
namespace Core {
namespace Utils { namespace Utils {
struct ClassNameValidatingLineEditPrivate { struct ClassNameValidatingLineEditPrivate {
@@ -58,7 +57,7 @@ ClassNameValidatingLineEditPrivate:: ClassNameValidatingLineEditPrivate() :
// --------------------- ClassNameValidatingLineEdit // --------------------- ClassNameValidatingLineEdit
ClassNameValidatingLineEdit::ClassNameValidatingLineEdit(QWidget *parent) : ClassNameValidatingLineEdit::ClassNameValidatingLineEdit(QWidget *parent) :
Core::Utils::BaseValidatingLineEdit(parent), Utils::BaseValidatingLineEdit(parent),
m_d(new ClassNameValidatingLineEditPrivate) m_d(new ClassNameValidatingLineEditPrivate)
{ {
} }
@@ -98,7 +97,7 @@ bool ClassNameValidatingLineEdit::validate(const QString &value, QString *errorM
void ClassNameValidatingLineEdit::slotChanged(const QString &t) void ClassNameValidatingLineEdit::slotChanged(const QString &t)
{ {
Core::Utils::BaseValidatingLineEdit::slotChanged(t); Utils::BaseValidatingLineEdit::slotChanged(t);
if (isValid()) { if (isValid()) {
// Suggest file names, strip namespaces // Suggest file names, strip namespaces
QString fileName = m_d->m_lowerCaseFileName ? t.toLower() : t; QString fileName = m_d->m_lowerCaseFileName ? t.toLower() : t;
@@ -148,4 +147,3 @@ void ClassNameValidatingLineEdit::setLowerCaseFileName(bool v)
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -33,7 +33,6 @@
#include "utils_global.h" #include "utils_global.h"
#include "basevalidatinglineedit.h" #include "basevalidatinglineedit.h"
namespace Core {
namespace Utils { namespace Utils {
struct ClassNameValidatingLineEditPrivate; struct ClassNameValidatingLineEditPrivate;
@@ -42,7 +41,7 @@ struct ClassNameValidatingLineEditPrivate;
* to derive suggested file names from it. */ * to derive suggested file names from it. */
class QTCREATOR_UTILS_EXPORT ClassNameValidatingLineEdit class QTCREATOR_UTILS_EXPORT ClassNameValidatingLineEdit
: public Core::Utils::BaseValidatingLineEdit : public Utils::BaseValidatingLineEdit
{ {
Q_DISABLE_COPY(ClassNameValidatingLineEdit) Q_DISABLE_COPY(ClassNameValidatingLineEdit)
Q_PROPERTY(bool namespacesEnabled READ namespacesEnabled WRITE setNamespacesEnabled DESIGNABLE true) Q_PROPERTY(bool namespacesEnabled READ namespacesEnabled WRITE setNamespacesEnabled DESIGNABLE true)
@@ -76,6 +75,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // CLASSNAMEVALIDATINGLINEEDIT_H #endif // CLASSNAMEVALIDATINGLINEEDIT_H

View File

@@ -33,7 +33,6 @@
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
namespace Core {
namespace Utils { namespace Utils {
static QString toAlphaNum(const QString &s) static QString toAlphaNum(const QString &s)
@@ -101,4 +100,3 @@ void writeClosingNameSpaces(const QStringList &l, const QString &indent,
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -38,7 +38,6 @@ class QTextStream;
class QStringList; class QStringList;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
QTCREATOR_UTILS_EXPORT QString headerGuard(const QString &file); QTCREATOR_UTILS_EXPORT QString headerGuard(const QString &file);
@@ -62,6 +61,5 @@ void writeClosingNameSpaces(const QStringList &namespaces,
QTextStream &str); QTextStream &str);
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // CODEGENERATION_H #endif // CODEGENERATION_H

View File

@@ -29,7 +29,6 @@
#include "consoleprocess.h" #include "consoleprocess.h"
namespace Core {
namespace Utils { namespace Utils {
QString ConsoleProcess::modeOption(Mode m) QString ConsoleProcess::modeOption(Mode m)
@@ -83,4 +82,3 @@ QString ConsoleProcess::msgCannotExecute(const QString & p, const QString &why)
} }
} }
}

View File

@@ -51,7 +51,6 @@ class QSettings;
class QTemporaryFile; class QTemporaryFile;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT ConsoleProcess : public QObject, public AbstractProcess class QTCREATOR_UTILS_EXPORT ConsoleProcess : public QObject, public AbstractProcess
@@ -138,6 +137,5 @@ private:
}; };
} //namespace Utils } //namespace Utils
} //namespace Core
#endif #endif

View File

@@ -42,7 +42,7 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
using namespace Core::Utils; using namespace Utils;
ConsoleProcess::ConsoleProcess(QObject *parent) : ConsoleProcess::ConsoleProcess(QObject *parent) :
QObject(parent), QObject(parent),

View File

@@ -40,7 +40,7 @@
#include <stdlib.h> #include <stdlib.h>
using namespace Core::Utils; using namespace Utils;
ConsoleProcess::ConsoleProcess(QObject *parent) : ConsoleProcess::ConsoleProcess(QObject *parent) :
QObject(parent), QObject(parent),

View File

@@ -39,7 +39,6 @@
enum { margin = 6 }; enum { margin = 6 };
namespace Core {
namespace Utils { namespace Utils {
static inline QString sideToStyleSheetString(FancyLineEdit::Side side) static inline QString sideToStyleSheetString(FancyLineEdit::Side side)
@@ -311,4 +310,3 @@ QString FancyLineEdit::typedText() const
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -34,7 +34,6 @@
#include <QtGui/QLineEdit> #include <QtGui/QLineEdit>
namespace Core {
namespace Utils { namespace Utils {
class FancyLineEditPrivate; class FancyLineEditPrivate;
@@ -107,6 +106,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // FANCYLINEEDIT_H #endif // FANCYLINEEDIT_H

View File

@@ -35,7 +35,7 @@
#include <QtCore/QSettings> #include <QtCore/QSettings>
using namespace Core::Utils; using namespace Utils;
FancyMainWindow::FancyMainWindow(QWidget *parent) FancyMainWindow::FancyMainWindow(QWidget *parent)
: QMainWindow(parent), : QMainWindow(parent),

View File

@@ -41,7 +41,6 @@ QT_BEGIN_NAMESPACE
class QSettings; class QSettings;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT FancyMainWindow : public QMainWindow class QTCREATOR_UTILS_EXPORT FancyMainWindow : public QMainWindow
@@ -85,6 +84,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // FANCYMAINWINDOW_H #endif // FANCYMAINWINDOW_H

View File

@@ -33,7 +33,6 @@
#include <QtCore/QRegExp> #include <QtCore/QRegExp>
#include <QtCore/QDebug> #include <QtCore/QDebug>
namespace Core {
namespace Utils { namespace Utils {
#define WINDOWS_DEVICES "CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL" #define WINDOWS_DEVICES "CON|AUX|PRN|COM1|COM2|LPT1|LPT2|NUL"
@@ -133,4 +132,3 @@ bool FileNameValidatingLineEdit::validate(const QString &value, QString *errorM
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -32,7 +32,6 @@
#include "basevalidatinglineedit.h" #include "basevalidatinglineedit.h"
namespace Core {
namespace Utils { namespace Utils {
/** /**
@@ -67,6 +66,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // FILENAMEVALIDATINGLINEEDIT_H #endif // FILENAMEVALIDATINGLINEEDIT_H

View File

@@ -40,11 +40,11 @@
#include <qtconcurrent/runextensions.h> #include <qtconcurrent/runextensions.h>
using namespace Core::Utils; using namespace Utils;
static inline QString msgCanceled(const QString &searchTerm, int numMatches, int numFilesSearched) static inline QString msgCanceled(const QString &searchTerm, int numMatches, int numFilesSearched)
{ {
return QCoreApplication::translate("Core::Utils::FileSearch", return QCoreApplication::translate("Utils::FileSearch",
"%1: canceled. %n occurrences found in %2 files.", "%1: canceled. %n occurrences found in %2 files.",
0, QCoreApplication::CodecForTr, numMatches). 0, QCoreApplication::CodecForTr, numMatches).
arg(searchTerm).arg(numFilesSearched); arg(searchTerm).arg(numFilesSearched);
@@ -52,7 +52,7 @@ static inline QString msgCanceled(const QString &searchTerm, int numMatches, int
static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched) static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched)
{ {
return QCoreApplication::translate("Core::Utils::FileSearch", return QCoreApplication::translate("Utils::FileSearch",
"%1: %n occurrences found in %2 files.", "%1: %n occurrences found in %2 files.",
0, QCoreApplication::CodecForTr, numMatches). 0, QCoreApplication::CodecForTr, numMatches).
arg(searchTerm).arg(numFilesSearched); arg(searchTerm).arg(numFilesSearched);
@@ -60,7 +60,7 @@ static inline QString msgFound(const QString &searchTerm, int numMatches, int nu
static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched, int filesSize) static inline QString msgFound(const QString &searchTerm, int numMatches, int numFilesSearched, int filesSize)
{ {
return QCoreApplication::translate("Core::Utils::FileSearch", return QCoreApplication::translate("Utils::FileSearch",
"%1: %n occurrences found in %2 of %3 files.", "%1: %n occurrences found in %2 of %3 files.",
0, QCoreApplication::CodecForTr, numMatches). 0, QCoreApplication::CodecForTr, numMatches).
arg(searchTerm).arg(numFilesSearched).arg(filesSize); arg(searchTerm).arg(numFilesSearched).arg(filesSize);
@@ -246,14 +246,14 @@ void runFileSearchRegExp(QFutureInterface<FileSearchResult> &future,
} // namespace } // namespace
QFuture<FileSearchResult> Core::Utils::findInFiles(const QString &searchTerm, const QStringList &files, QFuture<FileSearchResult> Utils::findInFiles(const QString &searchTerm, const QStringList &files,
QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap) QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap)
{ {
return QtConcurrent::run<FileSearchResult, QString, QStringList, QTextDocument::FindFlags, QMap<QString, QString> > return QtConcurrent::run<FileSearchResult, QString, QStringList, QTextDocument::FindFlags, QMap<QString, QString> >
(runFileSearch, searchTerm, files, flags, fileToContentsMap); (runFileSearch, searchTerm, files, flags, fileToContentsMap);
} }
QFuture<FileSearchResult> Core::Utils::findInFilesRegExp(const QString &searchTerm, const QStringList &files, QFuture<FileSearchResult> Utils::findInFilesRegExp(const QString &searchTerm, const QStringList &files,
QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap) QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap)
{ {
return QtConcurrent::run<FileSearchResult, QString, QStringList, QTextDocument::FindFlags, QMap<QString, QString> > return QtConcurrent::run<FileSearchResult, QString, QStringList, QTextDocument::FindFlags, QMap<QString, QString> >

View File

@@ -37,7 +37,6 @@
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtGui/QTextDocument> #include <QtGui/QTextDocument>
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT FileSearchResult class QTCREATOR_UTILS_EXPORT FileSearchResult
@@ -62,6 +61,5 @@ QTCREATOR_UTILS_EXPORT QFuture<FileSearchResult> findInFilesRegExp(const QString
QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap = QMap<QString, QString>()); QTextDocument::FindFlags flags, QMap<QString, QString> fileToContentsMap = QMap<QString, QString>());
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // FILESEARCH_H #endif // FILESEARCH_H

View File

@@ -32,7 +32,6 @@
#include <QtGui/QAbstractButton> #include <QtGui/QAbstractButton>
namespace Core {
namespace Utils { namespace Utils {
FileWizardDialog::FileWizardDialog(QWidget *parent) : FileWizardDialog::FileWizardDialog(QWidget *parent) :
@@ -69,4 +68,3 @@ void FileWizardDialog::setName(const QString &name)
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -34,7 +34,6 @@
#include <QtGui/QWizard> #include <QtGui/QWizard>
namespace Core {
namespace Utils { namespace Utils {
class FileWizardPage; class FileWizardPage;
@@ -62,6 +61,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // FILEWIZARDDIALOG_H #endif // FILEWIZARDDIALOG_H

View File

@@ -30,7 +30,6 @@
#include "filewizardpage.h" #include "filewizardpage.h"
#include "ui_filewizardpage.h" #include "ui_filewizardpage.h"
namespace Core {
namespace Utils { namespace Utils {
struct FileWizardPagePrivate struct FileWizardPagePrivate
@@ -130,4 +129,3 @@ bool FileWizardPage::validateBaseName(const QString &name, QString *errorMessage
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -34,7 +34,6 @@
#include <QtGui/QWizardPage> #include <QtGui/QWizardPage>
namespace Core {
namespace Utils { namespace Utils {
struct FileWizardPagePrivate; struct FileWizardPagePrivate;
@@ -87,6 +86,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // FILEWIZARDPAGE_H #endif // FILEWIZARDPAGE_H

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Core::Utils::WizardPage</class> <class>Utils::WizardPage</class>
<widget class="QWizardPage" name="Core::Utils::WizardPage"> <widget class="QWizardPage" name="Utils::WizardPage">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@@ -22,7 +22,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="Core::Utils::FileNameValidatingLineEdit" name="nameLineEdit"/> <widget class="Utils::FileNameValidatingLineEdit" name="nameLineEdit"/>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="pathLabel"> <widget class="QLabel" name="pathLabel">
@@ -32,19 +32,19 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/> <widget class="Utils::PathChooser" name="pathChooser" native="true"/>
</item> </item>
</layout> </layout>
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>Core::Utils::PathChooser</class> <class>Utils::PathChooser</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>pathchooser.h</header> <header>pathchooser.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>Core::Utils::FileNameValidatingLineEdit</class> <class>Utils::FileNameValidatingLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header>filenamevalidatinglineedit.h</header> <header>filenamevalidatinglineedit.h</header>
</customwidget> </customwidget>

View File

@@ -29,7 +29,6 @@
#include "linecolumnlabel.h" #include "linecolumnlabel.h"
namespace Core {
namespace Utils { namespace Utils {
LineColumnLabel::LineColumnLabel(QWidget *parent) LineColumnLabel::LineColumnLabel(QWidget *parent)
@@ -62,4 +61,3 @@ void LineColumnLabel::setMaxText(const QString &maxText)
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -33,7 +33,6 @@
#include "utils_global.h" #include "utils_global.h"
#include <QtGui/QLabel> #include <QtGui/QLabel>
namespace Core {
namespace Utils { namespace Utils {
/* A label suitable for displaying cursor positions, etc. with a fixed /* A label suitable for displaying cursor positions, etc. with a fixed
@@ -61,6 +60,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // LINECOLUMNLABEL_H #endif // LINECOLUMNLABEL_H

View File

@@ -32,7 +32,6 @@
#include <QtCore/QList> #include <QtCore/QList>
namespace Core {
namespace Utils { namespace Utils {
template <class T1, class T2> template <class T1, class T2>
@@ -46,6 +45,5 @@ QList<T1> qwConvertList(const QList<T2> &list)
} }
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // LISTUTILS_H #endif // LISTUTILS_H

View File

@@ -41,7 +41,6 @@
enum { debugNewClassWidget = 0 }; enum { debugNewClassWidget = 0 };
namespace Core {
namespace Utils { namespace Utils {
struct NewClassWidgetPrivate { struct NewClassWidgetPrivate {
@@ -485,4 +484,3 @@ QStringList NewClassWidget::files() const
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -38,7 +38,6 @@ QT_BEGIN_NAMESPACE
class QStringList; class QStringList;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
struct NewClassWidgetPrivate; struct NewClassWidgetPrivate;
@@ -157,6 +156,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // NEWCLASSWIDGET_H #endif // NEWCLASSWIDGET_H

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Core::Utils::NewClassWidget</class> <class>Utils::NewClassWidget</class>
<widget class="QWidget" name="Core::Utils::NewClassWidget"> <widget class="QWidget" name="Utils::NewClassWidget">
<layout class="QFormLayout" name="formLayout"> <layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy"> <property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum> <enum>QFormLayout::ExpandingFieldsGrow</enum>
@@ -17,7 +17,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="Core::Utils::ClassNameValidatingLineEdit" name="classLineEdit"/> <widget class="Utils::ClassNameValidatingLineEdit" name="classLineEdit"/>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="baseClassLabel"> <widget class="QLabel" name="baseClassLabel">
@@ -76,7 +76,7 @@
</widget> </widget>
</item> </item>
<item row="3" column="1"> <item row="3" column="1">
<widget class="Core::Utils::FileNameValidatingLineEdit" name="headerFileLineEdit"/> <widget class="Utils::FileNameValidatingLineEdit" name="headerFileLineEdit"/>
</item> </item>
<item row="4" column="0"> <item row="4" column="0">
<widget class="QLabel" name="sourceLabel"> <widget class="QLabel" name="sourceLabel">
@@ -86,7 +86,7 @@
</widget> </widget>
</item> </item>
<item row="4" column="1"> <item row="4" column="1">
<widget class="Core::Utils::FileNameValidatingLineEdit" name="sourceFileLineEdit"/> <widget class="Utils::FileNameValidatingLineEdit" name="sourceFileLineEdit"/>
</item> </item>
<item row="5" column="0"> <item row="5" column="0">
<widget class="QLabel" name="generateFormLabel"> <widget class="QLabel" name="generateFormLabel">
@@ -103,7 +103,7 @@
</widget> </widget>
</item> </item>
<item row="6" column="1"> <item row="6" column="1">
<widget class="Core::Utils::FileNameValidatingLineEdit" name="formFileLineEdit"/> <widget class="Utils::FileNameValidatingLineEdit" name="formFileLineEdit"/>
</item> </item>
<item row="7" column="0"> <item row="7" column="0">
<widget class="QLabel" name="pathLabel"> <widget class="QLabel" name="pathLabel">
@@ -113,7 +113,7 @@
</widget> </widget>
</item> </item>
<item row="7" column="1"> <item row="7" column="1">
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/> <widget class="Utils::PathChooser" name="pathChooser" native="true"/>
</item> </item>
<item row="5" column="1"> <item row="5" column="1">
<widget class="QCheckBox" name="generateFormCheckBox"> <widget class="QCheckBox" name="generateFormCheckBox">
@@ -126,18 +126,18 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>Core::Utils::PathChooser</class> <class>Utils::PathChooser</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header location="global">pathchooser.h</header> <header location="global">pathchooser.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>Core::Utils::ClassNameValidatingLineEdit</class> <class>Utils::ClassNameValidatingLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header>classnamevalidatinglineedit.h</header> <header>classnamevalidatinglineedit.h</header>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>Core::Utils::FileNameValidatingLineEdit</class> <class>Utils::FileNameValidatingLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header location="global">utils/filenamevalidatinglineedit.h</header> <header location="global">utils/filenamevalidatinglineedit.h</header>
</customwidget> </customwidget>

View File

@@ -1,6 +1,5 @@
#include "parameteraction.h" #include "parameteraction.h"
namespace Core {
namespace Utils { namespace Utils {
ParameterAction::ParameterAction(const QString &emptyText, ParameterAction::ParameterAction(const QString &emptyText,
@@ -57,5 +56,3 @@ void ParameterAction::setParameter(const QString &p)
} }
} }
}

View File

@@ -34,7 +34,6 @@
#include <QtGui/QAction> #include <QtGui/QAction>
namespace Core {
namespace Utils { namespace Utils {
/* ParameterAction: Intended for actions that act on a 'current', /* ParameterAction: Intended for actions that act on a 'current',
@@ -79,7 +78,6 @@ private:
EnablingMode m_enablingMode; EnablingMode m_enablingMode;
}; };
}
} }
#endif // PARAMETERACTION_H #endif // PARAMETERACTION_H

View File

@@ -44,14 +44,13 @@
#include <QtGui/QToolButton> #include <QtGui/QToolButton>
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
/*static*/ const char * const Core::Utils::PathChooser::browseButtonLabel = /*static*/ const char * const Utils::PathChooser::browseButtonLabel =
#ifdef Q_WS_MAC #ifdef Q_WS_MAC
QT_TRANSLATE_NOOP("Core::Utils::PathChooser", "Choose..."); QT_TRANSLATE_NOOP("Utils::PathChooser", "Choose...");
#else #else
QT_TRANSLATE_NOOP("Core::Utils::PathChooser", "Browse..."); QT_TRANSLATE_NOOP("Utils::PathChooser", "Browse...");
#endif #endif
namespace Core {
namespace Utils { namespace Utils {
// ------------------ PathValidatingLineEdit // ------------------ PathValidatingLineEdit
@@ -324,4 +323,3 @@ QString PathChooser::makeDialogTitle(const QString &title)
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -35,7 +35,6 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QAbstractButton> #include <QtGui/QAbstractButton>
namespace Core {
namespace Utils { namespace Utils {
struct PathChooserPrivate; struct PathChooserPrivate;
@@ -117,6 +116,6 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // PATHCHOOSER_H #endif // PATHCHOOSER_H

View File

@@ -46,7 +46,6 @@
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QDebug> #include <QtCore/QDebug>
namespace Core {
namespace Utils { namespace Utils {
// ------------ PathListPlainTextEdit: // ------------ PathListPlainTextEdit:
@@ -310,4 +309,3 @@ void PathListEditor::deletePathAtCursor()
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -39,7 +39,6 @@ QT_BEGIN_NAMESPACE
class QAction; class QAction;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
struct PathListEditorPrivate; struct PathListEditorPrivate;
@@ -105,6 +104,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // PATHLISTEDITOR_H #endif // PATHLISTEDITOR_H

View File

@@ -35,7 +35,6 @@
#include <QtCore/QDir> #include <QtCore/QDir>
#include <QtCore/QFileInfo> #include <QtCore/QFileInfo>
namespace Core {
namespace Utils { namespace Utils {
struct ProjectIntroPagePrivate struct ProjectIntroPagePrivate
@@ -210,4 +209,3 @@ void ProjectIntroPage::hideStatusLabel()
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -34,7 +34,6 @@
#include <QtGui/QWizardPage> #include <QtGui/QWizardPage>
namespace Core {
namespace Utils { namespace Utils {
struct ProjectIntroPagePrivate; struct ProjectIntroPagePrivate;
@@ -101,6 +100,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // PROJECTINTROPAGE_H #endif // PROJECTINTROPAGE_H

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Core::Utils::ProjectIntroPage</class> <class>Utils::ProjectIntroPage</class>
<widget class="QWizardPage" name="Core::Utils::ProjectIntroPage"> <widget class="QWizardPage" name="Utils::ProjectIntroPage">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@@ -59,7 +59,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="Core::Utils::ProjectNameValidatingLineEdit" name="nameLineEdit"/> <widget class="Utils::ProjectNameValidatingLineEdit" name="nameLineEdit"/>
</item> </item>
<item row="1" column="0"> <item row="1" column="0">
<widget class="QLabel" name="pathLabel"> <widget class="QLabel" name="pathLabel">
@@ -69,7 +69,7 @@
</widget> </widget>
</item> </item>
<item row="1" column="1"> <item row="1" column="1">
<widget class="Core::Utils::PathChooser" name="pathChooser" native="true"/> <widget class="Utils::PathChooser" name="pathChooser" native="true"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@@ -97,13 +97,13 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>Core::Utils::PathChooser</class> <class>Utils::PathChooser</class>
<extends>QWidget</extends> <extends>QWidget</extends>
<header>pathchooser.h</header> <header>pathchooser.h</header>
<container>1</container> <container>1</container>
</customwidget> </customwidget>
<customwidget> <customwidget>
<class>Core::Utils::ProjectNameValidatingLineEdit</class> <class>Utils::ProjectNameValidatingLineEdit</class>
<extends>QLineEdit</extends> <extends>QLineEdit</extends>
<header>projectnamevalidatinglineedit.h</header> <header>projectnamevalidatinglineedit.h</header>
</customwidget> </customwidget>

View File

@@ -30,7 +30,6 @@
#include "projectnamevalidatinglineedit.h" #include "projectnamevalidatinglineedit.h"
#include "filenamevalidatinglineedit.h" #include "filenamevalidatinglineedit.h"
namespace Core {
namespace Utils { namespace Utils {
ProjectNameValidatingLineEdit::ProjectNameValidatingLineEdit(QWidget *parent) ProjectNameValidatingLineEdit::ProjectNameValidatingLineEdit(QWidget *parent)
@@ -60,4 +59,3 @@ bool ProjectNameValidatingLineEdit::validate(const QString &value, QString *erro
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -32,7 +32,6 @@
#include "basevalidatinglineedit.h" #include "basevalidatinglineedit.h"
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT ProjectNameValidatingLineEdit : public BaseValidatingLineEdit class QTCREATOR_UTILS_EXPORT ProjectNameValidatingLineEdit : public BaseValidatingLineEdit
@@ -50,6 +49,5 @@ protected:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // PROJECTNAMEVALIDATINGLINEEDIT_H #endif // PROJECTNAMEVALIDATINGLINEEDIT_H

View File

@@ -35,7 +35,6 @@
#include <QtGui/QDragEnterEvent> #include <QtGui/QDragEnterEvent>
#include <QtGui/QPainter> #include <QtGui/QPainter>
namespace Core {
namespace Utils { namespace Utils {
class QtColorButtonPrivate class QtColorButtonPrivate
@@ -283,6 +282,5 @@ void QtColorButton::dropEvent(QDropEvent *event)
#endif #endif
} // namespace Utils } // namespace Utils
} // namespace Core
#include "moc_qtcolorbutton.cpp" #include "moc_qtcolorbutton.cpp"

View File

@@ -34,7 +34,6 @@
#include <QtGui/QToolButton> #include <QtGui/QToolButton>
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT QtColorButton : public QToolButton class QTCREATOR_UTILS_EXPORT QtColorButton : public QToolButton
@@ -76,6 +75,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // QTCOLORBUTTON_H #endif // QTCOLORBUTTON_H

View File

@@ -33,27 +33,26 @@
#include <QtCore/QCoreApplication> #include <QtCore/QCoreApplication>
#include <QtCore/QDir> #include <QtCore/QDir>
using namespace Core; using namespace Utils;
using namespace Core::Utils;
QTCREATOR_UTILS_EXPORT Core::Utils::ReloadPromptAnswer QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer
Core::Utils::reloadPrompt(const QString &fileName, bool modified, QWidget *parent) Utils::reloadPrompt(const QString &fileName, bool modified, QWidget *parent)
{ {
const QString title = QCoreApplication::translate("Core::Utils::reloadPrompt", "File Changed"); const QString title = QCoreApplication::translate("Utils::reloadPrompt", "File Changed");
QString msg; QString msg;
if (modified) if (modified)
msg = QCoreApplication::translate("Core::Utils::reloadPrompt", msg = QCoreApplication::translate("Utils::reloadPrompt",
"The unsaved file %1 has been changed outside Qt Creator. Do you want to reload it and discard your changes?").arg(QDir::toNativeSeparators(fileName)); "The unsaved file %1 has been changed outside Qt Creator. Do you want to reload it and discard your changes?").arg(QDir::toNativeSeparators(fileName));
else else
msg = QCoreApplication::translate("Core::Utils::reloadPrompt", msg = QCoreApplication::translate("Utils::reloadPrompt",
"The file %1 has changed outside Qt Creator. Do you want to reload it?").arg(QDir::toNativeSeparators(fileName)); "The file %1 has changed outside Qt Creator. Do you want to reload it?").arg(QDir::toNativeSeparators(fileName));
return reloadPrompt(title, msg, parent); return reloadPrompt(title, msg, parent);
} }
QTCREATOR_UTILS_EXPORT Core::Utils::ReloadPromptAnswer QTCREATOR_UTILS_EXPORT Utils::ReloadPromptAnswer
Core::Utils::reloadPrompt(const QString &title, const QString &prompt, QWidget *parent) Utils::reloadPrompt(const QString &title, const QString &prompt, QWidget *parent)
{ {
switch (QMessageBox::question(parent, title, prompt, switch (QMessageBox::question(parent, title, prompt,
QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::No|QMessageBox::NoToAll, QMessageBox::Yes|QMessageBox::YesToAll|QMessageBox::No|QMessageBox::NoToAll,

View File

@@ -37,7 +37,6 @@ class QString;
class QWidget; class QWidget;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
enum ReloadPromptAnswer { ReloadCurrent, ReloadAll, ReloadSkipCurrent, ReloadNone }; enum ReloadPromptAnswer { ReloadCurrent, ReloadAll, ReloadSkipCurrent, ReloadNone };
@@ -46,6 +45,5 @@ QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &fileName,
QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, QWidget *parent); QTCREATOR_UTILS_EXPORT ReloadPromptAnswer reloadPrompt(const QString &title, const QString &prompt, QWidget *parent);
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // RELOADPROMPTUTILS_H #endif // RELOADPROMPTUTILS_H

View File

@@ -44,7 +44,7 @@
#include <QtGui/QSpinBox> #include <QtGui/QSpinBox>
using namespace Core::Utils; using namespace Utils;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
@@ -54,7 +54,7 @@ using namespace Core::Utils;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/*! /*!
\class Core::Utils::SavedAction \class Utils::SavedAction
\brief The SavedAction class is a helper class for actions with persistent \brief The SavedAction class is a helper class for actions with persistent
state. state.

View File

@@ -42,8 +42,6 @@ QT_BEGIN_NAMESPACE
class QSettings; class QSettings;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
enum ApplyMode { ImmediateApply, DeferedApply }; enum ApplyMode { ImmediateApply, DeferedApply };
@@ -122,6 +120,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // SAVED_ACTION_H #endif // SAVED_ACTION_H

View File

@@ -31,7 +31,6 @@
#include <QtCore/QString> #include <QtCore/QString>
namespace Core {
namespace Utils { namespace Utils {
QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category) QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category)
@@ -48,4 +47,3 @@ QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category)
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -32,7 +32,6 @@
#include "utils_global.h" #include "utils_global.h"
namespace Core {
namespace Utils { namespace Utils {
// Create a usable settings key from a category, // Create a usable settings key from a category,
@@ -40,6 +39,5 @@ namespace Utils {
QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category); QTCREATOR_UTILS_EXPORT QString settingsKey(const QString &category);
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // SETTINGSTUTILS_H #endif // SETTINGSTUTILS_H

View File

@@ -37,7 +37,7 @@
#include <QtGui/QStyle> #include <QtGui/QStyle>
#include <QtGui/QStyleOption> #include <QtGui/QStyleOption>
using namespace Core::Utils; using namespace Utils;
StyledBar::StyledBar(QWidget *parent) StyledBar::StyledBar(QWidget *parent)
: QWidget(parent) : QWidget(parent)

View File

@@ -34,7 +34,6 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
namespace Core {
namespace Utils { namespace Utils {
class QTCREATOR_UTILS_EXPORT StyledBar : public QWidget class QTCREATOR_UTILS_EXPORT StyledBar : public QWidget
@@ -56,6 +55,5 @@ protected:
}; };
} // Utils } // Utils
} // Core
#endif // STYLEDBAR_H #endif // STYLEDBAR_H

View File

@@ -52,6 +52,8 @@ static int range(float x, int min, int max)
} }
*/ */
namespace Utils {
QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int factor) QColor StyleHelper::mergedColors(const QColor &colorA, const QColor &colorB, int factor)
{ {
const int maxFactor = 100; const int maxFactor = 100;
@@ -231,3 +233,5 @@ void StyleHelper::menuGradient(QPainter *painter, const QRect &spanRect, const Q
QPixmapCache::insert(key, pixmap); QPixmapCache::insert(key, pixmap);
} }
} }
} // namespace Utils

View File

@@ -42,6 +42,7 @@ QT_END_NAMESPACE
// Helper class holding all custom color values // Helper class holding all custom color values
namespace Utils {
class QTCREATOR_UTILS_EXPORT StyleHelper class QTCREATOR_UTILS_EXPORT StyleHelper
{ {
public: public:
@@ -74,4 +75,5 @@ private:
static QColor m_baseColor; static QColor m_baseColor;
}; };
} // namespace Utils
#endif // STYLEHELPER_H #endif // STYLEHELPER_H

View File

@@ -44,7 +44,6 @@
enum { debug = 0 }; enum { debug = 0 };
enum { defaultLineWidth = 72 }; enum { defaultLineWidth = 72 };
namespace Core {
namespace Utils { namespace Utils {
// QActionPushButton: A push button tied to an action // QActionPushButton: A push button tied to an action
@@ -505,6 +504,5 @@ void SubmitEditorWidget::editorCustomContextMenuRequested(const QPoint &pos)
} }
} // namespace Utils } // namespace Utils
} // namespace Core
#include "submiteditorwidget.moc" #include "submiteditorwidget.moc"

View File

@@ -44,7 +44,6 @@ class QModelIndex;
class QLineEdit; class QLineEdit;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
class SubmitFieldWidget; class SubmitFieldWidget;
@@ -144,6 +143,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // SUBMITEDITORWIDGET_H #endif // SUBMITEDITORWIDGET_H

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>Core::Utils::SubmitEditorWidget</class> <class>Utils::SubmitEditorWidget</class>
<widget class="QWidget" name="Core::Utils::SubmitEditorWidget"> <widget class="QWidget" name="Utils::SubmitEditorWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@@ -22,8 +22,7 @@ static void inline setComboBlocked(QComboBox *cb, int index)
cb->blockSignals(blocked); cb->blockSignals(blocked);
} }
namespace Core { namespace Utils {
namespace Utils {
// Field/Row entry // Field/Row entry
struct FieldEntry { struct FieldEntry {
@@ -341,4 +340,3 @@ void SubmitFieldWidget::slotBrowseButtonClicked()
} }
} }
}

View File

@@ -9,8 +9,7 @@ QT_BEGIN_NAMESPACE
class QCompleter; class QCompleter;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core { namespace Utils {
namespace Utils {
struct SubmitFieldWidgetPrivate; struct SubmitFieldWidgetPrivate;
@@ -65,7 +64,6 @@ private:
SubmitFieldWidgetPrivate *m_d; SubmitFieldWidgetPrivate *m_d;
}; };
}
} }
#endif // SUBMITFIELDWIDGET_H #endif // SUBMITFIELDWIDGET_H

View File

@@ -44,7 +44,6 @@ enum { debug = 0 };
enum { defaultMaxHangTimerCount = 10 }; enum { defaultMaxHangTimerCount = 10 };
namespace Core {
namespace Utils { namespace Utils {
// ----------- SynchronousProcessResponse // ----------- SynchronousProcessResponse
@@ -492,6 +491,4 @@ QChar SynchronousProcess::pathSeparator()
return QLatin1Char(':'); return QLatin1Char(':');
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -42,7 +42,6 @@ class QDebug;
class QByteArray; class QByteArray;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
struct SynchronousProcessPrivate; struct SynchronousProcessPrivate;
@@ -146,6 +145,5 @@ private:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif #endif

View File

@@ -2,7 +2,7 @@
#include <QtGui/QTreeWidget> #include <QtGui/QTreeWidget>
#include <QtGui/QHideEvent> #include <QtGui/QHideEvent>
#include <QtGui/QHeaderView> #include <QtGui/QHeaderView>
using namespace Core::Utils; using namespace Utils;
TreeWidgetColumnStretcher::TreeWidgetColumnStretcher(QTreeWidget *treeWidget, int columnToStretch) TreeWidgetColumnStretcher::TreeWidgetColumnStretcher(QTreeWidget *treeWidget, int columnToStretch)
: QObject(treeWidget->header()), m_columnToStretch(columnToStretch) : QObject(treeWidget->header()), m_columnToStretch(columnToStretch)

View File

@@ -37,7 +37,6 @@ QT_BEGIN_NAMESPACE
class QTreeWidget; class QTreeWidget;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
/* /*
@@ -58,6 +57,5 @@ public:
}; };
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // TREEWIDGETCOLUMNSTRETCHER_H #endif // TREEWIDGETCOLUMNSTRETCHER_H

View File

@@ -33,7 +33,7 @@
#include <QtGui/QTextBlock> #include <QtGui/QTextBlock>
#include <QtGui/QTextDocument> #include <QtGui/QTextDocument>
void Core::Utils::unCommentSelection(QPlainTextEdit *edit) void Utils::unCommentSelection(QPlainTextEdit *edit)
{ {
QTextCursor cursor = edit->textCursor(); QTextCursor cursor = edit->textCursor();
QTextDocument *doc = cursor.document(); QTextDocument *doc = cursor.document();

View File

@@ -36,12 +36,10 @@ QT_BEGIN_NAMESPACE
class QPlainTextEdit; class QPlainTextEdit;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
QTCREATOR_UTILS_EXPORT void unCommentSelection(QPlainTextEdit *edit); QTCREATOR_UTILS_EXPORT void unCommentSelection(QPlainTextEdit *edit);
} // end of namespace Utils } // end of namespace Utils
} // end of namespace Core
#endif // UNCOMMENTSELECTION_H #endif // UNCOMMENTSELECTION_H

View File

@@ -33,8 +33,7 @@
#include <QtGui/QBoxLayout> #include <QtGui/QBoxLayout>
#include <QtGui/QHeaderView> #include <QtGui/QHeaderView>
namespace Core { namespace Utils {
namespace Utils {
void WelcomeModeLabel::setStyledText(const QString &text) void WelcomeModeLabel::setStyledText(const QString &text)
{ {
@@ -115,4 +114,3 @@ void WelcomeModeTreeWidget::slotItemClicked(QTreeWidgetItem *item)
} }
} }
}

View File

@@ -35,8 +35,7 @@
#include <QtGui/QTreeWidget> #include <QtGui/QTreeWidget>
#include <QtGui/QLabel> #include <QtGui/QLabel>
namespace Core { namespace Utils {
namespace Utils {
struct WelcomeModeTreeWidgetPrivate; struct WelcomeModeTreeWidgetPrivate;
struct WelcomeModeLabelPrivate; struct WelcomeModeLabelPrivate;
@@ -76,7 +75,6 @@ private:
WelcomeModeTreeWidgetPrivate *m_d; WelcomeModeTreeWidgetPrivate *m_d;
}; };
}
} }
#endif // WELCOMEMODETREEWIDGET_H #endif // WELCOMEMODETREEWIDGET_H

View File

@@ -32,7 +32,6 @@
#include <QtCore/QString> #include <QtCore/QString>
namespace Core {
namespace Utils { namespace Utils {
QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error) QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error)
@@ -53,4 +52,3 @@ QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error)
} }
} // namespace Utils } // namespace Utils
} // namespace Core

View File

@@ -36,7 +36,6 @@ QT_BEGIN_NAMESPACE
class QString; class QString;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
// Helper to format a Windows error message, taking the // Helper to format a Windows error message, taking the
@@ -44,5 +43,4 @@ namespace Utils {
QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error); QTCREATOR_UTILS_EXPORT QString winErrorMessage(unsigned long error);
} // namespace Utils } // namespace Utils
} // namespace Core
#endif // WINUTILS_H #endif // WINUTILS_H

View File

@@ -271,17 +271,17 @@ public:
break; break;
} }
switch (Core::Utils::reloadPrompt(fileName, isModified(), Core::ICore::instance()->mainWindow())) { switch (Utils::reloadPrompt(fileName, isModified(), Core::ICore::instance()->mainWindow())) {
case Core::Utils::ReloadCurrent: case Utils::ReloadCurrent:
open(fileName); open(fileName);
break; break;
case Core::Utils::ReloadAll: case Utils::ReloadAll:
open(fileName); open(fileName);
*behavior = Core::IFile::ReloadAll; *behavior = Core::IFile::ReloadAll;
break; break;
case Core::Utils::ReloadSkipCurrent: case Utils::ReloadSkipCurrent:
break; break;
case Core::Utils::ReloadNone: case Utils::ReloadNone:
*behavior = Core::IFile::ReloadNone; *behavior = Core::IFile::ReloadNone;
break; break;
} }
@@ -305,7 +305,7 @@ public:
m_file = new BinEditorFile(parent); m_file = new BinEditorFile(parent);
m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR); m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR); m_context << uidm->uniqueIdentifier(Constants::C_BINEDITOR);
m_cursorPositionLabel = new Core::Utils::LineColumnLabel; m_cursorPositionLabel = new Utils::LineColumnLabel;
QHBoxLayout *l = new QHBoxLayout; QHBoxLayout *l = new QHBoxLayout;
QWidget *w = new QWidget; QWidget *w = new QWidget;
@@ -362,7 +362,7 @@ private:
BinEditorFile *m_file; BinEditorFile *m_file;
QList<int> m_context; QList<int> m_context;
QToolBar *m_toolBar; QToolBar *m_toolBar;
Core::Utils::LineColumnLabel *m_cursorPositionLabel; Utils::LineColumnLabel *m_cursorPositionLabel;
}; };

View File

@@ -236,7 +236,7 @@ ShadowBuildPage::ShadowBuildPage(CMakeOpenProjectWizard *cmakeWizard, bool chang
"This ensures that the source directory remains clean and enables multiple builds " "This ensures that the source directory remains clean and enables multiple builds "
"with different settings.")); "with different settings."));
fl->addWidget(label); fl->addWidget(label);
m_pc = new Core::Utils::PathChooser(this); m_pc = new Utils::PathChooser(this);
m_pc->setPath(m_cmakeWizard->buildDirectory()); m_pc->setPath(m_cmakeWizard->buildDirectory());
connect(m_pc, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged())); connect(m_pc, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
fl->addRow(tr("Build directory:"), m_pc); fl->addRow(tr("Build directory:"), m_pc);
@@ -284,8 +284,8 @@ void CMakeRunPage::initWidgets()
fl->addRow(new QLabel(text, this)); fl->addRow(new QLabel(text, this));
// Show a field for the user to enter // Show a field for the user to enter
m_cmakeExecutable = new Core::Utils::PathChooser(this); m_cmakeExecutable = new Utils::PathChooser(this);
m_cmakeExecutable->setExpectedKind(Core::Utils::PathChooser::Command); m_cmakeExecutable->setExpectedKind(Utils::PathChooser::Command);
fl->addRow("CMake Executable", m_cmakeExecutable); fl->addRow("CMake Executable", m_cmakeExecutable);
} }

View File

@@ -40,10 +40,8 @@
#include <QtGui/QWizard> #include <QtGui/QWizard>
#include <QtGui/QPlainTextEdit> #include <QtGui/QPlainTextEdit>
namespace Core { namespace Utils {
namespace Utils {
class PathChooser; class PathChooser;
}
} }
namespace CMakeProjectManager { namespace CMakeProjectManager {
@@ -115,7 +113,7 @@ private slots:
void buildDirectoryChanged(); void buildDirectoryChanged();
private: private:
CMakeOpenProjectWizard *m_cmakeWizard; CMakeOpenProjectWizard *m_cmakeWizard;
Core::Utils::PathChooser *m_pc; Utils::PathChooser *m_pc;
}; };
class CMakeRunPage : public QWizardPage class CMakeRunPage : public QWizardPage
@@ -139,7 +137,7 @@ private:
QPushButton *m_runCMake; QPushButton *m_runCMake;
QProcess *m_cmakeProcess; QProcess *m_cmakeProcess;
QLineEdit *m_argumentsLineEdit; QLineEdit *m_argumentsLineEdit;
Core::Utils::PathChooser *m_cmakeExecutable; Utils::PathChooser *m_cmakeExecutable;
QComboBox *m_generatorComboBox; QComboBox *m_generatorComboBox;
QLabel *m_descriptionLabel; QLabel *m_descriptionLabel;
bool m_complete; bool m_complete;

View File

@@ -262,8 +262,8 @@ QWidget *CMakeSettingsPage::createPage(QWidget *parent)
{ {
QWidget *w = new QWidget(parent); QWidget *w = new QWidget(parent);
QFormLayout *fl = new QFormLayout(w); QFormLayout *fl = new QFormLayout(w);
m_pathchooser = new Core::Utils::PathChooser(w); m_pathchooser = new Utils::PathChooser(w);
m_pathchooser->setExpectedKind(Core::Utils::PathChooser::Command); m_pathchooser->setExpectedKind(Utils::PathChooser::Command);
fl->addRow(tr("CMake executable"), m_pathchooser); fl->addRow(tr("CMake executable"), m_pathchooser);
m_pathchooser->setPath(cmakeExecutable()); m_pathchooser->setPath(cmakeExecutable());
return w; return w;

View File

@@ -107,7 +107,7 @@ private:
QString findCmakeExecutable() const; QString findCmakeExecutable() const;
void updateInfo(); void updateInfo();
Core::Utils::PathChooser *m_pathchooser; Utils::PathChooser *m_pathchooser;
QString m_cmakeExecutable; QString m_cmakeExecutable;
enum STATE { VALID, INVALID, RUNNING } m_state; enum STATE { VALID, INVALID, RUNNING } m_state;
QProcess *m_process; QProcess *m_process;

View File

@@ -246,9 +246,9 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
this, SLOT(setArguments(QString))); this, SLOT(setArguments(QString)));
fl->addRow(tr("Arguments:"), argumentsLineEdit); fl->addRow(tr("Arguments:"), argumentsLineEdit);
m_workingDirectoryEdit = new Core::Utils::PathChooser(); m_workingDirectoryEdit = new Utils::PathChooser();
m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->workingDirectory()); m_workingDirectoryEdit->setPath(m_cmakeRunConfiguration->workingDirectory());
m_workingDirectoryEdit->setExpectedKind(Core::Utils::PathChooser::Directory); m_workingDirectoryEdit->setExpectedKind(Utils::PathChooser::Directory);
m_workingDirectoryEdit->setPromptDialogTitle(tr("Select the working directory")); m_workingDirectoryEdit->setPromptDialogTitle(tr("Select the working directory"));
QToolButton *resetButton = new QToolButton(); QToolButton *resetButton = new QToolButton();

View File

@@ -120,7 +120,7 @@ private:
void updateSummary(); void updateSummary();
bool m_ignoreChange; bool m_ignoreChange;
CMakeRunConfiguration *m_cmakeRunConfiguration; CMakeRunConfiguration *m_cmakeRunConfiguration;
Core::Utils::PathChooser *m_workingDirectoryEdit; Utils::PathChooser *m_workingDirectoryEdit;
QComboBox *m_baseEnvironmentComboBox; QComboBox *m_baseEnvironmentComboBox;
ProjectExplorer::EnvironmentWidget *m_environmentWidget; ProjectExplorer::EnvironmentWidget *m_environmentWidget;
Utils::DetailsWidget *m_detailsContainer; Utils::DetailsWidget *m_detailsContainer;

View File

@@ -647,7 +647,7 @@ QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
const QString &defaultPath, const QString &defaultPath,
const WizardPageList &extensionPages) const const WizardPageList &extensionPages) const
{ {
Core::Utils::FileWizardDialog *standardWizardDialog = new Core::Utils::FileWizardDialog(parent); Utils::FileWizardDialog *standardWizardDialog = new Utils::FileWizardDialog(parent);
standardWizardDialog->setWindowTitle(tr("New %1").arg(name())); standardWizardDialog->setWindowTitle(tr("New %1").arg(name()));
setupWizard(standardWizardDialog); setupWizard(standardWizardDialog);
standardWizardDialog->setPath(defaultPath); standardWizardDialog->setPath(defaultPath);
@@ -659,7 +659,7 @@ QWizard *StandardFileWizard::createWizardDialog(QWidget *parent,
GeneratedFiles StandardFileWizard::generateFiles(const QWizard *w, GeneratedFiles StandardFileWizard::generateFiles(const QWizard *w,
QString *errorMessage) const QString *errorMessage) const
{ {
const Core::Utils::FileWizardDialog *standardWizardDialog = qobject_cast<const Core::Utils::FileWizardDialog *>(w); const Utils::FileWizardDialog *standardWizardDialog = qobject_cast<const Utils::FileWizardDialog *>(w);
return generateFilesFromPath(standardWizardDialog->path(), return generateFilesFromPath(standardWizardDialog->path(),
standardWizardDialog->name(), standardWizardDialog->name(),
errorMessage); errorMessage);

View File

@@ -199,7 +199,7 @@ private:
}; };
// StandardFileWizard convenience class for creating one file. It uses // StandardFileWizard convenience class for creating one file. It uses
// Core::Utils::FileWizardDialog and introduces a new virtual to generate the // Utils::FileWizardDialog and introduces a new virtual to generate the
// files from path and name. // files from path and name.
class CORE_EXPORT StandardFileWizard : public BaseFileWizard class CORE_EXPORT StandardFileWizard : public BaseFileWizard
@@ -210,7 +210,7 @@ class CORE_EXPORT StandardFileWizard : public BaseFileWizard
protected: protected:
explicit StandardFileWizard(const BaseFileWizardParameters &parameters, QObject *parent = 0); explicit StandardFileWizard(const BaseFileWizardParameters &parameters, QObject *parent = 0);
// Implemented to create a Core::Utils::FileWizardDialog // Implemented to create a Utils::FileWizardDialog
virtual QWizard *createWizardDialog(QWidget *parent, virtual QWizard *createWizardDialog(QWidget *parent,
const QString &defaultPath, const QString &defaultPath,
const WizardPageList &extensionPages) const; const WizardPageList &extensionPages) const;

View File

@@ -113,7 +113,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
this, SLOT(commandChanged(QTreeWidgetItem *))); this, SLOT(commandChanged(QTreeWidgetItem *)));
connect(m_page->shortcutEdit, SIGNAL(textChanged(QString)), this, SLOT(keyChanged())); connect(m_page->shortcutEdit, SIGNAL(textChanged(QString)), this, SLOT(keyChanged()));
new Core::Utils::TreeWidgetColumnStretcher(m_page->commandList, 1); new Utils::TreeWidgetColumnStretcher(m_page->commandList, 1);
commandChanged(0); commandChanged(0);

View File

@@ -78,7 +78,7 @@ Q_DECLARE_METATYPE(Core::IEditor*)
using namespace Core; using namespace Core;
using namespace Core::Internal; using namespace Core::Internal;
using namespace Core::Utils; using namespace Utils;
enum { debugEditorManager=0 }; enum { debugEditorManager=0 };

View File

@@ -137,7 +137,7 @@ EditorView::EditorView(OpenEditorsModel *model, QWidget *parent) :
toplayout->addWidget(m_lockButton); toplayout->addWidget(m_lockButton);
toplayout->addWidget(m_closeButton); toplayout->addWidget(m_closeButton);
Core::Utils::StyledBar *top = new Core::Utils::StyledBar; Utils::StyledBar *top = new Utils::StyledBar;
top->setLayout(toplayout); top->setLayout(toplayout);
tl->addWidget(top); tl->addWidget(top);

View File

@@ -76,7 +76,7 @@ FancyTabBar::~FancyTabBar()
QSize FancyTabBar::tabSizeHint(bool minimum) const QSize FancyTabBar::tabSizeHint(bool minimum) const
{ {
QFont boldFont(font()); QFont boldFont(font());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize()); boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
boldFont.setBold(true); boldFont.setBold(true);
QFontMetrics fm(boldFont); QFontMetrics fm(boldFont);
int spacing = 6; int spacing = 6;
@@ -245,13 +245,13 @@ void FancyTabBar::paintTab(QPainter *painter, int tabIndex) const
QRect tabTextRect(tabRect(tabIndex)); QRect tabTextRect(tabRect(tabIndex));
QRect tabIconRect(tabTextRect); QRect tabIconRect(tabTextRect);
QFont boldFont(painter->font()); QFont boldFont(painter->font());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize()); boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
boldFont.setBold(true); boldFont.setBold(true);
painter->setFont(boldFont); painter->setFont(boldFont);
painter->setPen(selected ? StyleHelper::panelTextColor() : QColor(30, 30, 30, 80)); painter->setPen(selected ? Utils::StyleHelper::panelTextColor() : QColor(30, 30, 30, 80));
int textFlags = Qt::AlignCenter | Qt::AlignBottom | Qt::ElideRight | Qt::TextWordWrap; int textFlags = Qt::AlignCenter | Qt::AlignBottom | Qt::ElideRight | Qt::TextWordWrap;
painter->drawText(tabTextRect, textFlags, tabText); painter->drawText(tabTextRect, textFlags, tabText);
painter->setPen(selected ? QColor(60, 60, 60) : StyleHelper::panelTextColor()); painter->setPen(selected ? QColor(60, 60, 60) : Utils::StyleHelper::panelTextColor());
int textHeight = painter->fontMetrics().boundingRect(QRect(0, 0, width(), height()), Qt::TextWordWrap, tabText).height(); int textHeight = painter->fontMetrics().boundingRect(QRect(0, 0, width(), height()), Qt::TextWordWrap, tabText).height();
tabIconRect.adjust(0, 4, 0, -textHeight); tabIconRect.adjust(0, 4, 0, -textHeight);
int iconSize = qMin(tabIconRect.width(), tabIconRect.height()); int iconSize = qMin(tabIconRect.width(), tabIconRect.height());
@@ -285,7 +285,7 @@ public:
void mousePressEvent(QMouseEvent *ev) void mousePressEvent(QMouseEvent *ev)
{ {
if (ev->modifiers() & Qt::ShiftModifier) if (ev->modifiers() & Qt::ShiftModifier)
StyleHelper::setBaseColor(QColorDialog::getColor(StyleHelper::baseColor(), m_parent)); Utils::StyleHelper::setBaseColor(QColorDialog::getColor(Utils::StyleHelper::baseColor(), m_parent));
} }
private: private:
QWidget *m_parent; QWidget *m_parent;
@@ -305,7 +305,7 @@ FancyTabWidget::FancyTabWidget(QWidget *parent)
selectionLayout->setSpacing(0); selectionLayout->setSpacing(0);
selectionLayout->setMargin(0); selectionLayout->setMargin(0);
Core::Utils::StyledBar *bar = new Core::Utils::StyledBar; Utils::StyledBar *bar = new Utils::StyledBar;
QHBoxLayout *layout = new QHBoxLayout(bar); QHBoxLayout *layout = new QHBoxLayout(bar);
layout->setMargin(0); layout->setMargin(0);
layout->setSpacing(0); layout->setSpacing(0);
@@ -377,8 +377,8 @@ void FancyTabWidget::paintEvent(QPaintEvent *event)
QRect rect = m_selectionWidget->rect().adjusted(0, 0, 1, 0); QRect rect = m_selectionWidget->rect().adjusted(0, 0, 1, 0);
rect = style()->visualRect(layoutDirection(), geometry(), rect); rect = style()->visualRect(layoutDirection(), geometry(), rect);
StyleHelper::verticalGradient(&p, rect, rect); Utils::StyleHelper::verticalGradient(&p, rect, rect);
p.setPen(StyleHelper::borderColor()); p.setPen(Utils::StyleHelper::borderColor());
p.drawLine(rect.topRight(), rect.bottomRight()); p.drawLine(rect.topRight(), rect.bottomRight());
} }

View File

@@ -38,7 +38,7 @@
#include "ui_generalsettings.h" #include "ui_generalsettings.h"
using namespace Core::Utils; using namespace Utils;
using namespace Core::Internal; using namespace Core::Internal;
GeneralSettings::GeneralSettings(): GeneralSettings::GeneralSettings():

View File

@@ -46,7 +46,7 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="Core::Utils::QtColorButton" name="colorButton"> <widget class="Utils::QtColorButton" name="colorButton">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@@ -228,7 +228,7 @@
</widget> </widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>Core::Utils::QtColorButton</class> <class>Utils::QtColorButton</class>
<extends>QToolButton</extends> <extends>QToolButton</extends>
<header location="global">utils/qtcolorbutton.h</header> <header location="global">utils/qtcolorbutton.h</header>
</customwidget> </customwidget>

View File

@@ -863,7 +863,7 @@ QStringList MainWindow::showNewItemDialog(const QString &title,
if (defaultDir.isEmpty() && !m_coreImpl->fileManager()->currentFile().isEmpty()) if (defaultDir.isEmpty() && !m_coreImpl->fileManager()->currentFile().isEmpty())
defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath(); defaultDir = QFileInfo(m_coreImpl->fileManager()->currentFile()).absolutePath();
if (defaultDir.isEmpty()) if (defaultDir.isEmpty())
defaultDir = Core::Utils::PathChooser::homePath(); defaultDir = Utils::PathChooser::homePath();
// Scan for wizards matching the filter and pick one. Don't show // Scan for wizards matching the filter and pick one. Don't show
// dialog if there is only one. // dialog if there is only one.
@@ -1101,7 +1101,7 @@ void MainWindow::readSettings()
{ {
m_settings->beginGroup(QLatin1String(settingsGroup)); m_settings->beginGroup(QLatin1String(settingsGroup));
StyleHelper::setBaseColor(m_settings->value(QLatin1String(colorKey)).value<QColor>()); Utils::StyleHelper::setBaseColor(m_settings->value(QLatin1String(colorKey)).value<QColor>());
const QVariant geom = m_settings->value(QLatin1String(geometryKey)); const QVariant geom = m_settings->value(QLatin1String(geometryKey));
if (geom.isValid()) { if (geom.isValid()) {
@@ -1124,7 +1124,7 @@ void MainWindow::writeSettings()
{ {
m_settings->beginGroup(QLatin1String(settingsGroup)); m_settings->beginGroup(QLatin1String(settingsGroup));
m_settings->setValue(QLatin1String(colorKey), StyleHelper::baseColor()); m_settings->setValue(QLatin1String(colorKey), Utils::StyleHelper::baseColor());
if (windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) { if (windowState() & (Qt::WindowMaximized | Qt::WindowFullScreen)) {
m_settings->setValue(QLatin1String(maxKey), (bool) (windowState() & Qt::WindowMaximized)); m_settings->setValue(QLatin1String(maxKey), (bool) (windowState() & Qt::WindowMaximized));

View File

@@ -35,11 +35,6 @@
#include "eventfilteringmainwindow.h" #include "eventfilteringmainwindow.h"
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtCore/QList>
#include <QtCore/QSet>
#include <QtCore/QPointer>
#include <QtGui/QPrinter>
#include <QtGui/QToolButton>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
class QSettings; class QSettings;

View File

@@ -287,7 +287,7 @@ void ManhattanStyle::unpolish(QApplication *app)
QPalette panelPalette(const QPalette &oldPalette) QPalette panelPalette(const QPalette &oldPalette)
{ {
QColor color = StyleHelper::panelTextColor(); QColor color = Utils::StyleHelper::panelTextColor();
QPalette pal = oldPalette; QPalette pal = oldPalette;
pal.setBrush(QPalette::All, QPalette::WindowText, color); pal.setBrush(QPalette::All, QPalette::WindowText, color);
pal.setBrush(QPalette::All, QPalette::ButtonText, color); pal.setBrush(QPalette::All, QPalette::ButtonText, color);
@@ -312,20 +312,20 @@ void ManhattanStyle::polish(QWidget *widget)
widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true); widget->setAttribute(Qt::WA_LayoutUsesWidgetRect, true);
if (qobject_cast<QToolButton*>(widget)) { if (qobject_cast<QToolButton*>(widget)) {
widget->setAttribute(Qt::WA_Hover); widget->setAttribute(Qt::WA_Hover);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
} }
else if (qobject_cast<QLineEdit*>(widget)) { else if (qobject_cast<QLineEdit*>(widget)) {
widget->setAttribute(Qt::WA_Hover); widget->setAttribute(Qt::WA_Hover);
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
} }
else if (qobject_cast<QLabel*>(widget)) else if (qobject_cast<QLabel*>(widget))
widget->setPalette(panelPalette(widget->palette())); widget->setPalette(panelPalette(widget->palette()));
else if (qobject_cast<QToolBar*>(widget) || widget->property("panelwidget_singlerow").toBool()) else if (qobject_cast<QToolBar*>(widget) || widget->property("panelwidget_singlerow").toBool())
widget->setFixedHeight(StyleHelper::navigationWidgetHeight()); widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight());
else if (qobject_cast<QStatusBar*>(widget)) else if (qobject_cast<QStatusBar*>(widget))
widget->setFixedHeight(StyleHelper::navigationWidgetHeight() + 2); widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight() + 2);
else if (qobject_cast<QComboBox*>(widget)) { else if (qobject_cast<QComboBox*>(widget)) {
widget->setMaximumHeight(StyleHelper::navigationWidgetHeight() - 2); widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
widget->setAttribute(Qt::WA_Hover); widget->setAttribute(Qt::WA_Hover);
} }
} }
@@ -486,7 +486,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
drawCornerImage(d->lineeditImage_disabled, painter, option->rect, 2, 2, 2, 2); drawCornerImage(d->lineeditImage_disabled, painter, option->rect, 2, 2, 2, 2);
if (option->state & State_HasFocus || option->state & State_MouseOver) { if (option->state & State_HasFocus || option->state & State_MouseOver) {
QColor hover = StyleHelper::baseColor(); QColor hover = Utils::StyleHelper::baseColor();
if (state & State_HasFocus) if (state & State_HasFocus)
hover.setAlpha(100); hover.setAlpha(100);
else else
@@ -533,15 +533,15 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
{ {
painter->save(); painter->save();
QLinearGradient grad(option->rect.topLeft(), QPoint(rect.center().x(), rect.bottom())); QLinearGradient grad(option->rect.topLeft(), QPoint(rect.center().x(), rect.bottom()));
QColor startColor = StyleHelper::shadowColor().darker(164); QColor startColor = Utils::StyleHelper::shadowColor().darker(164);
QColor endColor = StyleHelper::baseColor().darker(130); QColor endColor = Utils::StyleHelper::baseColor().darker(130);
grad.setColorAt(0, startColor); grad.setColorAt(0, startColor);
grad.setColorAt(1, endColor); grad.setColorAt(1, endColor);
painter->fillRect(option->rect, grad); painter->fillRect(option->rect, grad);
painter->setPen(QColor(255, 255, 255, 60)); painter->setPen(QColor(255, 255, 255, 60));
painter->drawLine(rect.topLeft() + QPoint(0,1), painter->drawLine(rect.topLeft() + QPoint(0,1),
rect.topRight()+ QPoint(0,1)); rect.topRight()+ QPoint(0,1));
painter->setPen(StyleHelper::borderColor().darker(110)); painter->setPen(Utils::StyleHelper::borderColor().darker(110));
painter->drawLine(rect.topLeft(), rect.topRight()); painter->drawLine(rect.topLeft(), rect.topRight());
painter->restore(); painter->restore();
} }
@@ -549,7 +549,7 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
case PE_IndicatorToolBarSeparator: case PE_IndicatorToolBarSeparator:
{ {
QColor separatorColor = StyleHelper::borderColor(); QColor separatorColor = Utils::StyleHelper::borderColor();
separatorColor.setAlpha(100); separatorColor.setAlpha(100);
painter->setPen(separatorColor); painter->setPen(separatorColor);
const int margin = 6; const int margin = 6;
@@ -593,10 +593,10 @@ void ManhattanStyle::drawPrimitive(PrimitiveElement element, const QStyleOption
} }
painter->setPen(Qt::NoPen); painter->setPen(Qt::NoPen);
QColor dark = StyleHelper::borderColor(); QColor dark = Utils::StyleHelper::borderColor();
dark.setAlphaF(0.4); dark.setAlphaF(0.4);
QColor light = StyleHelper::baseColor(); QColor light = Utils::StyleHelper::baseColor();
light.setAlphaF(0.4); light.setAlphaF(0.4);
painter->fillPath(path, light); painter->fillPath(path, light);
@@ -709,10 +709,10 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
case CE_MenuBarItem: case CE_MenuBarItem:
painter->save(); painter->save();
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) { if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
QColor highlightOutline = StyleHelper::borderColor().lighter(120); QColor highlightOutline = Utils::StyleHelper::borderColor().lighter(120);
bool act = mbi->state & State_Selected && mbi->state & State_Sunken; bool act = mbi->state & State_Selected && mbi->state & State_Sunken;
bool dis = !(mbi->state & State_Enabled); bool dis = !(mbi->state & State_Enabled);
StyleHelper::menuGradient(painter, option->rect, option->rect); Utils::StyleHelper::menuGradient(painter, option->rect, option->rect);
QStyleOptionMenuItem item = *mbi; QStyleOptionMenuItem item = *mbi;
item.rect = mbi->rect; item.rect = mbi->rect;
QPalette pal = mbi->palette; QPalette pal = mbi->palette;
@@ -723,7 +723,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
if (act) { if (act) {
// Fill| // Fill|
QColor baseColor = StyleHelper::baseColor(); QColor baseColor = Utils::StyleHelper::baseColor();
QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft()); QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft());
grad.setColorAt(0, baseColor.lighter(120)); grad.setColorAt(0, baseColor.lighter(120));
grad.setColorAt(1, baseColor.lighter(130)); grad.setColorAt(1, baseColor.lighter(130));
@@ -786,7 +786,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
drawItemText(painter, editRect.translated(0, 1), drawItemText(painter, editRect.translated(0, 1),
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter), visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
customPal, cb->state & State_Enabled, text, QPalette::ButtonText); customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
customPal.setBrush(QPalette::All, QPalette::ButtonText, StyleHelper::panelTextColor()); customPal.setBrush(QPalette::All, QPalette::ButtonText, Utils::StyleHelper::panelTextColor());
drawItemText(painter, editRect, drawItemText(painter, editRect,
visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter), visualAlignment(option->direction, Qt::AlignLeft | Qt::AlignVCenter),
customPal, cb->state & State_Enabled, text, QPalette::ButtonText); customPal, cb->state & State_Enabled, text, QPalette::ButtonText);
@@ -830,9 +830,9 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
break; break;
case CE_MenuBarEmptyArea: { case CE_MenuBarEmptyArea: {
StyleHelper::menuGradient(painter, option->rect, option->rect); Utils::StyleHelper::menuGradient(painter, option->rect, option->rect);
painter->save(); painter->save();
painter->setPen(StyleHelper::borderColor()); painter->setPen(Utils::StyleHelper::borderColor());
painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight());
painter->restore(); painter->restore();
} }
@@ -841,12 +841,12 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
case CE_ToolBar: case CE_ToolBar:
{ {
QString key; QString key;
key.sprintf("mh_toolbar %d %d %d", option->rect.width(), option->rect.height(), StyleHelper::baseColor().rgb());; key.sprintf("mh_toolbar %d %d %d", option->rect.width(), option->rect.height(), Utils::StyleHelper::baseColor().rgb());;
QPixmap pixmap; QPixmap pixmap;
QPainter *p = painter; QPainter *p = painter;
QRect rect = option->rect; QRect rect = option->rect;
if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { if (Utils::StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) {
pixmap = QPixmap(option->rect.size()); pixmap = QPixmap(option->rect.size());
p = new QPainter(&pixmap); p = new QPainter(&pixmap);
rect = QRect(0, 0, option->rect.width(), option->rect.height()); rect = QRect(0, 0, option->rect.width(), option->rect.height());
@@ -861,11 +861,11 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
gradientSpan = QRect(offset, widget->window()->size()); gradientSpan = QRect(offset, widget->window()->size());
} }
if (horizontal) if (horizontal)
StyleHelper::horizontalGradient(p, gradientSpan, rect); Utils::StyleHelper::horizontalGradient(p, gradientSpan, rect);
else else
StyleHelper::verticalGradient(p, gradientSpan, rect); Utils::StyleHelper::verticalGradient(p, gradientSpan, rect);
painter->setPen(StyleHelper::borderColor()); painter->setPen(Utils::StyleHelper::borderColor());
if (horizontal) { if (horizontal) {
// Note: This is a hack to determine if the // Note: This is a hack to determine if the
@@ -886,7 +886,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
p->drawLine(rect.topRight(), rect.bottomRight()); p->drawLine(rect.topRight(), rect.bottomRight());
} }
if (StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) { if (Utils::StyleHelper::usePixmapCache() && !QPixmapCache::find(key, pixmap)) {
painter->drawPixmap(rect.topLeft(), pixmap); painter->drawPixmap(rect.topLeft(), pixmap);
p->end(); p->end();
delete p; delete p;
@@ -946,7 +946,7 @@ void ManhattanStyle::drawComplexControl(ComplexControl control, const QStyleOpti
fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator, fr.rect.adjust(0, 0, -pixelMetric(QStyle::PM_MenuButtonIndicator,
toolbutton, widget), 0); toolbutton, widget), 0);
QPen oldPen = painter->pen(); QPen oldPen = painter->pen();
QColor focusColor = StyleHelper::panelTextColor(); QColor focusColor = Utils::StyleHelper::panelTextColor();
focusColor.setAlpha(120); focusColor.setAlpha(120);
QPen outline(focusColor, 1); QPen outline(focusColor, 1);
outline.setStyle(Qt::DotLine); outline.setStyle(Qt::DotLine);

View File

@@ -71,7 +71,7 @@ void MiniSplitterHandle::resizeEvent(QResizeEvent *event)
void MiniSplitterHandle::paintEvent(QPaintEvent *event) void MiniSplitterHandle::paintEvent(QPaintEvent *event)
{ {
QPainter painter(this); QPainter painter(this);
painter.fillRect(event->rect(), StyleHelper::borderColor()); painter.fillRect(event->rect(), Utils::StyleHelper::borderColor());
} }
QSplitterHandle *MiniSplitter::createHandle() QSplitterHandle *MiniSplitter::createHandle()

View File

@@ -369,7 +369,7 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget)
m_navigationComboBox->setMinimumContentsLength(0); m_navigationComboBox->setMinimumContentsLength(0);
m_navigationWidget = 0; m_navigationWidget = 0;
m_toolBar = new Core::Utils::StyledBar(this); m_toolBar = new Utils::StyledBar(this);
QHBoxLayout *toolBarLayout = new QHBoxLayout; QHBoxLayout *toolBarLayout = new QHBoxLayout;
toolBarLayout->setMargin(0); toolBarLayout->setMargin(0);
toolBarLayout->setSpacing(0); toolBarLayout->setSpacing(0);

View File

@@ -40,10 +40,11 @@ class QShortcut;
class QToolButton; class QToolButton;
QT_END_NAMESPACE QT_END_NAMESPACE
namespace Core {
namespace Utils { namespace Utils {
class StyledBar; class StyledBar;
} }
namespace Core {
class INavigationWidgetFactory; class INavigationWidgetFactory;
class IMode; class IMode;
class Command; class Command;
@@ -147,7 +148,7 @@ private:
NavigationWidget *m_parentWidget; NavigationWidget *m_parentWidget;
QComboBox *m_navigationComboBox; QComboBox *m_navigationComboBox;
QWidget *m_navigationWidget; QWidget *m_navigationWidget;
Core::Utils::StyledBar *m_toolBar; Utils::StyledBar *m_toolBar;
QList<QToolButton *> m_additionalToolBarWidgets; QList<QToolButton *> m_additionalToolBarWidgets;
}; };

View File

@@ -193,7 +193,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
QVBoxLayout *mainlayout = new QVBoxLayout; QVBoxLayout *mainlayout = new QVBoxLayout;
mainlayout->setSpacing(0); mainlayout->setSpacing(0);
mainlayout->setMargin(0); mainlayout->setMargin(0);
m_toolBar = new Core::Utils::StyledBar; m_toolBar = new Utils::StyledBar;
QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar); QHBoxLayout *toolLayout = new QHBoxLayout(m_toolBar);
toolLayout->setMargin(0); toolLayout->setMargin(0);
toolLayout->setSpacing(0); toolLayout->setSpacing(0);

View File

@@ -125,8 +125,8 @@ void ProgressBar::mouseMoveEvent(QMouseEvent *)
void ProgressBar::paintEvent(QPaintEvent *) void ProgressBar::paintEvent(QPaintEvent *)
{ {
// TODO move font into stylehelper // TODO move font into Utils::StyleHelper
// TODO use stylehelper white // TODO use Utils::StyleHelper white
double range = maximum() - minimum(); double range = maximum() - minimum();
double percent = 0.50; double percent = 0.50;
@@ -139,7 +139,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
QPainter p(this); QPainter p(this);
QFont boldFont(p.font()); QFont boldFont(p.font());
boldFont.setPointSizeF(StyleHelper::sidebarFontSize()); boldFont.setPointSizeF(Utils::StyleHelper::sidebarFontSize());
boldFont.setBold(true); boldFont.setBold(true);
p.setFont(boldFont); p.setFont(boldFont);
QFontMetrics fm(boldFont); QFontMetrics fm(boldFont);
@@ -158,7 +158,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
p.setPen(QColor(30, 30, 30, 80)); p.setPen(QColor(30, 30, 30, 80));
p.drawText(textRect, Qt::AlignHCenter | Qt::AlignBottom, m_title); p.drawText(textRect, Qt::AlignHCenter | Qt::AlignBottom, m_title);
p.translate(0, -1); p.translate(0, -1);
p.setPen(StyleHelper::panelTextColor()); p.setPen(Utils::StyleHelper::panelTextColor());
p.drawText(textRect, Qt::AlignHCenter | Qt::AlignBottom, m_title); p.drawText(textRect, Qt::AlignHCenter | Qt::AlignBottom, m_title);
p.translate(0, 1); p.translate(0, 1);
@@ -166,11 +166,11 @@ void ProgressBar::paintEvent(QPaintEvent *)
m_progressHeight += ((m_progressHeight % 2) + 1) % 2; // make odd m_progressHeight += ((m_progressHeight % 2) + 1) % 2; // make odd
// draw outer rect // draw outer rect
QRect rect(INDENT - 1, h+6, size().width()-2*INDENT, m_progressHeight-1); QRect rect(INDENT - 1, h+6, size().width()-2*INDENT, m_progressHeight-1);
p.setPen(StyleHelper::panelTextColor()); p.setPen(Utils::StyleHelper::panelTextColor());
p.drawRect(rect); p.drawRect(rect);
// draw inner rect // draw inner rect
QColor c = StyleHelper::panelTextColor(); QColor c = Utils::StyleHelper::panelTextColor();
c.setAlpha(180); c.setAlpha(180);
p.setPen(Qt::NoPen); p.setPen(Qt::NoPen);
@@ -196,7 +196,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
p.drawRect(inner); p.drawRect(inner);
if (value() < maximum() && !m_error) { if (value() < maximum() && !m_error) {
QColor cancelOutline = StyleHelper::panelTextColor(); QColor cancelOutline = Utils::StyleHelper::panelTextColor();
p.setPen(cancelOutline); p.setPen(cancelOutline);
QRect cancelRect(rect.right() - m_progressHeight + 2, rect.top(), m_progressHeight-1, rect.height()); QRect cancelRect(rect.right() - m_progressHeight + 2, rect.top(), m_progressHeight-1, rect.height());
if (cancelRect.contains(mapFromGlobal(QCursor::pos()))) if (cancelRect.contains(mapFromGlobal(QCursor::pos())))
@@ -210,7 +210,7 @@ void ProgressBar::paintEvent(QPaintEvent *)
p.drawLine(cancelRect.center()+QPoint(-1,-1), cancelRect.center()+QPoint(+3,+3)); p.drawLine(cancelRect.center()+QPoint(-1,-1), cancelRect.center()+QPoint(+3,+3));
p.drawLine(cancelRect.center()+QPoint(+3,-1), cancelRect.center()+QPoint(-1,+3)); p.drawLine(cancelRect.center()+QPoint(+3,-1), cancelRect.center()+QPoint(-1,+3));
p.setPen(StyleHelper::panelTextColor()); p.setPen(Utils::StyleHelper::panelTextColor());
p.drawLine(cancelRect.center()+QPoint(-1,-1), cancelRect.center()+QPoint(+3,+3)); p.drawLine(cancelRect.center()+QPoint(-1,-1), cancelRect.center()+QPoint(+3,+3));
p.drawLine(cancelRect.center()+QPoint(+3,-1), cancelRect.center()+QPoint(-1,+3)); p.drawLine(cancelRect.center()+QPoint(+3,-1), cancelRect.center()+QPoint(-1,+3));
} }

View File

@@ -288,9 +288,9 @@ void SideBarWidget::setCurrentItem(const QString &title)
int idx = m_comboBox->findText(title); int idx = m_comboBox->findText(title);
if (idx < 0) if (idx < 0)
idx = 0; idx = 0;
m_comboBox->blockSignals(true); bool blocked = m_comboBox->blockSignals(true);
m_comboBox->setCurrentIndex(idx); m_comboBox->setCurrentIndex(idx);
m_comboBox->blockSignals(false); m_comboBox->blockSignals(blocked);
} }
SideBarItem *item = m_sideBar->item(title); SideBarItem *item = m_sideBar->item(title);
@@ -307,7 +307,7 @@ void SideBarWidget::setCurrentItem(const QString &title)
void SideBarWidget::updateAvailableItems() void SideBarWidget::updateAvailableItems()
{ {
m_comboBox->blockSignals(true); bool blocked = m_comboBox->blockSignals(true);
QString current = m_comboBox->currentText(); QString current = m_comboBox->currentText();
m_comboBox->clear(); m_comboBox->clear();
QStringList itms = m_sideBar->availableItems(); QStringList itms = m_sideBar->availableItems();
@@ -320,7 +320,7 @@ void SideBarWidget::updateAvailableItems()
idx = 0; idx = 0;
m_comboBox->setCurrentIndex(idx); m_comboBox->setCurrentIndex(idx);
m_splitButton->setEnabled(itms.count() > 1); m_splitButton->setEnabled(itms.count() > 1);
m_comboBox->blockSignals(false); m_comboBox->blockSignals(blocked);
} }
void SideBarWidget::removeCurrentItem() void SideBarWidget::removeCurrentItem()

View File

@@ -63,7 +63,7 @@ ClassNamePage::ClassNamePage(QWidget *parent) :
setTitle(tr("Enter class name")); setTitle(tr("Enter class name"));
setSubTitle(tr("The header and source file names will be derived from the class name")); setSubTitle(tr("The header and source file names will be derived from the class name"));
m_newClassWidget = new Core::Utils::NewClassWidget; m_newClassWidget = new Utils::NewClassWidget;
// Order, set extensions first before suggested name is derived // Order, set extensions first before suggested name is derived
m_newClassWidget->setBaseClassInputVisible(true); m_newClassWidget->setBaseClassInputVisible(true);
m_newClassWidget->setBaseClassChoices(QStringList() << QString() m_newClassWidget->setBaseClassChoices(QStringList() << QString()
@@ -148,7 +148,7 @@ void CppClassWizardDialog::setPath(const QString &path)
CppClassWizardParameters CppClassWizardDialog::parameters() const CppClassWizardParameters CppClassWizardDialog::parameters() const
{ {
CppClassWizardParameters rc; CppClassWizardParameters rc;
const Core::Utils::NewClassWidget *ncw = m_classNamePage->newClassWidget(); const Utils::NewClassWidget *ncw = m_classNamePage->newClassWidget();
rc.className = ncw->className(); rc.className = ncw->className();
rc.headerFile = ncw->headerFileName(); rc.headerFile = ncw->headerFileName();
rc.sourceFile = ncw->sourceFileName(); rc.sourceFile = ncw->sourceFileName();
@@ -216,7 +216,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
{ {
// TODO: // TODO:
// Quite a bit of this code has been copied from FormClassWizardParameters::generateCpp. // Quite a bit of this code has been copied from FormClassWizardParameters::generateCpp.
// Maybe more of it could be merged into Core::Utils. // Maybe more of it could be merged into Utils.
const QString indent = QString(4, QLatin1Char(' ')); const QString indent = QString(4, QLatin1Char(' '));
@@ -228,7 +228,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
const QString license = CppTools::AbstractEditorSupport::licenseTemplate(); const QString license = CppTools::AbstractEditorSupport::licenseTemplate();
const QString unqualifiedClassName = namespaceList.takeLast(); const QString unqualifiedClassName = namespaceList.takeLast();
const QString guard = Core::Utils::headerGuard(params.headerFile); const QString guard = Utils::headerGuard(params.headerFile);
// == Header file == // == Header file ==
QTextStream headerStr(header); QTextStream headerStr(header);
@@ -240,10 +240,10 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
const bool superIsQtClass = qtClassExpr.exactMatch(params.baseClass); const bool superIsQtClass = qtClassExpr.exactMatch(params.baseClass);
if (superIsQtClass) { if (superIsQtClass) {
headerStr << '\n'; headerStr << '\n';
Core::Utils::writeIncludeFileDirective(params.baseClass, true, headerStr); Utils::writeIncludeFileDirective(params.baseClass, true, headerStr);
} }
const QString namespaceIndent = Core::Utils::writeOpeningNameSpaces(namespaceList, QString(), headerStr); const QString namespaceIndent = Utils::writeOpeningNameSpaces(namespaceList, QString(), headerStr);
// Class declaration // Class declaration
headerStr << '\n'; headerStr << '\n';
@@ -257,7 +257,7 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
<< namespaceIndent << indent << unqualifiedClassName << "();\n"; << namespaceIndent << indent << unqualifiedClassName << "();\n";
headerStr << namespaceIndent << "};\n"; headerStr << namespaceIndent << "};\n";
Core::Utils::writeClosingNameSpaces(namespaceList, QString(), headerStr); Utils::writeClosingNameSpaces(namespaceList, QString(), headerStr);
headerStr << '\n'; headerStr << '\n';
headerStr << "#endif // "<< guard << '\n'; headerStr << "#endif // "<< guard << '\n';
@@ -266,13 +266,13 @@ bool CppClassWizard::generateHeaderAndSource(const CppClassWizardParameters &par
// == Source file == // == Source file ==
QTextStream sourceStr(source); QTextStream sourceStr(source);
sourceStr << license; sourceStr << license;
Core::Utils::writeIncludeFileDirective(params.headerFile, false, sourceStr); Utils::writeIncludeFileDirective(params.headerFile, false, sourceStr);
Core::Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr); Utils::writeOpeningNameSpaces(namespaceList, QString(), sourceStr);
// Constructor // Constructor
sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "()\n"; sourceStr << '\n' << namespaceIndent << unqualifiedClassName << "::" << unqualifiedClassName << "()\n";
sourceStr << namespaceIndent << "{\n" << namespaceIndent << "}\n"; sourceStr << namespaceIndent << "{\n" << namespaceIndent << "}\n";
Core::Utils::writeClosingNameSpaces(namespaceList, QString(), sourceStr); Utils::writeClosingNameSpaces(namespaceList, QString(), sourceStr);
return true; return true;
} }

View File

@@ -36,13 +36,11 @@
#include <QtGui/QWizardPage> #include <QtGui/QWizardPage>
#include <QtGui/QWizard> #include <QtGui/QWizard>
namespace Core {
namespace Utils { namespace Utils {
class NewClassWidget; class NewClassWidget;
} // namespace Utils } // namespace Utils
} // namespace Core
namespace CppEditor { namespace CppEditor {
namespace Internal { namespace Internal {
@@ -55,7 +53,7 @@ public:
explicit ClassNamePage(QWidget *parent = 0); explicit ClassNamePage(QWidget *parent = 0);
bool isComplete() const { return m_isValid; } bool isComplete() const { return m_isValid; }
Core::Utils::NewClassWidget *newClassWidget() const { return m_newClassWidget; } Utils::NewClassWidget *newClassWidget() const { return m_newClassWidget; }
private slots: private slots:
void slotValidChanged(); void slotValidChanged();
@@ -64,7 +62,7 @@ private slots:
private: private:
void initParameters(); void initParameters();
Core::Utils::NewClassWidget *m_newClassWidget; Utils::NewClassWidget *m_newClassWidget;
bool m_isValid; bool m_isValid;
}; };

Some files were not shown because too many files have changed in this diff Show More