diff --git a/doc/qtcreator.qch b/doc/qtcreator.qch
index 00473f3458d78cb11acb2bb75d02aee69b0869d7..c728e43245e3171093ce06f07e4e393d6fb157d4 100644
Binary files a/doc/qtcreator.qch and b/doc/qtcreator.qch differ
diff --git a/doc/qtcreator.qdoc b/doc/qtcreator.qdoc
index 4dd7a5fb53cd06eb302a26c27f78971d0a125540..0db515fe43467daf0bf37b855c8822eb129519ad 100644
--- a/doc/qtcreator.qdoc
+++ b/doc/qtcreator.qdoc
@@ -69,7 +69,7 @@
 
     \image qtcreator-breakdown.png
 
-    \seection1 The Mode Selectors
+    \section1 The Mode Selectors
 
     When working in Qt Creator, you can be in one of five modes: \bold Project,
     \bold Edit, \bold Debug, \bold Help, and \bold Output.
@@ -613,7 +613,7 @@
     \page creator-debugging.html
     \nextpage creator-tips.html
 
-    \title Debugging With Qt Creator
+    \title Debugging with Qt Creator
 
     \table
         \row 
@@ -677,9 +677,9 @@
 
     \list
        \o At a particular line you want the program to stop -- click on the
-          left margin or press \key F9 (\key F8 for Mac Os X).
-       \o At the name of a function that you want the program to stop -- enter
-          the function's name in \gui{Set Breakpoint at Function...} under the
+          left margin or press \key F9 (\key F8 for Mac OS X).
+       \o At a function that you want the program to stop -- enter the
+          function's name in \gui{Set Breakpoint at Function...} under the
           \gui Debug menu.
     \endlist
 
@@ -744,7 +744,7 @@
 
     When the program being debugged is stopped, Qt Creator displays the nested
     function calls leading to the current position as a \e call stack trace.
-    This stack trace is built up from \e call stack frames, each representing a
+    This stack trace is built up from \e{call stack frames}, each representing a
     particular function. For each function, Qt Creator will try to retrieve the
     file name and line number of the corresponding source files. This data is
     shown in the \gui Stack view.
@@ -765,11 +765,10 @@
     \section2 Threads
 
     
-    The \gui Thread view displays the state of the program being debugged one
-    thread at a time. If a multi-threaded program is stopped, the \gui Thread
-    view  or the combobox named \gui Thread in the debugger's status bar can
-    be used to switch from one thread to another. The \gui Stack view will
-    adjust itself accordingly.
+    If a multi-threaded program is stopped, the \gui Thread view  or the
+    combobox named \gui Thread in the debugger's status bar can be used to
+    switch from one thread to another. The \gui Stack view will adjust itself
+    accordingly.
 
 
     \section2 Locals and Watchers
@@ -851,8 +850,8 @@
     function, the latter the current state of the CPU registers.
     Both views are mainly useful in connection with the low-level
     \gui{Step single instruction} and \gui{Step over single instruction}
-    commands
-        
+    commands.
+
 
     \section1 A Walkthrough for the Debugger Frontend
 
@@ -947,8 +946,9 @@
 
     \bold{Running Qt Creator from the Command Line}
 
-    You can start Qt Creator from a command prompt with an existing session or
-    \c{.pro} file by giving the name as argument on the command line.
+    You can start Qt Creator from a command prompt with the name of an existing
+    session or \c{.pro} file by giving the name as argument on the command
+    line.
 
     \bold{Show and Hide the Sidebar}
 
diff --git a/shared/cpaster/cgi.cpp b/shared/cpaster/cgi.cpp
index 2e94dc96b0230ff877fcce8648ff73bf59ece381..6e8ecd1404ca491f1ee2a41b3ea490e0ae1efa52 100644
--- a/shared/cpaster/cgi.cpp
+++ b/shared/cpaster/cgi.cpp
@@ -45,7 +45,7 @@ QString CGI::encodeURL(const QString &rawText)
     enc.reserve(utf.length()); // Make sure we at least have space for a normal US-ASCII URL
     
     QByteArray::const_iterator it = utf.constBegin();
-    while(it != utf.constEnd()) {
+    while (it != utf.constEnd()) {
         char ch = *it;
         if (('A' <= ch && ch <= 'Z')
             || ('a' <= ch && ch <= 'z')
@@ -54,7 +54,7 @@ QString CGI::encodeURL(const QString &rawText)
         else if (ch == ' ')
             enc.append('+');
         else {
-            switch(ch) {
+            switch (ch) {
             case '-': case '_':
             case '(': case ')':
             case '.': case '!':
@@ -80,15 +80,15 @@ QString CGI::decodeURL(const QString &urlText)
 {
     QByteArray dec;
     QString::const_iterator it = urlText.constBegin();
-    while(it != urlText.constEnd()) {
+    while (it != urlText.constEnd()) {
         ushort ch = (*it).unicode();
-        switch(ch) {
+        switch (ch) {
         case '%':
             {
                 char c1 = char(0x00ff & (*(++it)).unicode());
                 char c2 = char(0x00ff & (*(++it)).unicode());
                 ushort v = 0;
-                if('A' <= c1 && c1 <= 'Z')
+                if ('A' <= c1 && c1 <= 'Z')
                     v = c1 - 'A' + 10;
                 else if ('a' <= c1 && c1 <= 'z')
                     v = c1 - 'a' + 10;
@@ -97,7 +97,7 @@ QString CGI::decodeURL(const QString &urlText)
                 else
                     continue; // Malformed URL!
                 v <<= 4; // c1 was MSB half
-                if('A' <= c2 && c2 <= 'Z')
+                if ('A' <= c2 && c2 <= 'Z')
                     v |= c2 - 'A' + 10;
                 else if ('a' <= c2 && c2 <= 'z')
                     v |= c2 - 'a' + 10;
@@ -123,7 +123,7 @@ QString CGI::decodeURL(const QString &urlText)
 // -------------------------------------------------------------------------------------------------
 inline const char *unicodeToHTML(ushort unicode_char)
 {
-    switch(unicode_char) {
+    switch (unicode_char) {
     // Latin -------------------------------
     case 0x0022: return "quot";    // (34  ) quotation mark = APL quote
     case 0x0026: return "amp";     // (38  ) ampersand
diff --git a/shared/cpaster/splitter.cpp b/shared/cpaster/splitter.cpp
index 08ec626f625a83352141e92c87baed8d6f62bb6d..22ccf1d99012fc6553cd5effa9551821c58da85c 100644
--- a/shared/cpaster/splitter.cpp
+++ b/shared/cpaster/splitter.cpp
@@ -66,10 +66,8 @@ FileDataList splitDiffToFiles(const QByteArray &data)
     // The algorithm works like this:
     // On the first match we only get the filename of the first patch part
     // On the second match (if any) we get the diff content, and the name of the next file patch
-    //
     
-    
-    while(-1 != (splitIndex = splitExpr.indexIn(strData,splitIndex))) {
+    while (-1 != (splitIndex = splitExpr.indexIn(strData,splitIndex))) {
         if (!filename.isEmpty()) {
             QString content = strData.mid(previousSplit, splitIndex - previousSplit);
             ret.append(FileData(filename, content.toLatin1()));
diff --git a/shared/cpaster/view.cpp b/shared/cpaster/view.cpp
index ca5bd270eb2d46aa3dc7ff6521ab2e99d442bbf8..6c37defe36b99cf5211570d5b3dcf31a1d046664 100644
--- a/shared/cpaster/view.cpp
+++ b/shared/cpaster/view.cpp
@@ -125,7 +125,7 @@ QString View::getComment()
 QByteArray View::getContent()
 {
     QByteArray newContent;
-    for(int i = 0; i < m_ui.uiPatchList->count(); ++i) {
+    for (int i = 0; i < m_ui.uiPatchList->count(); ++i) {
         QListWidgetItem *item = m_ui.uiPatchList->item(i);
         if (item->checkState() != Qt::Unchecked)
             newContent += m_parts.at(i).content;
@@ -159,7 +159,7 @@ int View::show(const QString &user, const QString &description, const QString &c
     QByteArray content;
     m_parts = parts;
     m_ui.uiPatchList->clear();
-    foreach(const FileData part, parts) {
+    foreach (const FileData part, parts) {
         QListWidgetItem *itm = new QListWidgetItem(part.filename, m_ui.uiPatchList);
         itm->setCheckState(Qt::Checked);
         itm->setFlags(Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled);
diff --git a/shared/cplusplus/Control.cpp b/shared/cplusplus/Control.cpp
index c994dbab9a276f6885e121f0176cac8ff44a1972..a486dfdb9408b9b7544c03d4a19e3cba9a287087 100644
--- a/shared/cplusplus/Control.cpp
+++ b/shared/cplusplus/Control.cpp
@@ -511,6 +511,12 @@ Identifier *Control::findOrInsertIdentifier(const char *chars)
     return findOrInsertIdentifier(chars, length);
 }
 
+Control::IdentifierIterator Control::firstIdentifier() const
+{ return d->identifiers.begin(); }
+
+Control::IdentifierIterator Control::lastIdentifier() const
+{ return d->identifiers.end(); }
+
 StringLiteral *Control::findOrInsertStringLiteral(const char *chars, unsigned size)
 { return d->stringLiterals.findOrInsertLiteral(chars, size); }
 
diff --git a/shared/cplusplus/Control.h b/shared/cplusplus/Control.h
index fa7b4faa50256d43202acaa0591600ce1eb64ebe..bd4b204843f3ae215b0db7138f34d5c25e336e8e 100644
--- a/shared/cplusplus/Control.h
+++ b/shared/cplusplus/Control.h
@@ -151,6 +151,11 @@ public:
     Identifier *findOrInsertIdentifier(const char *chars, unsigned size);
     Identifier *findOrInsertIdentifier(const char *chars);
 
+    typedef const Identifier *const *IdentifierIterator;
+
+    IdentifierIterator firstIdentifier() const;
+    IdentifierIterator lastIdentifier() const;
+
     StringLiteral *findOrInsertStringLiteral(const char *chars, unsigned size);
     StringLiteral *findOrInsertStringLiteral(const char *chars);
 
diff --git a/shared/help/helpviewer.cpp b/shared/help/helpviewer.cpp
index d542e4996f56592719b507ec1c77dbc604db52ee..9b80e99cd8437b1b5507478de6aa2fa106e7ca54 100644
--- a/shared/help/helpviewer.cpp
+++ b/shared/help/helpviewer.cpp
@@ -409,7 +409,7 @@ QVariant HelpViewer::loadResource(int type, const QUrl &name)
 
 void HelpViewer::openLinkInNewTab()
 {
-    if(lastAnchor.isEmpty())
+    if (lastAnchor.isEmpty())
         return;
 
     parentWidget->setSourceInNewTab(QUrl(lastAnchor));
diff --git a/shared/indenter/test/main.cpp b/shared/indenter/test/main.cpp
index 701f66987c010968d53bef1fa80d7410d2502be8..e9c9396197a476794c5bbd03d2f0ad56d9a02cf1 100644
--- a/shared/indenter/test/main.cpp
+++ b/shared/indenter/test/main.cpp
@@ -174,7 +174,7 @@ int main(int argc, char **argv)
         return 1;
     }
 
-    foreach(QString fileName, fileNames)
+    foreach (const QString &fileName, fileNames)
         if (const int rc = format(fileName))
             return rc;
 
diff --git a/shared/proparser/proeditor.cpp b/shared/proparser/proeditor.cpp
index 02287b06ab102caaf044e14adac3ce28c8ddc0bb..93adb12493eee6946266417efa298d4d16e39258 100644
--- a/shared/proparser/proeditor.cpp
+++ b/shared/proparser/proeditor.cpp
@@ -139,7 +139,7 @@ bool ProEditor::eventFilter(QObject *, QEvent *event)
     if (event->type() == QEvent::ShortcutOverride) {
         QKeyEvent *k = static_cast<QKeyEvent*>(event);
         if (k->modifiers() == Qt::ControlModifier) {
-            switch(k->key()) {
+            switch (k->key()) {
                 case Qt::Key_X:
                     cut(); return true;
                 case Qt::Key_C:
@@ -168,11 +168,8 @@ void ProEditor::updatePasteAction()
     bool pasteEnabled = false;
 
     const QMimeData *data = QApplication::clipboard()->mimeData();
-    if (data) {
-        if (data->hasFormat(QLatin1String("application/x-problock"))) {
-            pasteEnabled = true;
-        }
-    }
+    if (data && data->hasFormat(QLatin1String("application/x-problock")))
+        pasteEnabled = true;
 
     m_pasteAction->setEnabled(pasteEnabled);
 }
diff --git a/shared/proparser/proeditormodel.cpp b/shared/proparser/proeditormodel.cpp
index d0f28f68688c89c43cc30972ca075f2bf58399ac..a929c7ab88d781526f11da4827ed78af41fa54f4 100644
--- a/shared/proparser/proeditormodel.cpp
+++ b/shared/proparser/proeditormodel.cpp
@@ -732,13 +732,10 @@ bool ProEditorModel::insertItem(ProItem *item, int row, const QModelIndex &paren
 
 void ProEditorModel::markProFileModified(QModelIndex index)
 {
-    while(index.isValid())
-    {        
-        if( proItem(index)->kind() == ProItem::BlockKind)
-        {
+    while (index.isValid()) {        
+        if (proItem(index)->kind() == ProItem::BlockKind) {
             ProBlock * block = proBlock(index);
-            if(block->blockKind() == ProBlock::ProFileKind)
-            {
+            if (block->blockKind() == ProBlock::ProFileKind) {
                 ProFile * file = static_cast<ProFile *>(block);
                 file->setModified(true);
                 return;
@@ -791,9 +788,9 @@ QString ProEditorModel::expressionToString(ProBlock *block, bool display) const
 {
     QString result;
     QList<ProItem*> items = block->items();
-    for(int i=0; i<items.count(); ++i) {
+    for (int i = 0; i < items.count(); ++i) {
         ProItem *item = items.at(i);
-        switch(item->kind()) {
+        switch (item->kind()) {
             case ProItem::FunctionKind: {
                 ProFunction *v = static_cast<ProFunction*>(item);
                 result += v->text();
@@ -808,14 +805,16 @@ QString ProEditorModel::expressionToString(ProBlock *block, bool display) const
                 } else {
                     result += v->text();
                 }
-                break; }
+                break;
+            }
             case ProItem::OperatorKind: {
                 ProOperator *v = static_cast<ProOperator*>(item);
                 if (v->operatorKind() == ProOperator::NotOperator)
                     result += QLatin1Char('!');
                 else
                     result += QLatin1Char('|');
-                break; }
+                break;
+            }
             case ProItem::ValueKind:
             case ProItem::BlockKind:
                 break; // ### unhandled
@@ -847,7 +846,7 @@ QList<ProItem *> ProEditorModel::stringToExpression(const QString &exp) const
     bool c = false;
 
     QString tmpstr;
-    for (int i=0; i<exp.length(); ++i) {
+    for (int i = 0; i < exp.length(); ++i) {
         QChar tmpchar = exp.at(i);
         if (tmpchar == '(') ++p;
         else if (tmpchar == ')') --p;
diff --git a/shared/proparser/profileevaluator.cpp b/shared/proparser/profileevaluator.cpp
index c50de16fecabe94caa3c04e3ad88c4d386fc0613..cdb02609c6e48cfaed75849a7884172a1226e0a1 100644
--- a/shared/proparser/profileevaluator.cpp
+++ b/shared/proparser/profileevaluator.cpp
@@ -332,7 +332,7 @@ void ProFileEvaluator::Private::insertOperator(const char op)
     updateItem();
 
     ProOperator::OperatorKind opkind;
-    switch(op) {
+    switch (op) {
         case '!':
             opkind = ProOperator::NotOperator;
             break;
@@ -532,21 +532,21 @@ bool ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
             evaluateFile(mkspecDirectory + "/features/default_post.prf", &ok);
 
             QStringList processed;
-            while(1) {
+            while (1) {
                 bool finished = true;
                 QStringList configs = values("CONFIG");
-                for(int i = configs.size()-1; i >= 0; --i) {
+                for (int i = configs.size()-1; i >= 0; --i) {
                     const QString config = configs[i].toLower();
-                    if(!processed.contains(config)) {
+                    if (!processed.contains(config)) {
                         processed.append(config);
                         evaluateFile(mkspecDirectory + "/features/" + config + ".prf", &ok);
-                        if(ok) {
+                        if (ok) {
                             finished = false;
                             break;
                         }
                     }
                 }
-                if(finished)
+                if (finished)
                     break;
             }
         }
diff --git a/shared/proparser/proparserutils.h b/shared/proparser/proparserutils.h
index 8c5cb3aaabca67d9beec918ef38100c5f542c9dd..82941e31c1be4a7795004c14bbe350199db84e90 100644
--- a/shared/proparser/proparserutils.h
+++ b/shared/proparser/proparserutils.h
@@ -173,41 +173,41 @@ static QStringList split_arg_list(QString params)
     const QChar *params_data = params.data();
     const int params_len = params.length();
     int last = 0;
-    while(last < params_len && ((params_data+last)->unicode() == SPACE
+    while (last < params_len && ((params_data+last)->unicode() == SPACE
                                 /*|| (params_data+last)->unicode() == TAB*/))
         ++last;
-    for(int x = last, parens = 0; x <= params_len; x++) {
+    for (int x = last, parens = 0; x <= params_len; x++) {
         unicode = (params_data+x)->unicode();
-        if(x == params_len) {
-            while(x && (params_data+(x-1))->unicode() == SPACE)
+        if (x == params_len) {
+            while (x && (params_data+(x-1))->unicode() == SPACE)
                 --x;
             QString mid(params_data+last, x-last);
-            if(quote) {
-                if(mid[0] == quote && mid[(int)mid.length()-1] == quote)
+            if (quote) {
+                if (mid[0] == quote && mid[(int)mid.length()-1] == quote)
                     mid = mid.mid(1, mid.length()-2);
                 quote = 0;
             }
             args << mid;
             break;
         }
-        if(unicode == LPAREN) {
+        if (unicode == LPAREN) {
             --parens;
-        } else if(unicode == RPAREN) {
+        } else if (unicode == RPAREN) {
             ++parens;
-        } else if(quote && unicode == quote) {
+        } else if (quote && unicode == quote) {
             quote = 0;
-        } else if(!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) {
+        } else if (!quote && (unicode == SINGLEQUOTE || unicode == DOUBLEQUOTE)) {
             quote = unicode;
-        } else if(!parens && !quote && unicode == COMMA) {
+        } else if (!parens && !quote && unicode == COMMA) {
             QString mid = params.mid(last, x - last).trimmed();
             args << mid;
             last = x+1;
-            while(last < params_len && ((params_data+last)->unicode() == SPACE
+            while (last < params_len && ((params_data+last)->unicode() == SPACE
                                         /*|| (params_data+last)->unicode() == TAB*/))
                 ++last;
         }
     }
-    for(int i = 0; i < args.count(); i++)
+    for (int i = 0; i < args.count(); i++)
         unquote(&args[i]);
     return args;
 }
@@ -227,22 +227,22 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false
 
     const QChar *vals_data = vals.data();
     const int vals_len = vals.length();
-    for(int x = 0, parens = 0; x < vals_len; x++) {
+    for (int x = 0, parens = 0; x < vals_len; x++) {
         QChar c = vals_data[x];
         if (x != vals_len-1 && c == BACKSLASH &&
            vals_data[x+1].unicode() == '\'' || vals_data[x+1] == DOUBLEQUOTE) {
             build += vals_data[x++]; // get that 'escape'
         } else if (!quote.isEmpty() && c == quote.top()) {
             quote.pop();
-        } else if(c == SINGLEQUOTE || c == DOUBLEQUOTE) {
+        } else if (c == SINGLEQUOTE || c == DOUBLEQUOTE) {
             quote.push(c);
-        } else if(c == RPAREN) {
+        } else if (c == RPAREN) {
             --parens;
-        } else if(c == LPAREN) {
+        } else if (c == LPAREN) {
             ++parens;
         }
 
-        if(!parens && quote.isEmpty() && ((do_semicolon && c == SEMICOLON) ||
+        if (!parens && quote.isEmpty() && ((do_semicolon && c == SEMICOLON) ||
                                           vals_data[x] == Option::field_sep)) {
             ret << build;
             build.clear();
@@ -250,7 +250,7 @@ static QStringList split_value_list(const QString &vals, bool do_semicolon=false
             build += vals_data[x];
         }
     }
-    if(!build.isEmpty())
+    if (!build.isEmpty())
         ret << build;
     return ret;
 }
@@ -262,7 +262,7 @@ static QStringList qmake_mkspec_paths()
     QByteArray qmakepath = qgetenv("QMAKEPATH");
     if (!qmakepath.isEmpty()) {
         const QStringList lst = splitPathList(QString::fromLocal8Bit(qmakepath));
-        for(QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
+        for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
             ret << ((*it) + concat);
     }
     ret << QLibraryInfo::location(QLibraryInfo::DataPath) + concat;
diff --git a/shared/proparser/prowriter.cpp b/shared/proparser/prowriter.cpp
index 0f215fd79c4ca2df140cfe45877ddacdb9637ed0..98787294ce48872338e10bd4c929c92e2c5598b2 100644
--- a/shared/proparser/prowriter.cpp
+++ b/shared/proparser/prowriter.cpp
@@ -137,7 +137,7 @@ void ProWriter::writeBlock(ProBlock *block, const QString &indent)
     if (block->blockKind() & ProBlock::VariableKind) {
         ProVariable *v = static_cast<ProVariable*>(block);
         m_out << v->variable();
-        switch(v->variableOperator()) {
+        switch (v->variableOperator()) {
             case ProVariable::AddOperator:
                 m_out << QLatin1String(" += "); break;
             case ProVariable::RemoveOperator:
@@ -165,12 +165,12 @@ void ProWriter::writeBlock(ProBlock *block, const QString &indent)
     }
 
     QList<ProItem*> items = block->items();
-    for (int i=0; i<items.count(); ++i) {
+    for (int i = 0; i < items.count(); ++i) {
         m_writeState &= ~LastItem;
         m_writeState &= ~FirstItem;
         if (i == 0)
             m_writeState |= FirstItem;
-        if (i == (items.count()-1))
+        if (i == items.count() - 1)
             m_writeState |= LastItem;
         writeItem(items.at(i), newindent);
     }
diff --git a/shared/proparser/proxml.cpp b/shared/proparser/proxml.cpp
index 4b63fc255d3a659b44fbfb7ab7be4a60a28a1fe1..2416b3f6bc1dd235b26d34c5b8246aa45d54ca8a 100644
--- a/shared/proparser/proxml.cpp
+++ b/shared/proparser/proxml.cpp
@@ -104,7 +104,7 @@ QDomNode ProXmlParser::createItemNode(QDomDocument doc, ProItem *item) const
             tag = doc.createElement(QLatin1String("block"));
         }
 
-        foreach(ProItem *child, block->items()) {
+        foreach (ProItem *child, block->items()) {
             QDomNode childNode = createItemNode(doc, child);
             if (!childNode.isNull())
                 tag.appendChild(childNode);
diff --git a/shared/proparser/valueeditor.cpp b/shared/proparser/valueeditor.cpp
index 2208b0492e9ebbc6c4e5390dd1f31e7af9f8c421..638d7994a9224eee505152958bb51a6dccc673e2 100644
--- a/shared/proparser/valueeditor.cpp
+++ b/shared/proparser/valueeditor.cpp
@@ -131,7 +131,7 @@ void ValueEditor::initialize()
     connect(m_itemListWidget, SIGNAL(itemChanged(QListWidgetItem *)),
         this, SLOT(updateItemChanges(QListWidgetItem *)));
 
-    foreach(ProVariableInfo *varinfo, m_infomanager->variables()) {
+    foreach (ProVariableInfo *varinfo, m_infomanager->variables()) {
         m_varComboBox->addItem(varinfo->name(), varinfo->id());
     }
 
diff --git a/shared/qrceditor/resourcefile.cpp b/shared/qrceditor/resourcefile.cpp
index daf1946e53eb67ebc6b77bc6e1d70c34560ea227..2867814c8524d7e25fcf6d3234703261355d7869 100644
--- a/shared/qrceditor/resourcefile.cpp
+++ b/shared/qrceditor/resourcefile.cpp
@@ -151,7 +151,7 @@ bool ResourceFile::save()
 
     const QStringList name_list = prefixList();
 
-    foreach (QString name, name_list) {
+    foreach (const QString &name, name_list) {
         FileList file_list;
         QString lang;
         foreach (Prefix *pref, m_prefix_list) {
@@ -164,7 +164,7 @@ bool ResourceFile::save()
         QDomElement relt = doc.createElement(QLatin1String("qresource"));
         root.appendChild(relt);
         relt.setAttribute(QLatin1String("prefix"), name);
-        if(!lang.isEmpty())
+        if (!lang.isEmpty())
             relt.setAttribute(QLatin1String("lang"), lang);
 
         foreach (const File *f, file_list) {
@@ -622,14 +622,14 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
                 // Prefix node
                 stringRes = prefix->name;
                 const QString &lang = prefix->lang;
-                if(!lang.isEmpty())
+                if (!lang.isEmpty())
                     appendParenthesized(lang, stringRes);
             } else  {
                 // File node
                 Q_ASSERT(file != NULL);
                 stringRes = QFileInfo(file->name).fileName();
                 const QString alias = file->alias;
-                if(!alias.isEmpty())
+                if (!alias.isEmpty())
                     appendParenthesized(alias, stringRes);
             }
             result = stringRes;
@@ -654,7 +654,7 @@ QVariant ResourceModel::data(const QModelIndex &index, int role) const
             QString conv_file = m_resource_file.relativePath(file->name);
             QString stringRes = conv_file.replace(QDir::separator(), QLatin1Char('/'));
             const QString &alias_file = file->alias;
-            if(!alias_file.isEmpty())
+            if (!alias_file.isEmpty())
                     appendParenthesized(alias_file, stringRes);
 
             result = stringRes;
@@ -696,7 +696,7 @@ void ResourceModel::getItem(const QModelIndex &index, QString &prefix, QString &
 
 QString ResourceModel::lang(const QModelIndex &index) const
 {
-    if(!index.isValid())
+    if (!index.isValid())
         return QString();
 
     return m_resource_file.lang(index.row());
@@ -704,14 +704,14 @@ QString ResourceModel::lang(const QModelIndex &index) const
 
 QString ResourceModel::alias(const QModelIndex &index) const
 {
-    if(!index.isValid() || !index.parent().isValid())
+    if (!index.isValid() || !index.parent().isValid())
         return QString();
     return m_resource_file.alias(index.parent().row(), index.row());
 }
 
 QString ResourceModel::file(const QModelIndex &index) const
 {
-    if(!index.isValid() || !index.parent().isValid())
+    if (!index.isValid() || !index.parent().isValid())
         return QString();
     return m_resource_file.file(index.parent().row(), index.row());
 }
@@ -852,7 +852,7 @@ void ResourceModel::changePrefix(const QModelIndex &model_idx, const QString &pr
     if (m_resource_file.prefix(prefix_idx) == ResourceFile::fixPrefix(prefix))
         return;
 
-    if(m_resource_file.contains(prefix))
+    if (m_resource_file.contains(prefix))
         return;
 
     m_resource_file.replacePrefix(prefix_idx, prefix);
@@ -880,7 +880,7 @@ void ResourceModel::changeAlias(const QModelIndex &index, const QString &alias)
     if (!index.parent().isValid())
         return;
 
-    if(m_resource_file.alias(index.parent().row(), index.row()) == alias)
+    if (m_resource_file.alias(index.parent().row(), index.row()) == alias)
         return;
     m_resource_file.replaceAlias(index.parent().row(), index.row(), alias);
     emit dataChanged(index, index);
diff --git a/shared/qrceditor/resourceview.cpp b/shared/qrceditor/resourceview.cpp
index 27a0a5a4254016277ba8a9f88316c7eadd9a07d1..53b35b97e793a452a9444a45824f8b96a6385a4e 100644
--- a/shared/qrceditor/resourceview.cpp
+++ b/shared/qrceditor/resourceview.cpp
@@ -476,7 +476,7 @@ bool ResourceView::load(QString fileName)
     const QFileInfo fi(fileName);
     m_qrcModel->setFileName(fi.absoluteFilePath());
 
-    if(!fi.exists())
+    if (!fi.exists())
         return false;
 
     const bool result = m_qrcModel->reload();
@@ -501,9 +501,8 @@ void ResourceView::changePrefix(const QModelIndex &index)
     QString const prefixAfter = QInputDialog::getText(this, tr("Change Prefix"), tr("Input Prefix:"),
         QLineEdit::Normal, prefixBefore, &ok);
 
-    if (ok) {
+    if (ok)
         addUndoCommand(preindex, PrefixProperty, prefixBefore, prefixAfter);
-    }
 }
 
 void ResourceView::changeLang(const QModelIndex &index)
@@ -522,7 +521,7 @@ void ResourceView::changeLang(const QModelIndex &index)
 
 void ResourceView::changeAlias(const QModelIndex &index)
 {
-    if(!index.parent().isValid())
+    if (!index.parent().isValid())
         return;
 
     bool ok = false;
@@ -531,9 +530,8 @@ void ResourceView::changeAlias(const QModelIndex &index)
     QString const aliasAfter = QInputDialog::getText(this, tr("Change File Alias"), tr("Alias:"),
         QLineEdit::Normal, aliasBefore, &ok);
 
-    if (ok) {
+    if (ok)
         addUndoCommand(index, AliasProperty, aliasBefore, aliasAfter);
-    }
 }
 
 QString ResourceView::currentAlias() const
@@ -585,15 +583,16 @@ void ResourceView::changeValue(const QModelIndex &nodeIndex, NodeProperty proper
     }
 }
 
-void ResourceView::advanceMergeId() {
+void ResourceView::advanceMergeId()
+{
     m_mergeId++;
-    if (m_mergeId < 0) {
+    if (m_mergeId < 0)
         m_mergeId = 0;
-    }
 }
 
 void ResourceView::addUndoCommand(const QModelIndex &nodeIndex, NodeProperty property,
-        const QString &before, const QString &after) {
+        const QString &before, const QString &after)
+{
     QUndoCommand * const command = new ModifyPropertyCommand(this, nodeIndex, property,
             m_mergeId, before, after);
     m_history->push(command);
diff --git a/shared/qtsingleapplication/qtlocalpeer.cpp b/shared/qtsingleapplication/qtlocalpeer.cpp
index f488e72134b29c8986064045457459cae22eb521..1e324106ad0b545e28349a49f9580670e1b4532f 100644
--- a/shared/qtsingleapplication/qtlocalpeer.cpp
+++ b/shared/qtsingleapplication/qtlocalpeer.cpp
@@ -50,9 +50,9 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
 
 namespace SharedTools {
 
-const char* QtLocalPeer::ack = "ack";
+const char *QtLocalPeer::ack = "ack";
 
-QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
+QtLocalPeer::QtLocalPeer(QObject *parent, const QString &appId)
     : QObject(parent), id(appId)
 {
     if (id.isEmpty())
@@ -86,8 +86,6 @@ QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
     lockFile.open(QIODevice::ReadWrite);
 }
 
-
-
 bool QtLocalPeer::isClient()
 {
     if (lockFile.isLocked())
@@ -105,7 +103,6 @@ bool QtLocalPeer::isClient()
     return false;
 }
 
-
 bool QtLocalPeer::sendMessage(const QString &message, int timeout)
 {
     if (!isClient())
@@ -113,7 +110,7 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout)
 
     QLocalSocket socket;
     bool connOk = false;
-    for(int i = 0; i < 2; i++) {
+    for (int i = 0; i < 2; i++) {
         // Try twice, in case the other instance is just starting up
         socket.connectToServer(socketName);
         connOk = socket.waitForConnected(timeout/2);
@@ -139,7 +136,6 @@ bool QtLocalPeer::sendMessage(const QString &message, int timeout)
     return res;
 }
 
-
 void QtLocalPeer::receiveConnection()
 {
     QLocalSocket* socket = server->nextPendingConnection();
diff --git a/src/libs/cplusplus/OverviewModel.cpp b/src/libs/cplusplus/OverviewModel.cpp
index 38456d8fa7dafaecef99b0e2747d0b2ebf10d505..20658778905013ba8f9b1c37989913b5921b3963 100644
--- a/src/libs/cplusplus/OverviewModel.cpp
+++ b/src/libs/cplusplus/OverviewModel.cpp
@@ -74,10 +74,10 @@ Symbol *OverviewModel::globalSymbolAt(unsigned index) const
 
 QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent) const
 {
-    if (! hasDocument()) {
-        return QModelIndex();
-    } else if (! parent.isValid()) {
-        Symbol *symbol = globalSymbolAt(row);
+    if (!parent.isValid()) {
+        if (row == 0) // account for no symbol item
+            return createIndex(row, column);
+        Symbol *symbol = globalSymbolAt(row-1); // account for no symbol item
         return createIndex(row, column, symbol);
     } else {
         Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
@@ -96,12 +96,20 @@ QModelIndex OverviewModel::index(int row, int column, const QModelIndex &parent)
 QModelIndex OverviewModel::parent(const QModelIndex &child) const
 {
     Symbol *symbol = static_cast<Symbol *>(child.internalPointer());
-    Q_ASSERT(symbol != 0);
+    if (!symbol) // account for no symbol item
+        return QModelIndex();
 
     if (Scope *scope = symbol->scope()) {
         Symbol *parentSymbol = scope->owner();
-        if (parentSymbol && parentSymbol->scope())
-            return createIndex(parentSymbol->index(), 0, parentSymbol);
+        if (parentSymbol && parentSymbol->scope()) {
+            QModelIndex index;
+            if (parentSymbol->scope() && parentSymbol->scope()->owner()
+                    && parentSymbol->scope()->owner()->scope()) // the parent doesn't have a parent
+                index = createIndex(parentSymbol->index(), 0, parentSymbol);
+            else //+1 to account for no symbol item
+                index = createIndex(parentSymbol->index() + 1, 0, parentSymbol);
+            return index;
+        }
     }
 
     return QModelIndex();
@@ -110,22 +118,27 @@ QModelIndex OverviewModel::parent(const QModelIndex &child) const
 int OverviewModel::rowCount(const QModelIndex &parent) const
 {
     if (hasDocument()) {
-        if (! parent.isValid()) {
-            return globalSymbolCount();
+        if (!parent.isValid()) {
+            return globalSymbolCount()+1; // account for no symbol item
         } else {
+            if (!parent.parent().isValid() && parent.row() == 0) // account for no symbol item
+                return 0;
             Symbol *parentSymbol = static_cast<Symbol *>(parent.internalPointer());
             Q_ASSERT(parentSymbol != 0);
 
             if (ScopedSymbol *scopedSymbol = parentSymbol->asScopedSymbol()) {
-                if (! scopedSymbol->isFunction()) {
+                if (!scopedSymbol->isFunction()) {
                     Scope *parentScope = scopedSymbol->members();
                     Q_ASSERT(parentScope != 0);
 
                     return parentScope->symbolCount();
                 }
             }
+            return 0;
         }
     }
+    if (!parent.isValid())
+        return 1; // account for no symbol item
     return 0;
 }
 
@@ -136,6 +149,19 @@ int OverviewModel::columnCount(const QModelIndex &) const
 
 QVariant OverviewModel::data(const QModelIndex &index, int role) const
 {
+    // account for no symbol item
+    if (!index.parent().isValid() && index.row() == 0) {
+        switch (role) {
+        case Qt::DisplayRole:
+            if (rowCount() > 1)
+                return tr("<Select Symbol>");
+            else
+                return tr("<No Symbols>");
+        default:
+            return QVariant();
+        } //switch
+    }
+
     switch (role) {
     case Qt::DisplayRole: {
         Symbol *symbol = static_cast<Symbol *>(index.internalPointer());
diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp
index f6f623f66541d09ffc4ebf4371a7c0bda34995ce..3f7ba386e4e2d096d247cced281e457c26398d69 100644
--- a/src/libs/extensionsystem/pluginmanager.cpp
+++ b/src/libs/extensionsystem/pluginmanager.cpp
@@ -422,12 +422,12 @@ void PluginManager::formatPluginVersions(QTextStream &str) const
 void PluginManager::startTests()
 {
 #ifdef WITH_TESTS
-    foreach(PluginSpec *pluginSpec, d->testSpecs) {
+    foreach (PluginSpec *pluginSpec, d->testSpecs) {
         const QMetaObject *mo = pluginSpec->plugin()->metaObject();
         QStringList methods;
         methods.append("arg0");
         // We only want slots starting with "test"
-        for(int i = mo->methodOffset(); i < mo->methodCount(); ++i) {
+        for (int i = mo->methodOffset(); i < mo->methodCount(); ++i) {
             if (QByteArray(mo->method(i).signature()).startsWith("test")) {
                 QString method = QString::fromLatin1(mo->method(i).signature());
                 methods.append(method.left(method.size()-2));
diff --git a/src/libs/utils/filewizardpage.cpp b/src/libs/utils/filewizardpage.cpp
index 3e85b34d44b729142ff233b5f16f2d37cdc06e23..da892faf03b9f7c67d261d1c4c844edd488eba5c 100644
--- a/src/libs/utils/filewizardpage.cpp
+++ b/src/libs/utils/filewizardpage.cpp
@@ -92,7 +92,7 @@ void FileWizardPage::setName(const QString &name)
 
 void FileWizardPage::changeEvent(QEvent *e)
 {
-    switch(e->type()) {
+    switch (e->type()) {
     case QEvent::LanguageChange:
         m_d->m_ui.retranslateUi(this);
         break;
diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp
index 68ebe9cbbfd429bd1578d4641ac52151e0f8d2d1..8565b13edd60106b9f70c7d8ac93eafd7cbc6409 100644
--- a/src/libs/utils/pathchooser.cpp
+++ b/src/libs/utils/pathchooser.cpp
@@ -55,7 +55,8 @@ namespace Utils {
 #endif
 
 // ------------------ PathValidatingLineEdit
-class PathValidatingLineEdit : public BaseValidatingLineEdit {
+class PathValidatingLineEdit : public BaseValidatingLineEdit
+{
 public:
     explicit PathValidatingLineEdit(PathChooser *chooser, QWidget *parent = 0);
 
@@ -79,7 +80,8 @@ bool PathValidatingLineEdit::validate(const QString &value, QString *errorMessag
 }
 
 // ------------------ PathChooserPrivate
-struct PathChooserPrivate {
+struct PathChooserPrivate
+{
     PathChooserPrivate(PathChooser *chooser);
 
     PathValidatingLineEdit *m_lineEdit;
@@ -160,9 +162,9 @@ void PathChooser::slotBrowse()
 
     // TODO make cross-platform
     // Delete trailing slashes unless it is "/", only
-    if (!newPath .isEmpty()) {
-        if (newPath .size() > 1 && newPath .endsWith(QDir::separator()))
-            newPath .truncate(newPath .size() - 1);
+    if (!newPath.isEmpty()) {
+        if (newPath.size() > 1 && newPath.endsWith(QDir::separator()))
+            newPath.truncate(newPath.size() - 1);
         setPath(newPath);
     }
 }
@@ -174,7 +176,7 @@ bool PathChooser::isValid() const
 
 QString PathChooser::errorMessage() const
 {
-    return  m_d->m_lineEdit->errorMessage();
+    return m_d->m_lineEdit->errorMessage();
 }
 
 bool PathChooser::validatePath(const QString &path, QString *errorMessage)
@@ -207,17 +209,19 @@ bool PathChooser::validatePath(const QString &path, QString *errorMessage)
     // Check expected kind
     switch (m_d->m_acceptingKind) {
     case PathChooser::Directory:
-        if (!isDir)
+        if (!isDir) {
             if (errorMessage)
                 *errorMessage = tr("The path '%1' is not a directory.").arg(path);
             return false;
+        }
         break;
 
     case PathChooser::File:
-        if (isDir)
+        if (isDir) {
             if (errorMessage)
                 *errorMessage = tr("The path '%1' is not a file.").arg(path);
             return false;
+        }
         break;
 
     case PathChooser::Command:
diff --git a/src/libs/utils/projectintropage.cpp b/src/libs/utils/projectintropage.cpp
index 8d3705719377fea03909804ada1576633d92072e..63123138730a7037c148faf8cbc005af95991e74 100644
--- a/src/libs/utils/projectintropage.cpp
+++ b/src/libs/utils/projectintropage.cpp
@@ -117,7 +117,7 @@ void ProjectIntroPage::setDescription(const QString &description)
 
 void ProjectIntroPage::changeEvent(QEvent *e)
 {
-    switch(e->type()) {
+    switch (e->type()) {
     case QEvent::LanguageChange:
         m_d->m_ui.retranslateUi(this);
         break;
diff --git a/src/plugins/debugger/assert.h b/src/libs/utils/qtcassert.h
similarity index 90%
rename from src/plugins/debugger/assert.h
rename to src/libs/utils/qtcassert.h
index 014bb3b25d382bf787490e9e99c8578cb09fa203..538d906f827190e9a73b16c9e2bcd99e5ec70b43 100644
--- a/src/plugins/debugger/assert.h
+++ b/src/libs/utils/qtcassert.h
@@ -31,16 +31,16 @@
 **
 ***************************************************************************/
 
-#ifndef DEBUGGER_QWB_ASSERT_H
-#define DEBUGGER_QWB_ASSERT_H
+#ifndef QTC_ASSERT_H
+#define QTC_ASSERT_H
 
 #ifdef Q_OS_UNIX
-#define QWB_ASSERT(cond, action) \
+#define QTC_ASSERT(cond, action) \
     if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED"<<__FILE__<<__LINE__;action;}
 #else
-#define QWB_ASSERT(cond, action) \
+#define QTC_ASSERT(cond, action) \
     if(cond){}else{qDebug()<<"ASSERTION"<<#cond<<"FAILED";action;}
 #endif
 
-#endif // DEBUGGER_QWB_ASSERT_H
+#endif // QTC_ASSERT_H
 
diff --git a/src/libs/utils/submiteditorwidget.cpp b/src/libs/utils/submiteditorwidget.cpp
index 85c1124149082549da7c6ead507847464920aa69..4aa021e63ecfb4eb00e6bb08c65263b54adecbc0 100644
--- a/src/libs/utils/submiteditorwidget.cpp
+++ b/src/libs/utils/submiteditorwidget.cpp
@@ -46,7 +46,8 @@ namespace Utils {
 
 // QActionPushButton: A push button tied to an action
 // (similar to a QToolButton)
-class QActionPushButton : public QPushButton {
+class QActionPushButton : public QPushButton
+{
     Q_OBJECT
 public:
     explicit QActionPushButton(QAction *a);
@@ -319,7 +320,7 @@ void SubmitEditorWidget::fileSelectionChanged()
 
 void SubmitEditorWidget::changeEvent(QEvent *e)
 {
-    switch(e->type()) {
+    switch (e->type()) {
     case QEvent::LanguageChange:
         m_d->m_ui.retranslateUi(this);
         break;
diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp
index 05e24a77b49b6b7c8e1b5028480bf3c2ef18f8b9..9ca1dbfb74985930719ffabbe8e41664abecfbdf 100644
--- a/src/plugins/bineditor/bineditor.cpp
+++ b/src/plugins/bineditor/bineditor.cpp
@@ -222,7 +222,7 @@ void BinEditor::scrollContentsBy(int dx, int dy)
 void BinEditor::changeEvent(QEvent *e)
 {
     QAbstractScrollArea::changeEvent(e);
-    if(e->type() == QEvent::ActivationChange) {
+    if (e->type() == QEvent::ActivationChange) {
         if (!isActiveWindow())
             m_autoScrollTimer.stop();
     }
@@ -450,7 +450,7 @@ void BinEditor::paintEvent(QPaintEvent *e)
         for (int c = 0; c < 16; ++c) {
             int pos = line * 16 + c;
             if (pos >= m_data.size()) {
-                while(c < 16) {
+                while (c < 16) {
                     itemStringData[c*3] = itemStringData[c*3+1] = ' ';
                     ++c;
                 }
diff --git a/src/plugins/bookmarks/bookmarkmanager.cpp b/src/plugins/bookmarks/bookmarkmanager.cpp
index fd4541a01dd2b13f6d1e94f15bd1a0a25d012c53..fefe7562967aab6e12c3021fcc13fdb052ff29b0 100644
--- a/src/plugins/bookmarks/bookmarkmanager.cpp
+++ b/src/plugins/bookmarks/bookmarkmanager.cpp
@@ -173,7 +173,7 @@ void BookmarkDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti
 //        int idx;
 //        forever {
 //            idx = directory.lastIndexOf("/", pos-1);
-//            if(idx == -1) {
+//            if (idx == -1) {
 //                // Can't happen, this means the string did fit after all?
 //                break;
 //            }
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index 6e4cdfa59ecb625b1a1d479d5613cd9a991abc97..9448b1b94df8096e6d00e859ba8e8306a7fa2fd2 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -63,7 +63,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
     if (cbpparser.parseCbpFile(cbpFile)) {
         // TODO do a intelligent updating of the tree
         buildTree(m_rootNode, cbpparser.fileList());
-        foreach(ProjectExplorer::FileNode *fn, cbpparser.fileList())
+        foreach (ProjectExplorer::FileNode *fn, cbpparser.fileList())
             m_files.append(fn->path());
         m_files.sort();
 
@@ -102,11 +102,9 @@ QString CMakeProject::findCbpFile(const QDir &directory)
     //   TODO the cbp file is named like the project() command in the CMakeList.txt file
     //   so this method below could find the wrong cbp file, if the user changes the project()
     //   name
-    foreach(const QString &cbpFile , directory.entryList())
-    {
-        if (cbpFile.endsWith(".cbp")) {
+    foreach (const QString &cbpFile , directory.entryList()) {
+        if (cbpFile.endsWith(".cbp"))
             return directory.path() + "/" + cbpFile;
-        }
     }
     return QString::null;
 }
@@ -132,7 +130,7 @@ void CMakeProject::buildTree(CMakeProjectNode *rootNode, QList<ProjectExplorer::
 {
     //m_rootNode->addFileNodes(fileList, m_rootNode);
     qSort(list.begin(), list.end(), ProjectExplorer::ProjectNode::sortNodesByPath);
-    foreach( ProjectExplorer::FileNode *fn, list) {
+    foreach (ProjectExplorer::FileNode *fn, list) {
         // Get relative path to rootNode
         QString parentDir = QFileInfo(fn->path()).absolutePath();
         ProjectExplorer::FolderNode *folder = findOrCreateFolder(rootNode, parentDir);
@@ -146,10 +144,10 @@ ProjectExplorer::FolderNode *CMakeProject::findOrCreateFolder(CMakeProjectNode *
     QString relativePath = QDir(QFileInfo(rootNode->path()).path()).relativeFilePath(directory);
     QStringList parts = relativePath.split("/");
     ProjectExplorer::FolderNode *parent = rootNode;
-    foreach(const QString &part, parts) {
+    foreach (const QString &part, parts) {
         // Find folder in subFolders
         bool found = false;
-        foreach(ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
+        foreach (ProjectExplorer::FolderNode *folder, parent->subFolderNodes()) {
             if (QFileInfo(folder->path()).fileName() == part) {
                 // yeah found something :)
                 parent = folder;
@@ -359,7 +357,7 @@ bool CMakeCbpParser::parseCbpFile(const QString &fileName)
     if (fi.exists() && fi.open(QFile::ReadOnly)) {
         setDevice(&fi);
 
-        while(!atEnd()) {
+        while (!atEnd()) {
             readNext();
             if (name() == "CodeBlocks_project_file") {
                 parseCodeBlocks_project_file();
@@ -377,7 +375,7 @@ bool CMakeCbpParser::parseCbpFile(const QString &fileName)
 
 void CMakeCbpParser::parseCodeBlocks_project_file()
 {
-    while(!atEnd()) {
+    while (!atEnd()) {
         readNext();
         if (isEndElement()) {
             return;
@@ -391,7 +389,7 @@ void CMakeCbpParser::parseCodeBlocks_project_file()
 
 void CMakeCbpParser::parseProject()
 {
-    while(!atEnd()) {
+    while (!atEnd()) {
         readNext();
         if (isEndElement()) {
             return;
@@ -407,7 +405,7 @@ void CMakeCbpParser::parseProject()
 
 void CMakeCbpParser::parseBuild()
 {
-    while(!atEnd()) {
+    while (!atEnd()) {
         readNext();
         if (isEndElement()) {
             return;
@@ -509,7 +507,7 @@ void CMakeCbpParser::parseTargetClean()
 
 void CMakeCbpParser::parseCompiler()
 {
-    while(!atEnd()) {
+    while (!atEnd()) {
         readNext();
         if (isEndElement()) {
             return;
@@ -524,7 +522,7 @@ void CMakeCbpParser::parseCompiler()
 void CMakeCbpParser::parseAdd()
 {
     m_includeFiles.append(attributes().value("directory").toString());
-    while(!atEnd()) {
+    while (!atEnd()) {
         readNext();
         if (isEndElement()) {
             return;
@@ -540,7 +538,7 @@ void CMakeCbpParser::parseUnit()
     QString fileName = attributes().value("filename").toString();
     if (!fileName.endsWith(".rule"))
         m_fileList.append( new ProjectExplorer::FileNode(fileName, ProjectExplorer::SourceType, false));
-    while(!atEnd()) {
+    while (!atEnd()) {
         readNext();
         if (isEndElement()) {
             return;
diff --git a/src/plugins/coreplugin/basefilewizard.cpp b/src/plugins/coreplugin/basefilewizard.cpp
index 58030ba20c9ad8e0c7aaef03c266ff694fbbc3d6..bb7adb996200a3f4a118d630e7bda6657d2b85b9 100644
--- a/src/plugins/coreplugin/basefilewizard.cpp
+++ b/src/plugins/coreplugin/basefilewizard.cpp
@@ -456,7 +456,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
             }
         }
         if (firstExtensionPageHit)
-            foreach(IFileWizardExtension *ex, extensions)
+            foreach (IFileWizardExtension *ex, extensions)
                 ex->firstExtensionPageShown(files);
         if (accepted)
             break;
@@ -486,7 +486,7 @@ QStringList BaseFileWizard::runWizard(const QString &path, QWidget *parent)
         }
     }
     // Run the extensions
-    foreach(IFileWizardExtension *ex, extensions)
+    foreach (IFileWizardExtension *ex, extensions)
         if (!ex->process(files, &errorMessage)) {
             QMessageBox::critical(parent, tr("File Generation Failure"), errorMessage);
             return QStringList();
diff --git a/src/plugins/coreplugin/dialogs/settingsdialog.cpp b/src/plugins/coreplugin/dialogs/settingsdialog.cpp
index 696a7ddbdf9ea9d34a8605b69b3cb6c511aafcf4..2d8531f3ed7e0c2a620cca6dc86c33a2fce75e2b 100644
--- a/src/plugins/coreplugin/dialogs/settingsdialog.cpp
+++ b/src/plugins/coreplugin/dialogs/settingsdialog.cpp
@@ -58,7 +58,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
         CoreImpl::instance()->pluginManager()->getObjects<IOptionsPage>();
 
     int index = 0;
-    foreach(IOptionsPage *page, pages) {
+    foreach (IOptionsPage *page, pages) {
         QTreeWidgetItem *item = new QTreeWidgetItem();
         item->setText(0, page->name());
         item->setData(0, Qt::UserRole, index);
@@ -77,7 +77,7 @@ SettingsDialog::SettingsDialog(QWidget *parent, const QString &initialCategory,
 
         int catCount = 1;
         while (catCount < categoriesId.count()) {
-            if(!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) {
+            if (!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) {
                 treeitem = new QTreeWidgetItem(categories.value(currentCategory));
                 currentCategory +=  QLatin1Char('|') + categoriesId.at(catCount);
                 treeitem->setText(0, trCategories.at(catCount));
@@ -123,14 +123,14 @@ void SettingsDialog::pageSelected(QTreeWidgetItem *)
 
 void SettingsDialog::accept()
 {
-    foreach(IOptionsPage *page, m_pages)
+    foreach (IOptionsPage *page, m_pages)
         page->finished(true);
     done(QDialog::Accepted);
 }
 
 void SettingsDialog::reject()
 {
-    foreach(IOptionsPage *page, m_pages)
+    foreach (IOptionsPage *page, m_pages)
         page->finished(false);
     done(QDialog::Rejected);
 }
diff --git a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
index c00e6cc683883334ef1990a919d82417eeeab613..b5c98643b4265539c5e635e98fa0952fbdfa10bd 100644
--- a/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
+++ b/src/plugins/coreplugin/dialogs/shortcutsettings.cpp
@@ -123,7 +123,7 @@ QWidget *ShortcutSettings::createPage(QWidget *parent)
 void ShortcutSettings::finished(bool accepted)
 {
     if (accepted) {
-        foreach(ShortcutItem *item, m_scitems) {
+        foreach (ShortcutItem *item, m_scitems) {
             item->m_cmd->setKeySequence(item->m_key);
         }
     }
@@ -196,7 +196,7 @@ bool ShortcutSettings::filter(const QString &f, const QTreeWidgetItem *item)
         if (f.isEmpty())
             return false;
         for (int i = 0; i < item->columnCount(); ++i) {
-            if(item->text(i).contains(f, Qt::CaseInsensitive))
+            if (item->text(i).contains(f, Qt::CaseInsensitive))
                 return false;
         }
         return true;
@@ -242,7 +242,7 @@ void ShortcutSettings::importAction()
         CommandsFile cf(fileName);
         QMap<QString, QKeySequence> mapping = cf.importCommands();
 
-        foreach(ShortcutItem *item, m_scitems) {
+        foreach (ShortcutItem *item, m_scitems) {
             QString sid = uidm->stringForUniqueIdentifier(item->m_cmd->id());
             if (mapping.contains(sid)) {
                 item->m_key = mapping.value(sid);
@@ -256,7 +256,7 @@ void ShortcutSettings::importAction()
 
 void ShortcutSettings::defaultAction()
 {
-    foreach(ShortcutItem *item, m_scitems) {
+    foreach (ShortcutItem *item, m_scitems) {
         item->m_key = item->m_cmd->defaultKeySequence();
         item->m_item->setText(2, item->m_key);
         if (item->m_item == m_page->commandList->currentItem())
diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp
index 29798b25c010e9202f09cd2c27d38e6278ff9900..3f3b93af70417f9651463128a41e7245cb4654b9 100644
--- a/src/plugins/coreplugin/editormanager/editormanager.cpp
+++ b/src/plugins/coreplugin/editormanager/editormanager.cpp
@@ -1089,7 +1089,7 @@ bool EditorManager::saveFileAs(IEditor *editor)
     const bool success = editor->file()->save(absoluteFilePath);
     m_d->m_core->fileManager()->unblockFileChange(editor->file());
 
-    if(success)
+    if (success)
         m_d->m_core->fileManager()->addToRecentFiles(editor->file()->fileName());
 
     updateActions();
diff --git a/src/plugins/coreplugin/editormanager/openeditorsview.cpp b/src/plugins/coreplugin/editormanager/openeditorsview.cpp
index 79e912e6e04ee6eae8026e04aecf23c89053e566..d321491e2f238d3e9b0b04d59af7f6b65b74b4cd 100644
--- a/src/plugins/coreplugin/editormanager/openeditorsview.cpp
+++ b/src/plugins/coreplugin/editormanager/openeditorsview.cpp
@@ -70,7 +70,7 @@ OpenEditorsWidget::OpenEditorsWidget()
     m_ui.editorList->installEventFilter(this);
     m_ui.editorList->setFrameStyle(QFrame::NoFrame);
     EditorManager *em = EditorManager::instance();
-    foreach(IEditor *editor, em->openedEditors()) {
+    foreach (IEditor *editor, em->openedEditors()) {
         registerEditor(editor);
     }
     connect(em, SIGNAL(editorOpened(Core::IEditor*)),
diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp
index 243e5dd64dee36ea75dc3ee580234051c0c1ad1b..571a49e8ed36ee6dd06d3e2eabec3ab093560ab9 100644
--- a/src/plugins/coreplugin/fileiconprovider.cpp
+++ b/src/plugins/coreplugin/fileiconprovider.cpp
@@ -96,7 +96,7 @@ void FileIconProvider::registerIconForSuffix(const QIcon &icon, const QString &s
 {
     // delete old icon, if it exists
     QList<QPair<QString,QIcon> >::iterator iter = m_cache.begin();
-    for(; iter != m_cache.end(); ++iter) {
+    for (; iter != m_cache.end(); ++iter) {
         if ((*iter).first == suffix) {
             iter = m_cache.erase(iter);
             break;
@@ -118,7 +118,7 @@ QIcon FileIconProvider::iconForSuffix(const QString &suffix) const
         return icon;
 
     QList<QPair<QString,QIcon> >::const_iterator iter = m_cache.constBegin();
-    for(; iter != m_cache.constEnd(); ++iter) {
+    for (; iter != m_cache.constEnd(); ++iter) {
         if ((*iter).first == suffix) {
             icon = (*iter).second;
             break;
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index 1d9050705496bc05501ed25a3a22cec105f034ce..4eab3fb55719566e789044c73362ff4ef7bf711c 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -896,7 +896,7 @@ void MainWindow::removeContextObject(IContext *context)
         return;
 
     m_contextWidgets.remove(widget);
-    if(m_activeContext == context)
+    if (m_activeContext == context)
         updateContextObject(0);
 }
 
@@ -957,10 +957,11 @@ void MainWindow::resetContext()
     updateContextObject(0);
 }
 
-QMenu *MainWindow::createPopupMenu() {
+QMenu *MainWindow::createPopupMenu()
+{
     QMenu *menu = new QMenu(this);
     QList<ActionContainer *> containers = m_actionManager->containers();
-    foreach(ActionContainer *c, containers) {
+    foreach (ActionContainer *c, containers) {
         if (c->toolBar())
             menu->addAction(c->toolBar()->toggleViewAction());
     }
diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp
index a39e68baad6e165915eed117c8c051d672bfffe3..d796af3bdca99f2fbc8efc6fbe8abf9554d914e5 100644
--- a/src/plugins/coreplugin/manhattanstyle.cpp
+++ b/src/plugins/coreplugin/manhattanstyle.cpp
@@ -140,7 +140,7 @@ void drawCornerImage(const QImage &img, QPainter *painter, QRect rect,
     if (top > 0) { //top
         painter->drawImage(QRect(rect.left() + left, rect.top(), rect.width() -right - left, top), img,
                            QRect(left, 0, size.width() -right - left, top));
-        if(left > 0) //top-left
+        if (left > 0) //top-left
             painter->drawImage(QRect(rect.left(), rect.top(), left, top), img,
                                QRect(0, 0, left, top));
         if (right > 0) //top-right
diff --git a/src/plugins/coreplugin/mimedatabase.cpp b/src/plugins/coreplugin/mimedatabase.cpp
index 0c6d1d4cdde31bfb16d476740a68b5b0c5546139..37ff518a76adafb5847b89769a80408aa37476a8 100644
--- a/src/plugins/coreplugin/mimedatabase.cpp
+++ b/src/plugins/coreplugin/mimedatabase.cpp
@@ -299,7 +299,7 @@ void MimeTypeData::debug(QTextStream &str, int indent) const
         str << indentS << "SubClassesOf: " << subClassesOf.join(comma) << '\n';
     if (!globPatterns.empty()) {
         str << indentS << "Glob: ";
-        foreach(const QRegExp &r, globPatterns)
+        foreach (const QRegExp &r, globPatterns)
             str << r.pattern() << ' ';
         str << '\n';
         if (!suffixes.empty()) {
diff --git a/src/plugins/coreplugin/navigationwidget.cpp b/src/plugins/coreplugin/navigationwidget.cpp
index 5ce8e7498d04f326f4f72c50cd983030a0d14f4a..82ed13a29e8f5d927e37e67de8e4e7df172927a5 100644
--- a/src/plugins/coreplugin/navigationwidget.cpp
+++ b/src/plugins/coreplugin/navigationwidget.cpp
@@ -87,8 +87,8 @@ void NavigationWidgetPlaceHolder::applyStoredSize(int width)
             QList<int> sizes = splitter->sizes();
             int index = splitter->indexOf(this);
             int diff = width - sizes.at(index);
-            int adjust = sizes.count() > 1? ( diff / (sizes.count() - 1)) : 0;
-            for(int i=0; i<sizes.count(); ++i) {
+            int adjust = sizes.count() > 1 ? (diff / (sizes.count() - 1)) : 0;
+            for (int i = 0; i < sizes.count(); ++i) {
                 if (i != index)
                     sizes[i] += adjust;
             }
diff --git a/src/plugins/coreplugin/outputpane.cpp b/src/plugins/coreplugin/outputpane.cpp
index ca60d674ff044382704e1834ed233b8eff0ea1f8..11c0a1c4a0c5f6d771b021827d064d40d121101b 100644
--- a/src/plugins/coreplugin/outputpane.cpp
+++ b/src/plugins/coreplugin/outputpane.cpp
@@ -277,7 +277,7 @@ void OutputPane::init(ICore *core, ExtensionSystem::PluginManager *pm)
 
         connect(cmd->action(), SIGNAL(triggered()), this, SLOT(shortcutTriggered()));
         connect(cmd->action(), SIGNAL(changed()), this, SLOT(updateToolTip()));
-    } while(it != begin);
+    } while (it != begin);
 
     changePage();
 }
@@ -293,7 +293,7 @@ void OutputPane::shortcutTriggered()
         // but the outputpane doesn't have focus
         // then just give it focus
         // else do the same as clicking on the button does
-        if(OutputPanePlaceHolder::m_current
+        if (OutputPanePlaceHolder::m_current
            && OutputPanePlaceHolder::m_current->isVisible()
            && m_widgetComboBox->itemData(m_widgetComboBox->currentIndex()).toInt() == idx) {
             if (!outputPane->hasFocus() && outputPane->canFocus())
diff --git a/src/plugins/coreplugin/progressmanager/progresspie.cpp b/src/plugins/coreplugin/progressmanager/progresspie.cpp
index b6f34d36b41965d12abf5e24d828770d360a6af8..f3aac399709dbd71b66541ef9881ad23dd652c6f 100644
--- a/src/plugins/coreplugin/progressmanager/progresspie.cpp
+++ b/src/plugins/coreplugin/progressmanager/progresspie.cpp
@@ -101,9 +101,9 @@ void ProgressBar::paintEvent(QPaintEvent *)
     double percent = 0.50;
     if (range != 0)
         percent = (value() - minimum()) / range;
-    if(percent > 1)
+    if (percent > 1)
         percent = 1;
-    else if(percent < 0)
+    else if (percent < 0)
         percent = 0;
 
     QPainter p(this);
diff --git a/src/plugins/coreplugin/rightpane.cpp b/src/plugins/coreplugin/rightpane.cpp
index 3c17b25583303c6d48db3602f30ee6f70571f688..1465164d1874f9a0eada2b74f3ca9531c8f031ca 100644
--- a/src/plugins/coreplugin/rightpane.cpp
+++ b/src/plugins/coreplugin/rightpane.cpp
@@ -76,8 +76,8 @@ void RightPanePlaceHolder::applyStoredSize(int width)
             QList<int> sizes = splitter->sizes();
             int index = splitter->indexOf(this);
             int diff = width - sizes.at(index);
-            int adjust = sizes.count() > 1? ( diff / (sizes.count() - 1)) : 0;
-            for(int i=0; i<sizes.count(); ++i) {
+            int adjust = sizes.count() > 1 ? (diff / (sizes.count() - 1)) : 0;
+            for (int i = 0; i < sizes.count(); ++i) {
                 if (i != index)
                     sizes[i] -= adjust;
             }
@@ -125,7 +125,7 @@ void RightPanePlaceHolder::currentModeChanged(Core::IMode *mode)
 RightPaneWidget *RightPaneWidget::m_instance = 0;
 
 RightPaneWidget::RightPaneWidget()
-    :m_shown(true), m_width(0)
+    : m_shown(true), m_width(0)
 {
     m_instance = this;
 
diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp
index e69c48200d0a1c62d968a773e90e7d6c1cb743a0..8ca453278b25c48e632adc039159de078b4b6bec 100644
--- a/src/plugins/coreplugin/styleanimator.cpp
+++ b/src/plugins/coreplugin/styleanimator.cpp
@@ -52,7 +52,8 @@ void Animation::paint(QPainter *painter, const QStyleOption *option)
     Q_UNUSED(painter);
 }
 
-void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) {
+void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha)
+{
     if (_secondaryImage.isNull() || _primaryImage.isNull())
         return;
 
@@ -64,7 +65,7 @@ void Animation::drawBlendedImage(QPainter *painter, QRect rect, float alpha) {
     const int sw = _primaryImage.width();
     const int sh = _primaryImage.height();
     const int bpl = _primaryImage.bytesPerLine();
-    switch(_primaryImage.depth()) {
+    switch (_primaryImage.depth()) {
     case 32:
         {
             uchar *mixed_data = _tempImage.bits();
diff --git a/src/plugins/coreplugin/vcsmanager.cpp b/src/plugins/coreplugin/vcsmanager.cpp
index 02475a0d0e66cfb5369327ec1c5f2827f43aa167..5980879ab1abcff5b7de49b031e0d4827b46d0a1 100644
--- a/src/plugins/coreplugin/vcsmanager.cpp
+++ b/src/plugins/coreplugin/vcsmanager.cpp
@@ -77,7 +77,7 @@ void VCSManager::setVCSEnabled(const QString &directory)
         qDebug() << Q_FUNC_INFO << directory;
     IVersionControl* managingVCS = findVersionControlForDirectory(directory);
     const VersionControlList versionControls = allVersionControls();
-    foreach(IVersionControl *versionControl, versionControls) {
+    foreach (IVersionControl *versionControl, versionControls) {
         const bool newEnabled = versionControl == managingVCS;
         if (newEnabled != versionControl->isEnabled())
             versionControl->setEnabled(newEnabled);
@@ -89,7 +89,7 @@ void VCSManager::setAllVCSEnabled()
     if (debug)
         qDebug() << Q_FUNC_INFO;
     const VersionControlList versionControls = allVersionControls();
-    foreach(IVersionControl *versionControl, versionControls)
+    foreach (IVersionControl *versionControl, versionControls)
         if (!versionControl->isEnabled())
             versionControl->setEnabled(true);
 }
@@ -106,7 +106,7 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc
 
     int pos = 0;
     const QChar slash = QLatin1Char('/');
-    while(true) {
+    while (true) {
         int index = directory.indexOf(slash, pos);
         if (index == -1)
             break;
@@ -119,7 +119,7 @@ IVersionControl* VCSManager::findVersionControlForDirectory(const QString &direc
 
     // ah nothing so ask the IVersionControls directly
     const VersionControlList versionControls = allVersionControls();
-    foreach(IVersionControl * versionControl, versionControls) {
+    foreach (IVersionControl * versionControl, versionControls) {
         if (versionControl->managesDirectory(directory)) {
             m_d->m_cachedMatches.insert(versionControl->findTopLevelForDirectory(directory), versionControl);
             return versionControl;
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 8567f81d75139c74cb413357fc70818beff14260..ff68bd0bac27e8f9e2c1574ea1f598ae970b9f4e 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -203,9 +203,7 @@ void CPPEditor::createToolBar(CPPEditorEditable *editable)
     m_methodCombo->setMaxVisibleItems(20);
 
     m_overviewModel = new OverviewModel(this);
-    m_noSymbolsModel = new QStringListModel(this);
-    m_noSymbolsModel->setStringList(QStringList() << tr("<no symbols>"));
-    m_methodCombo->setModel(m_noSymbolsModel);
+    m_methodCombo->setModel(m_overviewModel);
 
     connect(m_methodCombo, SIGNAL(activated(int)), this, SLOT(jumpToMethod(int)));
     connect(this, SIGNAL(cursorPositionChanged()), this, SLOT(updateMethodBoxIndex()));
@@ -318,16 +316,9 @@ void CPPEditor::onDocumentUpdated(Document::Ptr doc)
         return;
 
     m_overviewModel->rebuild(doc);
-    if (m_overviewModel->rowCount() > 0) {
-        if (m_methodCombo->model() != m_overviewModel)
-            m_methodCombo->setModel(m_overviewModel);
-        OverviewTreeView *treeView = static_cast<OverviewTreeView *>(m_methodCombo->view());
-        treeView->sync();
-        updateMethodBoxIndex();
-    } else {
-        if (m_methodCombo->model() != m_noSymbolsModel)
-            m_methodCombo->setModel(m_noSymbolsModel);
-    }
+    OverviewTreeView *treeView = static_cast<OverviewTreeView *>(m_methodCombo->view());
+    treeView->sync();
+    updateMethodBoxIndex();
 }
 
 void CPPEditor::updateFileName()
@@ -335,8 +326,6 @@ void CPPEditor::updateFileName()
 
 void CPPEditor::jumpToMethod(int)
 {
-    if (m_methodCombo->model() != m_overviewModel)
-        return;
     QModelIndex index = m_methodCombo->view()->currentIndex();
     Symbol *symbol = m_overviewModel->symbolFromIndex(index);
     if (! symbol)
@@ -351,8 +340,6 @@ void CPPEditor::jumpToMethod(int)
 
 void CPPEditor::updateMethodBoxIndex()
 {
-    if (m_methodCombo->model() != m_overviewModel)
-        return;
     int line = 0, column = 0;
     convertPosition(position(), &line, &column);
 
@@ -362,7 +349,7 @@ void CPPEditor::updateMethodBoxIndex()
     for (int row = 0; row < rc; ++row) {
         const QModelIndex index = m_overviewModel->index(row, 0, QModelIndex());
         Symbol *symbol = m_overviewModel->symbolFromIndex(index);
-        if (symbol->line() > unsigned(line))
+        if (symbol && symbol->line() > unsigned(line))
             break;
         lastIndex = index;
     }
diff --git a/src/plugins/cppeditor/cppeditor.h b/src/plugins/cppeditor/cppeditor.h
index 33745eddef27f9156af2ed062295b24a949e9eca..05f2c5d9c74098d9e6dbd0518bd85bef8271d7fb 100644
--- a/src/plugins/cppeditor/cppeditor.h
+++ b/src/plugins/cppeditor/cppeditor.h
@@ -139,7 +139,6 @@ private:
     QList<int> m_contexts;
     QComboBox *m_methodCombo;
     CPlusPlus::OverviewModel *m_overviewModel;
-    QStringListModel *m_noSymbolsModel;
 };
 
 } // namespace Internal
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index e8359da2b5b988b254f5d69cdb393993588af1a2..a165614a59479107d72703b33a074a85b70b730c 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -115,7 +115,6 @@ public:
     void setWorkingCopy(const QMap<QString, QByteArray> &workingCopy);
     void setIncludePaths(const QStringList &includePaths);
     void setFrameworkPaths(const QStringList &frameworkPaths);
-    void addIncludePath(const QString &path);
     void setProjectFiles(const QStringList &files);
     void run(QString &fileName);
     void operator()(QString &fileName);
@@ -170,9 +169,6 @@ void CppPreprocessor::setIncludePaths(const QStringList &includePaths)
 void CppPreprocessor::setFrameworkPaths(const QStringList &frameworkPaths)
 { m_frameworkPaths = frameworkPaths; }
 
-void CppPreprocessor::addIncludePath(const QString &path)
-{ m_includePaths.append(path); }
-
 void CppPreprocessor::setProjectFiles(const QStringList &files)
 { m_projectFiles = files; }
 
@@ -488,14 +484,14 @@ void CppModelManager::ensureUpdated()
     if (! m_dirty)
         return;
 
-    m_projectFiles = updateProjectFiles();
-    m_includePaths = updateIncludePaths();
-    m_frameworkPaths = updateFrameworkPaths();
-    m_definedMacros = updateDefinedMacros();
+    m_projectFiles = internalProjectFiles();
+    m_includePaths = internalIncludePaths();
+    m_frameworkPaths = internalFrameworkPaths();
+    m_definedMacros = internalDefinedMacros();
     m_dirty = false;
 }
 
-QStringList CppModelManager::updateProjectFiles() const
+QStringList CppModelManager::internalProjectFiles() const
 {
     QStringList files;
     QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects);
@@ -504,10 +500,11 @@ QStringList CppModelManager::updateProjectFiles() const
         ProjectInfo pinfo = it.value();
         files += pinfo.sourceFiles;
     }
+    files.removeDuplicates();
     return files;
 }
 
-QStringList CppModelManager::updateIncludePaths() const
+QStringList CppModelManager::internalIncludePaths() const
 {
     QStringList includePaths;
     QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects);
@@ -516,10 +513,11 @@ QStringList CppModelManager::updateIncludePaths() const
         ProjectInfo pinfo = it.value();
         includePaths += pinfo.includePaths;
     }
+    includePaths.removeDuplicates();
     return includePaths;
 }
 
-QStringList CppModelManager::updateFrameworkPaths() const
+QStringList CppModelManager::internalFrameworkPaths() const
 {
     QStringList frameworkPaths;
     QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects);
@@ -528,10 +526,11 @@ QStringList CppModelManager::updateFrameworkPaths() const
         ProjectInfo pinfo = it.value();
         frameworkPaths += pinfo.frameworkPaths;
     }
+    frameworkPaths.removeDuplicates();
     return frameworkPaths;
 }
 
-QByteArray CppModelManager::updateDefinedMacros() const
+QByteArray CppModelManager::internalDefinedMacros() const
 {
     QByteArray macros;
     QMapIterator<ProjectExplorer::Project *, ProjectInfo> it(m_projects);
@@ -588,6 +587,7 @@ void CppModelManager::updateProjectInfo(const ProjectInfo &pinfo)
         return;
 
     m_projects.insert(pinfo.project, pinfo);
+    m_dirty = true;
 }
 
 QFuture<void> CppModelManager::refreshSourceFiles(const QStringList &sourceFiles)
diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h
index 6bc7d0c1c55809a5d8bf9c143d384174564e6fbc..3b2f4e19993248a6e31c124c902568ed89947d9d 100644
--- a/src/plugins/cpptools/cppmodelmanager.h
+++ b/src/plugins/cpptools/cppmodelmanager.h
@@ -133,10 +133,10 @@ private:
     }
 
     void ensureUpdated();
-    QStringList updateProjectFiles() const;
-    QStringList updateIncludePaths() const;
-    QStringList updateFrameworkPaths() const;
-    QByteArray updateDefinedMacros() const;
+    QStringList internalProjectFiles() const;
+    QStringList internalIncludePaths() const;
+    QStringList internalFrameworkPaths() const;
+    QByteArray internalDefinedMacros() const;
 
     static void parse(QFutureInterface<void> &future,
                       CppPreprocessor *preproc,
diff --git a/src/plugins/debugger/attachexternaldialog.cpp b/src/plugins/debugger/attachexternaldialog.cpp
index 1a376b3373ffce4854ddcaa1481a4fcc12e38d53..f5d2101cc95ff8f8c53f6ac19e6e8f8266196667 100644
--- a/src/plugins/debugger/attachexternaldialog.cpp
+++ b/src/plugins/debugger/attachexternaldialog.cpp
@@ -152,13 +152,12 @@ void AttachExternalDialog::rebuildProcessList()
 
 #ifdef Q_OS_WINDOWS
 
-//  Forward declarations:
-BOOL GetProcessList( );
-BOOL ListProcessModules( DWORD dwPID );
-BOOL ListProcessThreads( DWORD dwOwnerPID );
-void printError( TCHAR* msg );
+BOOL GetProcessList();
+BOOL ListProcessModules(DWORD dwPID);
+BOOL ListProcessThreads(DWORD dwOwnerPID);
+void printError(TCHAR *msg);
 
-BOOL GetProcessList( )
+BOOL GetProcessList()
 {
   HANDLE hProcessSnap;
   HANDLE hProcess;
@@ -167,7 +166,7 @@ BOOL GetProcessList( )
 
   // Take a snapshot of all processes in the system.
   hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
-  if( hProcessSnap == INVALID_HANDLE_VALUE )
+  if (hProcessSnap == INVALID_HANDLE_VALUE)
   {
     printError( TEXT("CreateToolhelp32Snapshot (of processes)") );
     return( FALSE );
@@ -178,7 +177,7 @@ BOOL GetProcessList( )
 
   // Retrieve information about the first process,
   // and exit if unsuccessful
-  if( !Process32First( hProcessSnap, &pe32 ) )
+  if (!Process32First( hProcessSnap, &pe32 ))
   {
     printError( TEXT("Process32First") ); // show cause of failure
     CloseHandle( hProcessSnap );          // clean the snapshot object
@@ -196,12 +195,12 @@ BOOL GetProcessList( )
     // Retrieve the priority class.
     dwPriorityClass = 0;
     hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID );
-    if( hProcess == NULL )
+    if (hProcess == NULL)
       printError( TEXT("OpenProcess") );
     else
     {
       dwPriorityClass = GetPriorityClass( hProcess );
-      if( !dwPriorityClass )
+      if (!dwPriorityClass)
         printError( TEXT("GetPriorityClass") );
       CloseHandle( hProcess );
     }
@@ -210,31 +209,30 @@ BOOL GetProcessList( )
     printf( "\n  Thread count      = %d",   pe32.cntThreads );
     printf( "\n  Parent process ID = 0x%08X", pe32.th32ParentProcessID );
     printf( "\n  Priority base     = %d", pe32.pcPriClassBase );
-    if( dwPriorityClass )
+    if (dwPriorityClass)
       printf( "\n  Priority class    = %d", dwPriorityClass );
 
     // List the modules and threads associated with this process
     ListProcessModules( pe32.th32ProcessID );
     ListProcessThreads( pe32.th32ProcessID );
 
-  } while( Process32Next( hProcessSnap, &pe32 ) );
+  } while (Process32Next(hProcessSnap, &pe32));
 
-  CloseHandle( hProcessSnap );
-  return( TRUE );
+  CloseHandle(hProcessSnap);
+  return TRUE;
 }
 
 
-BOOL ListProcessModules( DWORD dwPID )
+BOOL ListProcessModules(DWORD dwPID)
 {
   HANDLE hModuleSnap = INVALID_HANDLE_VALUE;
   MODULEENTRY32 me32;
 
   // Take a snapshot of all modules in the specified process.
   hModuleSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID );
-  if( hModuleSnap == INVALID_HANDLE_VALUE )
-  {
-    printError( TEXT("CreateToolhelp32Snapshot (of modules)") );
-    return( FALSE );
+  if (hModuleSnap == INVALID_HANDLE_VALUE) {
+    printError(TEXT("CreateToolhelp32Snapshot (of modules)"));
+    return FALSE;
   }
 
   // Set the size of the structure before using it.
@@ -242,7 +240,7 @@ BOOL ListProcessModules( DWORD dwPID )
 
   // Retrieve information about the first module,
   // and exit if unsuccessful
-  if( !Module32First( hModuleSnap, &me32 ) )
+  if (!Module32First( hModuleSnap, &me32))
   {
     printError( TEXT("Module32First") );  // show cause of failure
     CloseHandle( hModuleSnap );           // clean the snapshot object
@@ -261,10 +259,10 @@ BOOL ListProcessModules( DWORD dwPID )
     printf( "\n     Base address   = 0x%08X", (DWORD) me32.modBaseAddr );
     printf( "\n     Base size      = %d",             me32.modBaseSize );
 
-  } while( Module32Next( hModuleSnap, &me32 ) );
+  } while (Module32Next(hModuleSnap, &me32));
 
-  CloseHandle( hModuleSnap );
-  return( TRUE );
+  CloseHandle(hModuleSnap);
+  return TRUE;
 }
 
 BOOL ListProcessThreads( DWORD dwOwnerPID ) 
@@ -274,7 +272,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
  
   // Take a snapshot of all running threads  
   hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); 
-  if( hThreadSnap == INVALID_HANDLE_VALUE ) 
+  if (hThreadSnap == INVALID_HANDLE_VALUE) 
     return( FALSE ); 
  
   // Fill in the size of the structure before using it. 
@@ -282,7 +280,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
  
   // Retrieve information about the first thread,
   // and exit if unsuccessful
-  if( !Thread32First( hThreadSnap, &te32 ) ) 
+  if (!Thread32First( hThreadSnap, &te32 )) 
   {
     printError( TEXT("Thread32First") ); // show cause of failure
     CloseHandle( hThreadSnap );          // clean the snapshot object
@@ -294,13 +292,13 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
   // associated with the specified process
   do 
   { 
-    if( te32.th32OwnerProcessID == dwOwnerPID )
+    if (te32.th32OwnerProcessID == dwOwnerPID)
     {
       printf( "\n\n     THREAD ID      = 0x%08X", te32.th32ThreadID ); 
       printf( "\n     Base priority  = %d", te32.tpBasePri ); 
       printf( "\n     Delta priority = %d", te32.tpDeltaPri ); 
     }
-  } while( Thread32Next(hThreadSnap, &te32 ) ); 
+  } while (Thread32Next(hThreadSnap, &te32)); 
 
   CloseHandle( hThreadSnap );
   return( TRUE );
@@ -308,22 +306,24 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
 
 void printError( TCHAR* msg )
 {
-  DWORD eNum;
-  TCHAR sysMsg[256];
-  TCHAR* p;
+    DWORD eNum;
+    TCHAR sysMsg[256];
+    TCHAR* p;
 
-  eNum = GetLastError( );
-  FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+    eNum = GetLastError( );
+    FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
          NULL, eNum,
          MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
          sysMsg, 256, NULL );
 
-  // Trim the end of the line and terminate it with a null
-  p = sysMsg;
-  while( ( *p > 31 ) || ( *p == 9 ) )
-    ++p;
-  do { *p-- = 0; } while( ( p >= sysMsg ) &&
-                          ( ( *p == '.' ) || ( *p < 33 ) ) );
+    // Trim the end of the line and terminate it with a null
+    p = sysMsg;
+    while (*p > 31 || *p == 9 )
+        ++p;
+
+    do {
+        *p-- = 0;
+    } while( p >= sysMsg && (*p == '.' || *p < 33));
 
   // Display the message
   _tprintf( TEXT("\n  WARNING: %s failed with error %d (%s)"), msg, eNum, sysMsg );
@@ -331,7 +331,6 @@ void printError( TCHAR* msg )
 
 #endif
 
-
 void AttachExternalDialog::procSelected(const QModelIndex &index0)
 {
     QModelIndex index = index0.sibling(index0.row(), 0);
diff --git a/src/plugins/debugger/attachremotedialog.cpp b/src/plugins/debugger/attachremotedialog.cpp
index 65b02f37f100978739f13b5d999ede99a2b5caea..a409ceba03ac9aa6a1c10195da0e8dfb8dfdb45d 100644
--- a/src/plugins/debugger/attachremotedialog.cpp
+++ b/src/plugins/debugger/attachremotedialog.cpp
@@ -150,10 +150,10 @@ void AttachRemoteDialog::rebuildProcessList()
 #include <stdio.h>
 
 //  Forward declarations:
-BOOL GetProcessList( );
-BOOL ListProcessModules( DWORD dwPID );
-BOOL ListProcessThreads( DWORD dwOwnerPID );
-void printError( TCHAR* msg );
+BOOL GetProcessList();
+BOOL ListProcessModules(DWORD dwPID);
+BOOL ListProcessThreads(DWORD dwOwnerPID);
+void printError(TCHAR* msg);
 
 BOOL GetProcessList( )
 {
@@ -164,7 +164,7 @@ BOOL GetProcessList( )
 
   // Take a snapshot of all processes in the system.
   hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
-  if( hProcessSnap == INVALID_HANDLE_VALUE )
+  if (hProcessSnap == INVALID_HANDLE_VALUE)
   {
     printError( TEXT("CreateToolhelp32Snapshot (of processes)") );
     return( FALSE );
@@ -175,7 +175,7 @@ BOOL GetProcessList( )
 
   // Retrieve information about the first process,
   // and exit if unsuccessful
-  if( !Process32First( hProcessSnap, &pe32 ) )
+  if (!Process32First( hProcessSnap, &pe32 ))
   {
     printError( TEXT("Process32First") ); // show cause of failure
     CloseHandle( hProcessSnap );          // clean the snapshot object
@@ -193,12 +193,12 @@ BOOL GetProcessList( )
     // Retrieve the priority class.
     dwPriorityClass = 0;
     hProcess = OpenProcess( PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID );
-    if( hProcess == NULL )
+    if (hProcess == NULL)
       printError( TEXT("OpenProcess") );
     else
     {
       dwPriorityClass = GetPriorityClass( hProcess );
-      if( !dwPriorityClass )
+      if (!dwPriorityClass)
         printError( TEXT("GetPriorityClass") );
       CloseHandle( hProcess );
     }
@@ -207,7 +207,7 @@ BOOL GetProcessList( )
     printf( "\n  Thread count      = %d",   pe32.cntThreads );
     printf( "\n  Parent process ID = 0x%08X", pe32.th32ParentProcessID );
     printf( "\n  Priority base     = %d", pe32.pcPriClassBase );
-    if( dwPriorityClass )
+    if (dwPriorityClass)
       printf( "\n  Priority class    = %d", dwPriorityClass );
 
     // List the modules and threads associated with this process
@@ -228,7 +228,7 @@ BOOL ListProcessModules( DWORD dwPID )
 
   // Take a snapshot of all modules in the specified process.
   hModuleSnap = CreateToolhelp32Snapshot( TH32CS_SNAPMODULE, dwPID );
-  if( hModuleSnap == INVALID_HANDLE_VALUE )
+  if (hModuleSnap == INVALID_HANDLE_VALUE)
   {
     printError( TEXT("CreateToolhelp32Snapshot (of modules)") );
     return( FALSE );
@@ -239,7 +239,7 @@ BOOL ListProcessModules( DWORD dwPID )
 
   // Retrieve information about the first module,
   // and exit if unsuccessful
-  if( !Module32First( hModuleSnap, &me32 ) )
+  if (!Module32First( hModuleSnap, &me32 ))
   {
     printError( TEXT("Module32First") );  // show cause of failure
     CloseHandle( hModuleSnap );           // clean the snapshot object
@@ -271,7 +271,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
  
   // Take a snapshot of all running threads  
   hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); 
-  if( hThreadSnap == INVALID_HANDLE_VALUE ) 
+  if (hThreadSnap == INVALID_HANDLE_VALUE) 
     return( FALSE ); 
  
   // Fill in the size of the structure before using it. 
@@ -279,7 +279,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
  
   // Retrieve information about the first thread,
   // and exit if unsuccessful
-  if( !Thread32First( hThreadSnap, &te32 ) ) 
+  if (!Thread32First( hThreadSnap, &te32 )) 
   {
     printError( TEXT("Thread32First") ); // show cause of failure
     CloseHandle( hThreadSnap );          // clean the snapshot object
@@ -291,7 +291,7 @@ BOOL ListProcessThreads( DWORD dwOwnerPID )
   // associated with the specified process
   do 
   { 
-    if( te32.th32OwnerProcessID == dwOwnerPID )
+    if (te32.th32OwnerProcessID == dwOwnerPID)
     {
       printf( "\n\n     THREAD ID      = 0x%08X", te32.th32ThreadID ); 
       printf( "\n     Base priority  = %d", te32.tpBasePri ); 
diff --git a/src/plugins/debugger/breakhandler.cpp b/src/plugins/debugger/breakhandler.cpp
index f4b528c50fa9816f896ab3941c062e5f44e0ac2e..926568517daabea3ebae63d3506fda87e2f49d62 100644
--- a/src/plugins/debugger/breakhandler.cpp
+++ b/src/plugins/debugger/breakhandler.cpp
@@ -33,8 +33,8 @@
 
 #include "breakhandler.h"
 
-#include "assert.h"
 #include "imports.h" // TextEditor::BaseTextMark
+#include "qtcassert.h"
 
 #include <QtCore/QDebug>
 #include <QtCore/QFileInfo>
@@ -371,7 +371,7 @@ QVariant BreakHandler::data(const QModelIndex &mi, int role) const
     static const QIcon icon2(":/gdbdebugger/images/breakpoint_pending.svg");
     static const QString empty = QString(QLatin1Char('-'));
 
-    QWB_ASSERT(mi.isValid(), return QVariant());
+    QTC_ASSERT(mi.isValid(), return QVariant());
 
     if (mi.row() >= size())
         return QVariant();
@@ -550,7 +550,7 @@ void BreakHandler::breakByFunction(const QString &functionName)
     // One per function is enough for now
     for (int index = size(); --index >= 0;) {
         const BreakpointData *data = at(index);
-        QWB_ASSERT(data, break);
+        QTC_ASSERT(data, break);
         if (data->funcName == functionName && data->condition.isEmpty()
                 && data->ignoreCount.isEmpty())
             return;
diff --git a/src/plugins/debugger/debugger.pro b/src/plugins/debugger/debugger.pro
index d21eb7cdc01dfa98f4349dfc48df2904c041a13f..6b8c2e74ca45f204ef14028aeb91540da3dd1e22 100644
--- a/src/plugins/debugger/debugger.pro
+++ b/src/plugins/debugger/debugger.pro
@@ -10,11 +10,12 @@ include(../../plugins/texteditor/texteditor.pri)
 include(../../plugins/cpptools/cpptools.pri)
 include(../../libs/cplusplus/cplusplus.pri)
 
+INCLUDEPATH += ../../libs/utils
+
 # DEFINES += QT_NO_CAST_FROM_ASCII QT_NO_CAST_TO_ASCII
 QT += gui network script
 
-HEADERS += assert.h \
-    attachexternaldialog.h \
+HEADERS += attachexternaldialog.h \
     attachremotedialog.h \
     breakhandler.h \
     breakwindow.h \
diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp
index a94b1fb0931e3ac551f4fb815126b947ec998b80..a01a3ddc57e0d81e136e2945c7bdc8ed5e520ad7 100644
--- a/src/plugins/debugger/debuggermanager.cpp
+++ b/src/plugins/debugger/debuggermanager.cpp
@@ -62,6 +62,7 @@
 #include <QtCore/QDir>
 #include <QtCore/QFileInfo>
 #include <QtCore/QTime>
+#include <QtCore/QTimer>
 
 #include <QtGui/QAction>
 #include <QtGui/QComboBox>
@@ -145,6 +146,7 @@ void DebuggerManager::init()
     m_modulesHandler = 0;
     m_registerHandler = 0;
 
+    m_statusLabel = new QLabel;
     m_breakWindow = new BreakWindow;
     m_disassemblerWindow = new DisassemblerWindow;
     m_modulesWindow = new ModulesWindow;
@@ -157,6 +159,7 @@ void DebuggerManager::init()
     //m_tooltipWindow = new WatchWindow(WatchWindow::TooltipType);
     //m_watchersWindow = new QTreeView;
     m_tooltipWindow = new QTreeView;
+    m_statusTimer = new QTimer(this);
 
     m_mainWindow = new QMainWindow;
     m_mainWindow->setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
@@ -349,6 +352,15 @@ void DebuggerManager::init()
     m_useFastStartAction->setCheckable(true);
     m_useFastStartAction->setChecked(true);
 
+    m_useToolTipsAction = new QAction(this);
+    m_useToolTipsAction->setText(tr("Use Tooltips While Debugging"));
+    m_useToolTipsAction->setToolTip(tr("Checking this will make enable "
+        "tooltips for variable values during debugging. Since this can slow "
+        "down debugging and does not provide reliable information as it does "
+        "not use scope information, it is switched off by default."));
+    m_useToolTipsAction->setCheckable(true);
+    m_useToolTipsAction->setChecked(false);
+
     // FIXME
     m_useFastStartAction->setChecked(false);
     m_useFastStartAction->setEnabled(false);
@@ -408,6 +420,8 @@ void DebuggerManager::init()
         this, SLOT(saveSessionData()));
     connect(m_dumpLogAction, SIGNAL(triggered()),
         this, SLOT(dumpLog()));
+    connect(m_statusTimer, SIGNAL(timeout()),
+        this, SLOT(clearStatusMessage()));
 
     connect(m_outputWindow, SIGNAL(commandExecutionRequested(QString)),
         this, SLOT(executeDebuggerCommand(QString)));
@@ -553,24 +567,24 @@ QAbstractItemModel *DebuggerManager::threadsModel()
     return qobject_cast<ThreadsWindow*>(m_threadsWindow)->model();
 }
 
+void DebuggerManager::clearStatusMessage()
+{
+    m_statusLabel->setText(m_lastPermanentStatusMessage);
+}
+
 void DebuggerManager::showStatusMessage(const QString &msg, int timeout)
 {
     Q_UNUSED(timeout)
     //qDebug() << "STATUS: " << msg;
     showDebuggerOutput("status:", msg);
-    mainWindow()->statusBar()->showMessage(msg, timeout);
-#if 0
-    QString currentTime = QTime::currentTime().toString("hh:mm:ss.zzz");
-
-    ICore *core = m_pm->getObject<Core::ICore>();
-    //qDebug() << qPrintable(currentTime) << "Setting status:    " << msg;
-    if (msg.isEmpty())
-        core->messageManager()->displayStatusBarMessage(msg);
-    else if (timeout == -1)
-        core->messageManager()->displayStatusBarMessage(tr("Debugger: ") + msg);
-    else
-        core->messageManager()->displayStatusBarMessage(tr("Debugger: ") + msg, timeout);
-#endif
+    m_statusLabel->setText("   " + msg);
+    if (timeout > 0) {
+        m_statusTimer->setSingleShot(true);
+        m_statusTimer->start(timeout);
+    } else {
+        m_lastPermanentStatusMessage = msg;
+        m_statusTimer->stop();
+    }
 }
 
 void DebuggerManager::notifyStartupFinished()
@@ -938,6 +952,8 @@ void DebuggerManager::loadSessionData()
     QVariant value;
     querySessionValue(QLatin1String("UseFastStart"), &value);
     m_useFastStartAction->setChecked(value.toBool());
+    querySessionValue(QLatin1String("UseToolTips"), &value);
+    m_useToolTipsAction->setChecked(value.toBool());
     querySessionValue(QLatin1String("UseCustomDumpers"), &value);
     m_useCustomDumpersAction->setChecked(!value.isValid() || value.toBool());
     querySessionValue(QLatin1String("SkipKnownFrames"), &value);
@@ -951,6 +967,8 @@ void DebuggerManager::saveSessionData()
 
     setSessionValue(QLatin1String("UseFastStart"),
         m_useFastStartAction->isChecked());
+    setSessionValue(QLatin1String("UseToolTips"),
+        m_useToolTipsAction->isChecked());
     setSessionValue(QLatin1String("UseCustomDumpers"),
         m_useCustomDumpersAction->isChecked());
     setSessionValue(QLatin1String("SkipKnownFrames"),
diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h
index fd1e7cf5cbaab2f0f7f12314c6d28876bf29db0b..64dee6957f732c73400e83072b9f75e4023218db 100644
--- a/src/plugins/debugger/debuggermanager.h
+++ b/src/plugins/debugger/debuggermanager.h
@@ -44,9 +44,11 @@ QT_BEGIN_NAMESPACE
 class QAction;
 class QAbstractItemModel;
 class QDockWidget;
+class QLabel;
 class QMainWindow;
 class QModelIndex;
 class QSplitter;
+class QTimer;
 class QWidget;
 QT_END_NAMESPACE
 
@@ -190,7 +192,8 @@ public:
 private:
     friend class DebugMode;
 
-    virtual QWidget *threadsWindow() = 0;
+    virtual QWidget *threadsWindow() const = 0;
+    virtual QLabel *statusLabel() const = 0;
     virtual QList<QDockWidget*> dockWidgets() const = 0;
     virtual void createDockWidgets() = 0;
 };
@@ -213,6 +216,7 @@ public:
     IDebuggerManagerAccessForEngines *engineInterface();
     IDebuggerManagerAccessForDebugMode *debugModeInterface();
     QMainWindow *mainWindow() const { return m_mainWindow; }
+    QLabel *statusLabel() const { return m_statusLabel; }
 
     enum StartMode { startInternal, startExternal, attachExternal };
     enum DebuggerType { GdbDebugger, ScriptDebugger, WinDebugger };
@@ -272,7 +276,7 @@ public slots:
     void assignValueInDebugger(const QString &expr, const QString &value);
     void executeDebuggerCommand(const QString &command);
 
-    void showStatusMessage(const QString &msg, int timeout); // -1 forever
+    void showStatusMessage(const QString &msg, int timeout = -1); // -1 forever
 
 private slots:
     void showDebuggerOutput(const QString &prefix, const QString &msg);
@@ -290,6 +294,7 @@ private slots:
     void reloadRegisters();
     void registerDockToggled(bool on);
     void setStatus(int status);
+    void clearStatusMessage();
 
 private:
     //
@@ -303,6 +308,7 @@ private:
     ThreadsHandler *threadsHandler() { return m_threadsHandler; }
     WatchHandler *watchHandler() { return m_watchHandler; }
     QAction *useCustomDumpersAction() const { return m_useCustomDumpersAction; }
+    QAction *useToolTipsAction() const { return m_useToolTipsAction; }
     QAction *debugDumpersAction() const { return m_debugDumpersAction; }
     bool skipKnownFrames() const;
     bool debugDumpers() const;
@@ -322,7 +328,7 @@ private:
     //
     // Implementation of IDebuggerManagerAccessForDebugMode
     //
-    QWidget *threadsWindow() { return m_threadsWindow; }
+    QWidget *threadsWindow() const { return m_threadsWindow; }
     QList<QDockWidget*> dockWidgets() const { return m_dockWidgets; }
     void createDockWidgets();
 
@@ -382,6 +388,7 @@ private:
 
     /// Views
     QMainWindow *m_mainWindow;
+    QLabel *m_statusLabel;
     QDockWidget *m_breakDock;
     QDockWidget *m_disassemblerDock;
     QDockWidget *m_modulesDock;
@@ -425,6 +432,7 @@ private:
     QAction *m_debugDumpersAction;
     QAction *m_useCustomDumpersAction;
     QAction *m_useFastStartAction;
+    QAction *m_useToolTipsAction;
     QAction *m_dumpLogAction;
 
     QWidget *m_breakWindow;
@@ -440,6 +448,8 @@ private:
 
     int m_status;
     bool m_busy;
+    QTimer *m_statusTimer;
+    QString m_lastPermanentStatusMessage;
 
     IDebuggerEngine *engine();
     IDebuggerEngine *m_engine;
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index feb63fa0c306da890538993d03b4871526d425e2..03f86bec2492ed19e0edc4363d8dad7965378551 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -33,13 +33,13 @@
 
 #include "debuggerplugin.h"
 
-#include "assert.h"
 #include "debuggerconstants.h"
 #include "debuggermanager.h"
 #include "debuggerrunner.h"
 #include "gdboptionpage.h"
 #include "gdbengine.h"
 #include "mode.h"
+#include "qtcassert.h"
 
 #include <coreplugin/actionmanager/actionmanagerinterface.h>
 #include <coreplugin/coreconstants.h>
@@ -91,6 +91,7 @@ const char * const DEBUG_DUMPERS        = "Debugger.DebugDumpers";
 const char * const ADD_TO_WATCH         = "Debugger.AddToWatch";
 const char * const USE_CUSTOM_DUMPERS   = "Debugger.UseCustomDumpers";
 const char * const USE_FAST_START       = "Debugger.UseFastStart";
+const char * const USE_TOOL_TIPS        = "Debugger.UseToolTips";
 const char * const SKIP_KNOWN_FRAMES    = "Debugger.SkipKnownFrames";
 const char * const DUMP_LOG             = "Debugger.DumpLog";
 
@@ -188,7 +189,7 @@ void DebuggerPlugin::shutdown()
 {
     if (m_debugMode)
         m_debugMode->shutdown(); // saves state including manager information
-    QWB_ASSERT(m_manager, /**/);
+    QTC_ASSERT(m_manager, /**/);
     if (m_manager)
         m_manager->shutdown();
 
@@ -225,13 +226,13 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
     m_pm = ExtensionSystem::PluginManager::instance();
 
     ICore *core = m_pm->getObject<Core::ICore>();
-    QWB_ASSERT(core, return false);
+    QTC_ASSERT(core, return false);
 
     Core::ActionManagerInterface *actionManager = core->actionManager();
-    QWB_ASSERT(actionManager, return false);
+    QTC_ASSERT(actionManager, return false);
 
     Core::UniqueIDManager *uidm = core->uniqueIDManager();
-    QWB_ASSERT(uidm, return false);
+    QTC_ASSERT(uidm, return false);
 
     QList<int> globalcontext;
     globalcontext << Core::Constants::C_GLOBAL_ID;
@@ -374,13 +375,17 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *error_mes
         Constants::USE_FAST_START, globalcontext);
     mdebug->addAction(cmd);
 
+    cmd = actionManager->registerAction(m_manager->m_useToolTipsAction,
+        Constants::USE_TOOL_TIPS, globalcontext);
+    mdebug->addAction(cmd);
+
+#ifdef QT_DEBUG
     cmd = actionManager->registerAction(m_manager->m_dumpLogAction,
         Constants::DUMP_LOG, globalcontext);
     //cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+D,Ctrl+L")));
     cmd->setDefaultKeySequence(QKeySequence(tr("Ctrl+Shift+F11")));
     mdebug->addAction(cmd);
 
-#ifdef QT_DEBUG
     cmd = actionManager->registerAction(m_manager->m_debugDumpersAction,
         Constants::DEBUG_DUMPERS, debuggercontext);
     mdebug->addAction(cmd);
@@ -549,6 +554,9 @@ void DebuggerPlugin::requestMark(TextEditor::ITextEditor *editor, int lineNumber
 void DebuggerPlugin::showToolTip(TextEditor::ITextEditor *editor,
     const QPoint &point, int pos)
 {
+    if (!m_manager->useToolTipsAction()->isChecked())
+        return;
+
     QPlainTextEdit *plaintext = qobject_cast<QPlainTextEdit*>(editor->widget());
     if (!plaintext)
         return;
@@ -590,13 +598,13 @@ void DebuggerPlugin::querySessionValue(const QString &name, QVariant *value)
 
 void DebuggerPlugin::setConfigValue(const QString &name, const QVariant &value)
 {
-    QWB_ASSERT(m_debugMode, return);
+    QTC_ASSERT(m_debugMode, return);
     m_debugMode->settings()->setValue(name, value);
 }
 
 void DebuggerPlugin::queryConfigValue(const QString &name, QVariant *value)
 {
-    QWB_ASSERT(m_debugMode, return);
+    QTC_ASSERT(m_debugMode, return);
     *value = m_debugMode->settings()->value(name);
 }
 
diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp
index 90c8c4e9f7d6dc53acf6bfe7dfcbc415b596b0e1..21da78fae9fd64ae8dfadd9d562a16520ba6cc55 100644
--- a/src/plugins/debugger/debuggerrunner.cpp
+++ b/src/plugins/debugger/debuggerrunner.cpp
@@ -33,8 +33,8 @@
 
 #include "debuggerrunner.h"
 
-#include "assert.h"
 #include "debuggermanager.h"
+#include "qtcassert.h"
 
 #include <projectexplorer/applicationrunconfiguration.h>
 #include <projectexplorer/environment.h>
@@ -118,9 +118,9 @@ void DebuggerRunControl::start()
     m_running = true;
     ApplicationRunConfigurationPtr rc =
         qSharedPointerCast<ApplicationRunConfiguration>(runConfiguration());
-    QWB_ASSERT(rc, return);
+    QTC_ASSERT(rc, return);
     ProjectExplorer::Project *project = rc->project();
-    QWB_ASSERT(project, return);
+    QTC_ASSERT(project, return);
 
     m_manager->m_executable = rc->executable();
     m_manager->m_environment = rc->environment().toStringList();
diff --git a/src/plugins/debugger/gdbengine.cpp b/src/plugins/debugger/gdbengine.cpp
index 9336981b128ba3cab1b8e7e63b1c2c0509f2969f..13af8e3075bd145450f3d081a6de47567958185d 100644
--- a/src/plugins/debugger/gdbengine.cpp
+++ b/src/plugins/debugger/gdbengine.cpp
@@ -33,11 +33,11 @@
 
 #include "gdbengine.h"
 
-#include "assert.h"
 #include "debuggerconstants.h"
 #include "debuggermanager.h"
 #include "gdbmi.h"
 #include "procinterrupt.h"
+#include "qtcassert.h"
 
 #include "disassemblerhandler.h"
 #include "breakhandler.h"
@@ -278,25 +278,8 @@ void GdbEngine::init()
     connect(&m_gdbProc, SIGNAL(finished(int, QProcess::ExitStatus)), q,
         SLOT(exitDebugger()));
 
-    // Custom dumpers
-    //m_dumperServerConnection = 0;
-    //m_dumperServer = new DumperServer(this);
-    //QString name = "gdb-" +
-    //    QDateTime::currentDateTime().toString("yyyy_MM_dd-hh_mm_ss_zzz");
-    //m_dumperServer->listen(name);
-    //connect(m_dumperServer, SIGNAL(newConnection()),
-    //   this, SLOT(acceptConnection()));
-
-    //if (!m_dumperServer->isListening()) {
-    //    QMessageBox::critical(q->mainWindow(), tr("Dumper Server Setup Failed"),
-    //      tr("Unable to create server listening for data: %1.\n"
-    //         "Server name: %2").arg(m_dumperServer->errorString(), name),
-    //      QMessageBox::Retry | QMessageBox::Cancel);
-   // }
-
     connect(qq->debugDumpersAction(), SIGNAL(toggled(bool)),
         this, SLOT(setDebugDumpers(bool)));
-
     connect(qq->useCustomDumpersAction(), SIGNAL(toggled(bool)),
         this, SLOT(setCustomDumpersWanted(bool)));
 
@@ -347,7 +330,7 @@ void GdbEngine::gdbProcError(QProcess::ProcessError error)
                 "This is the default return value of error().");
     }
 
-    q->showStatusMessage(msg, 5000);
+    q->showStatusMessage(msg);
     QMessageBox::critical(q->mainWindow(), tr("Error"), msg);
     // act as if it was closed by the core
     q->exitDebugger();
@@ -451,7 +434,7 @@ void GdbEngine::handleResponse()
             while (from != to && *from != '\n')
                 s += *from++;
             //qDebug() << "UNREQUESTED DATA " << s << " TAKEN AS APPLICATION OUTPUT";
-            s += '\n';
+            //s += '\n';
 
             m_inbuffer = QByteArray(from, to - from);
             emit applicationOutputAvailable("app-stdout: ", s);
@@ -470,7 +453,7 @@ void GdbEngine::handleResponse()
                 for (; from != to; ++from) {
                     const char c = *from;
                     if (!isNameChar(c))
-                      break;
+                        break;
                     asyncClass += *from;
                 }
                 //qDebug() << "ASYNCCLASS" << asyncClass;
@@ -647,7 +630,7 @@ void GdbEngine::readGdbStandardOutput()
     #endif
 
     m_inbuffer.append(out);
-    //QWB_ASSERT(!m_inbuffer.isEmpty(), return);
+    //QTC_ASSERT(!m_inbuffer.isEmpty(), return);
 
     char c = m_inbuffer[m_inbuffer.size() - 1];
     static const QByteArray termArray("(gdb) ");
@@ -710,7 +693,7 @@ void GdbEngine::sendCommand(const QString &command, int type,
 
     bool temporarilyStopped = false;
     if (needStop && q->status() == DebuggerInferiorRunning) {
-        q->showStatusMessage(tr("Temporarily stopped"), -1);
+        q->showStatusMessage(tr("Temporarily stopped"));
         interruptInferior();
         temporarilyStopped = true;
     }
@@ -1055,7 +1038,7 @@ void GdbEngine::handleExecJumpToLine(const GdbResultRecord &record)
     // ~"242\t x *= 2;"
     //109^done"
     qq->notifyInferiorStopped();
-    q->showStatusMessage(tr("Jumped. Stopped."), -1);
+    q->showStatusMessage(tr("Jumped. Stopped."));
     QString output = record.data.findChild("logstreamoutput").data();
     if (!output.isEmpty())
         return;
@@ -1074,7 +1057,7 @@ void GdbEngine::handleExecRunToFunction(const GdbResultRecord &record)
     // func="foo",args=[{name="str",value="@0x7fff0f450460"}],
     // file="main.cpp",fullname="/tmp/g/main.cpp",line="37"}
     qq->notifyInferiorStopped();
-    q->showStatusMessage(tr("Run to Function finished. Stopped."), -1);
+    q->showStatusMessage(tr("Run to Function finished. Stopped."));
     GdbMi frame = record.data.findChild("frame");
     QString file = frame.findChild("fullname").data();
     int line = frame.findChild("line").data().toInt();
@@ -1212,7 +1195,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
             }
         } else {
             // slow start requested.
-            q->showStatusMessage("Loading " + data.toString(), -1);
+            q->showStatusMessage(tr("Loading %1...").arg(QString(data.toString())));
             continueInferior();
         }
         return;
@@ -1231,7 +1214,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
             msg = "Program exited after receiving signal "
                 + data.findChild("signal-name").toString();
         }
-        q->showStatusMessage(msg, -1);
+        q->showStatusMessage(msg);
         q->exitDebugger();
         return;
     }
@@ -1271,7 +1254,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
     if (isStoppedReason(reason) || reason.isEmpty()) {
         // Need another round trip
         if (reason == "breakpoint-hit") {
-            q->showStatusMessage(tr("Stopped at breakpoint."), -1);
+            q->showStatusMessage(tr("Stopped at breakpoint"));
             GdbMi frame = data.findChild("frame");
             //qDebug() << frame.toString();
             m_currentFrame = frame.findChild("addr").data() + '%' +
@@ -1283,7 +1266,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
             QVariant var = QVariant::fromValue<GdbMi>(data);
             sendCommand("p 0", GdbAsyncOutput2, var);  // dummy
         } else {
-            q->showStatusMessage(tr("Stopped. %1").arg(reason), -1);
+            q->showStatusMessage(tr("Stopped: \"%1\"").arg(reason));
             handleAsyncOutput2(data);
         }
         return;
@@ -1305,7 +1288,7 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
     // system="0.00136",start="1218810678.805432",end="1218810678.812011"}
     q->resetLocation();
     qq->notifyInferiorStopped();
-    q->showStatusMessage(tr("Run to Function finished. Stopped."), -1);
+    q->showStatusMessage(tr("Run to Function finished. Stopped."));
     GdbMi frame = data.findChild("frame");
     QString file = frame.findChild("fullname").data();
     int line = frame.findChild("line").data().toInt();
@@ -1378,8 +1361,9 @@ void GdbEngine::handleShowVersion(const GdbResultRecord &response)
     if (response.resultClass == GdbResultDone) {
         m_gdbVersion = 100;
         QString msg = response.data.findChild("consolestreamoutput").data();
-        QRegExp supported("GNU gdb 6.[6789]");
-        if (msg.indexOf(supported) == -1) {
+        QRegExp supported("GNU gdb(.*) (\\d+)\\.(\\d+)\\.(\\d+)");
+        if (supported.indexIn(msg) == -1) {
+            qDebug() << "UNSUPPORTED GDB VERSION " << msg;
             QStringList list = msg.split("\n");
             while (list.size() > 2)
                 list.removeLast();
@@ -1396,11 +1380,11 @@ void GdbEngine::handleShowVersion(const GdbResultRecord &response)
 #else
             //QMessageBox::information(m_mainWindow, tr("Warning"), msg);
 #endif
-        }
-        int pos = msg.indexOf("GNU gdb 6.");
-        if (pos != -1) {
-            m_gdbVersion = 600 + (msg.at(pos + 10).unicode() - '0') * 10;
-            //qDebug() << "GDB VERSION " << m_gdbVersion << msg;
+        } else {
+            m_gdbVersion = 10000 * supported.cap(2).toInt()
+                         +   100 * supported.cap(3).toInt()
+                         +     1 * supported.cap(4).toInt();
+            //qDebug() << "GDB VERSION " << m_gdbVersion;
         }
     }
 }
@@ -1414,7 +1398,7 @@ void GdbEngine::handleFileExecAndSymbols
         QString msg = response.data.findChild("msg").data();
         QMessageBox::critical(q->mainWindow(), tr("Error"),
             tr("Starting executable failed:\n") + msg);
-        QWB_ASSERT(q->status() == DebuggerInferiorRunning, /**/);
+        QTC_ASSERT(q->status() == DebuggerInferiorRunning, /**/);
         interruptInferior();
     }
 }
@@ -1423,19 +1407,19 @@ void GdbEngine::handleExecRun(const GdbResultRecord &response)
 {
     if (response.resultClass == GdbResultRunning) {
         qq->notifyInferiorRunning();
-        q->showStatusMessage(tr("Running..."), -1);
+        q->showStatusMessage(tr("Running..."));
         //reloadModules();
     } else if (response.resultClass == GdbResultError) {
         QString msg = response.data.findChild("msg").data();
         if (msg == "Cannot find bounds of current function") {
             qq->notifyInferiorStopped();
             //q->showStatusMessage(tr("No debug information available. "
-            //  "Leaving function..."), -1);
+            //  "Leaving function..."));
             //stepOutExec();
         } else {
             QMessageBox::critical(q->mainWindow(), tr("Error"),
                 tr("Starting executable failed:\n") + msg);
-            QWB_ASSERT(q->status() == DebuggerInferiorRunning, /**/);
+            QTC_ASSERT(q->status() == DebuggerInferiorRunning, /**/);
             interruptInferior();
         }
     }
@@ -1558,7 +1542,7 @@ bool GdbEngine::startDebugger()
     qDebug() << "ExeFile: " << q->m_executable;
     #endif
 
-    q->showStatusMessage("Starting Debugger", -1);
+    q->showStatusMessage(tr("Starting Debugger"));
     emit gdbInputAvailable(QString(), theGdbSettings().m_gdbCmd + ' ' + gdbArgs.join(" "));
 
     m_gdbProc.start(theGdbSettings().m_gdbCmd, gdbArgs);
@@ -1567,7 +1551,7 @@ bool GdbEngine::startDebugger()
     if (m_gdbProc.state() != QProcess::Running)
         return false;
 
-    q->showStatusMessage(tr("Gdb Running"), -1);
+    q->showStatusMessage(tr("Gdb Running"));
 
     sendCommand("show version", GdbShowVersion);
     if (qq->useFastStart()) {
@@ -2337,8 +2321,8 @@ void GdbEngine::handleModulesList(const GdbResultRecord &record)
 void GdbEngine::handleStackSelectThread(const GdbResultRecord &record, int)
 {
     Q_UNUSED(record);
-    qDebug("FIXME: StackHandler::handleOutput: SelectThread");
-    q->showStatusMessage(tr("Retrieving data for stack view..."), -1);
+    //qDebug("FIXME: StackHandler::handleOutput: SelectThread");
+    q->showStatusMessage(tr("Retrieving data for stack view..."), 3000);
     sendCommand("-stack-list-frames", StackListFrames);
 }
 
@@ -2430,9 +2414,9 @@ void GdbEngine::selectThread(int index)
     threadsHandler->setCurrentThread(index);
 
     QList<ThreadData> threads = threadsHandler->threads();
-    QWB_ASSERT(index < threads.size(), return);
+    QTC_ASSERT(index < threads.size(), return);
     int id = threads.at(index).id;
-    q->showStatusMessage(tr("Retrieving data for stack view..."), -1);
+    q->showStatusMessage(tr("Retrieving data for stack view..."), 10000);
     sendCommand(QLatin1String("-thread-select ") + QString::number(id),
         StackSelectThread);
 }
@@ -2447,7 +2431,7 @@ void GdbEngine::activateFrame(int frameIndex)
     //qDebug() << "ACTIVATE FRAME: " << frameIndex << oldIndex
     //    << stackHandler->currentIndex();
 
-    QWB_ASSERT(frameIndex < stackHandler->stackSize(), return);
+    QTC_ASSERT(frameIndex < stackHandler->stackSize(), return);
 
     if (oldIndex != frameIndex) {
         // Assuming this always succeeds saves a roundtrip.
@@ -2545,7 +2529,7 @@ bool GdbEngine::supportsThreads() const
 {
     // 6.3 crashes happily on -thread-list-ids. So don't use it.
     // The test below is a semi-random pick, 6.8 works fine
-    return m_gdbVersion > 650;
+    return m_gdbVersion > 60500;
 }
 
 //////////////////////////////////////////////////////////////////////
@@ -2968,7 +2952,7 @@ bool GdbEngine::isCustomValueDumperAvailable(const QString &type) const
 void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
 {
     WatchData data = data0;
-    QWB_ASSERT(!data.exp.isEmpty(), return);
+    QTC_ASSERT(!data.exp.isEmpty(), return);
     QString tmplate;
     QString inner;
     bool isTemplate = extractTemplate(data.type, &tmplate, &inner);
@@ -3081,7 +3065,7 @@ void GdbEngine::runCustomDumper(const WatchData & data0, bool dumpChildren)
 
     q->showStatusMessage(
         tr("Retrieving data for watch view (%1 requests pending)...")
-            .arg(m_pendingRequests + 1), -1);
+            .arg(m_pendingRequests + 1), 10000);
     // create response slot for socket data
     QVariant var;
     var.setValue(data);
@@ -3109,7 +3093,7 @@ void GdbEngine::updateSubItem(const WatchData &data0)
     #if DEBUG_SUBITEM
     qDebug() << "UPDATE SUBITEM: " << data.toString();
     #endif
-    QWB_ASSERT(data.isValid(), return);
+    QTC_ASSERT(data.isValid(), return);
 
     // in any case we need the type first
     if (data.isTypeNeeded()) {
@@ -3137,7 +3121,7 @@ void GdbEngine::updateSubItem(const WatchData &data0)
     }
 
     // we should have a type now. this is relied upon further below
-    QWB_ASSERT(!data.type.isEmpty(), return);
+    QTC_ASSERT(!data.type.isEmpty(), return);
 
     // a common case that can be easily solved
     if (data.isChildrenNeeded() && isPointerType(data.type)
@@ -3195,7 +3179,7 @@ void GdbEngine::updateSubItem(const WatchData &data0)
     }
 
     if (data.isValueNeeded()) {
-        QWB_ASSERT(!data.variable.isEmpty(), return); // tested above
+        QTC_ASSERT(!data.variable.isEmpty(), return); // tested above
         #if DEBUG_SUBITEM
         qDebug() << "UPDATE SUBITEM: VALUE";
         #endif
@@ -3224,7 +3208,7 @@ void GdbEngine::updateSubItem(const WatchData &data0)
     }
 
     if (data.isChildrenNeeded()) {
-        QWB_ASSERT(!data.variable.isEmpty(), return); // tested above
+        QTC_ASSERT(!data.variable.isEmpty(), return); // tested above
         QString cmd = "-var-list-children --all-values \"" + data.variable + "\"";
         sendSynchronizedCommand(cmd, WatchVarListChildren, QVariant::fromValue(data));
         return;
@@ -3249,14 +3233,14 @@ void GdbEngine::updateSubItem(const WatchData &data0)
     }
 
     if (data.isChildCountNeeded()) {
-        QWB_ASSERT(!data.variable.isEmpty(), return); // tested above
+        QTC_ASSERT(!data.variable.isEmpty(), return); // tested above
         QString cmd = "-var-list-children --all-values \"" + data.variable + "\"";
         sendCommand(cmd, WatchVarListChildren, QVariant::fromValue(data));
         return;
     }
 
     qDebug() << "FIXME: UPDATE SUBITEM: " << data.toString();
-    QWB_ASSERT(false, return);
+    QTC_ASSERT(false, return);
 }
 
 void GdbEngine::updateWatchModel()
@@ -3270,7 +3254,7 @@ void GdbEngine::updateWatchModel2()
 {
     PENDING_DEBUG("UPDATE WATCH MODEL");
     QList<WatchData> incomplete = qq->watchHandler()->takeCurrentIncompletes();
-    //QWB_ASSERT(incomplete.isEmpty(), /**/);
+    //QTC_ASSERT(incomplete.isEmpty(), /**/);
     if (!incomplete.isEmpty()) {
         #if DEBUG_PENDING
         qDebug() << "##############################################";
@@ -3299,7 +3283,7 @@ void GdbEngine::updateWatchModel2()
     PENDING_DEBUG("REBUILDING MODEL")
     emit gdbInputAvailable(QString(),
         "[" + currentTime() + "]    <Rebuild Watchmodel>");
-    q->showStatusMessage(tr("Finished retrieving data."), -1);
+    q->showStatusMessage(tr("Finished retrieving data."), 400);
     qq->watchHandler()->rebuildModel();
 
     if (!m_toolTipExpression.isEmpty()) {
@@ -3313,9 +3297,6 @@ void GdbEngine::updateWatchModel2()
                 "Cannot evaluate expression: " + m_toolTipExpression);
         }
     }
-
-    //qDebug() << "INSERT DATA" << data0.toString();
-    //q->showStatusMessage(tr("Stopped."), 5000);
 }
 
 void GdbEngine::handleQueryDataDumper1(const GdbResultRecord &record)
@@ -3438,7 +3419,7 @@ void GdbEngine::handleEvaluateExpression(const GdbResultRecord &record,
     const WatchData &data0)
 {
     WatchData data = data0;
-    QWB_ASSERT(data.isValid(), qDebug() << "HUH?");
+    QTC_ASSERT(data.isValid(), qDebug() << "HUH?");
     if (record.resultClass == GdbResultDone) {
         //if (col == 0)
         //    data.name = record.data.findChild("value").data();
@@ -3466,7 +3447,7 @@ void GdbEngine::handleDumpCustomValue1(const GdbResultRecord &record,
     const WatchData &data0)
 {
     WatchData data = data0;
-    QWB_ASSERT(data.isValid(), return);
+    QTC_ASSERT(data.isValid(), return);
     if (record.resultClass == GdbResultDone) {
         // ignore this case, data will follow
     } else if (record.resultClass == GdbResultError) {
@@ -3500,7 +3481,7 @@ void GdbEngine::handleDumpCustomValue2(const GdbResultRecord &record,
     const WatchData &data0)
 {
     WatchData data = data0;
-    QWB_ASSERT(data.isValid(), return);
+    QTC_ASSERT(data.isValid(), return);
     //qDebug() << "CUSTOM VALUE RESULT: " << record.toString();
     //qDebug() << "FOR DATA: " << data.toString() << record.resultClass;
     if (record.resultClass == GdbResultDone) {
@@ -3661,10 +3642,20 @@ void GdbEngine::setLocals(const QList<GdbMi> &locals)
     QHash<QString, int> seen;
 
     foreach (const GdbMi &item, locals) {
+        // Local variables of inlined code are reported as 
+        // 26^done,locals={varobj={exp="this",value="",name="var4",exp="this",
+        // numchild="1",type="const QtSharedPointer::Basic<CPlusPlus::..."
+        // We do not want these at all. Current hypotheses is that those
+        // "spurious" locals have _two_ "exp" field. Try to filter them:
         #ifdef Q_OS_MAC
-            QString name = item.findChild("exp").data();
+        int numExps = 0;
+        foreach (const GdbMi &child, item.children())
+            numExps += int(child.name() == "exp");
+        if (numExps > 1)
+            continue;
+        QString name = item.findChild("exp").data();
         #else
-            QString name = item.findChild("name").data();
+        QString name = item.findChild("name").data();
         #endif
         int n = seen.value(name);
         if (n) {
@@ -3897,7 +3888,7 @@ void GdbEngine::handleToolTip(const GdbResultRecord &record,
             if (isCustomValueDumperAvailable(m_toolTip.type))
                 runCustomDumper(m_toolTip, false);
             else
-                q->showStatusMessage(tr("Retrieving data for tooltip..."), -1);
+                q->showStatusMessage(tr("Retrieving data for tooltip..."), 10000);
                 sendCommand("-data-evaluate-expression " + m_toolTip.exp,
                     WatchToolTip, "evaluate");
                 //sendToolTipCommand("-var-evaluate-expression tooltip")
@@ -3972,7 +3963,7 @@ void GdbEngine::tryLoadCustomDumpers()
         if (qq->useFastStart())
             sendCommand("set stop-on-solib-events 0");
         QString flag = QString::number(RTLD_NOW);
-        sendCommand("call dlopen(\"" + lib + "\", " + flag + ")");
+        sendCommand("call (void)dlopen(\"" + lib + "\", " + flag + ")");
         sendCommand("sharedlibrary " + dotEscape(lib));
         if (qq->useFastStart())
             sendCommand("set stop-on-solib-events 1");
diff --git a/src/plugins/debugger/gdbengine.h b/src/plugins/debugger/gdbengine.h
index b3e13233526754ac0d0c41bec3992bd668f19913..56106a7524468e7270340462f80df9e1a88a02ff 100644
--- a/src/plugins/debugger/gdbengine.h
+++ b/src/plugins/debugger/gdbengine.h
@@ -34,6 +34,9 @@
 #ifndef DEBUGGER_GDBENGINE_H
 #define DEBUGGER_GDBENGINE_H
 
+#include "idebuggerengine.h"
+#include "gdbmi.h"
+
 #include <QtCore/QByteArray>
 #include <QtCore/QHash>
 #include <QtCore/QMap>
@@ -48,9 +51,6 @@ class QAbstractItemModel;
 class QWidget;
 QT_END_NAMESPACE
 
-#include "idebuggerengine.h"
-#include "gdbmi.h"
-
 namespace Debugger {
 namespace Internal {
 
diff --git a/src/plugins/debugger/gdbmi.cpp b/src/plugins/debugger/gdbmi.cpp
index ff976eff798978694e9acf0db461b19ecd4f12de..3beadc385fa8067186ac4f5c1f01515c753cd2cf 100644
--- a/src/plugins/debugger/gdbmi.cpp
+++ b/src/plugins/debugger/gdbmi.cpp
@@ -32,7 +32,7 @@
 ***************************************************************************/
 
 #include "gdbmi.h"
-#include "assert.h"
+#include "qtcassert.h"
 
 #include <QtCore/QByteArray>
 #include <QtCore/QDebug>
@@ -138,7 +138,7 @@ void GdbMi::parseValue(const Char *&from, const Char *to)
 void GdbMi::parseTuple(const Char *&from, const Char *to)
 {
     //qDebug() << "parseTuple: " << QByteArray::fromUtf16(from, to - from);
-    QWB_ASSERT(*from == '{', /**/);
+    QTC_ASSERT(*from == '{', /**/);
     ++from;
     parseTuple_helper(from, to);
 }
@@ -166,7 +166,7 @@ void GdbMi::parseTuple_helper(const Char *&from, const Char *to)
 void GdbMi::parseList(const Char *&from, const Char *to)
 {
     //qDebug() << "parseList: " << QByteArray::fromUtf16(from, to - from);
-    QWB_ASSERT(*from == '[', /**/);
+    QTC_ASSERT(*from == '[', /**/);
     ++from;
     m_type = List;
     while (from < to) {
diff --git a/src/plugins/debugger/gdbtypemacros.cpp b/src/plugins/debugger/gdbtypemacros.cpp
index a445a336324a302c73cf39670db33cb6d2ad3749..8610d01e39d87c2c9a64ff84cbf1389a74fc11bd 100644
--- a/src/plugins/debugger/gdbtypemacros.cpp
+++ b/src/plugins/debugger/gdbtypemacros.cpp
@@ -59,10 +59,10 @@ TypeMacroPage::TypeMacroPage(GdbSettings *settings)
         //insert qt4 defaults
         m_settings->m_scriptFile = coreIFace->resourcePath() +
             QLatin1String("/gdb/qt4macros");
-        for (int i=0; i<3; ++i) {
+        for (int i = 0; i < 3; ++i) {
             QByteArray data;
             QDataStream stream(&data, QIODevice::WriteOnly);
-            switch(i) {
+            switch (i) {
             case 0:
                 stream << QString("printqstring") << (int)1;
                 m_settings->m_typeMacros.insert(QLatin1String("QString"), data);
@@ -154,7 +154,7 @@ void TypeMacroPage::finished(bool accepted)
     m_settings->m_typeMacros.clear();
     m_settings->m_scriptFile = m_ui.scriptEdit->text();
 
-    for (int i=0; i<m_ui.treeWidget->topLevelItemCount(); ++i) {
+    for (int i = 0; i < m_ui.treeWidget->topLevelItemCount(); ++i) {
         QTreeWidgetItem *item = m_ui.treeWidget->topLevelItem(i);
         QByteArray data;
         QDataStream stream(&data, QIODevice::WriteOnly);
diff --git a/src/plugins/debugger/idebuggerengine.h b/src/plugins/debugger/idebuggerengine.h
index 22ed3ca184583aedf5c729c806d969d8000f5444..8c7f2d2b2e8e585bdacde4564661ff602da6aad5 100644
--- a/src/plugins/debugger/idebuggerengine.h
+++ b/src/plugins/debugger/idebuggerengine.h
@@ -36,6 +36,11 @@
 
 #include <QtCore/QObject>
 
+QT_BEGIN_NAMESPACE
+class QPoint;
+class QString;
+QT_END_NAMESPACE
+
 namespace Debugger {
 namespace Internal {
 
diff --git a/src/plugins/debugger/mode.cpp b/src/plugins/debugger/mode.cpp
index 3eef7dc8329a78626ed628197defb93f1b037694..c1bbdd550f1039e8d97debd6199d66b0d9377f16 100644
--- a/src/plugins/debugger/mode.cpp
+++ b/src/plugins/debugger/mode.cpp
@@ -33,9 +33,9 @@
 
 #include "mode.h"
 
-#include "assert.h"
 #include "debuggerconstants.h"
 #include "debuggermanager.h"
+#include "qtcassert.h"
 
 #include <coreplugin/coreconstants.h>
 #include <coreplugin/icore.h>
@@ -169,6 +169,8 @@ QToolBar *DebugMode::createToolBar()
         managerAccess->threadsWindow(), SIGNAL(threadSelected(int)));
     debugToolBar->addWidget(threadBox);
 
+    debugToolBar->addWidget(managerAccess->statusLabel());
+
     QWidget *stretch = new QWidget;
     stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum);
     debugToolBar->addWidget(stretch);
@@ -211,8 +213,8 @@ void DebugMode::focusCurrentEditor(IMode *mode)
 void DebugMode::writeSettings() const
 {
     QSettings *s = settings();
-    QWB_ASSERT(m_manager, return);
-    QWB_ASSERT(m_manager->mainWindow(), return);
+    QTC_ASSERT(m_manager, return);
+    QTC_ASSERT(m_manager->mainWindow(), return);
     s->beginGroup(QLatin1String("DebugMode"));
     s->setValue(QLatin1String("State"), m_manager->mainWindow()->saveState());
     s->setValue(QLatin1String("Locked"), m_toggleLockedAction->isChecked());
diff --git a/src/plugins/debugger/scriptengine.cpp b/src/plugins/debugger/scriptengine.cpp
index 28722b37dd2a609e22d8919097707f853bffbded..50f9dcdf4e27bc1f37c4a71b2b22e1a6d9afaa98 100644
--- a/src/plugins/debugger/scriptengine.cpp
+++ b/src/plugins/debugger/scriptengine.cpp
@@ -33,7 +33,7 @@
 
 #include "scriptengine.h"
 
-#include "assert.h"
+#include "qtcassert.h"
 #include "debuggerconstants.h"
 #include "debuggermanager.h"
 
@@ -574,7 +574,7 @@ void ScriptEngine::updateSubItem(const WatchData &data0)
 {
     WatchData data = data0;
     //qDebug() << "\nUPDATE SUBITEM: " << data.toString();
-    QWB_ASSERT(data.isValid(), return);
+    QTC_ASSERT(data.isValid(), return);
 
     if (data.isTypeNeeded() || data.isValueNeeded()) {
         QScriptValue ob = data.scriptValue;
@@ -667,7 +667,7 @@ void ScriptEngine::updateSubItem(const WatchData &data0)
         return;
     }
 
-    QWB_ASSERT(false, return);
+    QTC_ASSERT(false, return);
 }
 
 IDebuggerEngine *createScriptEngine(DebuggerManager *parent)
diff --git a/src/plugins/debugger/stackhandler.cpp b/src/plugins/debugger/stackhandler.cpp
index d2a468b07c6e3bedeb83db8a1adc07d047f7c36f..818b6b6188822020f9f314e2fd0c32818aa80371 100644
--- a/src/plugins/debugger/stackhandler.cpp
+++ b/src/plugins/debugger/stackhandler.cpp
@@ -33,7 +33,7 @@
 
 #include "stackhandler.h"
 
-#include "assert.h"
+#include "qtcassert.h"
 
 #include <QtCore/QAbstractTableModel>
 #include <QtCore/QDebug>
@@ -128,8 +128,8 @@ Qt::ItemFlags StackHandler::flags(const QModelIndex &index) const
 
 StackFrame StackHandler::currentFrame() const
 {       
-    QWB_ASSERT(m_currentIndex >= 0, return StackFrame());
-    QWB_ASSERT(m_currentIndex < m_stackFrames.size(), return StackFrame());
+    QTC_ASSERT(m_currentIndex >= 0, return StackFrame());
+    QTC_ASSERT(m_currentIndex < m_stackFrames.size(), return StackFrame());
     return m_stackFrames.at(m_currentIndex);
 }
 
diff --git a/src/plugins/debugger/startexternaldialog.cpp b/src/plugins/debugger/startexternaldialog.cpp
index 785757b7667f42bc5ffb8fef92c6e47fe12cbdb4..cca92ff3a3f531ebc7e04fed4ec353574a5c2772 100644
--- a/src/plugins/debugger/startexternaldialog.cpp
+++ b/src/plugins/debugger/startexternaldialog.cpp
@@ -88,7 +88,7 @@ QString StartExternalDialog::executableArguments() const
         result << QLatin1String("--args");
     result << execEdit->text();
 
-    for(int i=0; i<args.length(); ++i) {
+    for (int i = 0; i < args.length(); ++i) {
         current = args.at(i);
 
         if (current == QLatin1Char('\"') && last != QLatin1Char('\\')) {
diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp
index 1041c2edcc697a246d403879ca0c96575c6c50ad..e03c91f71003e04d15325b20dbba770071bb0b51 100644
--- a/src/plugins/debugger/watchhandler.cpp
+++ b/src/plugins/debugger/watchhandler.cpp
@@ -37,7 +37,7 @@
 #include "modeltest.h"
 #endif
 
-#include "assert.h"
+#include "qtcassert.h"
 
 #include <QtCore/QDebug>
 #include <QtCore/QEvent>
@@ -426,7 +426,7 @@ QVariant WatchHandler::data(const QModelIndex &idx, int role) const
     int node = idx.internalId();
     if (node < 0)
         return QVariant();
-    QWB_ASSERT(node < m_displaySet.size(), return QVariant());
+    QTC_ASSERT(node < m_displaySet.size(), return QVariant());
 
     const WatchData &data = m_displaySet.at(node);
 
@@ -702,10 +702,10 @@ void WatchHandler::rebuildModel()
 
     // Possibly append dummy items to prevent empty views
     bool ok = true;
-    QWB_ASSERT(m_displaySet.size() >= 2, ok = false);
-    QWB_ASSERT(m_displaySet.at(1).iname == "local", ok = false);
-    QWB_ASSERT(m_displaySet.at(2).iname == "tooltip", ok = false);
-    QWB_ASSERT(m_displaySet.at(3).iname == "watch", ok = false);
+    QTC_ASSERT(m_displaySet.size() >= 2, ok = false);
+    QTC_ASSERT(m_displaySet.at(1).iname == "local", ok = false);
+    QTC_ASSERT(m_displaySet.at(2).iname == "tooltip", ok = false);
+    QTC_ASSERT(m_displaySet.at(3).iname == "watch", ok = false);
     if (ok) {
         for (int i = 1; i <= 3; ++i) {
             WatchData &data = m_displaySet[i];
@@ -777,7 +777,7 @@ void WatchHandler::collapseChildren(const QModelIndex &idx)
         qDebug() << "WATCHHANDLER: COLLAPSE IGNORED" << idx;
         return;
     }
-    QWB_ASSERT(checkIndex(idx.internalId()), return);
+    QTC_ASSERT(checkIndex(idx.internalId()), return);
 #if 0
     QString iname0 = m_displaySet.at(idx.internalId()).iname;
     MODEL_DEBUG("COLLAPSE NODE" << iname0);
@@ -806,11 +806,11 @@ void WatchHandler::expandChildren(const QModelIndex &idx)
     int index = idx.internalId();
     if (index == 0)
         return;
-    QWB_ASSERT(index >= 0, qDebug() << toString() << index; return);
-    QWB_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
+    QTC_ASSERT(index >= 0, qDebug() << toString() << index; return);
+    QTC_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
     const WatchData &display = m_displaySet.at(index);
-    QWB_ASSERT(index >= 0, qDebug() << toString() << index; return);
-    QWB_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
+    QTC_ASSERT(index >= 0, qDebug() << toString() << index; return);
+    QTC_ASSERT(index < m_completeSet.size(), qDebug() << toString() << index; return);
     const WatchData &complete = m_completeSet.at(index);
     MODEL_DEBUG("\n\nEXPAND" << display.iname);
     if (display.iname.isEmpty()) {
@@ -848,7 +848,7 @@ void WatchHandler::expandChildren(const QModelIndex &idx)
 void WatchHandler::insertData(const WatchData &data)
 {
     //MODEL_DEBUG("INSERTDATA: " << data.toString());
-    QWB_ASSERT(data.isValid(), return);
+    QTC_ASSERT(data.isValid(), return);
     if (data.isSomethingNeeded())
         insertDataHelper(m_incompleteSet, data);
     else
@@ -977,7 +977,7 @@ bool WatchHandler::canFetchMore(const QModelIndex &parent) const
     // needs to be made synchronous to be useful. Busy loop is no good.
     if (!parent.isValid())
         return false;
-    QWB_ASSERT(checkIndex(parent.internalId()), return false);
+    QTC_ASSERT(checkIndex(parent.internalId()), return false);
     const WatchData &data = m_displaySet.at(parent.internalId());
     MODEL_DEBUG("CAN FETCH MORE: " << parent << " children: " << data.childCount
         << data.iname);
@@ -990,7 +990,7 @@ void WatchHandler::fetchMore(const QModelIndex &parent)
     MODEL_DEBUG("FETCH MORE: " << parent);
     return;
 
-    QWB_ASSERT(checkIndex(parent.internalId()), return);
+    QTC_ASSERT(checkIndex(parent.internalId()), return);
     QString iname = m_displaySet.at(parent.internalId()).iname;
 
     if (m_inFetchMore) {
@@ -1049,15 +1049,15 @@ QModelIndex WatchHandler::index(int row, int col, const QModelIndex &parent) con
         MODEL_DEBUG(" -> " << QModelIndex() << " (2) ");
         return QModelIndex(); 
     }
-    QWB_ASSERT(checkIndex(parentIndex), return QModelIndex());
+    QTC_ASSERT(checkIndex(parentIndex), return QModelIndex());
     const WatchData &data = m_displaySet.at(parentIndex);
-    QWB_ASSERT(row >= 0, qDebug() << "ROW: " << row  << "PARENT: " << parent
+    QTC_ASSERT(row >= 0, qDebug() << "ROW: " << row  << "PARENT: " << parent
         << data.toString() << toString(); return QModelIndex());
-    QWB_ASSERT(row < data.childIndex.size(),
+    QTC_ASSERT(row < data.childIndex.size(),
         MODEL_DEBUG("ROW: " << row << data.toString() << toString());
         return QModelIndex());
     QModelIndex idx = createIndex(row, col, data.childIndex.at(row));
-    QWB_ASSERT(idx.row() == m_displaySet.at(idx.internalId()).row,
+    QTC_ASSERT(idx.row() == m_displaySet.at(idx.internalId()).row,
         return QModelIndex());
     MODEL_DEBUG(" -> " << idx << " (A) ");
     return idx;
@@ -1071,15 +1071,15 @@ QModelIndex WatchHandler::parent(const QModelIndex &idx) const
     }
     MODEL_DEBUG("PARENT " << idx);
     int currentIndex = idx.internalId();
-    QWB_ASSERT(checkIndex(currentIndex), return QModelIndex());
-    QWB_ASSERT(idx.row() == m_displaySet.at(currentIndex).row,
+    QTC_ASSERT(checkIndex(currentIndex), return QModelIndex());
+    QTC_ASSERT(idx.row() == m_displaySet.at(currentIndex).row,
         MODEL_DEBUG("IDX: " << idx << toString(); return QModelIndex()));
     int parentIndex = m_displaySet.at(currentIndex).parentIndex;
     if (parentIndex < 0) {
         MODEL_DEBUG(" -> " << QModelIndex() << " (2) ");
         return QModelIndex();
     }
-    QWB_ASSERT(checkIndex(parentIndex), return QModelIndex());
+    QTC_ASSERT(checkIndex(parentIndex), return QModelIndex());
     QModelIndex parent = 
         createIndex(m_displaySet.at(parentIndex).row, 0, parentIndex);
     MODEL_DEBUG(" -> " << parent);
@@ -1094,7 +1094,7 @@ int WatchHandler::rowCount(const QModelIndex &idx) const
         return 0;
     }
     int thisIndex = idx.internalId();
-    QWB_ASSERT(checkIndex(thisIndex), return 0);
+    QTC_ASSERT(checkIndex(thisIndex), return 0);
     if (idx.row() == -1 && idx.column() == -1) {
         MODEL_DEBUG(" -> " << 3 << " (B) ");
         return 1;
@@ -1129,7 +1129,7 @@ int WatchHandler::columnCount(const QModelIndex &idx) const
         return 0;
     }
     MODEL_DEBUG(" -> " << 3 << " (B) ");
-    QWB_ASSERT(checkIndex(idx.internalId()), return 3);
+    QTC_ASSERT(checkIndex(idx.internalId()), return 3);
     return 3;
 }
 
@@ -1139,7 +1139,7 @@ bool WatchHandler::hasChildren(const QModelIndex &idx) const
     bool base = rowCount(idx) > 0 && columnCount(idx) > 0;
     MODEL_DEBUG("HAS CHILDREN: " << idx << base);
     return base;
-    QWB_ASSERT(checkIndex(idx.internalId()), return false);
+    QTC_ASSERT(checkIndex(idx.internalId()), return false);
     const WatchData &data = m_displaySet.at(idx.internalId());
     MODEL_DEBUG("HAS CHILDREN: " << idx << data.toString());
     return data.childCount > 0; // || data.childIndex.size() > 0;
diff --git a/src/plugins/designer/cpp/formclasswizardparameters.cpp b/src/plugins/designer/cpp/formclasswizardparameters.cpp
index 7dd0056186a2dfc9440dfc835671b69970dbb2c5..10dda881db93fe54c1978f92506de35254776eba 100644
--- a/src/plugins/designer/cpp/formclasswizardparameters.cpp
+++ b/src/plugins/designer/cpp/formclasswizardparameters.cpp
@@ -156,7 +156,7 @@ bool FormClassWizardParameters::generateCpp(QString *header, QString *source, in
     if (languageChange) {
         sourceStr  << '\n' << namespaceIndent << "void " << unqualifiedClassName << "::" << "changeEvent(QEvent *e)\n"
         << namespaceIndent << "{\n"
-        << namespaceIndent << indent << "switch(e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n"
+        << namespaceIndent << indent << "switch (e->type()) {\n" << namespaceIndent << indent << "case QEvent::LanguageChange:\n"
         << namespaceIndent << indent << indent;
         if (embedding != InheritedUiClass)
             sourceStr << uiMemberC << (embedding == PointerAggregatedUiClass ? "->" : ".");
diff --git a/src/plugins/designer/formeditorw.cpp b/src/plugins/designer/formeditorw.cpp
index c156dec1b7f5416cf3a94cde812613e0f08465a4..a29759f0e385cf6900188ab59fba316178565ec7 100644
--- a/src/plugins/designer/formeditorw.cpp
+++ b/src/plugins/designer/formeditorw.cpp
@@ -472,7 +472,7 @@ Core::IActionContainer *FormEditorW::createPreviewStyleMenu(Core::ActionManagerI
     const QString deviceProfilePrefix = QLatin1String("DeviceProfile");
     const QChar dot = QLatin1Char('.');
 
-    foreach(QAction* a, actions) {
+    foreach (QAction* a, actions) {
         QString name = menuId;
         name += dot;
         const QVariant data = a->data();
diff --git a/src/plugins/find/basetextfind.cpp b/src/plugins/find/basetextfind.cpp
index 6598a47e6f3085409ba899c3f13f4903dd3ffe55..53578792d7046ec369800b6d6e363ee304261840 100644
--- a/src/plugins/find/basetextfind.cpp
+++ b/src/plugins/find/basetextfind.cpp
@@ -101,7 +101,7 @@ QString BaseTextFind::currentFindString() const
         cursor.movePosition(QTextCursor::StartOfWord);
         cursor.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor);
         QString s = cursor.selectedText();
-        foreach(QChar c, s) {
+        foreach (QChar c, s) {
             if (!c.isLetterOrNumber() && c != QLatin1Char('_')) {
                 s.clear();
                 break;
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index ebce0f7c452dbf9624a7186d3aded21a0fe056d0..ec67478a259b6443867eb64d91e711da138f44ec 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -161,7 +161,7 @@ GitPlugin::~GitPlugin()
     }
 
     if (!m_editorFactories.empty()) {
-        foreach(Core::IEditorFactory* pf, m_editorFactories)
+        foreach (Core::IEditorFactory* pf, m_editorFactories)
             removeObject(pf);
         qDeleteAll(m_editorFactories);
     }
diff --git a/src/plugins/help/contentstoolwindow.cpp b/src/plugins/help/contentstoolwindow.cpp
index ccd540bfef76b4041a6fa18ac4927ca70d6b51d5..3c14d7f1b8ef3202240a9d8c1008b325d86ed545 100644
--- a/src/plugins/help/contentstoolwindow.cpp
+++ b/src/plugins/help/contentstoolwindow.cpp
@@ -126,7 +126,7 @@ void ContentsToolWindow::contentsDone()
 {    
     m_widget->setCursor(QCursor(Qt::WaitCursor));
     QList<QPair<QString, ContentList> > contentList = helpEngine->contents();
-    for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
+    for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
         QTreeWidgetItem *newEntry;
         QTreeWidgetItem *contentEntry;
         QStack<QTreeWidgetItem*> stack;
@@ -135,7 +135,7 @@ void ContentsToolWindow::contentsDone()
         bool root = false;
 
         QTreeWidgetItem *lastItem[64];
-        for(int j = 0; j < 64; ++j)
+        for (int j = 0; j < 64; ++j)
             lastItem[j] = 0;
 
         ContentList lst = (*it).second;
@@ -149,19 +149,18 @@ void ContentsToolWindow::contentsDone()
                 stack.push(newEntry);
                 depth = 1;
                 root = true;
-            }
-            else{
-                if((item.depth > depth) && root) {
+            } else {
+                if (item.depth > depth && root) {
                     depth = item.depth;
                     stack.push(contentEntry);
                 }
-                if(item.depth == depth) {
+                if (item.depth == depth) {
                     contentEntry = new QTreeWidgetItem(stack.top(), lastItem[ depth ]);
                     lastItem[ depth ] = contentEntry;
                     contentEntry->setText(0, item.title);
                     contentEntry->setData(0, LinkRole, item.reference);
                 }
-                else if(item.depth < depth) {
+                else if (item.depth < depth) {
                     stack.pop();
                     depth--;
                     item = *(--it);
diff --git a/src/plugins/help/helpengine.cpp b/src/plugins/help/helpengine.cpp
index db259f7aa0328cbf5c2a900f8fa2df9831b5315c..44501d25abcb8bcff9065a509a16983e639e4ffa 100644
--- a/src/plugins/help/helpengine.cpp
+++ b/src/plugins/help/helpengine.cpp
@@ -296,7 +296,7 @@ quint32 HelpEngine::getFileAges()
     QStringList::const_iterator i = addDocuFiles.begin();
 
     quint32 fileAges = 0;
-    for(; i != addDocuFiles.end(); ++i) {
+    for (; i != addDocuFiles.end(); ++i) {
         QFileInfo fi(*i);
         if (fi.exists())
             fileAges += fi.lastModified().toTime_t();
@@ -364,7 +364,7 @@ void TitleMapThread::run()
     bool needRebuild = false;
     if (Config::configuration()->profileName() == QLatin1String("default")) {
         const QStringList docuFiles = Config::configuration()->docFiles();
-        for(QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
+        for (QStringList::ConstIterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
             if (!QFile::exists(*it)) {
                 Config::configuration()->saveProfile(Profile::createDefaultProfile());
                 Config::configuration()->loadDefaultProfile();
@@ -383,7 +383,7 @@ void TitleMapThread::run()
         getAllContents();
     
     titleMap.clear();
-    for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
+    for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
         ContentList lst = (*it).second;
         foreach (ContentItem item, lst) {
             titleMap[item.reference] = item.title.trimmed();
@@ -430,7 +430,7 @@ void TitleMapThread::buildContentDict()
     QStringList docuFiles = Config::configuration()->docFiles();
 
     quint32 fileAges = 0;
-    for(QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
+    for (QStringList::iterator it = docuFiles.begin(); it != docuFiles.end(); it++) {
         QFile file(*it);
         if (!file.exists()) {
 #ifdef _SHOW_ERRORS_
@@ -441,7 +441,7 @@ void TitleMapThread::buildContentDict()
         }
         fileAges += QFileInfo(file).lastModified().toTime_t();
         DocuParser *handler = DocuParser::createParser(*it);
-        if(!handler) {
+        if (!handler) {
 #ifdef _SHOW_ERRORS_
             emit errorOccured(tr("Documentation file %1 is not compatible!\n"
                 "Skipping file.").arg(QFileInfo(file).absoluteFilePath()));
@@ -450,7 +450,7 @@ void TitleMapThread::buildContentDict()
         }
         bool ok = handler->parse(&file);
         file.close();
-        if(ok) {
+        if (ok) {
             contentList += qMakePair(*it, QList<ContentItem>(handler->getContentItems()));
             delete handler;
         } else {
@@ -469,7 +469,7 @@ void TitleMapThread::buildContentDict()
     if (contentOut.open(QFile::WriteOnly)) {
         QDataStream s(&contentOut);
         s << fileAges;
-        for(QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
+        for (QList<QPair<QString, ContentList> >::Iterator it = contentList.begin(); it != contentList.end(); ++it) {
             s << *it;
         }
         contentOut.close();
@@ -542,12 +542,12 @@ void IndexThread::buildKeywordDB()
     QStringList::iterator i = addDocuFiles.begin();
 
     int steps = 0;
-    for(; i != addDocuFiles.end(); i++)
+    for (; i != addDocuFiles.end(); i++)
         steps += QFileInfo(*i).size();
 
     QList<IndexKeyword> lst;
     quint32 fileAges = 0;
-    for(i = addDocuFiles.begin(); i != addDocuFiles.end(); i++){
+    for (i = addDocuFiles.begin(); i != addDocuFiles.end(); i++) {
         QFile file(*i);
         if (!file.exists()) {
 #ifdef _SHOW_ERRORS_
@@ -560,7 +560,7 @@ void IndexThread::buildKeywordDB()
         DocuParser *handler = DocuParser::createParser(*i);
         bool ok = handler->parse(&file);
         file.close();
-        if(!ok){
+        if (!ok){
 #ifdef _SHOW_ERRORS_
             QString msg = QString::fromLatin1("In file %1:\n%2")
                           .arg(QFileInfo(file).absoluteFilePath())
diff --git a/src/plugins/help/helpplugin.cpp b/src/plugins/help/helpplugin.cpp
index c96fcf28472481f727570557de9e8bb98289fe12..972ab7d6a6b16df8ccbad11f0e9885d878d68d84 100644
--- a/src/plugins/help/helpplugin.cpp
+++ b/src/plugins/help/helpplugin.cpp
@@ -512,7 +512,7 @@ void HelpPlugin::activateContext()
     // case 1 sidebar shown and has focus, we show whatever we have in the
     // sidebar in big
     RightPanePlaceHolder* placeHolder = RightPanePlaceHolder::current();
-    if(placeHolder && Core::RightPaneWidget::instance()->hasFocus()) {
+    if (placeHolder && Core::RightPaneWidget::instance()->hasFocus()) {
         switchToHelpMode();
         return;
     }
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp
index dc28901b7050540b8dc028165ccf658308a0c493..b1f4494ce5ec23c559992f0d17944e0d1f7e7334 100644
--- a/src/plugins/perforce/perforceplugin.cpp
+++ b/src/plugins/perforce/perforceplugin.cpp
@@ -561,10 +561,9 @@ void PerforcePlugin::submit()
 
     QStringList stdOutLines = result2.stdOut.split(QLatin1Char('\n'));
     QStringList depotFileNames;
-    foreach(const QString &line, stdOutLines) {
-        if (line.startsWith("... depotFile")) {
+    foreach (const QString &line, stdOutLines) {
+        if (line.startsWith("... depotFile"))
             depotFileNames.append(line.mid(14));
-        }
     }
     if (depotFileNames.isEmpty()) {
         showOutput(tr("Project has no files"));
@@ -1225,7 +1224,7 @@ PerforcePlugin::~PerforcePlugin()
     }
 
     if (!m_editorFactories.empty()) {
-        foreach(Core::IEditorFactory* pf, m_editorFactories)
+        foreach (Core::IEditorFactory *pf, m_editorFactories)
             removeObject(pf);
         qDeleteAll(m_editorFactories);
         m_editorFactories.clear();
diff --git a/src/plugins/projectexplorer/abstractprocessstep.cpp b/src/plugins/projectexplorer/abstractprocessstep.cpp
index 06b40135c1262da635ecd62f21b5ec24364c7e5f..965a8b4c0c4649346008f2a59547df407c22f19b 100644
--- a/src/plugins/projectexplorer/abstractprocessstep.cpp
+++ b/src/plugins/projectexplorer/abstractprocessstep.cpp
@@ -112,7 +112,7 @@ bool AbstractProcessStep::init(const QString &name)
 void AbstractProcessStep::run(QFutureInterface<bool> & fi)
 {
     m_futureInterface = &fi;
-    if(!m_enabled) {
+    if (!m_enabled) {
         fi.reportResult(true);
         return;
     }
@@ -136,7 +136,7 @@ void AbstractProcessStep::run(QFutureInterface<bool> & fi)
             Qt::DirectConnection);
 
     m_process->start(m_command, m_arguments);
-    if(!m_process->waitForStarted()) {
+    if (!m_process->waitForStarted()) {
         processStartupFailed();
         delete m_process;
         m_process = 0;
@@ -188,8 +188,7 @@ void AbstractProcessStep::processStartupFailed()
 void AbstractProcessStep::processReadyReadStdOutput()
 {
     m_process->setReadChannel(QProcess::StandardOutput);
-    while(m_process->canReadLine())
-    {
+    while (m_process->canReadLine()) {
         QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed();
         stdOut(line);
     }
@@ -203,8 +202,7 @@ void AbstractProcessStep::stdOut(const QString &line)
 void AbstractProcessStep::processReadyReadStdError()
 {
     m_process->setReadChannel(QProcess::StandardError);
-    while (m_process->canReadLine())
-    {
+    while (m_process->canReadLine()) {
         QString line = QString::fromLocal8Bit(m_process->readLine()).trimmed();
         stdError(line);
     }
@@ -217,7 +215,7 @@ void AbstractProcessStep::stdError(const QString &line)
 
 void AbstractProcessStep::checkForCancel()
 {
-    if(m_futureInterface->isCanceled() && m_timer->isActive()) {
+    if (m_futureInterface->isCanceled() && m_timer->isActive()) {
         m_timer->stop();
         m_process->terminate();
         m_process->waitForFinished(5000);
@@ -228,13 +226,12 @@ void AbstractProcessStep::checkForCancel()
 void AbstractProcessStep::slotProcessFinished(int, QProcess::ExitStatus)
 {
     QString line = QString::fromLocal8Bit(m_process->readAllStandardError()).trimmed();
-    if (!line.isEmpty()) {
+    if (!line.isEmpty())
         stdOut(line);
-    }
 
     line = QString::fromLocal8Bit(m_process->readAllStandardOutput()).trimmed();
-    if (!line.isEmpty()) {
+    if (!line.isEmpty())
         stdError(line);
-    }
+
     m_eventLoop->exit(0);
 }
diff --git a/src/plugins/projectexplorer/buildconfiguration.cpp b/src/plugins/projectexplorer/buildconfiguration.cpp
index c9090723a19b05d2d2b944ad778df049ddcfdcb2..c960cb0e34c09828faac59f2c153ca515d743be7 100644
--- a/src/plugins/projectexplorer/buildconfiguration.cpp
+++ b/src/plugins/projectexplorer/buildconfiguration.cpp
@@ -42,9 +42,8 @@ BuildConfiguration::BuildConfiguration(const QString &name)
 }
 
 BuildConfiguration::BuildConfiguration(const QString &name, BuildConfiguration *source)
-    :m_values(source->m_values), m_name(name)
+    : m_values(source->m_values), m_name(name)
 {
-
 }
 
 QString BuildConfiguration::name() const
@@ -71,7 +70,7 @@ void BuildConfiguration::setDisplayName(const QString &name)
 QVariant BuildConfiguration::getValue(const QString & key) const
 {
     QHash<QString, QVariant>::const_iterator it = m_values.find(key);
-    if(it != m_values.constEnd())
+    if (it != m_values.constEnd())
         return *it;
     else
         return QVariant();
@@ -86,7 +85,7 @@ void BuildConfiguration::setValuesFromMap(QMap<QString, QVariant> map)
 {
     QMap<QString, QVariant>::const_iterator it, end;
     end = map.constEnd();
-    for(it = map.constBegin(); it != end; ++it)
+    for (it = map.constBegin(); it != end; ++it)
         setValue(it.key(), it.value());
 }
 
@@ -95,7 +94,7 @@ QMap<QString, QVariant> BuildConfiguration::toMap() const
     QMap<QString, QVariant> result;
     QHash<QString, QVariant>::const_iterator it, end;
     end = m_values.constEnd();
-    for(it = m_values.constBegin(); it != end; ++it)
+    for (it = m_values.constBegin(); it != end; ++it)
         result.insert(it.key(), it.value());
     return result;
 }
diff --git a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp
index a713fdc773ea3f494c083850b29db6bb9ba9929f..2c1434534be646963078c679bc78caa11343b5b4 100644
--- a/src/plugins/projectexplorer/buildsettingspropertiespage.cpp
+++ b/src/plugins/projectexplorer/buildsettingspropertiespage.cpp
@@ -142,7 +142,7 @@ BuildSettingsWidget::BuildSettingsWidget(Project *project)
 void BuildSettingsWidget::buildConfigurationDisplayNameChanged(const QString &buildConfiguration)
 {
     QTreeWidgetItem *rootItem = m_ui.buildSettingsList->invisibleRootItem();
-    for(int i = 0; i < rootItem->childCount(); ++i) {
+    for (int i = 0; i < rootItem->childCount(); ++i) {
         QTreeWidgetItem *child = rootItem->child(i);
         if (child->data(0, Qt::UserRole).toString() == buildConfiguration) {
             child->setText(0, m_project->displayNameFor(buildConfiguration));
@@ -334,7 +334,7 @@ void BuildSettingsWidget::createConfiguration()
 {
     bool ok;
     QString newBuildConfiguration = QInputDialog::getText(this, tr("New configuration"), tr("New Configuration Name:"), QLineEdit::Normal, QString(), &ok);
-    if(!ok || newBuildConfiguration.isEmpty())
+    if (!ok || newBuildConfiguration.isEmpty())
         return;
 
     QString newDisplayName = newBuildConfiguration;
@@ -342,22 +342,20 @@ void BuildSettingsWidget::createConfiguration()
     const QStringList &buildConfigurations = m_project->buildConfigurations();
     if (buildConfigurations.contains(newBuildConfiguration)) {
         int i = 2;
-        while(buildConfigurations.contains(newBuildConfiguration + QString::number(i))) {
+        while (buildConfigurations.contains(newBuildConfiguration + QString::number(i)))
             ++i;
-        }
         newBuildConfiguration += QString::number(i);
     }
 
     // Check that we don't have a configuration with the same displayName
     QStringList displayNames;
-    foreach(const QString &bc, buildConfigurations)
+    foreach (const QString &bc, buildConfigurations)
         displayNames << m_project->displayNameFor(bc);
 
     if (displayNames.contains(newDisplayName)) {
         int i = 2;
-        while(displayNames.contains(newDisplayName + QString::number(i))) {
+        while (displayNames.contains(newDisplayName + QString::number(i)))
             ++i;
-        }
         newDisplayName += QString::number(i);
     }
 
@@ -407,11 +405,11 @@ void BuildSettingsWidget::setActiveConfiguration(const QString &configuration)
 
 void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration)
 {
-    if(sourceConfiguration.isEmpty())
+    if (sourceConfiguration.isEmpty())
         return;
 
     QString newBuildConfiguration = QInputDialog::getText(this, tr("Clone configuration"), tr("New Configuration Name:"));
-    if(newBuildConfiguration.isEmpty())
+    if (newBuildConfiguration.isEmpty())
         return;
 
     QString newDisplayName = newBuildConfiguration;
@@ -419,22 +417,20 @@ void BuildSettingsWidget::cloneConfiguration(const QString &sourceConfiguration)
     const QStringList &buildConfigurations = m_project->buildConfigurations();
     if (buildConfigurations.contains(newBuildConfiguration)) {
         int i = 2;
-        while(buildConfigurations.contains(newBuildConfiguration + QString::number(i))) {
+        while (buildConfigurations.contains(newBuildConfiguration + QString::number(i)))
             ++i;
-        }
         newBuildConfiguration += QString::number(i);
     }
 
     // Check that we don't have a configuration with the same displayName
     QStringList displayNames;
-    foreach(const QString &bc, buildConfigurations)
+    foreach (const QString &bc, buildConfigurations)
         displayNames << m_project->displayNameFor(bc);
 
     if (displayNames.contains(newDisplayName)) {
         int i = 2;
-        while(displayNames.contains(newDisplayName + QString::number(i))) {
+        while (displayNames.contains(newDisplayName + QString::number(i)))
             ++i;
-        }
         newDisplayName += QString::number(i);
     }
 
diff --git a/src/plugins/projectexplorer/buildstep.cpp b/src/plugins/projectexplorer/buildstep.cpp
index 474306dd57a840dbac86ca0e5063b9694488491d..5367b50812d4639c50f1ddfd0ac12e5aecac1252 100644
--- a/src/plugins/projectexplorer/buildstep.cpp
+++ b/src/plugins/projectexplorer/buildstep.cpp
@@ -60,8 +60,8 @@ void BuildStep::addBuildConfiguration(const QString &name)
 
 void BuildStep::removeBuildConfiguration(const QString &name)
 {
-    for(int i = 0; i != m_buildConfigurations.size(); ++i)
-        if(m_buildConfigurations.at(i)->name() == name) {
+    for (int i = 0; i != m_buildConfigurations.size(); ++i)
+        if (m_buildConfigurations.at(i)->name() == name) {
             delete m_buildConfigurations.at(i);
             m_buildConfigurations.removeAt(i);
             break;
@@ -70,8 +70,8 @@ void BuildStep::removeBuildConfiguration(const QString &name)
 
 void BuildStep::copyBuildConfiguration(const QString &source, const QString &dest)
 {
-    for(int i = 0; i != m_buildConfigurations.size(); ++i)
-        if(m_buildConfigurations.at(i)->name() == source)
+    for (int i = 0; i != m_buildConfigurations.size(); ++i)
+        if (m_buildConfigurations.at(i)->name() == source)
             m_buildConfigurations.push_back(new BuildConfiguration(dest, m_buildConfigurations.at(i)));
 }
 
diff --git a/src/plugins/projectexplorer/buildstepspage.cpp b/src/plugins/projectexplorer/buildstepspage.cpp
index 6578d76e351fc0957d40faf93c8a7ff92f1618d8..84f23c46bbf4d0c7695031b39c7555a96e6c73ee 100644
--- a/src/plugins/projectexplorer/buildstepspage.cpp
+++ b/src/plugins/projectexplorer/buildstepspage.cpp
@@ -119,17 +119,17 @@ void BuildStepsPage::init(const QString &buildConfiguration)
 /* switch from one tree item / build step to another */
 void BuildStepsPage::updateBuildStepWidget(QTreeWidgetItem *newItem, QTreeWidgetItem *oldItem)
 {
-    if(oldItem == newItem)
+    if (oldItem == newItem)
         return;
     Q_ASSERT(m_pro);
 
-    if(newItem) {
+    if (newItem) {
         int row = m_ui->buildSettingsList->indexOfTopLevelItem(newItem);
         m_ui->buildSettingsWidget->setCurrentIndex(row);
         BuildStepConfigWidget *widget = qobject_cast<BuildStepConfigWidget *>(m_ui->buildSettingsWidget->currentWidget());
         Q_ASSERT(widget);
         if (widget)
-         widget->init(m_configuration);
+            widget->init(m_configuration);
     }
     updateBuildStepButtonsState();
 }
@@ -151,11 +151,11 @@ void BuildStepsPage::updateAddBuildStepMenu()
     QMenu *menu = m_ui->buildStepAddButton->menu();
     m_addBuildStepHash.clear();
     menu->clear();
-    if(!map.isEmpty()) {
+    if (!map.isEmpty()) {
         QStringList names;
         QMap<QString, QPair<QString, IBuildStepFactory *> >::const_iterator it, end;
         end = map.constEnd();
-        for(it = map.constBegin(); it != end; ++it) {
+        for (it = map.constBegin(); it != end; ++it) {
             QAction *action = menu->addAction(it.key());
             connect(action, SIGNAL(triggered()),
                     this, SLOT(addBuildStep()));
@@ -167,7 +167,7 @@ void BuildStepsPage::updateAddBuildStepMenu()
 
 void BuildStepsPage::addBuildStep()
 {
-    if(QAction *action = qobject_cast<QAction *>(sender())) {
+    if (QAction *action = qobject_cast<QAction *>(sender())) {
         QPair<QString, IBuildStepFactory *> pair = m_addBuildStepHash.value(action);
         BuildStep *newStep = pair.second->create(m_pro, pair.first);
         m_pro->insertBuildStep(0, newStep);
@@ -182,7 +182,7 @@ void BuildStepsPage::addBuildStep()
 void BuildStepsPage::removeBuildStep()
 {
     int pos = m_ui->buildSettingsList->currentIndex().row();
-    if(m_pro->buildSteps().at(pos)->immutable())
+    if (m_pro->buildSteps().at(pos)->immutable())
         return;
     bool blockSignals = m_ui->buildSettingsList->blockSignals(true);
     delete m_ui->buildSettingsList->invisibleRootItem()->takeChild(pos);
@@ -190,7 +190,7 @@ void BuildStepsPage::removeBuildStep()
     QWidget *widget = m_ui->buildSettingsWidget->widget(pos);
     m_ui->buildSettingsWidget->removeWidget(widget);
     delete widget;
-    if(pos < m_ui->buildSettingsList->invisibleRootItem()->childCount())
+    if (pos < m_ui->buildSettingsList->invisibleRootItem()->childCount())
         m_ui->buildSettingsList->setCurrentItem(m_ui->buildSettingsList->invisibleRootItem()->child(pos));
     else
         m_ui->buildSettingsList->setCurrentItem(m_ui->buildSettingsList->invisibleRootItem()->child(pos - 1));
@@ -201,11 +201,11 @@ void BuildStepsPage::removeBuildStep()
 void BuildStepsPage::upBuildStep()
 {
     int pos = m_ui->buildSettingsList->currentIndex().row();
-    if(pos < 1)
+    if (pos < 1)
         return;
-    if(pos > m_ui->buildSettingsList->invisibleRootItem()->childCount()-1)
+    if (pos > m_ui->buildSettingsList->invisibleRootItem()->childCount()-1)
         return;
-    if(m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos-1)->immutable())
+    if (m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos-1)->immutable())
         return;
 
     bool blockSignals = m_ui->buildSettingsList->blockSignals(true);
@@ -220,11 +220,11 @@ void BuildStepsPage::upBuildStep()
 void BuildStepsPage::downBuildStep()
 {
     int pos = m_ui->buildSettingsList->currentIndex().row() + 1;
-    if(pos < 1)
+    if (pos < 1)
         return;
-    if(pos > m_ui->buildSettingsList->invisibleRootItem()->childCount() - 1)
+    if (pos > m_ui->buildSettingsList->invisibleRootItem()->childCount() - 1)
         return;
-    if(m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos - 1)->immutable())
+    if (m_pro->buildSteps().at(pos)->immutable() && m_pro->buildSteps().at(pos - 1)->immutable())
         return;
 
     bool blockSignals = m_ui->buildSettingsList->blockSignals(true);
@@ -238,7 +238,7 @@ void BuildStepsPage::downBuildStep()
 
 void BuildStepsPage::changeEvent(QEvent *e)
 {
-    switch(e->type()) {
+    switch (e->type()) {
     case QEvent::LanguageChange:
         m_ui->retranslateUi(this);
         break;
diff --git a/src/plugins/projectexplorer/environment.cpp b/src/plugins/projectexplorer/environment.cpp
index a8470d3df5d11579d2c5a20cc3f6646013bbeef3..b428ed3a92d79b29e85f12f77b8ef245b39dea5d 100644
--- a/src/plugins/projectexplorer/environment.cpp
+++ b/src/plugins/projectexplorer/environment.cpp
@@ -45,7 +45,7 @@ QList<EnvironmentItem> EnvironmentItem::fromStringList(QStringList list)
     QList<EnvironmentItem> result;
     foreach (const QString &string, list) {
         int pos = string.indexOf(QLatin1Char('='));
-        if(pos == -1) {
+        if (pos == -1) {
             EnvironmentItem item(string, "");
             item.unset = true;
             result.append(item);
@@ -61,7 +61,7 @@ QStringList EnvironmentItem::toStringList(QList<EnvironmentItem> list)
 {
     QStringList result;
     foreach (const EnvironmentItem &item, list) {
-        if(item.unset)
+        if (item.unset)
             result << QString(item.name);
         else
             result << QString(item.name + '=' + item.value);
@@ -71,14 +71,13 @@ QStringList EnvironmentItem::toStringList(QList<EnvironmentItem> list)
 
 Environment::Environment()
 {
-
 }
 
 Environment::Environment(QStringList env)
 {
-    foreach(QString s, env) {
+    foreach (const QString &s, env) {
         int i = s.indexOf("=");
-        if (i >=0 ) {
+        if (i >= 0) {
 #ifdef Q_OS_WIN
             m_values.insert(s.left(i).toUpper(), s.mid(i+1));
 #else
@@ -196,13 +195,13 @@ QString Environment::searchInPath(QString executable)
         executable.append(QLatin1String(".exe"));
 #endif
     const QChar slash = QLatin1Char('/');
-    foreach(const QString &p, path()) {
+    foreach (const QString &p, path()) {
 //        qDebug()<<"trying"<<path + '/' + executable;
         QString fp = p;
         fp += slash;
         fp += executable;
         const QFileInfo fi(fp);
-        if(fi.exists()) {
+        if (fi.exists()) {
 //            qDebug()<<"returning "<<fi.absoluteFilePath();
             return fi.absoluteFilePath();
         }
@@ -248,7 +247,7 @@ Environment::const_iterator Environment::constEnd() const
 Environment::const_iterator Environment::find(const QString &name)
 {
     QMap<QString, QString>::const_iterator it = m_values.constFind(name);
-    if(it == m_values.constEnd())
+    if (it == m_values.constEnd())
         return constEnd();
     else
         return it;
@@ -263,24 +262,24 @@ void Environment::modify(const QList<EnvironmentItem> & list)
 {
     Environment resultEnvironment = *this;
     foreach (const EnvironmentItem &item, list) {
-        if(item.unset) {
+        if (item.unset) {
             resultEnvironment.unset(item.name);
         } else {
             // TODO use variable expansion
             QString value = item.value;
-            for(int i=0; i < value.size(); ++i) {
-                if(value.at(i) == QLatin1Char('$')) {
-                    if((i + 1) < value.size()) {
+            for (int i=0; i < value.size(); ++i) {
+                if (value.at(i) == QLatin1Char('$')) {
+                    if ((i + 1) < value.size()) {
                         const QChar &c = value.at(i+1);
                         int end = -1;
                         if (c == '(')
                             end = value.indexOf(')', i);
-                        else if (c=='{')
+                        else if (c == '{')
                             end = value.indexOf('}', i);
-                        if(end != -1) {
+                        if (end != -1) {
                             const QString &name = value.mid(i+2, end-i-2);
                             Environment::const_iterator it = find(name);
-                            if(it != constEnd())
+                            if (it != constEnd())
                                 value.replace(i, end-i+1, it.value());
                         }
                     }
@@ -334,7 +333,7 @@ QStringList Environment::parseCombinedArgString(const QString &program)
 QString Environment::joinArgumentList(const QStringList &arguments)
 {
     QString result;
-    foreach(QString arg, arguments) {
+    foreach (QString arg, arguments) {
         if (!result.isEmpty())
             result += QLatin1Char(' ');
         arg.replace(QLatin1String("\""), QLatin1String("\"\"\""));
diff --git a/src/plugins/projectexplorer/environmenteditmodel.cpp b/src/plugins/projectexplorer/environmenteditmodel.cpp
index 2405d86998e3760105706d734ecc84613202163c..68bb6f5fdfb9dac423cfda37ca757c67576d9a25 100644
--- a/src/plugins/projectexplorer/environmenteditmodel.cpp
+++ b/src/plugins/projectexplorer/environmenteditmodel.cpp
@@ -38,11 +38,13 @@ using namespace ProjectExplorer;
 EnvironmentModel::EnvironmentModel()
     : m_mergedEnvironments(false)
 {}
-EnvironmentModel::~EnvironmentModel() {}
+
+EnvironmentModel::~EnvironmentModel()
+{}
 
 QString EnvironmentModel::indexToVariable(const QModelIndex &index) const
 {
-    if(m_mergedEnvironments)
+    if (m_mergedEnvironments)
         return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
     else
         return m_items.at(index.row()).name;
@@ -53,7 +55,7 @@ void EnvironmentModel::updateResultEnvironment()
     m_resultEnvironment = m_baseEnvironment;
     m_resultEnvironment.modify(m_items);
     foreach (const EnvironmentItem &item, m_items) {
-        if(item.unset) {
+        if (item.unset) {
             m_resultEnvironment.set(item.name, "<UNSET>");
         }
     }
@@ -68,10 +70,10 @@ void EnvironmentModel::setBaseEnvironment(const ProjectExplorer::Environment &en
 
 void EnvironmentModel::setMergedEnvironments(bool b)
 {
-    if(m_mergedEnvironments == b)
+    if (m_mergedEnvironments == b)
         return;
     m_mergedEnvironments = b;
-    if(b)
+    if (b)
         updateResultEnvironment();
     reset();
 }
@@ -96,48 +98,46 @@ int EnvironmentModel::columnCount(const QModelIndex &parent) const
 
 bool EnvironmentModel::changes(const QString &name) const
 {
-    foreach(const EnvironmentItem& item, m_items) {
-        if(item.name == name) {
+    foreach (const EnvironmentItem& item, m_items)
+        if (item.name == name)
             return true;
-        }
-    }
     return false;
 }
 
 QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
 {
-    if((role == Qt::DisplayRole || role == Qt::EditRole) && index.isValid()) {
-        if((m_mergedEnvironments && index.row() >= m_resultEnvironment.size()) ||
+    if ((role == Qt::DisplayRole || role == Qt::EditRole) && index.isValid()) {
+        if ((m_mergedEnvironments && index.row() >= m_resultEnvironment.size()) ||
            (!m_mergedEnvironments && index.row() >= m_items.count())) {
             return QVariant();
         }
 
-        if(index.column() == 0) {
-            if(m_mergedEnvironments) {
+        if (index.column() == 0) {
+            if (m_mergedEnvironments) {
                 return m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
             } else {
                 return m_items.at(index.row()).name;
             }
-        } else if(index.column() == 1) {
-            if(m_mergedEnvironments) {
-                if(role == Qt::EditRole) {
+        } else if (index.column() == 1) {
+            if (m_mergedEnvironments) {
+                if (role == Qt::EditRole) {
                     int pos = findInChanges(indexToVariable(index));
-                    if(pos != -1)
+                    if (pos != -1)
                         return m_items.at(pos).value;
                 }
                 return m_resultEnvironment.value(m_resultEnvironment.constBegin() + index.row());
             } else {
-                if(m_items.at(index.row()).unset)
+                if (m_items.at(index.row()).unset)
                     return "<UNSET>";
                 else
                     return m_items.at(index.row()).value;
             }
         }
     }
-    if(role == Qt::FontRole) {
-        if(m_mergedEnvironments) {
+    if (role == Qt::FontRole) {
+        if (m_mergedEnvironments) {
             // check wheter this environment variable exists in m_items
-            if(changes(m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()))) {
+            if (changes(m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row()))) {
                 QFont f;
                 f.setBold(true);
                 return QVariant(f);
@@ -157,7 +157,7 @@ Qt::ItemFlags EnvironmentModel::flags(const QModelIndex &index) const
 
 bool EnvironmentModel::hasChildren(const QModelIndex &index) const
 {
-    if(!index.isValid())
+    if (!index.isValid())
         return true;
     else
         return false;
@@ -165,14 +165,14 @@ bool EnvironmentModel::hasChildren(const QModelIndex &index) const
 
 QVariant EnvironmentModel::headerData(int section, Qt::Orientation orientation, int role) const
 {
-    if(orientation == Qt::Vertical || role != Qt::DisplayRole)
+    if (orientation == Qt::Vertical || role != Qt::DisplayRole)
         return QVariant();
     return section == 0 ? tr("Variable") : tr("Value");
 }
 
 QModelIndex EnvironmentModel::index(int row, int column, const QModelIndex &parent) const
 {
-    if(!parent.isValid())
+    if (!parent.isValid())
         return createIndex(row, column, 0);
     return QModelIndex();
 }
@@ -188,16 +188,16 @@ QModelIndex EnvironmentModel::parent(const QModelIndex &index) const
 /// *****************
 int EnvironmentModel::findInChanges(const QString &name) const
 {
-    for(int i=0; i<m_items.size(); ++i)
-        if(m_items.at(i).name == name)
+    for (int i=0; i<m_items.size(); ++i)
+        if (m_items.at(i).name == name)
             return i;
     return -1;
 }
 
 int EnvironmentModel::findInChangesInsertPosition(const QString &name) const
 {
-    for(int i=0; i<m_items.size(); ++i)
-        if(m_items.at(i).name > name)
+    for (int i=0; i<m_items.size(); ++i)
+        if (m_items.at(i).name > name)
             return i;
     return m_items.size();
 }
@@ -206,8 +206,8 @@ int EnvironmentModel::findInResult(const QString &name) const
 {
     Environment::const_iterator it;
     int i = 0;
-    for(it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
-        if(m_resultEnvironment.key(it) == name)
+    for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
+        if (m_resultEnvironment.key(it) == name)
             return i;
     return -1;
 }
@@ -216,28 +216,28 @@ int EnvironmentModel::findInResultInsertPosition(const QString &name) const
 {
     Environment::const_iterator it;
     int i = 0;
-    for(it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
-        if(m_resultEnvironment.key(it) > name)
+    for (it = m_resultEnvironment.constBegin(); it != m_resultEnvironment.constEnd(); ++it, ++i)
+        if (m_resultEnvironment.key(it) > name)
             return i;
     return m_resultEnvironment.size();
 }
 
 bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value, int role)
 {
-    if(role == Qt::EditRole && index.isValid()) {
-        if(index.column() == 0) {
+    if (role == Qt::EditRole && index.isValid()) {
+        if (index.column() == 0) {
             //fail if a variable with the same name already exists
 #ifdef Q_OS_WIN
-            if(findInChanges(value.toString().toUpper()) != -1)
+            if (findInChanges(value.toString().toUpper()) != -1)
                 return false;
 #else
-            if(findInChanges(value.toString()) != -1)
+            if (findInChanges(value.toString()) != -1)
                 return false;
 #endif
             EnvironmentItem old("", "");
-            if(m_mergedEnvironments) {
+            if (m_mergedEnvironments) {
                 int pos = findInChanges(indexToVariable(index));
-                if(pos != -1) {
+                if (pos != -1) {
                     old = m_items.at(pos);
                 } else {
                     old.name = m_resultEnvironment.key(m_resultEnvironment.constBegin() + index.row());
@@ -252,16 +252,16 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
 #else
             const QString &newName = value.toString();
 #endif
-            if(changes(old.name))
+            if (changes(old.name))
                 removeVariable(old.name);
             old.name = newName;
             addVariable(old);
             return true;
-        } else if(index.column() == 1) {
-            if(m_mergedEnvironments) {
+        } else if (index.column() == 1) {
+            if (m_mergedEnvironments) {
                 const QString &name = indexToVariable(index);
                 int pos = findInChanges(name);
-                if(pos != -1) {
+                if (pos != -1) {
                     m_items[pos].value = value.toString();
                     m_items[pos].unset = false;
                     updateResultEnvironment();
@@ -287,13 +287,13 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
 QModelIndex EnvironmentModel::addVariable()
 {
     const QString &name = "<VARIABLE>";
-    if(m_mergedEnvironments) {
+    if (m_mergedEnvironments) {
         int i = findInResult(name);
-        if(i != -1)
+        if (i != -1)
             return index(i, 0, QModelIndex());
     } else {
         int i = findInChanges(name);
-        if(i != -1)
+        if (i != -1)
             return index(i, 0, QModelIndex());
     }
     // Don't exist, really add them
@@ -302,10 +302,10 @@ QModelIndex EnvironmentModel::addVariable()
 
 QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
 {
-    if(m_mergedEnvironments) {
+    if (m_mergedEnvironments) {
         bool existsInBaseEnvironment = (m_baseEnvironment.find(item.name) != m_baseEnvironment.constEnd());
         int rowInResult;
-        if(existsInBaseEnvironment)
+        if (existsInBaseEnvironment)
             rowInResult = findInResult(item.name);
         else
             rowInResult = findInResultInsertPosition(item.name);
@@ -313,7 +313,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
 
         qDebug()<<"addVariable "<<item.name<<existsInBaseEnvironment<<rowInResult<<rowInChanges;
 
-        if(existsInBaseEnvironment) {
+        if (existsInBaseEnvironment) {
             m_items.insert(rowInChanges, item);
             updateResultEnvironment();
             emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
@@ -340,11 +340,11 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
 
 void EnvironmentModel::removeVariable(const QString &name)
 {
-    if(m_mergedEnvironments) {
+    if (m_mergedEnvironments) {
         int rowInResult = findInResult(name);
         int rowInChanges = findInChanges(name);
         bool existsInBaseEnvironment = m_baseEnvironment.find(name) != m_baseEnvironment.constEnd();
-        if(existsInBaseEnvironment) {
+        if (existsInBaseEnvironment) {
             m_items.removeAt(rowInChanges);
             updateResultEnvironment();
             emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
@@ -368,11 +368,11 @@ void EnvironmentModel::removeVariable(const QString &name)
 
 void EnvironmentModel::unset(const QString &name)
 {
-    if(m_mergedEnvironments) {
+    if (m_mergedEnvironments) {
         int row = findInResult(name);
         // look in m_items for the variable
         int pos = findInChanges(name);
-        if(pos != -1) {
+        if (pos != -1) {
             m_items[pos].unset = true;
             updateResultEnvironment();
             emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex()));
@@ -398,7 +398,7 @@ void EnvironmentModel::unset(const QString &name)
 bool EnvironmentModel::isUnset(const QString &name)
 {
     int pos = findInChanges(name);
-    if(pos != -1)
+    if (pos != -1)
         return m_items.at(pos).unset;
     else
         return false;
diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp
index a2e0e206aee865dc2ebc022574aee0517700fff5..81a9f292450bdbd8f5cb95830e3a5b4ac23166d3 100644
--- a/src/plugins/projectexplorer/outputwindow.cpp
+++ b/src/plugins/projectexplorer/outputwindow.cpp
@@ -64,7 +64,7 @@ bool OutputPane::canFocus()
 
 void OutputPane::setFocus()
 {
-    if(m_tabWidget->currentWidget())
+    if (m_tabWidget->currentWidget())
         m_tabWidget->currentWidget()->setFocus();
 }
 
@@ -199,7 +199,7 @@ void OutputPane::createNewOutputWindow(RunControl *rc)
     
     // First look if we can reuse a tab
     bool found = false;
-    for(int i=0; i<m_tabWidget->count(); ++i) {
+    for (int i=0; i<m_tabWidget->count(); ++i) {
         RunControl *old = runControlForTab(i);
         if (old->runConfiguration() == rc->runConfiguration() && !old->isRunning()) {
             // Reuse this tab
diff --git a/src/plugins/projectexplorer/persistentsettings.cpp b/src/plugins/projectexplorer/persistentsettings.cpp
index 38253f3ae0d3119808a21894cb2ae2bf0f71947c..0939dc17850212cad19773140dd0e435c83d818e 100644
--- a/src/plugins/projectexplorer/persistentsettings.cpp
+++ b/src/plugins/projectexplorer/persistentsettings.cpp
@@ -152,7 +152,7 @@ void PersistentSettingsWriter::writeValue(QDomElement &ps, const QVariant &varia
         QDomElement values = ps.ownerDocument().createElement("valuelist");
         values.setAttribute("type", QVariant::typeToName(QVariant::List));
         QList<QVariant> varList = variant.toList();
-        foreach(QVariant var, varList) {
+        foreach (QVariant var, varList) {
             writeValue(values, var);
         }
         ps.appendChild(values);
diff --git a/src/plugins/projectexplorer/pluginfilefactory.cpp b/src/plugins/projectexplorer/pluginfilefactory.cpp
index a3d712ff5eed396cd5aeb38df7e93075cb352eae..723d5dbaf51f62400aa8ca0c9fb78630e2cd805e 100644
--- a/src/plugins/projectexplorer/pluginfilefactory.cpp
+++ b/src/plugins/projectexplorer/pluginfilefactory.cpp
@@ -90,7 +90,7 @@ QList<ProjectFileFactory*> ProjectFileFactory::createFactories(const Core::ICore
 
     const QString filterSeparator = QLatin1String(";;");
     filterString->clear();
-    foreach(IProjectManager *manager, projectManagers) {
+    foreach (IProjectManager *manager, projectManagers) {
         rc.push_back(new ProjectFileFactory(core, manager));
         if (!filterString->isEmpty())
             *filterString += filterSeparator;
diff --git a/src/plugins/projectexplorer/processstep.cpp b/src/plugins/projectexplorer/processstep.cpp
index 4a24efa70697d347cdf477a8fd1913f749a25c8b..f2e2a8ac5437bf937b773fbbaf24783f7940ab65 100644
--- a/src/plugins/projectexplorer/processstep.cpp
+++ b/src/plugins/projectexplorer/processstep.cpp
@@ -54,7 +54,7 @@ bool ProcessStep::init(const QString &buildConfiguration)
     setEnvironment(buildConfiguration, project()->environment(buildConfiguration));
     QVariant wd = value(buildConfiguration, "workingDirectory").toString();
     QString workingDirectory;
-    if(!wd.isValid() || wd.toString().isEmpty())
+    if (!wd.isValid() || wd.toString().isEmpty())
         workingDirectory = "$BUILDDIR";
     else
         workingDirectory = wd.toString();
@@ -161,7 +161,7 @@ QString ProcessStepConfigWidget::displayName() const
 void ProcessStepConfigWidget::workingDirBrowseButtonClicked()
 {
     QString workingDirectory = QFileDialog::getExistingDirectory(this, "Select the working directory", m_ui.workingDirectoryLineEdit->text());
-    if(workingDirectory.isEmpty())
+    if (workingDirectory.isEmpty())
         return;
     m_ui.workingDirectoryLineEdit->setText(workingDirectory);
     workingDirectoryLineEditTextEdited();
@@ -170,7 +170,7 @@ void ProcessStepConfigWidget::workingDirBrowseButtonClicked()
 void ProcessStepConfigWidget::commandBrowseButtonClicked()
 {
     QString filename = QFileDialog::getOpenFileName(this, "Select the executable");
-    if(filename.isEmpty())
+    if (filename.isEmpty())
         return;
     m_ui.commandLineEdit->setText(filename);
     commandLineEditTextEdited();
@@ -179,7 +179,7 @@ void ProcessStepConfigWidget::commandBrowseButtonClicked()
 void ProcessStepConfigWidget::init(const QString &buildConfiguration)
 {
     m_buildConfiguration = buildConfiguration;
-    if(buildConfiguration != QString::null) {
+    if (buildConfiguration != QString::null) {
         m_ui.commandLineEdit->setText(m_step->command(buildConfiguration));
 
         QString workingDirectory = m_step->value(buildConfiguration, "workingDirectory").toString();
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp
index 8c74fe6e564c067879bbfeb2a029239649e26ede..9cecd7b6841384f18540cf496e57046acd124ea1 100644
--- a/src/plugins/projectexplorer/project.cpp
+++ b/src/plugins/projectexplorer/project.cpp
@@ -57,11 +57,9 @@ void Project::insertBuildStep(int position, BuildStep *step)
 {
     m_buildSteps.insert(position, step);
     // check that the step has all the configurations
-    foreach(const QString & name, buildConfigurations())
-    {
+    foreach (const QString &name, buildConfigurations())
         if (!step->getBuildConfiguration(name))
             step->addBuildConfiguration(name);
-    }
 }
 
 void Project::removeBuildStep(int position)
@@ -80,11 +78,9 @@ void Project::insertCleanStep(int position, BuildStep *step)
 {
     m_cleanSteps.insert(position, step);
     // check that the step has all the configurations
-    foreach(const QString & name, buildConfigurations())
-    {
+    foreach (const QString &name, buildConfigurations())
         if (!step->getBuildConfiguration(name))
             step->addBuildConfiguration(name);
-    }
 }
 
 void Project::removeCleanStep(int position)
@@ -100,10 +96,10 @@ void Project::addBuildConfiguration(const QString &name)
 
     m_buildConfigurationValues.push_back(new BuildConfiguration(name));
 
-    for (int i = 0; i!=m_buildSteps.size(); ++i)
+    for (int i = 0; i != m_buildSteps.size(); ++i)
         m_buildSteps.at(i)->addBuildConfiguration(name);
 
-    for (int i = 0; i!=m_cleanSteps.size(); ++i)
+    for (int i = 0; i != m_cleanSteps.size(); ++i)
         m_cleanSteps.at(i)->addBuildConfiguration(name);
 }
 
@@ -113,15 +109,15 @@ void Project::removeBuildConfiguration(const QString &name)
         return;
 
     for (int i = 0; i != m_buildConfigurationValues.size(); ++i)
-        if(m_buildConfigurationValues.at(i)->name() == name) {
+        if (m_buildConfigurationValues.at(i)->name() == name) {
             delete m_buildConfigurationValues.at(i);
             m_buildConfigurationValues.removeAt(i);
             break;
         }
 
-    for (int i = 0; i!=m_buildSteps.size(); ++i)
+    for (int i = 0; i != m_buildSteps.size(); ++i)
         m_buildSteps.at(i)->removeBuildConfiguration(name);
-    for (int i = 0; i!=m_cleanSteps.size(); ++i)
+    for (int i = 0; i != m_cleanSteps.size(); ++i)
         m_cleanSteps.at(i)->removeBuildConfiguration(name);
 
 }
@@ -132,22 +128,21 @@ void Project::copyBuildConfiguration(const QString &source, const QString &dest)
         return;
 
     for (int i = 0; i != m_buildConfigurationValues.size(); ++i)
-        if(m_buildConfigurationValues.at(i)->name() == source)
+        if (m_buildConfigurationValues.at(i)->name() == source)
             m_buildConfigurationValues.push_back(new BuildConfiguration(dest, m_buildConfigurationValues.at(i)));
 
-    for (int i = 0; i!= m_buildSteps.size(); ++i)
+    for (int i = 0; i != m_buildSteps.size(); ++i)
         m_buildSteps.at(i)->copyBuildConfiguration(source, dest);
 
-    for (int i = 0; i!= m_cleanSteps.size(); ++i)
+    for (int i = 0; i != m_cleanSteps.size(); ++i)
         m_cleanSteps.at(i)->copyBuildConfiguration(source, dest);
 }
 
 QStringList Project::buildConfigurations() const
 {
     QStringList result;
-    foreach (BuildConfiguration *bc, m_buildConfigurationValues) {
+    foreach (BuildConfiguration *bc, m_buildConfigurationValues)
         result << bc->name();
-    }
     return result;
 }
 
@@ -195,39 +190,36 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer)
     writer.saveValue("project", m_values);
 
     //save buildsettings
-    foreach(const QString & buildConfigurationName, buildConfigurations()) {
+    foreach (const QString &buildConfigurationName, buildConfigurations()) {
         QMap<QString, QVariant> temp =
             getBuildConfiguration(buildConfigurationName)->toMap();
         writer.saveValue("buildConfiguration-" + buildConfigurationName, temp);
     }
 
     QStringList buildStepNames;
-    foreach(BuildStep * buildStep, buildSteps()) {
+    foreach (BuildStep *buildStep, buildSteps())
         buildStepNames << buildStep->name();
-    }
     writer.saveValue("buildsteps", buildStepNames);
 
     QStringList cleanStepNames;
-    foreach(BuildStep * cleanStep, cleanSteps()) {
+    foreach (BuildStep *cleanStep, cleanSteps())
         cleanStepNames << cleanStep->name();
-    }
     writer.saveValue("cleansteps", cleanStepNames);
     QStringList buildConfigurationNames = buildConfigurations();
     writer.saveValue("buildconfigurations", buildConfigurationNames );
 
     //save buildstep configuration
     int buildstepnr = 0;
-    foreach(BuildStep * buildStep, buildSteps())
-    {
+    foreach (BuildStep *buildStep, buildSteps()) {
         QMap<QString, QVariant> buildConfiguration = buildStep->valuesToMap();
         writer.saveValue("buildstep" + QString().setNum(buildstepnr), buildConfiguration);
         ++buildstepnr;
     }
 
     // save each buildstep/buildConfiguration combination
-    foreach(const QString & buildConfigurationName, buildConfigurationNames) {
+    foreach (const QString &buildConfigurationName, buildConfigurationNames) {
         buildstepnr = 0;
-        foreach(BuildStep * buildStep, buildSteps()) {
+        foreach (BuildStep *buildStep, buildSteps()) {
             QMap<QString, QVariant> temp =
                 buildStep->valuesToMap(buildConfigurationName);
             writer.saveValue("buildconfiguration-" + buildConfigurationName + "-buildstep" + QString().setNum(buildstepnr), temp);
@@ -237,17 +229,16 @@ void Project::saveSettingsImpl(PersistentSettingsWriter &writer)
 
     //save cleansteps buildconfiguration
     int cleanstepnr = 0;
-    foreach(BuildStep * cleanStep, cleanSteps())
-    {
+    foreach (BuildStep *cleanStep, cleanSteps()) {
         QMap<QString, QVariant> buildConfiguration = cleanStep->valuesToMap();
         writer.saveValue("cleanstep" + QString().setNum(cleanstepnr), buildConfiguration);
         ++cleanstepnr;
     }
 
     // save each cleanstep/buildConfiguration combination
-    foreach(const QString & buildConfigurationName, buildConfigurationNames) {
+    foreach (const QString &buildConfigurationName, buildConfigurationNames) {
         cleanstepnr = 0;
-        foreach(BuildStep * cleanStep, cleanSteps()) {
+        foreach (BuildStep *cleanStep, cleanSteps()) {
             QMap<QString, QVariant> temp = cleanStep->valuesToMap(buildConfigurationName);
             writer.saveValue("buildconfiguration-" + buildConfigurationName + "-cleanstep" + QString().setNum(cleanstepnr), temp);
             ++cleanstepnr;
@@ -279,7 +270,7 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
 
     //Build Settings
     const QStringList buildConfigurationNames = reader.restoreValue("buildconfigurations").toStringList();
-    foreach(const QString & buildConfigurationName, buildConfigurationNames) {
+    foreach (const QString &buildConfigurationName, buildConfigurationNames) {
         addBuildConfiguration(buildConfigurationName);
         QMap<QString, QVariant> temp =
             reader.restoreValue("buildConfiguration-" + buildConfigurationName).toMap();
@@ -287,16 +278,16 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
     }
 
     QVariant buildStepsVariant = reader.restoreValue("buildsteps");
-    if(buildStepsVariant.isValid()) {
+    if (buildStepsVariant.isValid()) {
         // restoring BuildSteps from settings
         int pos = 0;
         const QList<IBuildStepFactory *> buildStepFactories =
             ExtensionSystem::PluginManager::instance()->getObjects<IBuildStepFactory>();
         QStringList buildStepNames = buildStepsVariant.toStringList();
-        foreach(const QString & buildStepName, buildStepNames) {
-            foreach(IBuildStepFactory * factory, buildStepFactories) {
-                if(factory->canCreate(buildStepName)) {
-                    BuildStep * buildStep = factory->create(this, buildStepName);
+        foreach (const QString &buildStepName, buildStepNames) {
+            foreach (IBuildStepFactory *factory, buildStepFactories) {
+                if (factory->canCreate(buildStepName)) {
+                    BuildStep *buildStep = factory->create(this, buildStepName);
                     insertBuildStep(pos, buildStep);
                     ++pos;
                     break;
@@ -307,10 +298,10 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
         QStringList cleanStepNames = reader.restoreValue("cleansteps").toStringList();
         // restoring BuildSteps from settings
         pos = 0;
-        foreach(const QString & cleanStepName, cleanStepNames) {
-            foreach(IBuildStepFactory * factory, buildStepFactories) {
-                if(factory->canCreate(cleanStepName)) {
-                    BuildStep * cleanStep = factory->create(this, cleanStepName);
+        foreach (const QString &cleanStepName, cleanStepNames) {
+            foreach (IBuildStepFactory *factory, buildStepFactories) {
+                if (factory->canCreate(cleanStepName)) {
+                    BuildStep *cleanStep = factory->create(this, cleanStepName);
                     insertCleanStep(pos, cleanStep);
                     ++pos;
                     break;
@@ -324,15 +315,15 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
 
         // restore BuildSteps configuration
         int buildstepnr = 0;
-        foreach(BuildStep * buildStep, buildSteps()) {
+        foreach (BuildStep *buildStep, buildSteps()) {
             QMap<QString, QVariant> buildConfiguration = reader.restoreValue("buildstep" + QString().setNum(buildstepnr)).toMap();
             buildStep->setValuesFromMap(buildConfiguration);
             ++buildstepnr;
         }
 
-        foreach(const QString & buildConfigurationName, buildConfigurationNames) {
+        foreach (const QString &buildConfigurationName, buildConfigurationNames) {
             buildstepnr = 0;
-            foreach(BuildStep * buildStep, buildSteps()) {
+            foreach (BuildStep *buildStep, buildSteps()) {
                 //get the buildconfiguration for this build step
                 QMap<QString, QVariant> buildConfiguration =
                     reader.restoreValue("buildconfiguration-" + buildConfigurationName + "-buildstep" + QString().setNum(buildstepnr)).toMap();
@@ -343,16 +334,15 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
 
         // restore CleanSteps configuration
         int cleanstepnr = 0;
-        foreach(BuildStep * cleanStep, cleanSteps())
-        {
+        foreach (BuildStep *cleanStep, cleanSteps()) {
             QMap<QString, QVariant> buildConfiguration = reader.restoreValue("cleanstep" + QString().setNum(cleanstepnr)).toMap();
             cleanStep->setValuesFromMap(buildConfiguration);
             ++cleanstepnr;
         }
 
-        foreach(const QString & buildConfigurationName, buildConfigurationNames) {
+        foreach (const QString &buildConfigurationName, buildConfigurationNames) {
             cleanstepnr = 0;
-            foreach(BuildStep * cleanStep, cleanSteps()) {
+            foreach (BuildStep *cleanStep, cleanSteps()) {
                 //get the buildconfiguration for this clean step
                 QMap<QString, QVariant> buildConfiguration =
                     reader.restoreValue("buildconfiguration-" + buildConfigurationName + "-cleanstep" + QString().setNum(cleanstepnr)).toMap();
@@ -373,7 +363,7 @@ void Project::restoreSettingsImpl(PersistentSettingsReader &reader)
         if (!typeVariant.isValid())
             break;
         const QString &type = typeVariant.toString();
-        foreach (IRunConfigurationFactory * factory, factories) {
+        foreach (IRunConfigurationFactory *factory, factories) {
             if (factory->canCreate(type)) {
                 QSharedPointer<RunConfiguration> rc = factory->create(this, type);
                 rc->restore(reader);
@@ -403,7 +393,7 @@ QVariant Project::value(const QString &name) const
 {
     QMap<QString, QVariant>::const_iterator it =
         m_values.find(name);
-    if(it != m_values.constEnd())
+    if (it != m_values.constEnd())
         return it.value();
     else
         return QVariant();
@@ -497,7 +487,7 @@ QString Project::displayNameFor(const QString &buildConfiguration)
 void Project::setDisplayNameFor(const QString &buildConfiguration, const QString &displayName)
 {
     QStringList displayNames;
-    foreach(const QString &bc, buildConfigurations()) {
+    foreach (const QString &bc, buildConfigurations()) {
         if (bc != buildConfiguration)
             displayNames << displayNameFor(bc);
     }
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index f67984f0da8621d9d718d7abaeb23e9720f2e370..7b721b208ffa83ca832c19096f7ffd0bea183c3d 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -734,7 +734,7 @@ void ProjectExplorerPlugin::clearSession()
 void ProjectExplorerPlugin::extensionsInitialized()
 {
     m_fileFactories = ProjectFileFactory::createFactories(m_core, &m_projectFilterString);
-    foreach(ProjectFileFactory *pf, m_fileFactories) {
+    foreach (ProjectFileFactory *pf, m_fileFactories) {
         m_profileMimeTypes += pf->mimeTypes();
         addAutoReleasedObject(pf);
     }
@@ -1212,7 +1212,7 @@ QStringList ProjectExplorerPlugin::allFilesWithDependencies(Project *pro)
         qDebug() << "ProjectExplorerPlugin::allFilesWithDependencies(" << pro->file()->fileName() << ")";
 
     QStringList filesToSave;
-    foreach(Project *p, m_session->projectOrder(pro)) {
+    foreach (Project *p, m_session->projectOrder(pro)) {
         FindAllFilesVisitor filesVisitor;
         p->rootProjectNode()->accept(&filesVisitor);
         filesToSave << filesVisitor.filePaths();
@@ -1783,7 +1783,7 @@ void ProjectExplorerPlugin::updateSessionMenu()
 {
     m_sessionMenu->clear();
     const QString &activeSession = m_session->activeSession();
-    foreach(const QString &session, m_session->sessions()) {
+    foreach (const QString &session, m_session->sessions()) {
         QAction *act = m_sessionMenu->addAction(session, this, SLOT(setSession()));
         act->setCheckable(true);
         if (session == activeSession)
diff --git a/src/plugins/projectexplorer/projectmodels.cpp b/src/plugins/projectexplorer/projectmodels.cpp
index 3e04069408c1b8e6d2aa9212093322a87ac541a4..a3d601364f49c425e30cc3e4aa29df5ef187c84c 100644
--- a/src/plugins/projectexplorer/projectmodels.cpp
+++ b/src/plugins/projectexplorer/projectmodels.cpp
@@ -988,10 +988,9 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
         return;
     }
 
-    while(true)
-    {
+    while (true) {
         // Skip all that are the same
-        while(*oldIter == *newIter) {
+        while (*oldIter == *newIter) {
             ++oldIter;
             ++newIter;
             if (oldIter == oldNodeList.constEnd()) {
@@ -1002,7 +1001,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
                 int count = newIter - startOfBlock;
                 if (count > 0) {
                     beginInsertRows(parentIndex, pos, pos+count-1);
-                    while(startOfBlock != newIter) {
+                    while (startOfBlock != newIter) {
                         oldNodeList.insert(pos, *startOfBlock);
                         ++pos;
                         ++startOfBlock;
@@ -1015,7 +1014,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
         }
 
         QList<Node *>::const_iterator startOfBlock = newIter;
-        while(*oldIter != *newIter)
+        while (*oldIter != *newIter)
             ++newIter;
         // startOfBlock is the first that was diffrent
         // newIter points to the new position of oldIter
@@ -1024,7 +1023,7 @@ void FlatModel::added(FolderNode* parentNode, const QList<Node*> &newNodeList)
         int pos = oldIter - oldNodeList.constBegin();
         int count = newIter - startOfBlock;
         beginInsertRows(parentIndex, pos, pos + count - 1);
-        while(startOfBlock != newIter) {
+        while (startOfBlock != newIter) {
             oldNodeList.insert(pos, *startOfBlock);
             ++pos;
             ++startOfBlock;
@@ -1059,10 +1058,9 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
         return;
     }
 
-    while(true)
-    {
+    while (true) {
         // Skip all that are the same
-        while(*oldIter == *newIter) {
+        while (*oldIter == *newIter) {
             ++oldIter;
             ++newIter;
             if (newIter == newNodeList.constEnd()) {
@@ -1073,7 +1071,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
                 int count = oldIter - startOfBlock;
                 if (count > 0) {
                     beginRemoveRows(parentIndex, pos, pos+count-1);
-                    while(startOfBlock != oldIter) {
+                    while (startOfBlock != oldIter) {
                         ++startOfBlock;
                         oldNodeList.removeAt(pos);
                     }
@@ -1086,7 +1084,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
         }
 
         QList<Node *>::const_iterator startOfBlock = oldIter;
-        while(*oldIter != *newIter)
+        while (*oldIter != *newIter)
             ++oldIter;
         // startOfBlock is the first that was diffrent
         // oldIter points to the new position of newIter
@@ -1095,7 +1093,7 @@ void FlatModel::removed(FolderNode* parentNode, const QList<Node*> &newNodeList)
         int pos = startOfBlock - oldNodeList.constBegin();
         int count = oldIter - startOfBlock;
         beginRemoveRows(parentIndex, pos, pos + count - 1);
-        while(startOfBlock != oldIter) {
+        while (startOfBlock != oldIter) {
             ++startOfBlock;
             oldNodeList.removeAt(pos);
         }
@@ -1125,7 +1123,7 @@ void FlatModel::foldersAdded()
 void FlatModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<FolderNode*> &staleFolders)
 {
     QSet<Node *> blackList;
-    foreach(FolderNode * node, staleFolders)
+    foreach (FolderNode *node, staleFolders)
         blackList.insert(node);
 
     FolderNode *folderNode = visibleFolderNode(parentFolder);
@@ -1137,7 +1135,7 @@ void FlatModel::foldersAboutToBeRemoved(FolderNode *parentFolder, const QList<Fo
 
 void FlatModel::removeFromCache(QList<FolderNode *> list)
 {
-    foreach(FolderNode * fn, list) {
+    foreach (FolderNode *fn, list) {
         removeFromCache(fn->subFolderNodes());
         m_childNodes.remove(fn);
     }
@@ -1170,7 +1168,7 @@ void FlatModel::filesAboutToBeRemoved(FolderNode *folder, const QList<FileNode*>
     FolderNode *folderNode = visibleFolderNode(folder);
 
     QSet<Node *> blackList;
-    foreach(Node* node, staleFiles)
+    foreach(Node *node, staleFiles)
         blackList.insert(node);
 
     // Now get the new List for that folder
diff --git a/src/plugins/projectexplorer/projectwindow.cpp b/src/plugins/projectexplorer/projectwindow.cpp
index 38aa7f958a19f9623a223bfc58b234fe9c2ba759..c725c915c9e37692fb39507ca46d6881511714e3 100644
--- a/src/plugins/projectexplorer/projectwindow.cpp
+++ b/src/plugins/projectexplorer/projectwindow.cpp
@@ -230,13 +230,11 @@ void ProjectWindow::updateTreeWidget()
 Project *ProjectWindow::findProject(const QString &path) const
 {
     QList<Project*> projects = m_session->projects();
-    foreach(Project* project, projects) {
-        if (project->file()->fileName() == path) {
+    foreach (Project* project, projects)
+        if (project->file()->fileName() == path)
             return project;
-        }
-    }
     return 0;
- }
+}
 
 
 void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
@@ -244,7 +242,6 @@ void ProjectWindow::handleCurrentItemChanged(QTreeWidgetItem *current)
     if (current) {
         QString path = current->text(2);
         if (Project *project = findProject(path)) {
-
             m_projectExplorer->setCurrentFile(project, path);
             showProperties(project, QModelIndex());
             return;
diff --git a/src/plugins/projectexplorer/projectwizardpage.cpp b/src/plugins/projectexplorer/projectwizardpage.cpp
index 8912fbb9e948e02c1c505fd56b8ca699cb8f9aab..f7022158bc8d85ac832cb181c8963143e95e5518 100644
--- a/src/plugins/projectexplorer/projectwizardpage.cpp
+++ b/src/plugins/projectexplorer/projectwizardpage.cpp
@@ -99,7 +99,7 @@ void ProjectWizardPage::setAddToVersionControlEnabled(bool b)
 
 void ProjectWizardPage::changeEvent(QEvent *e)
 {
-    switch(e->type()) {
+    switch (e->type()) {
     case QEvent::LanguageChange:
         m_ui->retranslateUi(this);
         break;
@@ -115,7 +115,8 @@ void ProjectWizardPage::setVCSDisplay(const QString &vcsName)
 
 void ProjectWizardPage::setFilesDisplay(const QStringList &files)
 {
-    QString fileMessage; {
+    QString fileMessage;
+    {
         QTextStream str(&fileMessage);
         str << "<html>Files to be added:<pre>";
         const QStringList::const_iterator cend = files.constEnd();
diff --git a/src/plugins/projectexplorer/removefiledialog.cpp b/src/plugins/projectexplorer/removefiledialog.cpp
index 3d8f11345a237eb202929b6df79413290e3185b8..32f573b5f623e7a8c92be922e0d8c1f96147e193 100644
--- a/src/plugins/projectexplorer/removefiledialog.cpp
+++ b/src/plugins/projectexplorer/removefiledialog.cpp
@@ -59,7 +59,7 @@ bool RemoveFileDialog::isDeleteFileChecked() const
 
 void RemoveFileDialog::changeEvent(QEvent *e)
 {
-    switch(e->type()) {
+    switch (e->type()) {
     case QEvent::LanguageChange:
         m_ui->retranslateUi(this);
         break;
diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp
index 71057473046d4abb52f43ad766f79762ead2681a..6f17dd51a17dfb2bb65a4545f307a3015cbf4688 100644
--- a/src/plugins/projectexplorer/session.cpp
+++ b/src/plugins/projectexplorer/session.cpp
@@ -387,10 +387,10 @@ SessionManager::SessionManager(Core::ICore *core, QObject *parent)
         dir.mkpath(configDir + "/qtcreator");
 
         // Move sessions to that directory
-        foreach(const QString &session, sessions()) {
+        foreach (const QString &session, sessions()) {
             QFile file(configDir + "/" + session + ".qws");
             if (file.exists())
-                if(file.copy(configDir + "/qtcreator/" + session + ".qws"))
+                if (file.copy(configDir + "/qtcreator/" + session + ".qws"))
                     file.remove();
         }
     }
@@ -413,15 +413,15 @@ SessionManager::~SessionManager()
 
 bool SessionManager::isDefaultVirgin() const
 {
-    return (isDefaultSession(m_sessionName)
+    return isDefaultSession(m_sessionName)
             && projects().isEmpty()
-            && m_core->editorManager()->openedEditors().isEmpty());
+            && m_core->editorManager()->openedEditors().isEmpty();
 }
 
 
 bool SessionManager::isDefaultSession(const QString &session) const
 {
-    return (session == QLatin1String("default"));
+    return session == QLatin1String("default");
 }
 
 
@@ -1082,7 +1082,7 @@ bool SessionManager::loadSession(const QString &session)
         }
     } else {
         // Create a new session with that name
-        if(!createImpl(sessionNameToFileName(session)))
+        if (!createImpl(sessionNameToFileName(session)))
             return false;
         updateName(session);
         return true;
diff --git a/src/plugins/projectexplorer/sessiondialog.cpp b/src/plugins/projectexplorer/sessiondialog.cpp
index f00697597ed32120ebbd1a5bc27df2231da55cca..b264ac11a9acafc0abb61d702e5c5721cea52922 100644
--- a/src/plugins/projectexplorer/sessiondialog.cpp
+++ b/src/plugins/projectexplorer/sessiondialog.cpp
@@ -128,7 +128,7 @@ SessionDialog::SessionDialog(SessionManager *sessionManager, const QString &last
             this, SLOT(updateActions()));
 
     QStringList sessions = sessionManager->sessions();
-    foreach(const QString &session, sessions) {
+    foreach (const QString &session, sessions) {
         m_ui.sessionList->addItem(session);
         if (session == lastSession)
             m_ui.sessionList->setCurrentRow(m_ui.sessionList->count() - 1);
diff --git a/src/plugins/projectexplorer/taskwindow.cpp b/src/plugins/projectexplorer/taskwindow.cpp
index 309e8ab983693116aff611f19822792519565785..236b2069ae003da21c929f6083b0aca6e31ad783 100644
--- a/src/plugins/projectexplorer/taskwindow.cpp
+++ b/src/plugins/projectexplorer/taskwindow.cpp
@@ -441,7 +441,7 @@ QSize TaskDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelInd
         int height = 0;
         QTextLayout tl(description);
         tl.beginLayout();
-        while(true) {
+        while (true) {
             QTextLine line = tl.createLine();
             if (!line.isValid())
                 break;
@@ -528,7 +528,7 @@ void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
         int height = 0;
         QTextLayout tl(description);
         tl.beginLayout();
-        while(true) {
+        while (true) {
             QTextLine line = tl.createLine();
             if (!line.isValid())
                 break;
diff --git a/src/plugins/qt4projectmanager/cesdkhandler.cpp b/src/plugins/qt4projectmanager/cesdkhandler.cpp
index cb10cba50119b97d5c4031e6a2bae56f9d6bc4af..25200c3ab2707b1ee90a05a5b3f5a40b3ab2c6a0 100644
--- a/src/plugins/qt4projectmanager/cesdkhandler.cpp
+++ b/src/plugins/qt4projectmanager/cesdkhandler.cpp
@@ -41,13 +41,13 @@ using namespace Qt4ProjectManager::Internal;
 using ProjectExplorer::Environment;
 
 CeSdkInfo::CeSdkInfo()
-    : m_major(0) , m_minor(0)
+    : m_major(0), m_minor(0)
 {
 }
 
 Environment CeSdkInfo::addToEnvironment(const Environment &env)
 {
-    qDebug()<<"adding "<<name()<< "to Environment";
+    qDebug() << "adding " << name() << "to Environment";
     Environment e(env);
     e.set("INCLUDE", m_include);
     e.set("LIB", m_lib);
@@ -66,21 +66,21 @@ QString CeSdkHandler::platformName(const QString &qtpath)
     QString CE_SDK;
     QString CE_ARCH;
     QFile f(qtpath);
-    if(f.exists() && f.open(QIODevice::ReadOnly)) {
-        while(!f.atEnd()) {
+    if (f.exists() && f.open(QIODevice::ReadOnly)) {
+        while (!f.atEnd()) {
             QByteArray line = f.readLine();
-            if(line.startsWith("CE_SDK")) {
+            if (line.startsWith("CE_SDK")) {
                 int index = line.indexOf('=');
-                if(index >= 0) {
+                if (index >= 0) {
                     CE_SDK = line.mid(index + 1).trimmed();
                 }
-            } else if(line.startsWith("CE_ARCH")) {
+            } else if (line.startsWith("CE_ARCH")) {
                 int index = line.indexOf('=');
-                if(index >= 0) {
+                if (index >= 0) {
                     CE_ARCH = line.mid(index + 1).trimmed();
                 }
             }
-            if(!CE_SDK.isEmpty() && !CE_ARCH.isEmpty()) {
+            if (!CE_SDK.isEmpty() && !CE_ARCH.isEmpty()) {
                 platformName = CE_SDK + " (" + CE_ARCH + ")";
                 break;
             }
@@ -146,9 +146,9 @@ bool CeSdkHandler::parse(const QString &vsdir)
 
 CeSdkInfo CeSdkHandler::find(const QString &name)
 {
-    qDebug()<<"looking for platform "<<name;
+    qDebug() << "looking for platform " << name;
     for (QList<CeSdkInfo>::iterator it = m_list.begin(); it != m_list.end(); ++it) {
-        qDebug()<<"...."<<it->name();
+        qDebug() << "...." << it->name();
         if (it->name() == name)
             return *it;
     }
diff --git a/src/plugins/qt4projectmanager/deployhelper.cpp b/src/plugins/qt4projectmanager/deployhelper.cpp
index 57386afd2efb4a0892a76bee97a2401fe9e7845d..cf48604ad20776df28de65adc9a173a95be40c46 100644
--- a/src/plugins/qt4projectmanager/deployhelper.cpp
+++ b/src/plugins/qt4projectmanager/deployhelper.cpp
@@ -60,9 +60,9 @@ bool DeployHelperRunStep::init(const QString &configuration)
     //find target
     m_exec = "";
     QStringList targets = QStringList(); //TODO fix m_pro->qmakeTarget();
-    foreach(const QString& target, targets) {
+    foreach (const QString &target, targets) {
         QFileInfo fi(m_appdir + QLatin1Char('/') + target);
-        if(fi.exists())
+        if (fi.exists())
             m_exec = target;
         break;
     }
diff --git a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp
index 0046a9e4acfcb36e0051f700dbf90d694df36e00..bd2c367f696d6a70782d24ad6caecd8449ff82b2 100644
--- a/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp
+++ b/src/plugins/qt4projectmanager/gdbmacrosbuildstep.cpp
@@ -74,7 +74,7 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
     QString destDir = m_buildDirectory + "/qtc-gdbmacros/";
     QDir dir;
     dir.mkpath(destDir);
-    foreach(const QString &file, files) {
+    foreach (const QString &file, files) {
         QFile destination(destDir + file);
         if (destination.exists())
             destination.remove();
@@ -116,7 +116,7 @@ void GdbMacrosBuildStep::run(QFutureInterface<bool> & fi)
         QStringList makeargs = ms->value(m_buildConfiguration, "makeargs").toStringList();
         if (makeargs.contains("debug")) {
             makeArguments <<  "debug";
-        } else if(makeargs.contains("release")) {
+        } else if (makeargs.contains("release")) {
             makeArguments << "release";
         }
     }
diff --git a/src/plugins/qt4projectmanager/makestep.cpp b/src/plugins/qt4projectmanager/makestep.cpp
index d88281ce59681fa96274350cae9b2e46f21a742a..59acdb1b5e010f395c8f78ac86e34d49ad465b41 100644
--- a/src/plugins/qt4projectmanager/makestep.cpp
+++ b/src/plugins/qt4projectmanager/makestep.cpp
@@ -69,7 +69,7 @@ ProjectExplorer::BuildParserInterface *MakeStep::buildParser(const QtVersion * c
 {
     QString buildParser;
     QtVersion::ToolchainType type = version->toolchainType();
-    if( type == QtVersion::MSVC || type == QtVersion::WINCE)
+    if ( type == QtVersion::MSVC || type == QtVersion::WINCE)
         buildParser = Constants::BUILD_PARSER_MSVC;
     else
         buildParser = Constants::BUILD_PARSER_GCC;
@@ -92,18 +92,18 @@ bool MakeStep::init(const QString &name)
     QString workingDirectory;
     if (project()->value(name, "useShadowBuild").toBool())
         workingDirectory = project()->value(name, "buildDirectory").toString();
-    if(workingDirectory.isEmpty())
+    if (workingDirectory.isEmpty())
         workingDirectory = QFileInfo(project()->file()->fileName()).absolutePath();
     setWorkingDirectory(name, workingDirectory);
 
     //NBS only dependency on Qt4Project, we probably simply need a MakeProject from which Qt4Project derives
     QString makeCmd = qobject_cast<Qt4Project *>(project())->qtVersion(name)->makeCommand();
-    if(!value(name, "makeCmd").toString().isEmpty())
+    if (!value(name, "makeCmd").toString().isEmpty())
         makeCmd = value(name, "makeCmd").toString();
     if (!QFileInfo(makeCmd).isAbsolute()) {
         // Try to detect command in environment
         QString tmp = environment.searchInPath(makeCmd);
-        if(tmp == QString::null) {
+        if (tmp == QString::null) {
             emit addToOutputWindow(tr("<font color=\"#ff0000\">Could not find make command: %1 "\
                                       "in the build environment</font>").arg(makeCmd));
             return false;
@@ -291,7 +291,7 @@ void MakeStepConfigWidget::init(const QString &buildConfiguration)
     bool showPage0 = buildConfiguration.isNull();
     m_ui.stackedWidget->setCurrentIndex(showPage0? 0 : 1);
 
-    if(!showPage0) {
+    if (!showPage0) {
         Qt4Project *pro = qobject_cast<Qt4Project *>(m_makeStep->project());
         m_ui.makeLabel->setText(tr("Override %1:").arg(pro->qtVersion(buildConfiguration)->makeCommand()));
 
diff --git a/src/plugins/qt4projectmanager/msvcenvironment.cpp b/src/plugins/qt4projectmanager/msvcenvironment.cpp
index 1c3a158d72fc4f79d1628d9a3bdabc5f349d3602..48d751f0f2593b7f87b0e7d3a833c950f59b4b97 100644
--- a/src/plugins/qt4projectmanager/msvcenvironment.cpp
+++ b/src/plugins/qt4projectmanager/msvcenvironment.cpp
@@ -66,7 +66,7 @@ QList<MSVCEnvironment> MSVCEnvironment::availableVersions()
     QSettings registry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7", 
                        QSettings::NativeFormat);
     QStringList versions = registry.allKeys();
-    foreach(const QString &version, versions) {
+    foreach (const QString &version, versions) {
         QString dir = registry.value(version).toString();
         result << MSVCEnvironment(version, dir);
     }
@@ -92,7 +92,7 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const
         QString varsbat = m_path + "Common7\\Tools\\vsvars32.bat";
         if (QFileInfo(varsbat).exists()) {
             QTemporaryFile tf(QDir::tempPath() + "\\XXXXXX.bat");
-            if(!tf.open())
+            if (!tf.open())
                 return e;
             QString filename = tf.fileName();
             tf.write("call \"" + varsbat.toLocal8Bit()+"\"\r\n");
@@ -107,13 +107,13 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const
             tf.close();
 
             QFile vars(QDir::tempPath() + "\\qtcreator-msvc-environment.txt");
-            if(vars.exists() && vars.open(QIODevice::ReadOnly)) {
-                while(!vars.atEnd()) {
+            if (vars.exists() && vars.open(QIODevice::ReadOnly)) {
+                while (!vars.atEnd()) {
                     QByteArray line = vars.readLine();
                     QString line2 = QString::fromLocal8Bit(line);
                     line2 = line2.trimmed();
                     QRegExp regexp("(\\w*)=(.*)");
-                    if(regexp.exactMatch(line2)) {
+                    if (regexp.exactMatch(line2)) {
                         QString variable = regexp.cap(1);
                         QString value = regexp.cap(2);
                         value.replace('%' + variable + '%', e.value(variable));
@@ -137,13 +137,13 @@ Environment MSVCEnvironment::addToEnvironment(const Environment &env) const
 
 
 //    QFile varsbat(m_path + "Common7\\Tools\\vsvars32.bat");
-//    if(varsbat.exists() && varsbat.open(QIODevice::ReadOnly)) {
-//        while(!varsbat.atEnd()) {
+//    if (varsbat.exists() && varsbat.open(QIODevice::ReadOnly)) {
+//        while (!varsbat.atEnd()) {
 //            QByteArray line = varsbat.readLine();
 //            QString line2 = QString::fromLocal8Bit(line);
 //            line2 = line2.trimmed();
 //            QRegExp regexp("\\s*@?(S|s)(E|e)(T|t)\\s*(\\w*)=(.*)");
-//            if(regexp.exactMatch(line2)) {
+//            if (regexp.exactMatch(line2)) {
 //                QString variable = regexp.cap(4);
 //                QString value = regexp.cap(5);
 //                value.replace('%' + variable + '%', e.value(variable));
diff --git a/src/plugins/qt4projectmanager/profilereader.cpp b/src/plugins/qt4projectmanager/profilereader.cpp
index 9f65cc890d0da62b194421dfc481cdc4bac07c3d..2b4c817928f385e54b8cdba0302f3282be311ecd 100644
--- a/src/plugins/qt4projectmanager/profilereader.cpp
+++ b/src/plugins/qt4projectmanager/profilereader.cpp
@@ -45,7 +45,7 @@ ProFileReader::ProFileReader()
 
 ProFileReader::~ProFileReader()
 {
-    foreach(ProFile *pf, m_proFiles)
+    foreach (ProFile *pf, m_proFiles)
         delete pf;
 }
 
diff --git a/src/plugins/qt4projectmanager/qmakestep.cpp b/src/plugins/qt4projectmanager/qmakestep.cpp
index 44780a7dcc5584ce297475f637b1a619e41235dd..786675e84b34f56c52aa2106b94a80a87638d975 100644
--- a/src/plugins/qt4projectmanager/qmakestep.cpp
+++ b/src/plugins/qt4projectmanager/qmakestep.cpp
@@ -65,7 +65,7 @@ QStringList QMakeStep::arguments(const QString &buildConfiguration)
     QStringList arguments;
     arguments << project()->file()->fileName();
     if (!additonalArguments.contains("-spec")) {
-        if(m_pro->value("useVBOX").toBool()) { //NBS TODO don't special case VBOX like this
+        if (m_pro->value("useVBOX").toBool()) { //NBS TODO don't special case VBOX like this
             arguments << "-spec" << "linux-i686fb-g++";
             arguments << "-unix";
         } else {
@@ -116,7 +116,7 @@ bool QMakeStep::init(const QString &name)
     QString workingDirectory = m_pro->buildDirectory(name);
 
     Environment environment = m_pro->environment(name);
-    if(!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec())
+    if (!environment.value("QMAKESPEC").isEmpty() && environment.value("QMAKESPEC") != qtVersion->mkspec())
         emit addToOutputWindow(tr("QMAKESPEC set to ") + environment.value("QMAKESPEC") +
                                tr(" overrides mkspec of selected qt ")+qtVersion->mkspec());
 
diff --git a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp
index a9d7753cfbbc76255e9f2415255cbdac4b5a454a..75ea55097c1fa98c20580179fb08374260c00a66 100644
--- a/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp
+++ b/src/plugins/qt4projectmanager/qt4buildconfigwidget.cpp
@@ -118,31 +118,31 @@ void Qt4BuildConfigWidget::setupQtVersionsComboBox()
     if (m_buildConfiguration.isEmpty()) // not yet initialized
         return;
 
-    disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(const QString &)),
-        this, SLOT(qtVersionComboBoxCurrentIndexChanged(const QString &)));
+    disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
+        this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
 
     m_ui->qtVersionComboBox->clear();
     m_ui->qtVersionComboBox->addItem(tr("Default Qt Version"), 0);
 
-    if(m_pro->qtVersionId(m_buildConfiguration) == 0) {
+    if (m_pro->qtVersionId(m_buildConfiguration) == 0) {
         m_ui->qtVersionComboBox->setCurrentIndex(0);
         m_ui->invalidQtWarningLabel->setVisible(false);
     }
     // Add Qt Versions to the combo box
     QtVersionManager *vm = m_pro->qt4ProjectManager()->versionManager();
     const QList<QtVersion *> &versions = vm->versions();
-    for(int i=0; i<versions.size(); ++i) {
+    for (int i = 0; i < versions.size(); ++i) {
         m_ui->qtVersionComboBox->addItem(versions.at(i)->name(), versions.at(i)->uniqueId());
 
-        if(versions.at(i)->uniqueId() == m_pro->qtVersionId(m_buildConfiguration)) {
-            m_ui->qtVersionComboBox->setCurrentIndex(i+1);
+        if (versions.at(i)->uniqueId() == m_pro->qtVersionId(m_buildConfiguration)) {
+            m_ui->qtVersionComboBox->setCurrentIndex(i + 1);
             m_ui->invalidQtWarningLabel->setVisible(!versions.at(i)->isValid());
         }
     }
 
     // And connect again
-    connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(const QString &)),
-        this, SLOT(qtVersionComboBoxCurrentIndexChanged(const QString &)));
+    connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
+        this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
 }
 
 void Qt4BuildConfigWidget::shadowBuildButtonClicked()
@@ -180,7 +180,7 @@ void Qt4BuildConfigWidget::shadowBuildLineEditTextChanged()
     m_ui->importLabel->setVisible(false);
     if (m_ui->shadowBuildCheckBox->isChecked()) {
         QString qtPath = m_pro->qt4ProjectManager()->versionManager()->findQtVersionFromMakefile(m_ui->shadowBuildLineEdit->text());
-        if(!qtPath.isEmpty()) {
+        if (!qtPath.isEmpty()) {
             m_ui->importLabel->setVisible(true);
         }
     }
@@ -252,7 +252,7 @@ void Qt4BuildConfigWidget::qtVersionComboBoxCurrentIndexChanged(const QString &)
     }
     bool isValid = m_pro->qt4ProjectManager()->versionManager()->version(newQtVersion)->isValid();
     m_ui->invalidQtWarningLabel->setVisible(!isValid);
-    if(newQtVersion != m_pro->qtVersionId(m_buildConfiguration)) {
+    if (newQtVersion != m_pro->qtVersionId(m_buildConfiguration)) {
         m_pro->setQtVersion(m_buildConfiguration, newQtVersion);
         m_pro->update();
     }
diff --git a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp
index 98dbd196a1d9ca8d3c6890a2d1fbbf4014112824..84ae6744a455e878f142a3694065c83a062079e4 100644
--- a/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp
+++ b/src/plugins/qt4projectmanager/qt4buildenvironmentwidget.cpp
@@ -127,7 +127,7 @@ void Qt4BuildEnvironmentWidget::removeEnvironmentButtonClicked()
 void Qt4BuildEnvironmentWidget::unsetEnvironmentButtonClicked()
 {
     const QString &name = m_environmentModel->indexToVariable(m_ui->environmentTreeView->currentIndex());
-    if(!m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->mergedEnvironments())
+    if (!m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->mergedEnvironments())
         m_environmentModel->removeVariable(name);
     else
         m_environmentModel->unset(name);
@@ -138,7 +138,7 @@ void Qt4BuildEnvironmentWidget::switchEnvironmentTab(int newTab)
 {
     bool mergedEnvironments = (newTab == 0);
     m_environmentModel->setMergedEnvironments(mergedEnvironments);
-    if(mergedEnvironments) {
+    if (mergedEnvironments) {
         m_ui->removeButton->setText(tr("Reset"));
     } else {
         m_ui->removeButton->setText(tr("Remove"));
@@ -153,8 +153,8 @@ void Qt4BuildEnvironmentWidget::updateButtonsEnabled()
 void Qt4BuildEnvironmentWidget::environmentCurrentIndexChanged(const QModelIndex &current, const QModelIndex &previous)
 {
     Q_UNUSED(previous)
-    if(current.isValid()) {
-        if(m_environmentModel->mergedEnvironments()) {
+    if (current.isValid()) {
+        if (m_environmentModel->mergedEnvironments()) {
             const QString &name = m_environmentModel->indexToVariable(current);
             bool modified = m_environmentModel->isInBaseEnvironment(name) && m_environmentModel->changes(name);
             bool unset = m_environmentModel->isUnset(name);
diff --git a/src/plugins/qt4projectmanager/qt4nodes.cpp b/src/plugins/qt4projectmanager/qt4nodes.cpp
index 73e3620f9bccfbf4e6f54111a9690692be3f07b5..556e7798f9f81f8bff00c522cab53644e9c7562e 100644
--- a/src/plugins/qt4projectmanager/qt4nodes.cpp
+++ b/src/plugins/qt4projectmanager/qt4nodes.cpp
@@ -321,7 +321,7 @@ void Qt4PriFileNode::changeFiles(const FileType fileType,
     }
 
     ProFile *includeFile = reader->proFileFor(m_projectFilePath);
-    if(!includeFile) {
+    if (!includeFile) {
         m_project->proFileParseError(tr("Error while changing pro file %1.").arg(m_projectFilePath));
     }
 
@@ -418,7 +418,7 @@ void Qt4PriFileNode::save(ProFile *includeFile)
     Core::FileManager *fileManager = core->fileManager();
     QList<Core::IFile *> allFileHandles = fileManager->managedFiles(includeFile->fileName());
     Core::IFile *modifiedFileHandle = 0;
-    foreach(Core::IFile *file, allFileHandles)
+    foreach (Core::IFile *file, allFileHandles)
         if (file->fileName() == includeFile->fileName())
             modifiedFileHandle = file;
 
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index b3950ab63b721581430b0f31d14712bd3a13cae5..edaabdf154eb6b51f415007227f13f4a2cb0326b 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -273,7 +273,7 @@ void Qt4Project::qtVersionsChanged()
     foreach (QString bc, buildConfigurations()) {
         if (!qt4ProjectManager()->versionManager()->version(qtVersionId(bc))->isValid()) {
             setQtVersion(bc, 0);
-            if(bc == activeBuildConfiguration())
+            if (bc == activeBuildConfiguration())
                 update();
         }
     }
@@ -663,7 +663,7 @@ QString Qt4Project::buildDirectory(const QString &buildConfiguration) const
     QString workingDirectory;
     if (value(buildConfiguration, "useShadowBuild").toBool())
         workingDirectory = value(buildConfiguration, "buildDirectory").toString();
-    if(workingDirectory.isEmpty())
+    if (workingDirectory.isEmpty())
         workingDirectory = QFileInfo(file()->fileName()).absolutePath();
     return workingDirectory;
 }
@@ -698,7 +698,7 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const
         qDebug()<<"Looking for qtVersion ID of "<<buildConfiguration;
     int id = 0;
     QVariant vid = value(buildConfiguration, "QtVersionId");
-    if(vid.isValid()) {
+    if (vid.isValid()) {
         id = vid.toInt();
         if (m_manager->versionManager()->version(id)->isValid()) {
             return id;
@@ -711,10 +711,10 @@ int Qt4Project::qtVersionId(const QString &buildConfiguration) const
         QString vname = value(buildConfiguration, "QtVersion").toString();
         if (debug)
             qDebug()<<"  Backward compatibility reading QtVersion"<<vname;
-        if(!vname.isEmpty()) {
+        if (!vname.isEmpty()) {
             const QList<QtVersion *> &versions = m_manager->versionManager()->versions();
             foreach (const QtVersion * const version, versions) {
-                if(version->name() == vname) {
+                if (version->name() == vname) {
                     if (debug)
                         qDebug()<<"found name in versions";
                     const_cast<Qt4Project *>(this)->setValue(buildConfiguration, "QtVersionId", version->uniqueId());
@@ -828,7 +828,7 @@ void Qt4Project::checkForDeletedApplicationProjects()
 
     bool resetActiveRunConfiguration = false;
     QSharedPointer<RunConfiguration> rc(new ProjectExplorer::CustomExecutableRunConfiguration(this));
-    foreach(QSharedPointer<Qt4RunConfiguration> qt4rc, removeList) {
+    foreach (QSharedPointer<Qt4RunConfiguration> qt4rc, removeList) {
         removeRunConfiguration(qt4rc);
         if (activeRunConfiguration() == qt4rc)
             resetActiveRunConfiguration = true;
@@ -905,7 +905,7 @@ bool Qt4Project::hasSubNode(Qt4PriFileNode *root, const QString &path)
     foreach (FolderNode *fn, root->subFolderNodes()) {
         if (qobject_cast<Qt4ProFileNode *>(fn)) {
             // we aren't interested in pro file nodes
-        } else if(Qt4PriFileNode *qt4prifilenode = qobject_cast<Qt4PriFileNode *>(fn)) {
+        } else if (Qt4PriFileNode *qt4prifilenode = qobject_cast<Qt4PriFileNode *>(fn)) {
             if (hasSubNode(qt4prifilenode, path))
                 return true;
         }
diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.cpp b/src/plugins/qt4projectmanager/qt4projectmanager.cpp
index 8ff73970d5374e886a26e30d9c7c4f09b05e4a6f..2e1281682efadfb55f0b0dda604a2da8a8d992b5 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanager.cpp
+++ b/src/plugins/qt4projectmanager/qt4projectmanager.cpp
@@ -102,9 +102,8 @@ void Qt4Manager::unregisterProject(Qt4Project *project)
 
 void Qt4Manager::notifyChanged(const QString &name)
 {
-    foreach(Qt4Project *pro, m_projects) {
+    foreach (Qt4Project *pro, m_projects)
         pro->notifyChanged(name);
-    }
 }
 
 void Qt4Manager::init()
diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
index 28f7ca2a8c812f295128449a426b9bf7bcd20173..b3aaa817ab0707b631a5dcc158b52e21d7e048e2 100644
--- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
@@ -297,7 +297,7 @@ QString Qt4RunConfiguration::qmakeBuildConfigFromBuildConfiguration(const QStrin
     QStringList makeargs = ms->value(buildConfigurationName, "makeargs").toStringList();
     if (makeargs.contains("debug"))
         return "debug";
-    else if(makeargs.contains("release"))
+    else if (makeargs.contains("release"))
         return "release";
 
     // Oh we don't have an explicit make argument
@@ -428,7 +428,7 @@ QStringList Qt4RunConfigurationFactoryUser::canCreate(ProjectExplorer::Project *
     if (qt4project) {
         QStringList applicationProFiles;
         QList<Qt4ProFileNode *> list = qt4project->applicationProFiles();
-        foreach(Qt4ProFileNode * node, list) {
+        foreach (Qt4ProFileNode * node, list) {
             applicationProFiles.append("Qt4RunConfiguration." + node->path());
         }
         return applicationProFiles;
diff --git a/src/plugins/qt4projectmanager/qtversionmanager.cpp b/src/plugins/qt4projectmanager/qtversionmanager.cpp
index ea0da4f989d53d652424e60660062f7f24059d3f..8bb4ca20af065b92033372f471185cc98807e0ce 100644
--- a/src/plugins/qt4projectmanager/qtversionmanager.cpp
+++ b/src/plugins/qt4projectmanager/qtversionmanager.cpp
@@ -158,7 +158,7 @@ QWidget *QtVersionManager::createPage(QWidget *parent)
 void QtVersionManager::updateUniqueIdToIndexMap()
 {
     m_uniqueIdToIndex.clear();
-    for(int i=0; i<m_versions.size(); ++i)
+    for (int i = 0; i < m_versions.size(); ++i)
         m_uniqueIdToIndex.insert(m_versions.at(i)->uniqueId(), i);
 }
 
@@ -225,7 +225,7 @@ QtVersion *QtVersionManager::version(int id) const
     if (pos != -1)
         return m_versions.at(pos);
 
-    if(m_defaultVersion < m_versions.count())
+    if (m_defaultVersion < m_versions.count())
         return m_versions.at(m_defaultVersion);
     else
         return m_emptyVersion;
@@ -248,17 +248,17 @@ void QtVersionManager::addNewVersionsFromInstaller()
     bool defaultVersionWasReset = false;
     foreach (QString newVersion, newVersionsList) {
         QStringList newVersionData = newVersion.split('=');
-        if(newVersionData.count()>=2) {
+        if (newVersionData.count()>=2) {
             if (QDir(newVersionData[1]).exists()) {
                 QtVersion *version = new QtVersion(newVersionData[0], newVersionData[1], m_idcount++ );
-                if(newVersionData.count() >= 3)
+                if (newVersionData.count() >= 3)
                     version->setMingwDirectory(newVersionData[2]);
-                if(newVersionData.count() >= 4)
+                if (newVersionData.count() >= 4)
                     version->setPrependPath(newVersionData[3]);
 
                 bool versionWasAlreadyInList = false;
                 foreach(const QtVersion * const it, m_versions) {
-                    if(QDir(version->path()).canonicalPath() == QDir(it->path()).canonicalPath()) {
+                    if (QDir(version->path()).canonicalPath() == QDir(it->path()).canonicalPath()) {
                         versionWasAlreadyInList = true;
                         break;
                     }
@@ -352,7 +352,7 @@ QString QtVersionManager::findSystemQt() const
 
 QtVersion *QtVersionManager::currentQtVersion() const
 {
-    if(m_defaultVersion < m_versions.count())
+    if (m_defaultVersion < m_versions.count())
         return m_versions.at(m_defaultVersion);
     else
         return m_emptyVersion;
@@ -468,27 +468,27 @@ void QtDirWidget::updateState()
 void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
 {
     m_ui.msvcComboBox->setVisible(false);
-    if(item) {
+    if (item) {
         int index = m_ui.qtdirList->indexOfTopLevelItem(item);
         m_ui.errorLabel->setText("");
         QtVersion::ToolchainType t = m_versions.at(index)->toolchainType();
-        if(t == QtVersion::MinGW) {
+        if (t == QtVersion::MinGW) {
             m_ui.msvcComboBox->setVisible(false);
             m_ui.msvcLabel->setVisible(false);
             m_ui.mingwLineEdit->setVisible(true);
             m_ui.mingwLabel->setVisible(true);
             m_ui.mingwBrowseButton->setVisible(true);
             m_ui.mingwLineEdit->setText(m_versions.at(index)->mingwDirectory());
-        } else if(t == QtVersion::MSVC || t == QtVersion::WINCE){
+        } else if (t == QtVersion::MSVC || t == QtVersion::WINCE){
             m_ui.msvcComboBox->setVisible(false);
             m_ui.msvcLabel->setVisible(true);
             m_ui.mingwLineEdit->setVisible(false);
             m_ui.mingwLabel->setVisible(false);
             m_ui.mingwBrowseButton->setVisible(false);
             QList<MSVCEnvironment> msvcenvironments = MSVCEnvironment::availableVersions();
-            if(msvcenvironments.count() == 0) {
+            if (msvcenvironments.count() == 0) {
                 m_ui.msvcLabel->setText(tr("No Visual Studio Installation found"));
-            } else if(msvcenvironments.count() == 1) {
+            } else if (msvcenvironments.count() == 1) {
                 m_ui.msvcLabel->setText( msvcenvironments.at(0).description());
             } else {
                  m_ui.msvcComboBox->setVisible(true);
@@ -503,7 +503,7 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
                  }
                  m_ui.msvcComboBox->blockSignals(block);
             }
-        } else if(t == QtVersion::INVALID) {
+        } else if (t == QtVersion::INVALID) {
             m_ui.msvcComboBox->setVisible(false);
             m_ui.msvcLabel->setVisible(false);
             m_ui.mingwLineEdit->setVisible(false);
@@ -536,7 +536,7 @@ void QtDirWidget::showEnvironmentPage(QTreeWidgetItem *item)
 
 void QtDirWidget::versionChanged(QTreeWidgetItem *item, QTreeWidgetItem *old)
 {
-    if(old) {
+    if (old) {
         fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(old));
     }
     if (item) {
@@ -607,7 +607,7 @@ void QtDirWidget::updateCurrentQtName()
 
 void QtDirWidget::finish()
 {
-    if(QTreeWidgetItem *item = m_ui.qtdirList->currentItem())
+    if (QTreeWidgetItem *item = m_ui.qtdirList->currentItem())
         fixQtVersionName(m_ui.qtdirList->indexOfTopLevelItem(item));
 }
 
@@ -618,9 +618,9 @@ void QtDirWidget::finish()
 void QtDirWidget::fixQtVersionName(int index)
 {
     int count = m_versions.count();
-    for(int i=0; i<count; ++i) {
-        if(i != index) {
-            if(m_versions.at(i)->name() == m_versions.at(index)->name()) {
+    for (int i = 0; i < count; ++i) {
+        if (i != index) {
+            if (m_versions.at(i)->name() == m_versions.at(index)->name()) {
                 // Same name, find new name
                 QString name = m_versions.at(index)->name();
                 QRegExp regexp("^(.*)\\((\\d)\\)$");
@@ -672,7 +672,7 @@ void QtDirWidget::msvcVersionChanged()
     //get descriptionx
     QList<MSVCEnvironment> msvcEnvironments = MSVCEnvironment::availableVersions();
     foreach(const MSVCEnvironment &msvcEnv, msvcEnvironments) {
-        if(msvcEnv.name() == msvcVersion) {
+        if (msvcEnv.name() == msvcVersion) {
             m_ui.msvcLabel->setText(msvcEnv.description());
             break;
         }
@@ -697,7 +697,7 @@ QtVersion::QtVersion(const QString &name, const QString &path, int id, bool isSy
     : m_name(name), m_isSystemVersion(isSystemVersion), m_notInstalled(false), m_defaultConfigIsDebug(true), m_defaultConfigIsDebugAndRelease(true)
 {
     setPath(path);
-    if(id == -1)
+    if (id == -1)
         m_id = getUniqueId();
     else
         m_id = id;
@@ -872,7 +872,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
                     //Now chop into parts that are intresting
                     QStringList parts;
                     int lastpos = 0;
-                    for(int i=1; i<line.size(); ++i) {
+                    for (int i = 1; i < line.size(); ++i) {
                         if (line.at(i) == QLatin1Char(' ') && line.at(i-1) != QLatin1Char('\\')) {
                             // found a part
                             parts.append(line.mid(lastpos, i-lastpos));
@@ -886,7 +886,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
                         qDebug()<<"part appended:"<<line.mid(lastpos);
 
                     foreach(const QString &part, parts) {
-                        if(debugScan)
+                        if (debugScan)
                             qDebug()<<"now interpreting part"<<part;
                         bool setFlags;
                         // Now try to understand each part for that we do a rather stupid approach, optimize it if you care
@@ -905,7 +905,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
                                 qDebug()<<"part has setFlags:"<<setFlags;
                             // now loop forward, looking for something that looks like debug, release or debug_and_release
 
-                            for(int i=0; i<part.size(); ++i) {
+                            for (int i = 0; i < part.size(); ++i) {
                                 int left = part.size() - i;
                                 if (left >= 17  && QStringRef(&part, i, 17) == "debug_and_release") {
                                         if (setFlags)
@@ -922,7 +922,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
                                             result = QtVersion::QmakeBuildConfig(result | QtVersion::DebugBuild);
                                         if (debugScan)
                                             qDebug()<<"found release new value"<<result;
-                                        i +=7;
+                                        i += 7;
                                 } else if (left >= 5 && QStringRef(&part, i, 5) == "debug") {
                                         if (setFlags)
                                             result = QtVersion::QmakeBuildConfig(result  | QtVersion::DebugBuild);
@@ -930,7 +930,7 @@ QtVersion::QmakeBuildConfig QtVersionManager::scanMakefileForQmakeConfig(const Q
                                             result = QtVersion::QmakeBuildConfig(result  & ~QtVersion::DebugBuild);
                                         if (debugScan)
                                             qDebug()<<"found debug new value"<<result;
-                                        i+=5;
+                                        i += 5;
                                 }
                             }
                         }
@@ -1016,9 +1016,9 @@ void QtVersion::updateVersionInfo() const
                     foreach(const QString &value, values) {
                         if (value == "debug")
                             m_defaultConfigIsDebug = true;
-                        else if(value == "release")
+                        else if (value == "release")
                             m_defaultConfigIsDebug = false;
-                        else if(value == "build_all")
+                        else if (value == "build_all")
                             m_defaultConfigIsDebugAndRelease = true;
                     }
                 }
@@ -1043,11 +1043,11 @@ void QtVersion::updateMkSpec() const
     QString mkspec;
 //    QFile f(path() + "/.qmake.cache");
 //    if (f.exists() && f.open(QIODevice::ReadOnly)) {
-//        while(!f.atEnd()) {
+//        while (!f.atEnd()) {
 //            QByteArray line = f.readLine();
-//            if(line.startsWith("QMAKESPEC")) {
+//            if (line.startsWith("QMAKESPEC")) {
 //                const QList<QByteArray> &temp = line.split('=');
-//                if(temp.size() == 2) {
+//                if (temp.size() == 2) {
 //                    mkspec = temp.at(1).trimmed();
 //                    if (mkspec.startsWith("$$QT_BUILD_TREE/mkspecs/"))
 //                        mkspec = mkspec.mid(QString("$$QT_BUILD_TREE/mkspecs/").length());
@@ -1070,9 +1070,9 @@ void QtVersion::updateMkSpec() const
 #ifdef Q_OS_WIN
         QFile f2(mkspecPath + "/qmake.conf");
         if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
-            while(!f2.atEnd()) {
+            while (!f2.atEnd()) {
                 QByteArray line = f2.readLine();
-                if(line.startsWith("QMAKESPEC_ORIGINAL")) {
+                if (line.startsWith("QMAKESPEC_ORIGINAL")) {
                     const QList<QByteArray> &temp = line.split('=');
                     if (temp.size() == 2) {
                         mkspec = temp.at(1);
@@ -1085,9 +1085,9 @@ void QtVersion::updateMkSpec() const
 #elif defined(Q_OS_MAC)
         QFile f2(mkspecPath + "/qmake.conf");
         if (f2.exists() && f2.open(QIODevice::ReadOnly)) {
-            while(!f2.atEnd()) {
+            while (!f2.atEnd()) {
                 QByteArray line = f2.readLine();
-                if(line.startsWith("MAKEFILE_GENERATOR")) {
+                if (line.startsWith("MAKEFILE_GENERATOR")) {
                     const QList<QByteArray> &temp = line.split('=');
                     if (temp.size() == 2) {
                         const QByteArray &value = temp.at(1);
@@ -1118,7 +1118,7 @@ void QtVersion::updateMkSpec() const
 
     m_mkspecFullPath = mkspec;
     int index = mkspec.lastIndexOf('/');
-    if(index == -1)
+    if (index == -1)
         index = mkspec.lastIndexOf('\\');
     QString mkspecDir = QDir(m_path + "/mkspecs/").canonicalPath();
     if (index >= 0 && QDir(mkspec.left(index)).canonicalPath() == mkspecDir)
@@ -1135,7 +1135,7 @@ QString QtVersion::makeCommand() const
     const QString &spec = mkspec();
     if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
         return "nmake.exe";
-    else if(spec.startsWith("wince"))
+    else if (spec.startsWith("wince"))
         return "nmake.exe";
     else
         return "mingw32-make.exe";
@@ -1152,7 +1152,7 @@ QString QtVersion::qmakeCommand() const
         return m_qmakeCommand;
 
     QDir qtDir = path() + "/bin/";
-    foreach(const QString &possibleCommand, QtVersionManager::possibleQMakeCommands()) {
+    foreach (const QString &possibleCommand, QtVersionManager::possibleQMakeCommands()) {
         QString s = qtDir.absoluteFilePath(possibleCommand);
         QFileInfo qmake(s);
         if (qmake.exists() && qmake.isExecutable()) {
@@ -1172,13 +1172,13 @@ QtVersion::ToolchainType QtVersion::toolchainType() const
     if (!isValid())
         return INVALID;
     const QString &spec = mkspec();
-    if(spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
+    if (spec.contains("win32-msvc") || spec.contains(QLatin1String("win32-icc")))
         return MSVC;
-    else if(spec == "win32-g++")
+    else if (spec == "win32-g++")
         return MinGW;
-    else if(spec == QString::null)
+    else if (spec == QString::null)
         return INVALID;
-    else if(spec.startsWith("wince"))
+    else if (spec.startsWith("wince"))
         return WINCE;
     else
         return OTHER;
@@ -1224,32 +1224,32 @@ Environment QtVersion::addToEnvironment(const Environment &env)
     // or add Mingw dirs
     // or do nothing on other
     QtVersion::ToolchainType t = toolchainType();
-    if(t == QtVersion::MinGW) {
+    if (t == QtVersion::MinGW) {
         QFileInfo mingwFileInfo(m_mingwDirectory + "/bin");
-        if(mingwFileInfo.exists())
+        if (mingwFileInfo.exists())
             e.prependOrSetPath(m_mingwDirectory + "/bin");
-    } else if(t == QtVersion::MSVC) {
+    } else if (t == QtVersion::MSVC) {
         QList<MSVCEnvironment> list = MSVCEnvironment::availableVersions();
-        if(list.count() == 1) {
+        if (list.count() == 1) {
             e = list.at(0).addToEnvironment(e);
         } else {
             foreach(const MSVCEnvironment &m, list) {
-                if(m.name() == m_msvcVersion) {
+                if (m.name() == m_msvcVersion) {
                     e = m.addToEnvironment(e);
                     break;
                 }
             }
         }
-    } else if(t == QtVersion::WINCE) {
+    } else if (t == QtVersion::WINCE) {
         QString msvcPath;
         // Find MSVC path
         QList<MSVCEnvironment> list = MSVCEnvironment::availableVersions();
-        if(list.count() == 1) {
+        if (list.count() == 1) {
             msvcPath = list.at(0).path();
             e = list.at(0).addToEnvironment(e);
         } else {
             foreach(const MSVCEnvironment &m, list) {
-                if(m.name() == m_msvcVersion) {
+                if (m.name() == m_msvcVersion) {
                     e = m.addToEnvironment(e);
                     msvcPath = m.path();
                     break;
@@ -1268,8 +1268,8 @@ Environment QtVersion::addToEnvironment(const Environment &env)
         CeSdkHandler cesdkhandler;
         cesdkhandler.parse(msvcPath);
         e = cesdkhandler.find(platformName).addToEnvironment(e);
-    } else if(t == QtVersion::OTHER) {
-        if(!m_prependPath.isEmpty())
+    } else if (t == QtVersion::OTHER) {
+        if (!m_prependPath.isEmpty())
             e.prependOrSetPath(m_prependPath);
     }
     return e;
diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp
index 53972631c6884fb19bf94f33fd31c8284eba27fe..bf77fde7a3f7eb6b92091723e871e30f2b3c4744 100644
--- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp
+++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp
@@ -93,7 +93,7 @@ static QString pluginDependencies(const PluginBaseClasses *plb)
                                QString(QLatin1String(plb->dependentModules)).split(blank) :
                                QStringList();
     pluginModules.push_back(QLatin1String(plb->module));
-    foreach(const QString &module, pluginModules) {
+    foreach (const QString &module, pluginModules) {
         if (!dependencies.isEmpty())
             dependencies += blank;
         dependencies += ModulesPage::idOfModule(module);
diff --git a/src/plugins/qtscripteditor/qtscripteditor.cpp b/src/plugins/qtscripteditor/qtscripteditor.cpp
index fa10cdd51027bf231a30000f4c7908efa6e545e5..673c7a02fd8a1560ed2783bf8ffa79f58ee134d7 100644
--- a/src/plugins/qtscripteditor/qtscripteditor.cpp
+++ b/src/plugins/qtscripteditor/qtscripteditor.cpp
@@ -159,14 +159,12 @@ void ScriptEditor::contextMenuEvent(QContextMenuEvent *e)
 
     if (Core::IActionContainer *mcontext = m_core->actionManager()->actionContainer(QtScriptEditor::Constants::M_CONTEXT)) {
         QMenu *contextMenu = mcontext->menu();
-        foreach(QAction *action, contextMenu->actions()) {
+        foreach (QAction *action, contextMenu->actions())
             menu->addAction(action);
-        }
     }
 
     menu->exec(e->globalPos());
     delete menu;
-
 }
 
 } // namespace Internal
diff --git a/src/plugins/snippets/snippetswindow.cpp b/src/plugins/snippets/snippetswindow.cpp
index d549a06cf7f708272343e6716ba2d74c532e045a..866e75359354c9bb2f60e1375c1b614b3ff7c48d 100644
--- a/src/plugins/snippets/snippetswindow.cpp
+++ b/src/plugins/snippets/snippetswindow.cpp
@@ -243,7 +243,7 @@ void SnippetsWindow::showInputWidget(bool canceled, const QString &value)
     } else {
         QString desc = m_currentSnippet->argumentDescription(m_requiredArgs.first());
         QString def = m_currentSnippet->argumentDefault(m_requiredArgs.first());
-        foreach(QString arg, m_args) {
+        foreach (const QString &arg, m_args) {
             desc = desc.arg(arg);
             def = def.arg(arg);
         }
diff --git a/src/plugins/subversion/subversionplugin.cpp b/src/plugins/subversion/subversionplugin.cpp
index a24bb7d3d06bbb0e652143e6a73cc134332f97a1..aad871187f5901c52b3913fffffbe200aae47720 100644
--- a/src/plugins/subversion/subversionplugin.cpp
+++ b/src/plugins/subversion/subversionplugin.cpp
@@ -194,7 +194,7 @@ SubversionPlugin::~SubversionPlugin()
     }
 
     if (!m_editorFactories.empty()) {
-        foreach(Core::IEditorFactory* pf, m_editorFactories)
+        foreach (Core::IEditorFactory* pf, m_editorFactories)
             removeObject(pf);
         qDeleteAll(m_editorFactories);
         m_editorFactories.clear();
@@ -579,9 +579,8 @@ void SubversionPlugin::revertCurrentFile()
 
     Core::FileManager *fm = m_coreInstance->fileManager();
     QList<Core::IFile *> files = fm->managedFiles(file);
-    foreach (Core::IFile *file, files) {
+    foreach (Core::IFile *file, files)
         fm->blockFileChange(file);
-    }
 
     // revert
     args.clear();
@@ -726,7 +725,7 @@ QStringList SubversionPlugin::parseStatusOutput(const QString &output) const
     QStringList changeSet;
     const QString newLine = QString(QLatin1Char('\n'));
     const QStringList list = output.split(newLine, QString::SkipEmptyParts);
-    foreach (const QString& l, list) {
+    foreach (const QString &l, list) {
         QString line(l.trimmed());
         if (line.startsWith(QLatin1Char('A')) || line.startsWith(QLatin1Char('D'))
             || line.startsWith(QLatin1Char('M')))
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index 82a4201b264576bdc79dacc33b6488bc32695357..168e843150109cf0d66cee4e8210e2ca71d5dab0 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1635,6 +1635,20 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
     QRect er = e->rect();
     QRect viewportRect = viewport()->rect();
 
+    const QColor baseColor = palette().base().color();
+    const int blendBase = (baseColor.value() > 128) ? 0 : 255;
+    // Darker backgrounds may need a bit more contrast
+    // (this calculation is temporary solution until we have a setting for this color)
+    const int blendFactor = (baseColor.value() > 128) ? 8 : 16;
+    const QColor blendColor(
+        (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256,
+        (blendBase * blendFactor + baseColor.green() * (256 - blendFactor)) / 256,
+        (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256);
+    if (d->m_visibleWrapColumn > 0) {
+        qreal lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4;
+        painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), blendColor);
+    }
+
     // keep right margin clean from full-width selection
     int maxX = offset.x() + qMax((qreal)viewportRect.width(), documentLayout->documentSize().width())
                - doc->documentMargin();
@@ -1647,7 +1661,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
 
     QAbstractTextDocumentLayout::PaintContext context = getPaintContext();
 
-
     if (!d->m_findScope.isNull()) {
         QAbstractTextDocumentLayout::Selection selection;
         selection.format.setBackground(d->m_searchScopeFormat.background());
@@ -1672,20 +1685,6 @@ void BaseTextEditor::paintEvent(QPaintEvent *e)
         blockSelection->lastColumn = qMax(columnA, columnB) + d->m_blockSelectionExtraX;
     }
 
-    const QColor baseColor = palette().base().color();
-    const int blendBase = (baseColor.value() > 128) ? 0 : 255;
-    // Darker backgrounds may need a bit more contrast
-    // (this calculation is temporary solution until we have a setting for this color)
-    const int blendFactor = (baseColor.value() > 128) ? 8 : 16;
-    const QColor blendColor(
-        (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256,
-        (blendBase * blendFactor + baseColor.green() * (256 - blendFactor)) / 256,
-        (blendBase * blendFactor + baseColor.blue() * (256 - blendFactor)) / 256);
-    if (d->m_visibleWrapColumn > 0) {
-        qreal lineX = fontMetrics().averageCharWidth() * d->m_visibleWrapColumn + offset.x() + 4;
-        painter.fillRect(QRectF(lineX, 0, viewportRect.width() - lineX, viewportRect.height()), blendColor);
-    }
-
     QTextBlock visibleCollapsedBlock;
     QPointF visibleCollapsedBlockOffset;
 
diff --git a/src/plugins/texteditor/basetextmark.cpp b/src/plugins/texteditor/basetextmark.cpp
index 07af35771874b9635baf5a08d6e550b2633717c8..d3ec41eb293f5d8409bd72a61b80eb6a2db01a69 100644
--- a/src/plugins/texteditor/basetextmark.cpp
+++ b/src/plugins/texteditor/basetextmark.cpp
@@ -60,9 +60,8 @@ void BaseTextMark::init()
     Core::EditorManager *em = ExtensionSystem::PluginManager::instance()->getObject<Core::ICore>()->editorManager();
     connect(em, SIGNAL(editorOpened(Core::IEditor *)), this, SLOT(editorOpened(Core::IEditor *)));
 
-    foreach(Core::IEditor *editor, em->openedEditors()) {
+    foreach (Core::IEditor *editor, em->openedEditors())
         editorOpened(editor);
-    }
 }
 
 void BaseTextMark::editorOpened(Core::IEditor *editor)
@@ -132,7 +131,6 @@ void BaseTextMark::moveMark(const QString & /* filename */, int /* line */)
     delete m_internalMark;
     m_internalMark = 0;
 
-    foreach(Core::IEditor *editor, em->openedEditors()) {
+    foreach (Core::IEditor *editor, em->openedEditors())
         editorOpened(editor);
-    }
 }
diff --git a/src/plugins/texteditor/codecselector.cpp b/src/plugins/texteditor/codecselector.cpp
index a8ff2e68bc3721e6f2feb9118400f3f5416b6038..3dcdf9f37353b32cbbef8ae42061e286b877f0b2 100644
--- a/src/plugins/texteditor/codecselector.cpp
+++ b/src/plugins/texteditor/codecselector.cpp
@@ -87,15 +87,15 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc)
     QList<int> mibs = QTextCodec::availableMibs();
     qSort(mibs);
     QList<int> sortedMibs;
-    foreach(int mib, mibs)
+    foreach (int mib, mibs)
         if (mib >= 0)
             sortedMibs += mib;
-    foreach(int mib, mibs)
+    foreach (int mib, mibs)
         if (mib < 0)
             sortedMibs += mib;
 
     int currentIndex = -1;
-    foreach(int mib, sortedMibs) {
+    foreach (int mib, sortedMibs) {
         QTextCodec *c = QTextCodec::codecForMib(mib);
         if (!buf.isEmpty()) {
 
@@ -109,9 +109,8 @@ CodecSelector::CodecSelector(QWidget *parent, BaseTextDocument *doc)
                 continue;
         }
         QString names = QString::fromLatin1(c->name());
-        foreach(QByteArray alias, c->aliases()) {
+        foreach (QByteArray alias, c->aliases())
             names += QLatin1String(" / ") + QString::fromLatin1(alias);
-        }
         if (doc->codec() == c)
             currentIndex = encodings.count();
         encodings << names;
diff --git a/src/qworkbench.pri b/src/qworkbench.pri
index e869ce452a8aba19d28d009046cb44a32833adf4..1f84296084255cab76f64eda83f120e353738ebe 100644
--- a/src/qworkbench.pri
+++ b/src/qworkbench.pri
@@ -1,16 +1,14 @@
 IDE_SOURCE_TREE = $$PWD/../
 
-isEmpty(TEST) {
-    CONFIG(debug, debug|release) {
+isEmpty(TEST):CONFIG(debug, debug|release) {
+    !debug_and_release|build_pass {
         TEST = 1
     }
 }
 
-!isEmpty(TEST) {
-    equals(TEST, 1) {
-        QT +=testlib
-        DEFINES+=WITH_TESTS
-    }
+equals(TEST, 1) {
+    QT +=testlib
+    DEFINES += WITH_TESTS
 }
 
 isEmpty(IDE_BUILD_TREE) {
diff --git a/tests/auto/profilereader/sync b/tests/auto/profilereader/sync
index f0950addcc8806cbd4f7b40ad22d6a779d7c7608..9dcbc91dcae545259fa8746702403c34d8e83609 100755
--- a/tests/auto/profilereader/sync
+++ b/tests/auto/profilereader/sync
@@ -53,7 +53,7 @@ while ( @ARGV ) {
     if ("$arg" eq "-h" || "$arg" eq "-help" || "$arg" eq "--help" || "$arg" eq "?" || "$arg" eq "/?" || "$arg" eq "-?") {
 	showUsage();
 	exit(0);
-    } elsif("$arg" eq "-qtdir") {
+    } elsif ("$arg" eq "-qtdir") {
 	$qtSrcTree = shift @ARGV;
     } else {
 	print "Unknown option: $arg\n";