diff --git a/lib/qtcreator/qtcomponents/custom/ButtonGroup.js b/lib/qtcreator/qtcomponents/custom/ButtonGroup.js
index 19d05fee33d95bbfb302efab2dc1a3d05444c871..0a56b3cd069e663a136894d6f18edd2def0895b9 100644
--- a/lib/qtcreator/qtcomponents/custom/ButtonGroup.js
+++ b/lib/qtcreator/qtcomponents/custom/ButtonGroup.js
@@ -57,9 +57,9 @@ function build() {
     if (nrButtons == 0)
         return;
 
-    if (self.checkedButton)
+    if (self.checkedButton) {
         self.checkedButton.checked = true;
-    else if (self.exclusive) {
+    } else if (self.exclusive) {
         self.checkedButton = visibleButtons[0];
         self.checkedButton.checked = true;
     }
diff --git a/share/qtcreator/dumper/dumper.cpp b/share/qtcreator/dumper/dumper.cpp
index 8d8fa4195a78013c70127fcaba641fceded73ed7..0dd4208d3a700b057af5c2de501b7b845759561a 100644
--- a/share/qtcreator/dumper/dumper.cpp
+++ b/share/qtcreator/dumper/dumper.cpp
@@ -3770,9 +3770,7 @@ void *qDumpObjectData440(
         d.put(",namespace=\"" NS "\",");
         d.put("dumperversion=\"1.3\",");
         d.disarm();
-    }
-
-    else if (protocolVersion == 2 || protocolVersion == 3) {
+    } else if (protocolVersion == 2 || protocolVersion == 3) {
         QDumper d;
 
         d.protocolVersion = protocolVersion;
@@ -3796,9 +3794,7 @@ void *qDumpObjectData440(
                 << d.outerType << d.iname << d.exp << d.iname;
 #endif
         handleProtocolVersion2and3(d);
-    }
-
-    else {
+    } else {
 #if USE_QT_CORE
 #        ifndef QT_BOOTSTRAPPED
         qDebug() << "Unsupported protocol version" << protocolVersion;
diff --git a/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp
index 06f4568f05e8c65424d9290c7cb5af12f96f08fe..8ed9c60f6a62adfafbc0c2f8fce87ac8fd03e823 100644
--- a/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/editor/liveselectiontool.cpp
@@ -257,9 +257,7 @@ void LiveSelectionTool::mouseReleaseEvent(QMouseEvent *event)
 {
     if (m_singleSelectionManipulator.isActive()) {
         m_singleSelectionManipulator.end(event->pos());
-    }
-    else if (m_rubberbandSelectionManipulator.isActive()) {
-
+    } else if (m_rubberbandSelectionManipulator.isActive()) {
         QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->pos();
         if (mouseMovementVector.toPoint().manhattanLength() < Constants::DragStartDistance) {
             m_singleSelectionManipulator.begin(event->pos());
diff --git a/share/qtcreator/qml/qmlobserver/proxysettings.cpp b/share/qtcreator/qml/qmlobserver/proxysettings.cpp
index 88aac339d141e6216d39ab8f323204466f511926..473ec01c2b34c7026e3cc1aec8034e70d8c1c6dc 100644
--- a/share/qtcreator/qml/qmlobserver/proxysettings.cpp
+++ b/share/qtcreator/qml/qmlobserver/proxysettings.cpp
@@ -84,8 +84,7 @@ QNetworkProxy ProxySettings::httpProxy ()
         proxy.setUser (settings.value ("http_proxy/username", "").toString ());
         proxy.setPassword (settings.value ("http_proxy/password", "").toString ());
         //QNetworkProxy::setApplicationProxy (proxy);
-    }
-    else {
+    } else {
         proxy.setType (QNetworkProxy::NoProxy);
     }
     return proxy;
diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp
index 18f9963d995cbf0beebbcfcef02a5e63973f2885..9cfdba4f098dc1cee364926c5f9aebcc81f84df2 100644
--- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp
+++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp
@@ -464,7 +464,8 @@ void NodeInstanceClientProxy::dispatchCommand(const QVariant &command)
     else if (command.userType() == synchronizeCommandType) {
         SynchronizeCommand synchronizeCommand = command.value<SynchronizeCommand>();
         m_synchronizeId = synchronizeCommand.synchronizeId();
-    } else
+    } else {
         Q_ASSERT(false);
+    }
 }
 } // namespace QmlDesigner
diff --git a/share/qtcreator/qmldesigner/propertyeditor/HelperWidgets/ExtendedFunctionButton.qml b/share/qtcreator/qmldesigner/propertyeditor/HelperWidgets/ExtendedFunctionButton.qml
index 46cbfb22b4feb7ac1210637fbe652b1bfc76497e..1e804835de07b5874418823acdab2a17ec534326 100644
--- a/share/qtcreator/qmldesigner/propertyeditor/HelperWidgets/ExtendedFunctionButton.qml
+++ b/share/qtcreator/qmldesigner/propertyeditor/HelperWidgets/ExtendedFunctionButton.qml
@@ -38,9 +38,9 @@ AnimatedToolButton {
     hoverIconFromFile: "images/submenu.png";
 
     function setIcon() {
-        if (backendValue == null)
+        if (backendValue == null) {
             extendedFunctionButton.iconFromFile = "images/placeholder.png"
-        else if (backendValue.isBound ) {
+        } else if (backendValue.isBound ) {
             if (backendValue.isTranslated) { //translations are a special case
                 extendedFunctionButton.iconFromFile = "images/placeholder.png"
             } else {
diff --git a/src/app/main.cpp b/src/app/main.cpp
index a48d6d4d7c4c7b67d59ed43347c2102271e1cca5..acccb28b49a59b129579be2a9851723fe1246954 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -400,12 +400,11 @@ int main(int argc, char **argv)
         QNetworkProxy proxy(QNetworkProxy::HttpProxy, proxyUrl.host(),
                             proxyUrl.port(), proxyUrl.userName(), proxyUrl.password());
         QNetworkProxy::setApplicationProxy(proxy);
-    }
 # if defined(Q_OS_MAC) // unix and mac
-    else {
+    } else {
         QNetworkProxyFactory::setUseSystemConfiguration(true);
-    }
 # endif
+    }
 #else // windows
     QNetworkProxyFactory::setUseSystemConfiguration(true);
 #endif
diff --git a/src/libs/cplusplus/CppRewriter.cpp b/src/libs/cplusplus/CppRewriter.cpp
index 0224da4b024058d856f19e7708cc26e9d4405488..4e59c377386041fdd5659a557249e80883bd1c31 100644
--- a/src/libs/cplusplus/CppRewriter.cpp
+++ b/src/libs/cplusplus/CppRewriter.cpp
@@ -129,9 +129,9 @@ public:
         virtual void visit(NamedType *type)
         {
             FullySpecifiedType ty = rewrite->env->apply(type->name(), rewrite);
-            if (! ty->isUndefinedType())
+            if (! ty->isUndefinedType()) {
                 temps.append(ty);
-            else {
+            } else {
                 const Name *name = rewrite->rewriteName(type->name());
                 temps.append(control()->namedType(name));
             }
diff --git a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp
index 027c561cef0ed5eee302d9eda5eb32cdc2f2c20a..bbae274faf830a282ec235aa99cbe19495c56072 100644
--- a/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp
+++ b/src/libs/cplusplus/DeprecatedGenTemplateInstance.cpp
@@ -264,7 +264,7 @@ private:
             if (! name)
                 return name;
 
-            else if (const Identifier *nameId = name->asNameId()) {
+            if (const Identifier *nameId = name->asNameId()) {
                 const Identifier *id = control()->identifier(nameId->chars(), nameId->size());
                 return id;
 
diff --git a/src/libs/cplusplus/ExpressionUnderCursor.cpp b/src/libs/cplusplus/ExpressionUnderCursor.cpp
index df002672ee0411c822cd332755aa5e379643d0fa..35e16ab0c1b900a4e002e3e365feb218839755f5 100644
--- a/src/libs/cplusplus/ExpressionUnderCursor.cpp
+++ b/src/libs/cplusplus/ExpressionUnderCursor.cpp
@@ -263,19 +263,20 @@ int ExpressionUnderCursor::startOfFunctionCall(const QTextCursor &cursor) const
     forever {
         const Token &tk = scanner[index - 1];
 
-        if (tk.is(T_EOF_SYMBOL))
+        if (tk.is(T_EOF_SYMBOL)) {
             break;
-        else if (tk.is(T_LPAREN))
+        } else if (tk.is(T_LPAREN)) {
             return scanner.startPosition() + tk.begin();
-        else if (tk.is(T_RPAREN)) {
+        } else if (tk.is(T_RPAREN)) {
             int matchingBrace = scanner.startOfMatchingBrace(index);
 
             if (matchingBrace == index) // If no matching brace found
                 return -1;
 
             index = matchingBrace;
-        } else
+        } else {
             --index;
+        }
     }
 
     return -1;
diff --git a/src/libs/cplusplus/LookupContext.cpp b/src/libs/cplusplus/LookupContext.cpp
index f707601dba117a3fb8c42c58a08399cf2a90411b..5f7b7db3128b4e54876737fc91c59bd6ff2a802b 100644
--- a/src/libs/cplusplus/LookupContext.cpp
+++ b/src/libs/cplusplus/LookupContext.cpp
@@ -57,7 +57,7 @@ static void addNames(const Name *name, QList<const Name *> *names, bool addAllNa
 {
     if (! name)
         return;
-    else if (const QualifiedNameId *q = name->asQualifiedNameId()) {
+    if (const QualifiedNameId *q = name->asQualifiedNameId()) {
         addNames(q->base(), names);
         addNames(q->name(), names, addAllNames);
     } else if (addAllNames || name->isNameId() || name->isTemplateNameId() || name->isAnonymousNameId()) {
@@ -98,7 +98,7 @@ static inline bool compareName(const Name *name, const Name *other)
     if (name == other)
         return true;
 
-    else if (name && other) {
+    if (name && other) {
         const Identifier *id = name->identifier();
         const Identifier *otherId = other->identifier();
 
@@ -599,10 +599,9 @@ QList<LookupItem> ClassOrNamespace::lookup_helper(const Name *name, bool searchI
     if (name) {
 
         if (const QualifiedNameId *q = name->asQualifiedNameId()) {
-            if (! q->base()) // e.g. ::std::string
+            if (! q->base()) { // e.g. ::std::string
                 result = globalNamespace()->find(q->name());
-
-            else if (ClassOrNamespace *binding = lookupType(q->base())) {
+            } else if (ClassOrNamespace *binding = lookupType(q->base())) {
                 result = binding->find(q->name());
 
                 QList<const Name *> fullName;
@@ -864,7 +863,7 @@ ClassOrNamespace *ClassOrNamespace::lookupType_helper(const Name *name,
             if (ClassOrNamespace *e = nestedType(name, origin))
                 return e;
 
-            else if (_templateId) {
+            if (_templateId) {
                 if (_usings.size() == 1) {
                     ClassOrNamespace *delegate = _usings.first();
 
@@ -1265,8 +1264,7 @@ bool ClassOrNamespace::NestedClassInstantiator::isInstantiateNestedClassNeeded(c
                 if (Declaration *declaration = memberAsSymbol->asDeclaration()) {
                     if (containsTemplateType(declaration))
                         return true;
-                }
-                else if (Function *function = memberAsSymbol->asFunction()) {
+                } else if (Function *function = memberAsSymbol->asFunction()) {
                     if (containsTemplateType(function))
                         return true;
                 }
@@ -1447,7 +1445,7 @@ void CreateBindings::process(Document::Ptr doc)
     if (! doc)
         return;
 
-    else if (Namespace *globalNamespace = doc->globalNamespace()) {
+    if (Namespace *globalNamespace = doc->globalNamespace()) {
         if (! _processed.contains(globalNamespace)) {
             _processed.insert(globalNamespace);
 
diff --git a/src/libs/cplusplus/MatchingText.cpp b/src/libs/cplusplus/MatchingText.cpp
index b6fb54011a07581202aaaa9c4bffd372c0493071..6dedaec364bee2f29988a670698f618b6643efb2 100644
--- a/src/libs/cplusplus/MatchingText.cpp
+++ b/src/libs/cplusplus/MatchingText.cpp
@@ -244,7 +244,7 @@ QString MatchingText::insertParagraphSeparator(const QTextCursor &tc) const
             if (current.is(T_EOF_SYMBOL))
                 break;
 
-            else if (current.is(T_CLASS) || current.is(T_STRUCT) || current.is(T_UNION) || current.is(T_ENUM)) {
+            if (current.is(T_CLASS) || current.is(T_STRUCT) || current.is(T_UNION) || current.is(T_ENUM)) {
                 // found a class key.
                 QString str = QLatin1String("};");
 
diff --git a/src/libs/cplusplus/PreprocessorEnvironment.cpp b/src/libs/cplusplus/PreprocessorEnvironment.cpp
index be736b8569a39fcb25d832760da52d3df39cc3ad..23327dfefa733518e7473da196d049a0beb3c3c1 100644
--- a/src/libs/cplusplus/PreprocessorEnvironment.cpp
+++ b/src/libs/cplusplus/PreprocessorEnvironment.cpp
@@ -170,8 +170,7 @@ bool Environment::isBuiltinMacro(const ByteArrayRef &s)
                         }
                     }
                 }
-            }
-            else if (s[2] == 'F') {
+            } else if (s[2] == 'F') {
                 if (s[3] == 'I') {
                     if (s[4] == 'L') {
                         if (s[5] == 'E') {
@@ -183,8 +182,7 @@ bool Environment::isBuiltinMacro(const ByteArrayRef &s)
                         }
                     }
                 }
-            }
-            else if (s[2] == 'L') {
+            } else if (s[2] == 'L') {
                 if (s[3] == 'I') {
                     if (s[4] == 'N') {
                         if (s[5] == 'E') {
@@ -196,8 +194,7 @@ bool Environment::isBuiltinMacro(const ByteArrayRef &s)
                         }
                     }
                 }
-            }
-            else if (s[2] == 'T') {
+            } else if (s[2] == 'T') {
                 if (s[3] == 'I') {
                     if (s[4] == 'M') {
                         if (s[5] == 'E') {
diff --git a/src/libs/cplusplus/ResolveExpression.cpp b/src/libs/cplusplus/ResolveExpression.cpp
index 63dc2b92b25f25cdd2c03d0fd4376b3f63d22581..4b2046645870de3753f68640527cd23895f63bd4 100644
--- a/src/libs/cplusplus/ResolveExpression.cpp
+++ b/src/libs/cplusplus/ResolveExpression.cpp
@@ -576,16 +576,14 @@ bool ResolveExpression::visit(SimpleNameAST *ast)
                 if (n == 0) {
                     item.setType(newType);
                     item.setScope(typeItems[n].scope());
-                }
-                else {
+                } else {
                     LookupItem newItem(item);
                     newItem.setType(newType);
                     newItem.setScope(typeItems[n].scope());
                     newCandidates.push_back(newItem);
                 }
             }
-        }
-        else {
+        } else {
             item.setType(item.declaration()->type());
             item.setScope(item.declaration()->enclosingScope());
         }
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp
index 659b888327bf07afed10f0bb38b55bb7b7df72cb..0f678adf025290d3943504ad7b5f88c3e1b87416 100644
--- a/src/libs/cplusplus/pp-engine.cpp
+++ b/src/libs/cplusplus/pp-engine.cpp
@@ -1862,12 +1862,11 @@ void Preprocessor::handleElseDirective(PPToken *tk, const PPToken &poundToken)
             else if (m_client && !wasSkipping && startSkipping)
                 startSkippingBlocks(poundToken);
         }
-    }
 #ifndef NO_DEBUG
-    else {
+    } else {
         std::cerr << "*** WARNING #else without #if" << std::endl;
-    }
 #endif // NO_DEBUG
+    }
 }
 
 void Preprocessor::handleEndIfDirective(PPToken *tk, const PPToken &poundToken)
@@ -1930,12 +1929,11 @@ void Preprocessor::handleIfDefDirective(bool checkUndefined, PPToken *tk)
             startSkippingBlocks(*tk);
 
         lex(tk); // consume the identifier
-    }
 #ifndef NO_DEBUG
-    else {
+    } else {
         std::cerr << "*** WARNING #ifdef without identifier" << std::endl;
-    }
 #endif // NO_DEBUG
+    }
 }
 
 void Preprocessor::handleUndefDirective(PPToken *tk)
@@ -1948,12 +1946,11 @@ void Preprocessor::handleUndefDirective(PPToken *tk)
         if (m_client && macro)
             m_client->macroAdded(*macro);
         lex(tk); // consume macro name
-    }
 #ifndef NO_DEBUG
-    else {
+    } else {
         std::cerr << "*** WARNING #undef without identifier" << std::endl;
-    }
 #endif // NO_DEBUG
+    }
 }
 
 PPToken Preprocessor::generateToken(enum Kind kind,
diff --git a/src/libs/cplusplus/pp-scanner.cpp b/src/libs/cplusplus/pp-scanner.cpp
index 9f3320e4d3aab3564eb08c08ac32b678d2c3a13c..2b23a3e22893840e5c39dfbb20afd643197d36fe 100644
--- a/src/libs/cplusplus/pp-scanner.cpp
+++ b/src/libs/cplusplus/pp-scanner.cpp
@@ -259,13 +259,13 @@ const char *pp_skip_argument::operator () (const char *__first, const char *__la
     lines = 0;
 
     while (__first != __last) {
-        if (!depth && (*__first == ')' || *__first == ','))
+        if (!depth && (*__first == ')' || *__first == ',')) {
             break;
-        else if (*__first == '(')
+        } else if (*__first == '(') {
             ++depth, ++__first;
-        else if (*__first == ')')
+        } else if (*__first == ')') {
             --depth, ++__first;
-        else if (*__first == '\"') {
+        } else if (*__first == '\"') {
             __first = skip_string_literal (__first, __last);
             lines += skip_string_literal.lines;
         } else if (*__first == '\'') {
@@ -283,8 +283,9 @@ const char *pp_skip_argument::operator () (const char *__first, const char *__la
         } else if (*__first == '\n') {
             ++__first;
             ++lines;
-        } else
+        } else {
             ++__first;
+        }
     }
 
     return __first;
diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp
index 87fa98b9318353ef8d72dbd8161ecdec4f263d11..c8c6d0aaf6ab93c988c768ec22aba8203e31195f 100644
--- a/src/libs/extensionsystem/pluginmanager.cpp
+++ b/src/libs/extensionsystem/pluginmanager.cpp
@@ -1183,9 +1183,9 @@ void PluginManagerPrivate::readPluginPaths()
 
         PluginCollection *collection = 0;
         // find correct plugin collection or create a new one
-        if (pluginCategories.contains(spec->category()))
+        if (pluginCategories.contains(spec->category())) {
             collection = pluginCategories.value(spec->category());
-        else {
+        } else {
             collection = new PluginCollection(spec->category());
             pluginCategories.insert(spec->category(), collection);
         }
diff --git a/src/libs/glsl/glslsymbols.cpp b/src/libs/glsl/glslsymbols.cpp
index 69d02c5d0bf769ac04f33983340de0697b7abbc3..5c4978f0212b5eb8633a181f534a92e6f3145f2e 100644
--- a/src/libs/glsl/glslsymbols.cpp
+++ b/src/libs/glsl/glslsymbols.cpp
@@ -109,9 +109,9 @@ QList<Symbol *> Namespace::members() const
 void Namespace::add(Symbol *symbol)
 {
     Symbol *&sym = _members[symbol->name()];
-    if (! sym)
+    if (! sym) {
         sym = symbol;
-    else if (Function *fun = symbol->asFunction()) {
+    } else if (Function *fun = symbol->asFunction()) {
         if (OverloadSet *o = sym->asOverloadSet()) {
             o->addFunction(fun);
         } else if (Function *firstFunction = sym->asFunction()) {
@@ -121,8 +121,7 @@ void Namespace::add(Symbol *symbol)
             o->addFunction(firstFunction);
             o->addFunction(fun);
             sym = o;
-        }
-        else {
+        } else {
             // ### warning? return false?
         }
     } else {
diff --git a/src/libs/glsl/glsltypes.cpp b/src/libs/glsl/glsltypes.cpp
index f23f3f14c1868385a6c4da31e860b52a14faaf99..1ac7222ac7fdb9fdc4113c06092b065464410fc4 100644
--- a/src/libs/glsl/glsltypes.cpp
+++ b/src/libs/glsl/glsltypes.cpp
@@ -298,9 +298,9 @@ bool MatrixType::isLessThan(const Type *other) const
     Q_ASSERT(other != 0);
     const MatrixType *mat = other->asMatrixType();
     Q_ASSERT(mat != 0);
-    if (_columns < mat->columns())
+    if (_columns < mat->columns()) {
         return true;
-    else if (_columns == mat->columns()) {
+    } else if (_columns == mat->columns()) {
         if (_rows < mat->rows())
             return true;
         else if (_rows == mat->rows() && _elementType < mat->elementType())
diff --git a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp
index d54efe5c59a4bc94c43f878e96c2edbad8a185aa..6d6508ca0a52b9159d8136050ab63a7b7878dea9 100644
--- a/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp
+++ b/src/libs/qmleditorwidgets/easingpane/easingcontextpane.cpp
@@ -228,9 +228,9 @@ void EasingContextPane::setGraphDisplayMode(GraphDisplayMode newMode)
 
 void EasingContextPane::startAnimation()
 {
-    if (m_simulation->running())
+    if (m_simulation->running()) {
         m_simulation->stop();
-    else {
+    } else {
         m_simulation->animate(ui->durationSpinBox->value(), m_easingGraph->easingCurve());
         ui->playButton->setIcon(QIcon(QLatin1String(":/stopicon.png")));
     }
diff --git a/src/libs/qmljs/parser/qmljslexer.cpp b/src/libs/qmljs/parser/qmljslexer.cpp
index 99a800e2efc46dbd29854e75e80789f5afb4d8e3..68e5e9519d4935ef418730d33b1f33a0b0c36c1a 100644
--- a/src/libs/qmljs/parser/qmljslexer.cpp
+++ b/src/libs/qmljs/parser/qmljslexer.cpp
@@ -905,7 +905,7 @@ bool Lexer::scanRegExp(RegExpBodyPrefix prefix)
             while (! _char.isNull() && ! isLineTerminator()) {
                 if (_char == QLatin1Char(']'))
                     break;
-                else if (_char == QLatin1Char('\\')) {
+                if (_char == QLatin1Char('\\')) {
                     // regular expression backslash sequence
                     _tokenText += _char;
                     scanChar();
diff --git a/src/libs/qmljs/qmljsbind.cpp b/src/libs/qmljs/qmljsbind.cpp
index 54b9a204f265b8317c6b25b2680921bb91095508..1e156933d59b07b19dcb8955faa0a9eddcca5d81 100644
--- a/src/libs/qmljs/qmljsbind.cpp
+++ b/src/libs/qmljs/qmljsbind.cpp
@@ -154,9 +154,9 @@ ObjectValue *Bind::bindObject(UiQualifiedId *qualifiedTypeNameId, UiObjectInitia
 
     parentObjectValue = switchObjectValue(objectValue);
 
-    if (parentObjectValue)
+    if (parentObjectValue) {
         objectValue->setMember(QLatin1String("parent"), parentObjectValue);
-    else if (!_rootObjectValue) {
+    } else if (!_rootObjectValue) {
         _rootObjectValue = objectValue;
         _rootObjectValue->setClassName(_doc->componentName());
     }
diff --git a/src/libs/qmljs/qmljsreformatter.cpp b/src/libs/qmljs/qmljsreformatter.cpp
index a9eede5e3e64e5f85c24fd193386129fa19c6ff6..b3d5d1e7d308ad56ced39782fa1d9b32e4309506 100644
--- a/src/libs/qmljs/qmljsreformatter.cpp
+++ b/src/libs/qmljs/qmljsreformatter.cpp
@@ -255,14 +255,13 @@ protected:
             qreal result = badnessFromSplits;
             foreach (const QString &line, lines) {
                 // really long lines should be avoided at all cost
-                if (line.size() > strongMaxLineLength)
+                if (line.size() > strongMaxLineLength) {
                     result += 50 + (line.size() - strongMaxLineLength);
                 // having long lines is bad
-                else if (line.size() > maxLineLength) {
+                } else if (line.size() > maxLineLength) {
                     result += 3 + (line.size() - maxLineLength);
-                }
                 // and even ok-sized lines should have a cost
-                else {
+                } else {
                     result += 1;
                 }
 
diff --git a/src/libs/qmljs/qmljsrewriter.cpp b/src/libs/qmljs/qmljsrewriter.cpp
index b4957f08a29d93337f4093ac38821dfef43926cd..012bad73ee13a3f87df009cc4ab71b5803513b1f 100644
--- a/src/libs/qmljs/qmljsrewriter.cpp
+++ b/src/libs/qmljs/qmljsrewriter.cpp
@@ -282,9 +282,8 @@ void Rewriter::changeBinding(UiObjectInitializer *ast,
             }
 
             break;
-        }
         // for grouped properties:
-        else if (!prefix.isEmpty()) {
+        } else if (!prefix.isEmpty()) {
             if (UiObjectDefinition *def = cast<UiObjectDefinition *>(member)) {
                 if (toString(def->qualifiedTypeNameId) == prefix)
                     changeBinding(def->initializer, suffix, newValue, binding);
@@ -384,10 +383,10 @@ void Rewriter::removeBindingByName(UiObjectInitializer *ast, const QString &prop
         UiObjectMember *member = it->member;
 
         // run full name match (for ungrouped properties):
-        if (isMatchingPropertyMember(propertyName, member))
+        if (isMatchingPropertyMember(propertyName, member)) {
             removeMember(member);
         // check for grouped properties:
-        else if (!prefix.isEmpty()) {
+        } else if (!prefix.isEmpty()) {
             if (UiObjectDefinition *def = cast<UiObjectDefinition *>(member)) {
                 if (toString(def->qualifiedTypeNameId) == prefix)
                     removeGroupedProperty(def, propertyName);
diff --git a/src/libs/qmljs/qmljsscopebuilder.cpp b/src/libs/qmljs/qmljsscopebuilder.cpp
index a68e9e28f258bf273170e5ee5f91638457c5ccb1..2178132498e4e28d6319ffa3f305a16755e5287d 100644
--- a/src/libs/qmljs/qmljsscopebuilder.cpp
+++ b/src/libs/qmljs/qmljsscopebuilder.cpp
@@ -80,10 +80,10 @@ void ScopeBuilder::push(AST::Node *node)
                     break;
             }
             // signals defined in QML
-            if (const ASTSignal *astsig = value_cast<ASTSignal>(value))
+            if (const ASTSignal *astsig = value_cast<ASTSignal>(value)) {
                 _scopeChain->appendJsScope(astsig->bodyScope());
             // signals defined in C++
-            else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
+            } else if (const CppComponentValue *qmlObject = value_cast<CppComponentValue>(owner)) {
                 if (const ObjectValue *scope = qmlObject->signalScope(name))
                     _scopeChain->appendJsScope(scope);
             }
diff --git a/src/libs/qtcomponents/styleitem/qstyleitem.cpp b/src/libs/qtcomponents/styleitem/qstyleitem.cpp
index d7f23334679fd47fa1f173dbbfcb74ba1ab54618..ecdde82d11c3741d7b101b43cb7babcdd39c8eba 100644
--- a/src/libs/qtcomponents/styleitem/qstyleitem.cpp
+++ b/src/libs/qtcomponents/styleitem/qstyleitem.cpp
@@ -860,9 +860,8 @@ QRect QStyleItem::subControlRect(const QString &subcontrolString)
                 subcontrol = QStyle::SC_SpinBoxDown;
             else if (subcontrolString == QLatin1String("up"))
                 subcontrol = QStyle::SC_SpinBoxUp;
-            else if (subcontrolString == QLatin1String("edit")){
+            else if (subcontrolString == QLatin1String("edit"))
                 subcontrol = QStyle::SC_SpinBoxEditField;
-            }
             return qApp->style()->subControlRect(control,
                                                  qstyleoption_cast<QStyleOptionComplex*>(m_styleoption),
                                                  subcontrol, widget());
diff --git a/src/libs/ssh/ssh.qbs b/src/libs/ssh/ssh.qbs
index 924e8918d7d137693d0764c607e3b6c00ebc0a6f..87b006184020ee551e0b17eb83ac408ab81af7d5 100644
--- a/src/libs/ssh/ssh.qbs
+++ b/src/libs/ssh/ssh.qbs
@@ -66,9 +66,9 @@ QtcLibrary {
     }
     property var botanDefines: {
         var result = [];
-        if (useSystemBotan)
+        if (useSystemBotan) {
             result.push("USE_SYSTEM_BOTAN")
-        else {
+        } else {
             result.push("BOTAN_DLL=")
             if (qbs.toolchain === "msvc")
                 result.push("BOTAN_BUILD_COMPILER_IS_MSVC", "BOTAN_TARGET_OS_HAS_GMTIME_S")
diff --git a/src/libs/utils/fancymainwindow.cpp b/src/libs/utils/fancymainwindow.cpp
index 2c3dd06cf0928a00be067b1d6e2fa920305d4336..8db1e21723fd96fa78dab43be60bf7513d9cd2d2 100644
--- a/src/libs/utils/fancymainwindow.cpp
+++ b/src/libs/utils/fancymainwindow.cpp
@@ -124,9 +124,9 @@ void FancyMainWindow::updateDockWidget(QDockWidget *dockWidget)
                        : QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetFloatable;
     if (dockWidget->property("managed_dockwidget").isNull()) { // for the debugger tool bar
         QWidget *titleBarWidget = dockWidget->titleBarWidget();
-        if (d->m_locked && !titleBarWidget && !dockWidget->isFloating())
+        if (d->m_locked && !titleBarWidget && !dockWidget->isFloating()) {
             titleBarWidget = new QWidget(dockWidget);
-        else if ((!d->m_locked || dockWidget->isFloating()) && titleBarWidget) {
+        } else if ((!d->m_locked || dockWidget->isFloating()) && titleBarWidget) {
             delete titleBarWidget;
             titleBarWidget = 0;
         }
diff --git a/src/libs/utils/tooltip/tooltip.cpp b/src/libs/utils/tooltip/tooltip.cpp
index ab2ade2293d1d235360366556c320bf611069aaa..ea5659ba3029e94940e4e315b4640b1c880dfc99 100644
--- a/src/libs/utils/tooltip/tooltip.cpp
+++ b/src/libs/utils/tooltip/tooltip.cpp
@@ -162,9 +162,9 @@ bool ToolTip::tipChanged(const QPoint &pos, const TipContent &content, QWidget *
 
 void ToolTip::setTipRect(QWidget *w, const QRect &rect)
 {
-    if (!m_rect.isNull() && !w)
+    if (!m_rect.isNull() && !w) {
         qWarning("ToolTip::show: Cannot pass null widget if rect is set");
-    else{
+    } else {
         m_widget = w;
         m_rect = rect;
     }
diff --git a/src/libs/utils/unixutils.cpp b/src/libs/utils/unixutils.cpp
index 07e85701a00946cf8d9fc4127af5d7ab49ff0a45..f049a8645c31eb5f51d89cafed883e8abed1ff8e 100644
--- a/src/libs/utils/unixutils.cpp
+++ b/src/libs/utils/unixutils.cpp
@@ -75,15 +75,15 @@ QString UnixUtils::substituteFileBrowserParameters(const QString &pre, const QSt
         if (c == QLatin1Char('%') && i < pre.size()-1) {
             c = pre.at(++i);
             QString s;
-            if (c == QLatin1Char('d'))
+            if (c == QLatin1Char('d')) {
                 s = QLatin1Char('"') + QFileInfo(file).path() + QLatin1Char('"');
-            else if (c == QLatin1Char('f'))
+            } else if (c == QLatin1Char('f')) {
                 s = QLatin1Char('"') + file + QLatin1Char('"');
-            else if (c == QLatin1Char('n'))
+            } else if (c == QLatin1Char('n')) {
                 s = QLatin1Char('"') + QFileInfo(file).fileName() + QLatin1Char('"');
-            else if (c == QLatin1Char('%'))
+            } else if (c == QLatin1Char('%')) {
                 s = c;
-            else {
+            } else {
                 s = QLatin1Char('%');
                 s += c;
             }
diff --git a/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp b/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
index 0a7c59ad967dc508a506d5218ac9edee01fff311..8f91004c03e5be18b97715fe02993cdbe3314e72 100644
--- a/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakehighlighter.cpp
@@ -94,8 +94,7 @@ void CMakeHighlighter::highlightBlock(const QString &text)
                     setFormat(i, 1, m_formats[CMakeStringFormat]);
                 }
                 inStringMode = !inStringMode;
-            }
-            else if (c == '\\') {
+            } else if (c == '\\') {
                 setFormat(i, 1, emptyFormat);
                 buf += c;
                 i++;
diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp
index c0939d29769c96fcee9b3a90676ecebdbc9438ee..938f23f930fa65ed826bc4dd0b87efd7585f0b1c 100644
--- a/src/plugins/coreplugin/mainwindow.cpp
+++ b/src/plugins/coreplugin/mainwindow.cpp
@@ -172,9 +172,9 @@ MainWindow::MainWindow() :
     if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost()) {
         if (baseName == QLatin1String("windows")) {
             // Sometimes we get the standard windows 95 style as a fallback
-            if (QStyleFactory::keys().contains(QLatin1String("Fusion")))
+            if (QStyleFactory::keys().contains(QLatin1String("Fusion"))) {
                 baseName = QLatin1String("fusion"); // Qt5
-            else { // Qt4
+            } else { // Qt4
                 // e.g. if we are running on a KDE4 desktop
                 QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION");
                 if (desktopEnvironment == "kde")
diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp
index a07dbac94681b4e09da855df1358e190bd353f5b..15fcbfc977542a5ba125c85230b11a3a3dea2ea8 100644
--- a/src/plugins/coreplugin/manhattanstyle.cpp
+++ b/src/plugins/coreplugin/manhattanstyle.cpp
@@ -274,18 +274,16 @@ void ManhattanStyle::polish(QWidget *widget)
         if (qobject_cast<QToolButton*>(widget)) {
             widget->setAttribute(Qt::WA_Hover);
             widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
-        }
-        else if (qobject_cast<QLineEdit*>(widget)) {
+        } else if (qobject_cast<QLineEdit*>(widget)) {
             widget->setAttribute(Qt::WA_Hover);
             widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
-        }
-        else if (qobject_cast<QLabel*>(widget))
+        } else if (qobject_cast<QLabel*>(widget)) {
             widget->setPalette(panelPalette(widget->palette()));
-        else if (widget->property("panelwidget_singlerow").toBool())
+        } else if (widget->property("panelwidget_singlerow").toBool()) {
             widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight());
-        else if (qobject_cast<QStatusBar*>(widget))
+        } else if (qobject_cast<QStatusBar*>(widget)) {
             widget->setFixedHeight(Utils::StyleHelper::navigationWidgetHeight() + 2);
-        else if (qobject_cast<QComboBox*>(widget)) {
+        } else if (qobject_cast<QComboBox*>(widget)) {
             widget->setMaximumHeight(Utils::StyleHelper::navigationWidgetHeight() - 2);
             widget->setAttribute(Qt::WA_Hover);
         }
diff --git a/src/plugins/coreplugin/styleanimator.cpp b/src/plugins/coreplugin/styleanimator.cpp
index bd1a9ae4c187ccab2329743005703ab540eac30b..eb1a311cbc39ba284b6b033c481a5f82480659c8 100644
--- a/src/plugins/coreplugin/styleanimator.cpp
+++ b/src/plugins/coreplugin/styleanimator.cpp
@@ -105,8 +105,7 @@ void Transition::paint(QPainter *painter, const QStyleOption *option)
             m_running = false;
             alpha = 1.0;
         }
-    }
-    else {
+    } else {
         m_running = false;
     }
     drawBlendedImage(painter, option->rect, alpha);
diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index b8626fc4e15157a20bb3cc5a3ea6a13a55cebb4a..c20217930c63bb8d571a1bd7b9086f0bb1d1a4f3 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -303,7 +303,7 @@ struct CanonicalSymbol
                 if (classId && classId->isEqualTo(declId))
                     continue; // skip it, it's a ctor or a dtor.
 
-                else if (Function *funTy = r.declaration()->type()->asFunctionType()) {
+                if (Function *funTy = r.declaration()->type()->asFunctionType()) {
                     if (funTy->isVirtual())
                         return r.declaration();
                 }
@@ -1481,10 +1481,9 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
                     int depth = 0;
 
                     for (; j < tokens.size(); ++j) {
-                        if (tokens.at(j).is(T_LPAREN))
+                        if (tokens.at(j).is(T_LPAREN)) {
                             ++depth;
-
-                        else if (tokens.at(j).is(T_RPAREN)) {
+                        } else if (tokens.at(j).is(T_RPAREN)) {
                             if (! --depth)
                                 break;
                         }
@@ -1576,15 +1575,13 @@ CPPEditorWidget::Link CPPEditorWidget::findLinkAt(const QTextCursor &cursor, boo
         const QChar ch = document()->characterAt(pos);
         if (ch.isSpace())
             continue;
-        else {
-            if (ch == QLatin1Char('(') && ! expression.isEmpty()) {
-                tc.setPosition(pos);
-                if (TextEditor::TextBlockUserData::findNextClosingParenthesis(&tc, true))
-                    expression.append(tc.selectedText());
-            }
-
-            break;
+        if (ch == QLatin1Char('(') && ! expression.isEmpty()) {
+            tc.setPosition(pos);
+            if (TextEditor::TextBlockUserData::findNextClosingParenthesis(&tc, true))
+                expression.append(tc.selectedText());
         }
+
+        break;
     }
 
     TypeOfExpression typeOfExpression;
@@ -2070,9 +2067,8 @@ void CPPEditorWidget::updateSemanticInfo(const SemanticInfo &semanticInfo)
 
     if (! m_renameSelections.isEmpty())
         setExtraSelections(CodeSemanticsSelection, m_renameSelections); // ###
-    else {
+    else
         markSymbols(textCursor(), semanticInfo);
-    }
 
     m_lastSemanticInfo.forced = false; // clear the forced flag
 
diff --git a/src/plugins/cppeditor/cppeditorplugin.cpp b/src/plugins/cppeditor/cppeditorplugin.cpp
index 24c046e17be7f9ff14eeed944c924601b8e871cb..56ddd686f86f288255d39c6ddea209a26d098596 100644
--- a/src/plugins/cppeditor/cppeditorplugin.cpp
+++ b/src/plugins/cppeditor/cppeditorplugin.cpp
@@ -376,9 +376,8 @@ void CppEditorPlugin::currentEditorChanged(Core::IEditor *editor)
     if (! editor)
         return;
 
-    else if (CPPEditorWidget *textEditor = qobject_cast<CPPEditorWidget *>(editor->widget())) {
+    if (CPPEditorWidget *textEditor = qobject_cast<CPPEditorWidget *>(editor->widget()))
         textEditor->semanticRehighlight(/*force = */ true);
-    }
 }
 
 void CppEditorPlugin::openTypeHierarchy()
diff --git a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
index 2135ee25ad586a408993933effd2f417507fa6c4..35fa5ee86aa9053de04d96c356fd5979b9a69025 100644
--- a/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
+++ b/src/plugins/cppeditor/cppfunctiondecldeflink.cpp
@@ -778,9 +778,8 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
                 FullySpecifiedType type = rewriteType(newParam->type(), &env, control);
                 newTargetParam = overview.prettyType(type, newParam->name());
                 hadChanges = true;
-            }
             // otherwise preserve as much as possible from the existing parameter
-            else {
+            } else {
                 Symbol *targetParam = targetFunction->argumentAt(existingParamIndex);
                 Symbol *sourceParam = sourceFunction->argumentAt(existingParamIndex);
                 ParameterDeclarationAST *targetParamAst = targetParameterDecls.at(existingParamIndex);
@@ -833,9 +832,8 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
                     newTargetParam += overview.prettyType(replacementType, replacementName);
                     newTargetParam += targetFile->textOf(parameterTypeEnd, parameterEnd);
                     hadChanges = true;
-                }
                 // change the name only?
-                else if (!namesEqual(targetParam->name(), replacementName)) {
+                } else if (!namesEqual(targetParam->name(), replacementName)) {
                     DeclaratorIdAST *id = getDeclaratorId(targetParamAst->declarator);
                     const QString &replacementNameStr = overview.prettyName(replacementName);
                     if (id) {
@@ -878,9 +876,8 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
                         newTargetParam += rest;
                     }
                     hadChanges = true;
-                }
                 // change nothing - though the parameter might still have moved
-                else {
+                } else {
                     if (existingParamIndex != newParamIndex)
                         hadChanges = true;
                     newTargetParam = targetFile->textOf(parameterStart, parameterEnd);
@@ -934,9 +931,8 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
         if (!targetFunction->isConst() && !targetFunction->isVolatile()) {
             cvString.prepend(QLatin1Char(' '));
             changes.insert(targetFile->endOf(targetFunctionDeclarator->rparen_token), cvString);
-        }
         // modify/remove existing specifiers
-        else {
+        } else {
             SimpleSpecifierAST *constSpecifier = 0;
             SimpleSpecifierAST *volatileSpecifier = 0;
             for (SpecifierListAST *it = targetFunctionDeclarator->cv_qualifier_list; it; it = it->next) {
@@ -954,9 +950,8 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
                     changes.remove(targetFile->endOf(constSpecifier->specifier_token - 1), targetFile->endOf(constSpecifier));
                 if (!newFunction->isVolatile())
                     changes.remove(targetFile->endOf(volatileSpecifier->specifier_token - 1), targetFile->endOf(volatileSpecifier));
-            }
             // otherwise adjust, remove or extend the one existing specifier
-            else {
+            } else {
                 SimpleSpecifierAST *specifier = constSpecifier ? constSpecifier : volatileSpecifier;
                 QTC_ASSERT(specifier, return changes);
 
diff --git a/src/plugins/cppeditor/cpphighlighter.cpp b/src/plugins/cppeditor/cpphighlighter.cpp
index 5b02d92502be57bece74cab7c5c54b265fb80049..762f11ce19c53db381e60beebd384c5a69120615 100644
--- a/src/plugins/cppeditor/cpphighlighter.cpp
+++ b/src/plugins/cppeditor/cpphighlighter.cpp
@@ -160,13 +160,11 @@ void CppHighlighter::highlightBlock(const QString &text)
                 onlyHighlightComments = true;
             }
 
-        } else if (tk.is(T_NUMERIC_LITERAL))
+        } else if (tk.is(T_NUMERIC_LITERAL)) {
             setFormat(tk.begin(), tk.length(), m_formats[CppNumberFormat]);
-
-        else if (tk.isStringLiteral() || tk.isCharLiteral())
+        } else if (tk.isStringLiteral() || tk.isCharLiteral()) {
             highlightLine(text, tk.begin(), tk.length(), m_formats[CppStringFormat]);
-
-        else if (tk.isComment()) {
+        } else if (tk.isComment()) {
             const int startPosition = initialState ? previousTokenEnd : tk.begin();
             if (tk.is(T_COMMENT) || tk.is(T_CPP_COMMENT))
                 highlightLine(text, startPosition, tk.end() - startPosition, m_formats[CppCommentFormat]);
@@ -192,18 +190,15 @@ void CppHighlighter::highlightBlock(const QString &text)
                 initialState = 0;
             }
 
-        } else if (tk.isKeyword() || CppTools::isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword())
+        } else if (tk.isKeyword() || CppTools::isQtKeyword(text.midRef(tk.begin(), tk.length())) || tk.isObjCAtKeyword()) {
             setFormat(tk.begin(), tk.length(), m_formats[CppKeywordFormat]);
-
-        else if (tk.isOperator())
+        } else if (tk.isOperator()) {
             setFormat(tk.begin(), tk.length(), m_formats[CppOperatorFormat]);
-
-        else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON))
+        } else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) {
             setFormat(tk.begin(), tk.length(), m_formats[CppLabelFormat]);
-
-        else if (tk.is(T_IDENTIFIER))
+        } else if (tk.is(T_IDENTIFIER)) {
             highlightWord(text.midRef(tk.begin(), tk.length()), tk.begin(), tk.length());
-
+        }
     }
 
     // mark the trailing white spaces
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp
index 5eb4a4152a69a82f6f4f65e07d56bc37c423c9c6..fdc931e50a8c5bb16e382aeff44b03ee33b7514c 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -624,10 +624,9 @@ void SplitSimpleDeclaration::match(const CppQuickFixInterface &interface,
     for (int index = path.size() - 1; index != -1; --index) {
         AST *node = path.at(index);
 
-        if (CoreDeclaratorAST *coreDecl = node->asCoreDeclarator())
+        if (CoreDeclaratorAST *coreDecl = node->asCoreDeclarator()) {
             core_declarator = coreDecl;
-
-        else if (SimpleDeclarationAST *simpleDecl = node->asSimpleDeclaration()) {
+        } else if (SimpleDeclarationAST *simpleDecl = node->asSimpleDeclaration()) {
             if (checkDeclaration(simpleDecl)) {
                 SimpleDeclarationAST *declaration = simpleDecl;
 
@@ -1702,7 +1701,7 @@ void AddLocalDeclaration::match(const CppQuickFixInterface &interface, QuickFixO
                     foreach (const LookupItem &r, results) {
                         if (! r.declaration())
                             continue;
-                        else if (Declaration *d = r.declaration()->asDeclaration()) {
+                        if (Declaration *d = r.declaration()->asDeclaration()) {
                             if (! d->type()->isFunctionType()) {
                                 decl = d;
                                 break;
@@ -4078,8 +4077,7 @@ void MoveFuncDefToDecl::match(const CppQuickFixInterface &interface, QuickFixOpe
             if (!declText.isEmpty())
                 break;
         }
-    }
-    else if (Namespace *matchingNamespace = isNamespaceFunction(interface->context(), func)) {
+    } else if (Namespace *matchingNamespace = isNamespaceFunction(interface->context(), func)) {
         // Dealing with free functions
         bool isHeaderFile = false;
         declFileName = correspondingHeaderOrSource(interface->fileName(), &isHeaderFile);
diff --git a/src/plugins/cpptools/builtinindexingsupport.cpp b/src/plugins/cpptools/builtinindexingsupport.cpp
index cefa6894f812545f0f44ef4955f8c40e5f09455f..7b73f88f473850b6a5137fd88781d8a1826d10a4 100644
--- a/src/plugins/cpptools/builtinindexingsupport.cpp
+++ b/src/plugins/cpptools/builtinindexingsupport.cpp
@@ -57,10 +57,9 @@ static void parse(QFutureInterface<void> &future,
         const QString fileName = files.at(i);
 
         const bool isSourceFile = i < sourceCount;
-        if (isSourceFile)
+        if (isSourceFile) {
             (void) preproc->run(conf);
-
-        else if (! processingHeaders) {
+        } else if (! processingHeaders) {
             (void) preproc->run(conf);
 
             processingHeaders = true;
diff --git a/src/plugins/cpptools/cppchecksymbols.cpp b/src/plugins/cpptools/cppchecksymbols.cpp
index 2f076eead9964d21eb423ffea307029b7806f71f..da72e2a9156aa3323a2d0b1f5b5eecd455d86e81 100644
--- a/src/plugins/cpptools/cppchecksymbols.cpp
+++ b/src/plugins/cpptools/cppchecksymbols.cpp
@@ -96,7 +96,7 @@ protected:
     {
         if (! doc)
             return;
-        else if (! processed->contains(doc->globalNamespace())) {
+        if (! processed->contains(doc->globalNamespace())) {
             processed->insert(doc->globalNamespace());
 
             foreach (const Document::Include &i, doc->includes())
@@ -738,7 +738,7 @@ bool CheckSymbols::hasVirtualDestructor(Class *klass) const
     for (Symbol *s = klass->find(id); s; s = s->next()) {
         if (! s->name())
             continue;
-        else if (s->name()->isDestructorNameId()) {
+        if (s->name()->isDestructorNameId()) {
             if (Function *funTy = s->type()->asFunctionType()) {
                 if (funTy->isVirtual() && id->isEqualTo(s->identifier()))
                     return true;
@@ -1335,9 +1335,8 @@ NameAST *CheckSymbols::declaratorId(DeclaratorAST *ast) const
     if (ast && ast->core_declarator) {
         if (NestedDeclaratorAST *nested = ast->core_declarator->asNestedDeclarator())
             return declaratorId(nested->declarator);
-        else if (DeclaratorIdAST *declId = ast->core_declarator->asDeclaratorId()) {
+        if (DeclaratorIdAST *declId = ast->core_declarator->asDeclaratorId())
             return declId->name;
-        }
     }
 
     return 0;
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp
index 967bc9321c0b539dc9915dc10b7ed44c10608e6e..cf1a90b8e77f816c9f003461e357a44e2aa6c819 100644
--- a/src/plugins/cpptools/cppcodeformatter.cpp
+++ b/src/plugins/cpptools/cppcodeformatter.cpp
@@ -519,9 +519,9 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
             int previousPreviousMarker = -1;
             for (int i = size - 1; i >= 0; --i) {
                 if (m_currentState.at(i).type == cpp_macro_conditional) {
-                    if (previousMarker == -1)
+                    if (previousMarker == -1) {
                         previousMarker = i;
-                    else {
+                    } else {
                         previousPreviousMarker = i;
                         break;
                     }
diff --git a/src/plugins/cpptools/cppcompletionassist.cpp b/src/plugins/cpptools/cppcompletionassist.cpp
index f636c0a8e2b5bf66db9218ede297596dae531183..355ae975dd22101fdc13ba676f17d1fe5ee70b62 100644
--- a/src/plugins/cpptools/cppcompletionassist.cpp
+++ b/src/plugins/cpptools/cppcompletionassist.cpp
@@ -572,7 +572,7 @@ Class *asClassOrTemplateClassType(FullySpecifiedType ty)
 {
     if (Class *classTy = ty->asClassType())
         return classTy;
-    else if (Template *templ = ty->asTemplateType()) {
+    if (Template *templ = ty->asTemplateType()) {
         if (Symbol *decl = templ->declaration())
             return decl->asClass();
     }
@@ -595,7 +595,7 @@ Function *asFunctionOrTemplateFunctionType(FullySpecifiedType ty)
 {
     if (Function *funTy = ty->asFunctionType())
         return funTy;
-    else if (Template *templ = ty->asTemplateType()) {
+    if (Template *templ = ty->asTemplateType()) {
         if (Symbol *decl = templ->declaration())
             return decl->asFunction();
     }
@@ -799,13 +799,11 @@ int CppCompletionAssistProcessor::startOfOperator(int pos,
                                      && *kind != T_DOT))) {
             *kind = T_EOF_SYMBOL;
             start = pos;
-        }
         // Include completion: can be triggered by slash, but only in a string
-        else if (*kind == T_SLASH && (tk.isNot(T_STRING_LITERAL) && tk.isNot(T_ANGLE_STRING_LITERAL))) {
+        } else if (*kind == T_SLASH && (tk.isNot(T_STRING_LITERAL) && tk.isNot(T_ANGLE_STRING_LITERAL))) {
             *kind = T_EOF_SYMBOL;
             start = pos;
-        }
-        else if (*kind == T_LPAREN) {
+        } else if (*kind == T_LPAREN) {
             if (tokenIdx > 0) {
                 const Token &previousToken = tokens.at(tokenIdx - 1); // look at the token at the left of T_LPAREN
                 switch (previousToken.kind()) {
@@ -943,13 +941,11 @@ int CppCompletionAssistProcessor::startCompletionHelper()
         startOfExpression = endOfExpression - expression.length();
 
         if (m_model->m_completionOperator == T_LPAREN) {
-            if (expression.endsWith(QLatin1String("SIGNAL")))
+            if (expression.endsWith(QLatin1String("SIGNAL"))) {
                 m_model->m_completionOperator = T_SIGNAL;
-
-            else if (expression.endsWith(QLatin1String("SLOT")))
+            } else if (expression.endsWith(QLatin1String("SLOT"))) {
                 m_model->m_completionOperator = T_SLOT;
-
-            else if (m_interface->position() != endOfOperator) {
+            } else if (m_interface->position() != endOfOperator) {
                 // We don't want a function completion when the cursor isn't at the opening brace
                 expression.clear();
                 m_model->m_completionOperator = T_EOF_SYMBOL;
@@ -1225,7 +1221,7 @@ int CppCompletionAssistProcessor::startCompletionInternal(const QString fileName
             return m_startPosition;
         }
 
-        else if (m_model->m_completionOperator == T_SIGNAL || m_model->m_completionOperator == T_SLOT) {
+        if (m_model->m_completionOperator == T_SIGNAL || m_model->m_completionOperator == T_SLOT) {
             // Apply signal/slot completion on 'this'
             expression = QLatin1String("this");
         }
@@ -1335,7 +1331,7 @@ void CppCompletionAssistProcessor::globalCompletion(CPlusPlus::Scope *currentSco
                     Symbol *member = scope->memberAt(i);
                     if (! member->name())
                         continue;
-                    else if (UsingNamespaceDirective *u = member->asUsingNamespaceDirective()) {
+                    if (UsingNamespaceDirective *u = member->asUsingNamespaceDirective()) {
                         if (ClassOrNamespace *b = binding->lookupType(u->name()))
                             usingBindings.append(b);
                     }
diff --git a/src/plugins/cpptools/cpplocalsymbols.cpp b/src/plugins/cpptools/cpplocalsymbols.cpp
index 361fd5d9d65525be5516cf377a697c133e3c4619..93bf125e11abb2c6f5d624844ac1cedefcafd52d 100644
--- a/src/plugins/cpptools/cpplocalsymbols.cpp
+++ b/src/plugins/cpptools/cpplocalsymbols.cpp
@@ -84,7 +84,7 @@ protected:
             if (Symbol *member = scope->memberAt(i)) {
                 if (member->isTypedef())
                     continue;
-                else if (! member->isGenerated() && (member->isDeclaration() || member->isArgument())) {
+                if (! member->isGenerated() && (member->isDeclaration() || member->isArgument())) {
                     if (member->name() && member->name()->isNameId()) {
                         const Identifier *id = member->identifier();
                         unsigned line, column;
@@ -106,10 +106,10 @@ protected:
             const Identifier *id = identifier(simpleName->identifier_token);
             for (int i = _scopeStack.size() - 1; i != -1; --i) {
                 if (Symbol *member = _scopeStack.at(i)->find(id)) {
-                    if (member->isTypedef() ||
-                            !(member->isDeclaration() || member->isArgument()))
+                    if (member->isTypedef() || !(member->isDeclaration() || member->isArgument()))
                         continue;
-                    else if (!member->isGenerated() && (member->sourceLocation() < firstToken || member->enclosingScope()->isFunction())) {
+                    if (!member->isGenerated() && (member->sourceLocation() < firstToken
+                                                   || member->enclosingScope()->isFunction())) {
                         unsigned line, column;
                         getTokenStartPosition(simpleName->identifier_token, &line, &column);
                         localUses[member].append(
diff --git a/src/plugins/cpptools/cpptoolseditorsupport.cpp b/src/plugins/cpptools/cpptoolseditorsupport.cpp
index 1b73cf883c8da04f7325ffd6f2062caeb8a8c9bb..b563e556a5de211124f83a264e66be746fb69d63 100644
--- a/src/plugins/cpptools/cpptoolseditorsupport.cpp
+++ b/src/plugins/cpptools/cpptoolseditorsupport.cpp
@@ -74,11 +74,10 @@ protected:
         if (_functionDefinition)
             return false;
 
-        else if (FunctionDefinitionAST *def = ast->asFunctionDefinition()) {
+        if (FunctionDefinitionAST *def = ast->asFunctionDefinition())
             return checkDeclaration(def);
-        }
 
-        else if (ObjCMethodDeclarationAST *method = ast->asObjCMethodDeclaration()) {
+        if (ObjCMethodDeclarationAST *method = ast->asObjCMethodDeclaration()) {
             if (method->function_body)
                 return checkDeclaration(method);
         }
diff --git a/src/plugins/cpptools/includeutils.cpp b/src/plugins/cpptools/includeutils.cpp
index d51a0a2cd727a74c42c163cf6581ce999643ed02..9de8f5fe76b7ba31b4460f383a3b75bd1a45db42 100644
--- a/src/plugins/cpptools/includeutils.cpp
+++ b/src/plugins/cpptools/includeutils.cpp
@@ -277,13 +277,11 @@ QList<IncludeGroup> IncludeGroup::detectIncludeGroupsByNewLines(QList<Document::
         if (isFirst) {
             isFirst = false;
             currentIncludes << include;
-        }
         // Include belongs to current group
-        else if (lastLine + 1 == include.line()) {
+        } else if (lastLine + 1 == include.line()) {
             currentIncludes << include;
-        }
         // Include is member of new group
-        else {
+        } else {
             result << IncludeGroup(currentIncludes);
             currentIncludes.clear();
             currentIncludes << include;
@@ -312,13 +310,11 @@ QList<IncludeGroup> IncludeGroup::detectIncludeGroupsByIncludeDir(const QList<In
         if (isFirst) {
             isFirst = false;
             currentIncludes << include;
-        }
         // Include belongs to current group
-        else if (lastDir == currentDirPrefix) {
+        } else if (lastDir == currentDirPrefix) {
             currentIncludes << include;
-        }
         // Include is member of new group
-        else {
+        } else {
             result << IncludeGroup(currentIncludes);
             currentIncludes.clear();
             currentIncludes << include;
@@ -347,13 +343,11 @@ QList<IncludeGroup> IncludeGroup::detectIncludeGroupsByIncludeType(const QList<I
         if (isFirst) {
             isFirst = false;
             currentIncludes << include;
-        }
         // Include belongs to current group
-        else if (lastIncludeType == currentIncludeType) {
+        } else if (lastIncludeType == currentIncludeType) {
             currentIncludes << include;
-        }
         // Include is member of new group
-        else {
+        } else {
             result << IncludeGroup(currentIncludes);
             currentIncludes.clear();
             currentIncludes << include;
diff --git a/src/plugins/cpptools/symbolfinder.cpp b/src/plugins/cpptools/symbolfinder.cpp
index 9acd841121c758eb6c2b594df805673e8ee274a1..6a13157f513ccaec0fc32a3215e9c65052fbe6b9 100644
--- a/src/plugins/cpptools/symbolfinder.cpp
+++ b/src/plugins/cpptools/symbolfinder.cpp
@@ -176,7 +176,7 @@ Function *SymbolFinder::findMatchingDefinition(Symbol *declaration,
             foreach (Function *fun, viableFunctions) {
                 if (! (fun->unqualifiedName() && fun->unqualifiedName()->isEqualTo(declaration->unqualifiedName())))
                     continue;
-                else if (fun->argumentCount() == declarationTy->argumentCount()) {
+                if (fun->argumentCount() == declarationTy->argumentCount()) {
                     if (! strict && ! best)
                         best = fun;
 
@@ -287,13 +287,9 @@ void SymbolFinder::findMatchingDeclaration(const LookupContext &context,
             continue;
 
         for (Symbol *s = scope->find(funcId); s; s = s->next()) {
-            if (! s->name())
+            if (! s->name() || ! funcId->isEqualTo(s->identifier()) || ! s->type()->isFunctionType())
                 continue;
-            else if (! funcId->isEqualTo(s->identifier()))
-                continue;
-            else if (! s->type()->isFunctionType())
-                continue;
-            else if (Declaration *decl = s->asDeclaration()) {
+            if (Declaration *decl = s->asDeclaration()) {
                 if (Function *declFunTy = decl->type()->asFunctionType()) {
                     if (functionType->isEqualTo(declFunTy))
                         typeMatch->prepend(decl);
diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp
index 4158b313d949dfb193b88b6a64eafe2f5f415d94..68e27328574e712632d24bef1912d855a2a432d9 100644
--- a/src/plugins/debugger/debuggermainwindow.cpp
+++ b/src/plugins/debugger/debuggermainwindow.cpp
@@ -224,15 +224,13 @@ void DebuggerMainWindowPrivate::updateActiveLanguages()
 {
     DebuggerLanguages newLanguages = AnyLanguage;
 
-    if (m_engineDebugLanguages != AnyLanguage)
+    if (m_engineDebugLanguages != AnyLanguage) {
         newLanguages = m_engineDebugLanguages;
-    else {
-        if (m_previousRunConfiguration) {
-            if (m_previousRunConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useCppDebugger())
-                newLanguages |= CppLanguage;
-            if (m_previousRunConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger())
-                newLanguages |= QmlLanguage;
-        }
+    } else if (m_previousRunConfiguration) {
+        if (m_previousRunConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useCppDebugger())
+            newLanguages |= CppLanguage;
+        if (m_previousRunConfiguration->extraAspect<Debugger::DebuggerRunConfigurationAspect>()->useQmlDebugger())
+            newLanguages |= QmlLanguage;
     }
 
     if (newLanguages != m_activeDebugLanguages) {
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 2de263e2027fef4640233ef7b051b67c7dc47438..25ef0454f556680cb700ac494fe29e761c6a6002 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -1405,11 +1405,11 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
                 QString key = arg.section(QLatin1Char('='), 0, 0);
                 QString val = arg.section(QLatin1Char('='), 1, 1);
                 if (val.isEmpty()) {
-                    if (key.isEmpty())
+                    if (key.isEmpty()) {
                         continue;
-                    else if (sp.executable.isEmpty())
+                    } else if (sp.executable.isEmpty()) {
                         sp.executable = key;
-                    else {
+                    } else {
                         *errorMessage = DebuggerPlugin::tr("Only one executable allowed!");
                         return false;
                     }
@@ -1419,15 +1419,13 @@ bool DebuggerPluginPrivate::parseArgument(QStringList::const_iterator &it,
                     sp.remoteChannel = val;
                     sp.displayName = tr("Remote: \"%1\"").arg(sp.remoteChannel);
                     sp.startMessage = tr("Attaching to remote server %1.").arg(sp.remoteChannel);
-                }
-                else if (key == QLatin1String("core")) {
+                } else if (key == QLatin1String("core")) {
                     sp.startMode = AttachCore;
                     sp.closeMode = DetachAtClose;
                     sp.coreFile = val;
                     sp.displayName = tr("Core file \"%1\"").arg(sp.coreFile);
                     sp.startMessage = tr("Attaching to core file %1.").arg(sp.coreFile);
-                }
-                else if (key == QLatin1String("kit")) {
+                } else if (key == QLatin1String("kit")) {
                     kit = KitManager::instance()->find(Id::fromString(val));
                 }
             }
diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp
index b50f6c6e1949fdb4fb4d3961fe411ac73f7e4fd3..7807f1567c03789f9fcedae72b4070494bad3ea1 100644
--- a/src/plugins/debugger/gdb/coregdbadapter.cpp
+++ b/src/plugins/debugger/gdb/coregdbadapter.cpp
@@ -150,9 +150,9 @@ void GdbCoreEngine::continueSetupEngine()
             }
         }
     }
-    if (isCore)
+    if (isCore) {
         startGdb();
-    else {
+    } else {
         showMessageBox(QMessageBox::Warning,
             tr("Error Loading Core File"),
             tr("The specified file does not appear to be a core file."));
diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp
index 90237fab68ab4cb31f6b71c93499593f83db4c21..dbae89ae6753a028eba42f7337ec69696f6dfce1 100644
--- a/src/plugins/debugger/qml/qmlcppengine.cpp
+++ b/src/plugins/debugger/qml/qmlcppengine.cpp
@@ -699,9 +699,9 @@ void QmlCppEngine::slaveEngineStateChanged
             break;
         }
         case InferiorShutdownOk: {
-            if (state() == InferiorShutdownRequested)
+            if (state() == InferiorShutdownRequested) {
                 notifyInferiorShutdownOk();
-            else {
+            } else {
                 // we got InferiorExitOk before, but ignored it ...
                 notifyInferiorExited();
             }
diff --git a/src/plugins/debugger/registerwindow.cpp b/src/plugins/debugger/registerwindow.cpp
index 6e53eaef576f50847c4bffb3e94ff69a817c8bd7..a489f35a6b4f40066c86d60241cbf1a8b667c826 100644
--- a/src/plugins/debugger/registerwindow.cpp
+++ b/src/plugins/debugger/registerwindow.cpp
@@ -230,9 +230,9 @@ void RegisterTreeView::contextMenuEvent(QContextMenuEvent *ev)
     const QPoint position = ev->globalPos();
     QAction *act = menu.exec(position);
 
-    if (act == actReload)
+    if (act == actReload) {
         engine->reloadRegisters();
-    else if (act == actEditMemory) {
+    } else if (act == actEditMemory) {
         const QString registerName = QString::fromLatin1(aRegister.name);
         engine->openMemoryView(address, 0,
             RegisterMemoryView::registerMarkup(address, registerName),
diff --git a/src/plugins/debugger/stackwindow.cpp b/src/plugins/debugger/stackwindow.cpp
index fed2e8031f1b173d149edec848f7a3a82a4fb3bb..39b112189e07f06394cf585dde039badfdc10995 100644
--- a/src/plugins/debugger/stackwindow.cpp
+++ b/src/plugins/debugger/stackwindow.cpp
@@ -182,9 +182,9 @@ void StackTreeView::contextMenuEvent(QContextMenuEvent *ev)
     if (!act)
         return;
 
-    if (act == actCopyContents)
+    if (act == actCopyContents) {
         copyContentsToClipboard();
-    else if (act == actShowMemory) {
+    } else if (act == actShowMemory) {
         const QString title = tr("Memory at Frame #%1 (%2) 0x%3").
         arg(row).arg(frame.function).arg(address, 0, 16);
         QList<MemoryMarkup> ml;
diff --git a/src/plugins/diffeditor/diffeditorwidget.cpp b/src/plugins/diffeditor/diffeditorwidget.cpp
index 8b3b098dcbe2dfaf4393960bd9d82f90afe7acea..aff227c8b5e129c2024a263ec3da7b9c6328d5cf 100644
--- a/src/plugins/diffeditor/diffeditorwidget.cpp
+++ b/src/plugins/diffeditor/diffeditorwidget.cpp
@@ -952,12 +952,10 @@ ChunkData DiffEditorWidget::calculateOriginalData(const QList<Diff> &diffList) c
             if (diff.command == Diff::Delete) {
                 leftLines.last() += line;
                 currentLeftPos += line.count();
-            }
-            else if (diff.command == Diff::Insert) {
+            } else if (diff.command == Diff::Insert) {
                 rightLines.last() += line;
                 currentRightPos += line.count();
-            }
-            else if (diff.command == Diff::Equal) {
+            } else if (diff.command == Diff::Equal) {
                 if ((line.count() || (j && j < lines.count() - 1)) && // don't treat empty ending line as a line to be aligned unless a line is a one char '/n' only.
                         currentLeftLine != lastAlignedLeftLine &&
                         currentRightLine != lastAlignedRightLine) {
diff --git a/src/plugins/find/currentdocumentfind.cpp b/src/plugins/find/currentdocumentfind.cpp
index c6b7e2940e9762f34aecf75db2a4e7b5b256c4c8..16481b98c1c30b658aa5a1a64b7e9e62b947a904 100644
--- a/src/plugins/find/currentdocumentfind.cpp
+++ b/src/plugins/find/currentdocumentfind.cpp
@@ -246,8 +246,7 @@ void CurrentDocumentFind::aggregationChanged()
                 m_candidateWidget = m_currentWidget;
                 m_candidateFind = currentFind;
                 acceptCandidate();
-            }
-            else {
+            } else {
                 clearFindSupport();
             }
         }
diff --git a/src/plugins/genericprojectmanager/pkgconfigtool.cpp b/src/plugins/genericprojectmanager/pkgconfigtool.cpp
index a2f8b3b92425174ced60447e77d136ee3bb2734d..127d82d4734ff72e5c845acfdea1442daf8d481a 100644
--- a/src/plugins/genericprojectmanager/pkgconfigtool.cpp
+++ b/src/plugins/genericprojectmanager/pkgconfigtool.cpp
@@ -90,9 +90,7 @@ void PkgConfigTool::packages_helper() const
             if (ch.isSpace()) {
                 do { ++index; }
                 while (index < cflags.size() && cflags.at(index).isSpace());
-            }
-
-            else if (ch == QLatin1Char('-') && index + 1 < cflags.size()) {
+            } else if (ch == QLatin1Char('-') && index + 1 < cflags.size()) {
                 ++index;
 
                 const QChar opt = cflags.at(index);
@@ -109,9 +107,7 @@ void PkgConfigTool::packages_helper() const
                     qDebug() << "*** add include path:" << cflags.mid(start, index - start);
                     package.includePaths.append(cflags.mid(start, index - start));
                 }
-            }
-
-            else {
+            } else {
                 for (; index < cflags.size(); ++index) {
                     if (cflags.at(index).isSpace())
                         break;
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index 9c036cca79e2e722cc146a1aab88867df70d5ba1..70cd8a6655c811dd8385770cfe6adf8764023595 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -1463,9 +1463,9 @@ bool GitClient::synchronousInit(const QString &workingDirectory)
     const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText);
     // '[Re]Initialized...'
     outputWindow()->append(commandOutputFromLocal8Bit(outputText));
-    if (!rc)
+    if (!rc) {
         outputWindow()->appendError(commandOutputFromLocal8Bit(errorText));
-    else {
+    } else {
         // TODO: Turn this into a VcsBaseClient and use resetCachedVcsInfo(...)
         Core::ICore::vcsManager()->resetVersionControlForDirectory(workingDirectory);
     }
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp
index 3166313ca8430a68cb490073c870ae57ba8edcd6..2ee39cddf2f78fe6c682cb322114b4d3c6bcd45b 100644
--- a/src/plugins/git/gitplugin.cpp
+++ b/src/plugins/git/gitplugin.cpp
@@ -920,9 +920,9 @@ void GitPlugin::gitkForCurrentFolder()
      *
      */
     QDir dir(state.currentFileDirectory());
-    if (QFileInfo(dir,QLatin1String(".git")).exists() || dir.cd(QLatin1String(".git")))
+    if (QFileInfo(dir,QLatin1String(".git")).exists() || dir.cd(QLatin1String(".git"))) {
         m_gitClient->launchGitK(state.currentFileDirectory());
-    else {
+    } else {
         QString folderName = dir.absolutePath();
         dir.cdUp();
         folderName = folderName.remove(0, dir.absolutePath().length() + 1);
diff --git a/src/plugins/git/mergetool.cpp b/src/plugins/git/mergetool.cpp
index 1bf3a439fd37534602d0196ada605805702e6649..05704c5413a59ff385e84989e5e22f12581fc813 100644
--- a/src/plugins/git/mergetool.cpp
+++ b/src/plugins/git/mergetool.cpp
@@ -102,8 +102,7 @@ bool MergeTool::start(const QString &workingDirectory, const QStringList &files)
     if (m_process->waitForStarted()) {
         connect(m_process, SIGNAL(finished(int)), this, SLOT(done()));
         connect(m_process, SIGNAL(readyRead()), this, SLOT(readData()));
-    }
-    else {
+    } else {
         delete m_process;
         m_process = 0;
         return false;
diff --git a/src/plugins/glsleditor/glslautocompleter.cpp b/src/plugins/glsleditor/glslautocompleter.cpp
index 22e2cb0cda456b6b13534dc60e0da7b043c95229..5f5747c4695f2264774ea4fc20d2c59774ac895b 100644
--- a/src/plugins/glsleditor/glslautocompleter.cpp
+++ b/src/plugins/glsleditor/glslautocompleter.cpp
@@ -85,8 +85,7 @@ bool GLSLCompleter::contextAllowsElectricCharacters(const QTextCursor &cursor) c
 
         if (pos < tk.end())
             return false;
-    }
-    else if (tk.isStringLiteral() || tk.isCharLiteral()) {
+    } else if (tk.isStringLiteral() || tk.isCharLiteral()) {
         const unsigned pos = cursor.selectionEnd() - cursor.block().position();
         if (pos <= tk.end())
             return false;
diff --git a/src/plugins/glsleditor/glslhighlighter.cpp b/src/plugins/glsleditor/glslhighlighter.cpp
index 61b1e341d66e0bf59cb5cdd64a1f5d4f7acaabe9..abe873b501db7fab7caf8947d18e8a2a12803fb4 100644
--- a/src/plugins/glsleditor/glslhighlighter.cpp
+++ b/src/plugins/glsleditor/glslhighlighter.cpp
@@ -160,13 +160,13 @@ void Highlighter::highlightBlock(const QString &text)
             highlightLine(text, tk.begin(), tk.length, m_formats[GLSLPreprocessorFormat]);
             highlightAsPreprocessor = true;
 
-        } else if (highlightCurrentWordAsPreprocessor && isPPKeyword(text.midRef(tk.begin(), tk.length)))
+        } else if (highlightCurrentWordAsPreprocessor && isPPKeyword(text.midRef(tk.begin(), tk.length))) {
             setFormat(tk.begin(), tk.length, m_formats[GLSLPreprocessorFormat]);
 
-        else if (tk.is(GLSL::Parser::T_NUMBER))
+        } else if (tk.is(GLSL::Parser::T_NUMBER)) {
             setFormat(tk.begin(), tk.length, m_formats[GLSLNumberFormat]);
 
-        else if (tk.is(GLSL::Parser::T_COMMENT)) {
+        } else if (tk.is(GLSL::Parser::T_COMMENT)) {
             highlightLine(text, tk.begin(), tk.length, m_formats[GLSLCommentFormat]);
 
             // we need to insert a close comment parenthesis, if
@@ -362,11 +362,11 @@ void Highlighter::highlightBlock(const QString &text)
     for (int i = 0; i < tokens.size(); ++i) {
         const GLSL::Token &tk = tokens.at(i);
 
-        if (tk.is(GLSL::Parser::T_NUMBER))
+        if (tk.is(GLSL::Parser::T_NUMBER)) {
             setFormat(tk.position, tk.length, m_formats[GLSLNumberFormat]);
-        else if (tk.is(GLSL::Parser::T_COMMENT))
+        } else if (tk.is(GLSL::Parser::T_COMMENT)) {
             setFormat(tk.position, tk.length, Qt::darkGreen); // ### FIXME: m_formats[GLSLCommentFormat]);
-        else if (tk.is(GLSL::Parser::T_IDENTIFIER)) {
+        } else if (tk.is(GLSL::Parser::T_IDENTIFIER)) {
             int kind = lex.findKeyword(data.constData() + tk.position, tk.length);
             if (kind == GLSL::Parser::T_RESERVED)
                 setFormat(tk.position, tk.length, m_formats[GLSLReservedKeyword]);
diff --git a/src/plugins/madde/maemoqemuruntimeparser.cpp b/src/plugins/madde/maemoqemuruntimeparser.cpp
index e013711fe508a8bb5a060ecb09d7ae441242cb7f..1a88c73037e010fbdb93278bd843b4d71f84fbde 100644
--- a/src/plugins/madde/maemoqemuruntimeparser.cpp
+++ b/src/plugins/madde/maemoqemuruntimeparser.cpp
@@ -139,9 +139,9 @@ MaemoQemuRuntime MaemoQemuRuntimeParserV1::parseRuntime()
                         && m_madInfoReader.name() == QLatin1String("installed")) {
                         if (m_madInfoReader.readNext() == QXmlStreamReader::Characters
                             && m_madInfoReader.text() == QLatin1String("true")) {
-                            if (attrs.hasAttribute(QLatin1String("runtime_id")))
+                            if (attrs.hasAttribute(QLatin1String("runtime_id"))) {
                                 installedRuntimes << attrs.value(QLatin1String("runtime_id")).toString();
-                            else if (attrs.hasAttribute(QLatin1String("id"))) {
+                            } else if (attrs.hasAttribute(QLatin1String("id"))) {
                                 // older MADDE seems to use only id
                                 installedRuntimes << attrs.value(QLatin1String("id")).toString();
                             }
diff --git a/src/plugins/projectexplorer/cesdkhandler.cpp b/src/plugins/projectexplorer/cesdkhandler.cpp
index b6b245cfd360826ab77915014736c1815d17c528..261506ed76838bdad72783442ef7f8970d0bab65 100644
--- a/src/plugins/projectexplorer/cesdkhandler.cpp
+++ b/src/plugins/projectexplorer/cesdkhandler.cpp
@@ -79,9 +79,9 @@ bool CeSdkHandler::parse(const QString &vsdir)
         xml.readNext();
         if (xml.isStartElement()) {
             currentElement = xml.name().toString();
-            if (currentElement == QLatin1String("Platform"))
+            if (currentElement == QLatin1String("Platform")) {
                 currentItem = CeSdkInfo();
-            else if (currentElement == QLatin1String("Directories")) {
+            } else if (currentElement == QLatin1String("Directories")) {
                 QXmlStreamAttributes attr = xml.attributes();
                 currentItem.m_include = fixPaths(attr.value(QLatin1String("Include")).toString());
                 currentItem.m_lib = fixPaths(attr.value(QLatin1String("Library")).toString());
diff --git a/src/plugins/projectexplorer/target.cpp b/src/plugins/projectexplorer/target.cpp
index 5a5585f4852f73327288cd9cb39f0f4dd4ba7e4b..a6b0fe796d5d6b1daf6f5f72a63d08b30ac5e170 100644
--- a/src/plugins/projectexplorer/target.cpp
+++ b/src/plugins/projectexplorer/target.cpp
@@ -676,9 +676,9 @@ void Target::updateDefaultRunConfigurations()
 
     // Make sure a configured RC is active:
     if (activeRunConfiguration() && !activeRunConfiguration()->isConfigured()) {
-        if (!existingConfigured.isEmpty())
+        if (!existingConfigured.isEmpty()) {
             setActiveRunConfiguration(existingConfigured.at(0));
-        else if (!newConfigured.isEmpty()) {
+        } else if (!newConfigured.isEmpty()) {
             RunConfiguration *selected = newConfigured.at(0);
             // Try to find a runconfiguration that matches the project name. That is a good
             // candidate for something to run initially.
diff --git a/src/plugins/projectexplorer/wincetoolchain.cpp b/src/plugins/projectexplorer/wincetoolchain.cpp
index cb26749fed974211f67cf92237e97d29c6a885eb..f945c486fb35208084a0ede930e9179ec7afcb73 100644
--- a/src/plugins/projectexplorer/wincetoolchain.cpp
+++ b/src/plugins/projectexplorer/wincetoolchain.cpp
@@ -93,8 +93,7 @@ static QString winExpandDelayedEnvReferences(QString in, const Utils::Environmen
         if (replacement.isEmpty()) {
             qWarning() << "No replacement for var: " << var;
             pos = nextPos;
-        }
-        else {
+        } else {
             // Not sure about this, but we need to account for the case where
             // the end of the replacement doesn't have the directory seperator and
             // neither does the start of the insert. This solution assumes:
diff --git a/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp b/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp
index 6df144c7838e3a5cda447886b599f8687c623224..aee421b2ff9f1be5129a87afe0d0c96cadbc183b 100644
--- a/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp
+++ b/src/plugins/qmldesigner/components/formeditor/selectiontool.cpp
@@ -164,9 +164,9 @@ void SelectionTool::hoverMoveEvent(const QList<QGraphicsItem*> &itemList,
 void SelectionTool::mouseReleaseEvent(const QList<QGraphicsItem*> &itemList,
                                       QGraphicsSceneMouseEvent *event)
 {
-    if (m_singleSelectionManipulator.isActive())
+    if (m_singleSelectionManipulator.isActive()) {
         m_singleSelectionManipulator.end(event->scenePos());
-    else if (m_rubberbandSelectionManipulator.isActive()) {
+    } else if (m_rubberbandSelectionManipulator.isActive()) {
 
         QPointF mouseMovementVector = m_rubberbandSelectionManipulator.beginPoint() - event->scenePos();
         if (mouseMovementVector.toPoint().manhattanLength() < s_startDragDistance) {
diff --git a/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp b/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp
index f5dc94a079493c89e1d9c165f316a95f75fcb531..934d0370383b6a0b747dd511ef7939b9c68ae493 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp
+++ b/src/plugins/qmldesigner/components/itemlibrary/customdraganddrop.cpp
@@ -101,8 +101,7 @@ void CustomDragAndDropIcon::mouseMoveEvent(QMouseEvent *event)
         resize(m_size);
         show();
         update();
-    }
-    else {
+    } else {
        move(-1000, -1000); // if no top level widget is found we are out of the main window
     }
     QWidget* target = QApplication::widgetAt(globalPos - QPoint(2,2)); //-(2, 2) because:
diff --git a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml
index 8be13162126b107cc353497b086f6475bf020473..20ecae2ce497cec1cdd143a4492a0e435bd45972 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml
+++ b/src/plugins/qmldesigner/components/itemlibrary/qml/ItemsView.qml
@@ -193,9 +193,9 @@ reasons and then passed to the section views */
                                 /* Limit the content position. Without this, resizing would get the
 content position out of scope regarding the scrollbar. */
                                 function limitContentPos() {
-                                    if (contentY < 0)
+                                    if (contentY < 0) {
                                         contentY = 0;
-                                    else {
+                                    } else {
                                         var maxContentY = Math.max(0, contentHeight - height)
                                         if (contentY > maxContentY)
                                             contentY = maxContentY;
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index e9340401c91372d9dccb1077aaea9532e8f8c8bb..b1821e88d96189ba1b9c270a0edd282fbbb8dc72 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -149,8 +149,7 @@ bool NavigatorTreeModel::dropMimeData(const QMimeData *data,
             return false;
         targetIndex -= visibleProperties(parentNode).count();
         parentPropertyName = parentNode.metaInfo().defaultPropertyName();
-    }
-    else {
+    } else {
         parentItemIndex = parentIndex.parent();
         parentPropertyName = parentIndex.data(Qt::DisplayRole).toByteArray();
     }
@@ -295,8 +294,7 @@ void NavigatorTreeModel::updateItemRowOrder(const NodeListProperty &listProperty
             parentIdItem = parentRow.idItem;
             newRow += visibleProperties(listProperty.parentModelNode()).count();
         }
-    }
-    else {
+    } else {
         parentIdItem = itemRow.idItem->parent();
     }
     Q_ASSERT(parentIdItem);
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp
index 497318705df845363bc1d5bf8a21ff6b59191ca3..58cb96790c67561cc8ee751d23907f5b036cd3a6 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreeview.cpp
@@ -145,8 +145,7 @@ public:
             if (option->rect.height() == 0) {
                 if (option->rect.top()>0)
                     painter->drawLine(rect.topLeft(), rect.topRight());
-            }
-            else {
+            } else {
                 highlight.setAlphaF(0.2);
                 painter->setBrush(highlight);
                 painter->drawRect(rect.adjusted(0, 0, -1, -1));
@@ -280,8 +279,7 @@ void NameItemDelegate::paint(QPainter *painter,
         displayString = fm.elidedText(displayString,Qt::ElideMiddle,option.rect.width()-extraSpace);
         displayStringOffset = QPoint(5+pixmapSide,-5);
         width = fm.width(displayString);
-    }
-    else {
+    } else {
         displayString = index.data(Qt::DisplayRole).toString();
         displayStringOffset = QPoint(0, -2);
     }
diff --git a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
index ffc61704c9ad29f99af2f23625541da1762f8b42..a513410b5e1b6e28f7fc94f74fbe86580f2eee80 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/basicwidgets.cpp
@@ -1242,8 +1242,7 @@ void QGroupBoxDeclarativeUI::finish()
         gb->setUpdatesEnabled(true);
         //gb->resize(gb->sizeHint());
         gb->finishFirstExpand();
-    }
-    else {
+    } else {
         gb->setMinimumHeight(30);
         gb->setMaximumHeight(30);
         gb->resize(gb->sizeHint().width(), 30);
@@ -1315,8 +1314,7 @@ void QGroupBoxDeclarativeUI::animate(int frame)
     if (m_expanded) {
         height = ((qreal(frame) / 5.0) * qreal(m_oldHeight)) + (30.0 * (1.0 - qreal(frame) / 5.0));
         gb->setPixmap(m_contens, qreal(frame) / 5.0);
-    }
-    else {
+    } else {
         height = ((qreal(frame) / 5.0) * 30.0) + (qreal(m_oldHeight) * (1.0 - qreal(frame) / 5.0));
         qreal alpha = 0.8 - qreal(frame) / 4.0;
         if (alpha < 0)
diff --git a/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.cpp b/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.cpp
index d03203d03679a28a9af8bb01bd58b74e19bf52a2..602888566ce7637611a0bb3b27c020f75fff64eb 100644
--- a/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.cpp
+++ b/src/plugins/qmldesigner/designercore/filemanager/changepropertyvisitor.cpp
@@ -115,9 +115,8 @@ void ChangePropertyVisitor::replaceInMembers(UiObjectInitializer *initializer,
             }
 
             break;
-        }
         // for grouped properties:
-        else if (!prefix.isEmpty()) {
+        } else if (!prefix.isEmpty()) {
             if (UiObjectDefinition *def = cast<UiObjectDefinition *>(member)) {
                 if (toString(def->qualifiedTypeNameId) == prefix)
                     replaceInMembers(def->initializer, suffix);
diff --git a/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.cpp b/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.cpp
index e1ab75919d023f01d7957336592df7731e76a471..94af7278d634f4af0d898e6028135d2c18ffc3d0 100644
--- a/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.cpp
+++ b/src/plugins/qmldesigner/designercore/filemanager/removepropertyvisitor.cpp
@@ -83,10 +83,10 @@ void RemovePropertyVisitor::removeFrom(QmlJS::AST::UiObjectInitializer *ast)
         UiObjectMember *member = it->member;
 
         // run full name match (for ungrouped properties):
-        if (memberNameMatchesPropertyName(propertyName, member))
+        if (memberNameMatchesPropertyName(propertyName, member)) {
             removeMember(member);
         // check for grouped properties:
-        else if (!prefix.isEmpty()) {
+        } else if (!prefix.isEmpty()) {
             if (UiObjectDefinition *def = cast<UiObjectDefinition *>(member)) {
                 if (toString(def->qualifiedTypeNameId) == prefix)
                     removeGroupedProperty(def);
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
index 0700c35d88a1fca6f0083e8004dae9f6f05de98b..3dcb940372f8894cc91c9caec5b7990996734522 100644
--- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
+++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceserverproxy.cpp
@@ -294,23 +294,23 @@ void NodeInstanceServerProxy::dispatchCommand(const QVariant &command)
     static const int tokenCommandType = QMetaType::type("TokenCommand");
     static const int debugOutputCommandType = QMetaType::type("DebugOutputCommand");
 
-    if (command.userType() ==  informationChangedCommandType)
+    if (command.userType() ==  informationChangedCommandType) {
         nodeInstanceClient()->informationChanged(command.value<InformationChangedCommand>());
-    else if (command.userType() ==  valuesChangedCommandType)
+    } else if (command.userType() ==  valuesChangedCommandType) {
         nodeInstanceClient()->valuesChanged(command.value<ValuesChangedCommand>());
-    else if (command.userType() ==  pixmapChangedCommandType)
+    } else if (command.userType() ==  pixmapChangedCommandType) {
         nodeInstanceClient()->pixmapChanged(command.value<PixmapChangedCommand>());
-    else if (command.userType() == childrenChangedCommandType)
+    } else if (command.userType() == childrenChangedCommandType) {
         nodeInstanceClient()->childrenChanged(command.value<ChildrenChangedCommand>());
-    else if (command.userType() == statePreviewImageChangedCommandType)
+    } else if (command.userType() == statePreviewImageChangedCommandType) {
         nodeInstanceClient()->statePreviewImagesChanged(command.value<StatePreviewImageChangedCommand>());
-    else if (command.userType() == componentCompletedCommandType)
+    } else if (command.userType() == componentCompletedCommandType) {
         nodeInstanceClient()->componentCompleted(command.value<ComponentCompletedCommand>());
-    else if (command.userType() == tokenCommandType)
+    } else if (command.userType() == tokenCommandType) {
         nodeInstanceClient()->token(command.value<TokenCommand>());
-    else if (command.userType() == debugOutputCommandType)
+    } else if (command.userType() == debugOutputCommandType) {
         nodeInstanceClient()->debugOutput(command.value<DebugOutputCommand>());
-    else if (command.userType() == synchronizeCommandType) {
+    } else if (command.userType() == synchronizeCommandType) {
         SynchronizeCommand synchronizeCommand = command.value<SynchronizeCommand>();
         m_synchronizeId = synchronizeCommand.synchronizeId();
     }  else
diff --git a/src/plugins/qmljseditor/qmljscompletionassist.cpp b/src/plugins/qmljseditor/qmljscompletionassist.cpp
index 8cb43496e87fec2f8934e48b277020128e80329f..d5ef230dcc7a769a105bddf14149ff3fa4e486e7 100644
--- a/src/plugins/qmljseditor/qmljscompletionassist.cpp
+++ b/src/plugins/qmljseditor/qmljscompletionassist.cpp
@@ -286,9 +286,8 @@ private:
     {
         if (! value)
             return;
-        else if (const ObjectValue *object = value->asObjectValue()) {
+        if (const ObjectValue *object = value->asObjectValue())
             processProperties(object);
-        }
     }
 
     void processProperties(const ObjectValue *object)
diff --git a/src/plugins/qmljseditor/qmljshoverhandler.cpp b/src/plugins/qmljseditor/qmljshoverhandler.cpp
index 6f91d6b0f34c58fe097cd2f70d211494a82dfa90..3193298a3034a5812265e0efe4bf64d34ffb89e0 100644
--- a/src/plugins/qmljseditor/qmljshoverhandler.cpp
+++ b/src/plugins/qmljseditor/qmljshoverhandler.cpp
@@ -379,17 +379,10 @@ void HoverHandler::operateTooltip(TextEditor::ITextEditor *editor, const QPoint
 {
     if (toolTip().isEmpty())
         Utils::ToolTip::instance()->hide();
-    else {
-        if (m_colorTip.isValid()) {
-            Utils::ToolTip::instance()->show(point,
-                                                  Utils::ColorContent(m_colorTip),
-                                                  editor->widget());
-        } else {
-            Utils::ToolTip::instance()->show(point,
-                                                  Utils::TextContent(toolTip()),
-                                                  editor->widget());
-        }
-    }
+    else if (m_colorTip.isValid())
+        Utils::ToolTip::instance()->show(point, Utils::ColorContent(m_colorTip), editor->widget());
+    else
+        Utils::ToolTip::instance()->show(point, Utils::TextContent(toolTip()), editor->widget());
 }
 
 void HoverHandler::prettyPrintTooltip(const QmlJS::Value *value,
diff --git a/src/plugins/qmljstools/qmlconsoleview.cpp b/src/plugins/qmljstools/qmlconsoleview.cpp
index 872b4ae8671464980b8391fb699204cb9a3a0586..f74e858cd922fc9cb1ce45b2dec9b38f42e68dba 100644
--- a/src/plugins/qmljstools/qmlconsoleview.cpp
+++ b/src/plugins/qmljstools/qmlconsoleview.cpp
@@ -107,9 +107,9 @@ QmlConsoleView::QmlConsoleView(QWidget *parent) :
     if (Utils::HostOsInfo::isAnyUnixHost() && !Utils::HostOsInfo::isMacHost()
             && baseName == QLatin1String("windows")) {
         // Sometimes we get the standard windows 95 style as a fallback
-        if (QStyleFactory::keys().contains(QLatin1String("Fusion")))
+        if (QStyleFactory::keys().contains(QLatin1String("Fusion"))) {
             baseName = QLatin1String("fusion"); // Qt5
-        else { // Qt4
+        } else { // Qt4
             // e.g. if we are running on a KDE4 desktop
             QByteArray desktopEnvironment = qgetenv("DESKTOP_SESSION");
             if (desktopEnvironment == "kde")
diff --git a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp
index 74078654db198b4978a8b3a0504f308a59ce6748..0d2bd263f55aeb8a97aee1e1a3da6c9f1d3f2c87 100644
--- a/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp
+++ b/src/plugins/qmljstools/qmljsfindexportedcpptypes.cpp
@@ -309,9 +309,8 @@ protected:
             if (QString::fromUtf8(id->chars(), id->size()) != QLatin1String("QVariant"))
                 return ast;
             return call->expression_list->value;
-        }
         // QVariant::fromValue(foo) -> foo
-        else if (QualifiedNameAST *q = idExp->name->asQualifiedName()) {
+        } else if (QualifiedNameAST *q = idExp->name->asQualifiedName()) {
             SimpleNameAST *simpleRhsName = q->unqualified_name->asSimpleName();
             if (!simpleRhsName
                     || !q->nested_name_specifier_list
diff --git a/src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp b/src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
index 62e7f09207cb8860c942fcbb8385a8dc6d61e161..5121aac3320d2395fa2390d980b0a95b07a8d04f 100644
--- a/src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
+++ b/src/plugins/qmlprofiler/canvas/qdeclarativecontext2d.cpp
@@ -511,17 +511,17 @@ QString Context2D::textBaseline()
 
 void Context2D::setTextBaseline(const QString &baseline)
 {
-    if (baseline==QLatin1String("alphabetic"))
+    if (baseline==QLatin1String("alphabetic")) {
         m_state.textBaseline = Context2D::Alphabetic;
-    else if (baseline == QLatin1String("hanging"))
+    } else if (baseline == QLatin1String("hanging")) {
         m_state.textBaseline = Context2D::Hanging;
-    else if (baseline == QLatin1String("top"))
+    } else if (baseline == QLatin1String("top")) {
         m_state.textBaseline = Context2D::Top;
-    else if (baseline == QLatin1String("bottom"))
+    } else if (baseline == QLatin1String("bottom")) {
         m_state.textBaseline = Context2D::Bottom;
-    else if (baseline == QLatin1String("middle"))
+    } else if (baseline == QLatin1String("middle")) {
         m_state.textBaseline = Context2D::Middle;
-    else {
+    } else {
         m_state.textBaseline = Context2D::Alphabetic;
         qWarning() << (QLatin1String("Context2D: invalid baseline:") + baseline);
     }
@@ -550,17 +550,17 @@ QString Context2D::textAlign()
 
 void Context2D::setTextAlign(const QString &baseline)
 {
-    if (baseline==QLatin1String("start"))
+    if (baseline==QLatin1String("start")) {
         m_state.textAlign = Context2D::Start;
-    else if (baseline == QLatin1String("end"))
+    } else if (baseline == QLatin1String("end")) {
         m_state.textAlign = Context2D::End;
-    else if (baseline == QLatin1String("left"))
+    } else if (baseline == QLatin1String("left")) {
         m_state.textAlign = Context2D::Left;
-    else if (baseline == QLatin1String("right"))
+    } else if (baseline == QLatin1String("right")) {
         m_state.textAlign = Context2D::Right;
-    else if (baseline == QLatin1String("center"))
+    } else if (baseline == QLatin1String("center")) {
         m_state.textAlign = Context2D::Center;
-    else {
+    } else {
         m_state.textAlign= Context2D::Start;
         qWarning("Context2D: invalid text align");
     }
@@ -574,11 +574,11 @@ void Context2D::setFont(const QString &fontString)
     // ### this is simplified and incomplete
     QStringList tokens = fontString.split(QLatin1Char(QLatin1Char(' ')));
     foreach (const QString &token, tokens) {
-        if (token == QLatin1String("italic"))
+        if (token == QLatin1String("italic")) {
             font.setItalic(true);
-        else if (token == QLatin1String("bold"))
+        } else if (token == QLatin1String("bold")) {
             font.setBold(true);
-        else if (token.endsWith(QLatin1String("px"))) {
+        } else if (token.endsWith(QLatin1String("px"))) {
             QString number = token;
             number.remove(QLatin1String("px"));
 #ifdef Q_OS_MACX
@@ -589,8 +589,9 @@ void Context2D::setFont(const QString &fontString)
 #else
             font.setPointSizeF(number.trimmed().toFloat());
 #endif
-        } else
+        } else {
             font.setFamily(token);
+        }
     }
     m_state.font = font;
     m_state.flags |= DirtyFont;
diff --git a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp
index d6091ef9a10ec334fd01eb66319539408f1865a8..640b206d2b5408042e2259048b9b85b70f3a5aba 100644
--- a/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerdatamodel.cpp
@@ -310,9 +310,9 @@ void QmlProfilerDataModel::addRangedEvent(int type, int bindingType, qint64 star
     setState(AcquiringData);
 
     // generate details string
-    if (data.isEmpty())
+    if (data.isEmpty()) {
         details = tr("Source code not available.");
-    else {
+    } else {
         details = data.join(QLatin1String(" ")).replace(QLatin1Char('\n'),QLatin1Char(' ')).simplified();
         QRegExp rewrite(QLatin1String("\\(function \\$(\\w+)\\(\\) \\{ (return |)(.+) \\}\\)"));
         bool match = rewrite.exactMatch(details);
@@ -613,18 +613,14 @@ qint64 QmlProfilerDataModel::firstTimeMark() const
 {
     if (d->startInstanceList.isEmpty())
         return 0;
-    else {
-        return d->startInstanceList[0].startTime;
-    }
+    return d->startInstanceList[0].startTime;
 }
 
 qint64 QmlProfilerDataModel::lastTimeMark() const
 {
     if (d->endInstanceList.isEmpty())
         return 0;
-    else {
-        return d->endInstanceList.last().endTime;
-    }
+    return d->endInstanceList.last().endTime;
 }
 
 ////////////////////////////////////////////////////////////////////////////////////
@@ -1046,9 +1042,9 @@ void QmlProfilerDataModel::QmlProfilerDataModelPrivate::computeNestingDepth()
     for (int i = 0; i < endInstanceList.count(); i++) {
         int type = endInstanceList[i].description->eventType;
         int nestingInType = startInstanceList[endInstanceList[i].startTimeIndex].nestingLevel;
-        if (!nestingDepth.contains(type))
+        if (!nestingDepth.contains(type)) {
             nestingDepth[type] = nestingInType;
-        else {
+        } else {
             int nd = nestingDepth[type];
             nestingDepth[type] = nd > nestingInType ? nd : nestingInType;
         }
diff --git a/src/plugins/qmlprofiler/qmlprofilereventview.cpp b/src/plugins/qmlprofiler/qmlprofilereventview.cpp
index d04a0203e004d695635f37d6ccf6c2afc19e1319..d956fa61bc439dd895c7d7fb6e7ad4181063da1a 100644
--- a/src/plugins/qmlprofiler/qmlprofilereventview.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilereventview.cpp
@@ -970,8 +970,7 @@ void QmlProfilerEventsParentsAndChildrenView::displayEvent(int eventId)
             if (isChildren) {
                 QList <QV8EventSub *> childrenList = v8event->childrenHash.values();
                 rebuildTree((QObject *)&childrenList);
-            }
-            else {
+            } else {
                 QList <QV8EventSub *> parentList = v8event->parentHash.values();
                 rebuildTree((QObject *)&parentList);
             }
@@ -982,8 +981,7 @@ void QmlProfilerEventsParentsAndChildrenView::displayEvent(int eventId)
             if (isChildren) {
                 QList <QmlRangeEventRelative *> childrenList = qmlEvent->childrenHash.values();
                 rebuildTree((QObject *)&childrenList);
-            }
-            else {
+            } else {
                 QList <QmlRangeEventRelative *> parentList = qmlEvent->parentHash.values();
                 rebuildTree((QObject *)&parentList);
             }
diff --git a/src/plugins/qnx/qnxutils.cpp b/src/plugins/qnx/qnxutils.cpp
index 64eff9cea1563b7bc3193714cbb24d45b760153b..2da2c9bc1972ebbe86d40a3da92f7b3043fbad09 100644
--- a/src/plugins/qnx/qnxutils.cpp
+++ b/src/plugins/qnx/qnxutils.cpp
@@ -117,8 +117,7 @@ QMultiMap<QString, QString> QnxUtils::parseEnvironmentFile(const QString &fileNa
                 else
                     value = systemVarRegExp.cap(3);
             }
-        }
-        else if (Utils::HostOsInfo::isAnyUnixHost()) {
+        } else if (Utils::HostOsInfo::isAnyUnixHost()) {
             QRegExp systemVarRegExp(QLatin1String("\\$\\{([\\w\\d]+):=([\\w\\d]+)\\}")); // to match e.g. "${QNX_HOST_VERSION:=10_0_9_52}"
             if (value.contains(systemVarRegExp)) {
                 Utils::Environment sysEnv = Utils::Environment::systemEnvironment();
diff --git a/src/plugins/qtsupport/debugginghelperbuildtask.cpp b/src/plugins/qtsupport/debugginghelperbuildtask.cpp
index 5a53d2b3f5d730bac5fdba63d627d0b4e1408d5b..9f77184182019417f07cf3e186b8aa9c7f1016b6 100644
--- a/src/plugins/qtsupport/debugginghelperbuildtask.cpp
+++ b/src/plugins/qtsupport/debugginghelperbuildtask.cpp
@@ -101,9 +101,8 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const BaseQtVersion *version,
         // explicitly set 32 or 64 bit in case Qt is compiled with both
         if (toolChain->targetAbi().wordWidth() == 32)
             m_qmakeArguments << QLatin1String("CONFIG+=x86");
-        else if (toolChain->targetAbi().wordWidth() == 64) {
+        else if (toolChain->targetAbi().wordWidth() == 64)
             m_qmakeArguments << QLatin1String("CONFIG+=x86_64");
-        }
     }
     m_makeCommand = toolChain->makeCommand(m_environment);
     m_mkspec = version->mkspec();
diff --git a/src/plugins/texteditor/autocompleter.cpp b/src/plugins/texteditor/autocompleter.cpp
index 37d251e536aadcd7d1ea1f65064a3ce0e4ffe265..3b898508684382b6d2701f0920117d2f9ea63cde 100644
--- a/src/plugins/texteditor/autocompleter.cpp
+++ b/src/plugins/texteditor/autocompleter.cpp
@@ -122,8 +122,7 @@ QString AutoCompleter::autoComplete(QTextCursor &cursor, const QString &textToIn
                     str += QLatin1String("}") + QString(QChar::ParagraphSeparator);
                 else
                     str += QString(QChar::ParagraphSeparator) + QLatin1String("}");
-            }
-            else {
+            } else {
                 str += QLatin1String("}");
             }
             return str;
diff --git a/src/plugins/texteditor/basetextdocumentlayout.cpp b/src/plugins/texteditor/basetextdocumentlayout.cpp
index 263c78eb1a4746e4d049ef3a03d9d27c5d8a35cc..f8bccb4e4c68ee1bad8da76c50c02b388bf569af 100644
--- a/src/plugins/texteditor/basetextdocumentlayout.cpp
+++ b/src/plugins/texteditor/basetextdocumentlayout.cpp
@@ -680,10 +680,8 @@ void BaseTextDocumentLayout::setFolded(const QTextBlock &block, bool folded)
 {
     if (folded)
         userData(block)->setFolded(true);
-    else {
-        if (TextBlockUserData *userData = testUserData(block))
-            return userData->setFolded(false);
-    }
+    else if (TextBlockUserData *userData = testUserData(block))
+        return userData->setFolded(false);
 }
 
 void BaseTextDocumentLayout::requestExtraAreaUpdate()
diff --git a/src/plugins/texteditor/basetexteditor.cpp b/src/plugins/texteditor/basetexteditor.cpp
index cb5d4f33c1bbba8d6102649a15431fdae6ce0d88..17fca6633f71b927eaa9a71379bfdf9159e582f3 100644
--- a/src/plugins/texteditor/basetexteditor.cpp
+++ b/src/plugins/texteditor/basetexteditor.cpp
@@ -1424,55 +1424,44 @@ bool BaseTextEditorWidget::cursorMoveKeyEvent(QKeyEvent *e)
     QTextCursor::MoveMode mode = QTextCursor::MoveAnchor;
     QTextCursor::MoveOperation op = QTextCursor::NoMove;
 
-    if (e == QKeySequence::MoveToNextChar)
+    if (e == QKeySequence::MoveToNextChar) {
             op = QTextCursor::Right;
-    else if (e == QKeySequence::MoveToPreviousChar)
+    } else if (e == QKeySequence::MoveToPreviousChar) {
             op = QTextCursor::Left;
-    else if (e == QKeySequence::SelectNextChar) {
+    } else if (e == QKeySequence::SelectNextChar) {
            op = QTextCursor::Right;
            mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectPreviousChar) {
+    } else if (e == QKeySequence::SelectPreviousChar) {
             op = QTextCursor::Left;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectNextWord) {
+    } else if (e == QKeySequence::SelectNextWord) {
             op = QTextCursor::WordRight;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectPreviousWord) {
+    } else if (e == QKeySequence::SelectPreviousWord) {
             op = QTextCursor::WordLeft;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectStartOfLine) {
+    } else if (e == QKeySequence::SelectStartOfLine) {
             op = QTextCursor::StartOfLine;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectEndOfLine) {
+    } else if (e == QKeySequence::SelectEndOfLine) {
             op = QTextCursor::EndOfLine;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectStartOfBlock) {
+    } else if (e == QKeySequence::SelectStartOfBlock) {
             op = QTextCursor::StartOfBlock;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectEndOfBlock) {
+    } else if (e == QKeySequence::SelectEndOfBlock) {
             op = QTextCursor::EndOfBlock;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectStartOfDocument) {
+    } else if (e == QKeySequence::SelectStartOfDocument) {
             op = QTextCursor::Start;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectEndOfDocument) {
+    } else if (e == QKeySequence::SelectEndOfDocument) {
             op = QTextCursor::End;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectPreviousLine) {
+    } else if (e == QKeySequence::SelectPreviousLine) {
             op = QTextCursor::Up;
             mode = QTextCursor::KeepAnchor;
-    }
-    else if (e == QKeySequence::SelectNextLine) {
+    } else if (e == QKeySequence::SelectNextLine) {
             op = QTextCursor::Down;
             mode = QTextCursor::KeepAnchor;
             {
@@ -1483,41 +1472,29 @@ bool BaseTextEditorWidget::cursorMoveKeyEvent(QKeyEvent *e)
                     && line.lineNumber() == block.layout()->lineCount() - 1)
                     op = QTextCursor::End;
             }
-    }
-    else if (e == QKeySequence::MoveToNextWord) {
+    } else if (e == QKeySequence::MoveToNextWord) {
             op = QTextCursor::WordRight;
-    }
-    else if (e == QKeySequence::MoveToPreviousWord) {
+    } else if (e == QKeySequence::MoveToPreviousWord) {
             op = QTextCursor::WordLeft;
-    }
-    else if (e == QKeySequence::MoveToEndOfBlock) {
+    } else if (e == QKeySequence::MoveToEndOfBlock) {
             op = QTextCursor::EndOfBlock;
-    }
-    else if (e == QKeySequence::MoveToStartOfBlock) {
+    } else if (e == QKeySequence::MoveToStartOfBlock) {
             op = QTextCursor::StartOfBlock;
-    }
-    else if (e == QKeySequence::MoveToNextLine) {
+    } else if (e == QKeySequence::MoveToNextLine) {
             op = QTextCursor::Down;
-    }
-    else if (e == QKeySequence::MoveToPreviousLine) {
+    } else if (e == QKeySequence::MoveToPreviousLine) {
             op = QTextCursor::Up;
-    }
-    else if (e == QKeySequence::MoveToPreviousLine) {
+    } else if (e == QKeySequence::MoveToPreviousLine) {
             op = QTextCursor::Up;
-    }
-    else if (e == QKeySequence::MoveToStartOfLine) {
+    } else if (e == QKeySequence::MoveToStartOfLine) {
             op = QTextCursor::StartOfLine;
-    }
-    else if (e == QKeySequence::MoveToEndOfLine) {
+    } else if (e == QKeySequence::MoveToEndOfLine) {
             op = QTextCursor::EndOfLine;
-    }
-    else if (e == QKeySequence::MoveToStartOfDocument) {
+    } else if (e == QKeySequence::MoveToStartOfDocument) {
             op = QTextCursor::Start;
-    }
-    else if (e == QKeySequence::MoveToEndOfDocument) {
+    } else if (e == QKeySequence::MoveToEndOfDocument) {
             op = QTextCursor::End;
-    }
-    else {
+    } else {
         return false;
     }
 
@@ -1865,9 +1842,7 @@ void BaseTextEditorWidget::keyPressEvent(QKeyEvent *e)
     }
 
     if (ro || e->text().isEmpty() || !e->text().at(0).isPrint()) {
-        if (cursorMoveKeyEvent(e))
-            ;
-        else {
+        if (!cursorMoveKeyEvent(e)) {
             QTextCursor cursor = textCursor();
             bool cursorWithinSnippet = false;
             if (d->m_snippetOverlay->isVisible()
@@ -4001,9 +3976,9 @@ void BaseTextEditorWidget::slotModificationChanged(bool m)
 
 void BaseTextEditorWidget::slotUpdateRequest(const QRect &r, int dy)
 {
-    if (dy)
+    if (dy) {
         d->m_extraArea->scroll(0, dy);
-    else if (r.width() > 4) { // wider than cursor width, not just cursor blinking
+    } else if (r.width() > 4) { // wider than cursor width, not just cursor blinking
         d->m_extraArea->update(0, r.y(), d->m_extraArea->width(), r.height());
         if (!d->m_searchExpr.isEmpty()) {
             const int m = d->m_searchResultOverlay->dropShadowWidth();
diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp
index a1a52cfd79f28fba0a96ccdc8efec218274e841f..e3cd7e496aa2406658f9912bdb0a53509bd4ca00 100644
--- a/src/plugins/texteditor/fontsettingspage.cpp
+++ b/src/plugins/texteditor/fontsettingspage.cpp
@@ -260,15 +260,15 @@ QColor FormatDescription::foreground() const
 
 QColor FormatDescription::background() const
 {
-    if (m_id == C_TEXT)
+    if (m_id == C_TEXT) {
         return Qt::white;
-    else if (m_id == C_LINE_NUMBER)
+    } else if (m_id == C_LINE_NUMBER) {
         return QApplication::palette().background().color();
-    else if (m_id == C_SEARCH_RESULT)
+    } else if (m_id == C_SEARCH_RESULT) {
         return QColor(0xffef0b);
-    else if (m_id == C_PARENTHESES)
+    } else if (m_id == C_PARENTHESES) {
         return QColor(0xb4, 0xee, 0xb4);
-    else if (m_id == C_CURRENT_LINE || m_id == C_SEARCH_SCOPE) {
+    } else if (m_id == C_CURRENT_LINE || m_id == C_SEARCH_SCOPE) {
         const QPalette palette = QApplication::palette();
         const QColor &fg = palette.color(QPalette::Highlight);
         const QColor &bg = palette.color(QPalette::Base);
diff --git a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp
index f01fcf6621c51da3584c9293aa4a0be80904697c..d1e8ef6ac7f3a0df7e56dcff320c091ccbcbc2d2 100644
--- a/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp
+++ b/src/plugins/texteditor/generichighlighter/managedefinitionsdialog.cpp
@@ -84,9 +84,9 @@ void ManageDefinitionsDialog::populateDefinitionsWidget()
 
         for (int j = 0; j < 3; ++j) {
             QTableWidgetItem *item = new QTableWidgetItem;
-            if (j == 0)
+            if (j == 0) {
                 item->setText(downloadData.name);
-            else if (j == 1) {
+            } else if (j == 1) {
                 item->setText(dirVersion);
                 item->setTextAlignment(Qt::AlignCenter);
             } else if (j == 2) {
diff --git a/src/plugins/texteditor/refactoringchanges.cpp b/src/plugins/texteditor/refactoringchanges.cpp
index 99b0312f723d57684bd5f022a197f7a328b7af9e..f5e43b32ac6d70799c54ffd1f5f7834a6a037216 100644
--- a/src/plugins/texteditor/refactoringchanges.cpp
+++ b/src/plugins/texteditor/refactoringchanges.cpp
@@ -214,7 +214,7 @@ QTextDocument *RefactoringFile::mutableDocument() const
 {
     if (m_editor)
         return m_editor->document();
-    else if (!m_document) {
+    if (!m_document) {
         QString fileContents;
         if (!m_fileName.isEmpty()) {
             QString error;
@@ -238,7 +238,7 @@ const QTextCursor RefactoringFile::cursor() const
 {
     if (m_editor)
         return m_editor->textCursor();
-    else if (!m_fileName.isEmpty()) {
+    if (!m_fileName.isEmpty()) {
         if (QTextDocument *doc = mutableDocument())
             return QTextCursor(doc);
     }
diff --git a/src/plugins/todo/todoitemsprovider.cpp b/src/plugins/todo/todoitemsprovider.cpp
index 28e691bc7d23dd3fbf7b81d66d566a25758a3fc0..eb491cc4e46760821822fd1d44f9baabd352f8fc 100644
--- a/src/plugins/todo/todoitemsprovider.cpp
+++ b/src/plugins/todo/todoitemsprovider.cpp
@@ -79,10 +79,8 @@ void TodoItemsProvider::updateList()
     if (m_settings.scanningScope == ScanningScopeCurrentFile) {
         if (m_currentEditor)
             m_itemsList = m_itemsHash.value(m_currentEditor->document()->filePath());
-    }
-
     // Show only items of the startup project if any
-    else {
+    } else {
         if (m_startupProject)
             setItemsListWithinStartupProject();
     }
diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp
index 38e530c02e1287a29177455e0f543cc527f52f9d..a2cc8d12a13424e6f73d3078ce43c292e91580f6 100644
--- a/src/plugins/valgrind/callgrindtool.cpp
+++ b/src/plugins/valgrind/callgrindtool.cpp
@@ -408,8 +408,7 @@ void CallgrindToolPrivate::handleFilterProjectCosts()
     if (m_filterProjectCosts->isChecked()) {
         const QString projectDir = pro->projectDirectory();
         m_proxyModel->setFilterBaseDir(projectDir);
-    }
-    else {
+    } else {
         m_proxyModel->setFilterBaseDir(QString());
     }
 }
diff --git a/src/plugins/valgrind/callgrindvisualisation.cpp b/src/plugins/valgrind/callgrindvisualisation.cpp
index 9da37c6711ef529247cf4a120c9d84641b7363bc..b70eee9528f15f14a8ae8d314e295bf44aa88a75 100644
--- a/src/plugins/valgrind/callgrindvisualisation.cpp
+++ b/src/plugins/valgrind/callgrindvisualisation.cpp
@@ -188,8 +188,7 @@ void FunctionGraphicsItem::paint(QPainter *painter,
         gradient.setColorAt(0.5, color.lighter(200));
         gradient.setColorAt(1, color.darker(100));
         painter->setBrush(gradient);
-    }
-    else {
+    } else {
         painter->setBrush(color);
     }
 
@@ -256,9 +255,9 @@ void Visualisation::Private::handleMousePressEvent(QMouseEvent *event,
     if (itemAtPos) {
         const Function *func = q->functionForItem(itemAtPos);
 
-        if (doubleClicked)
+        if (doubleClicked) {
             q->functionActivated(func);
-        else {
+        } else {
             q->scene()->clearSelection();
             itemAtPos->setSelected(true);
             q->functionSelected(func);
diff --git a/src/plugins/valgrind/xmlprotocol/parser.cpp b/src/plugins/valgrind/xmlprotocol/parser.cpp
index ca76a006f54fd5668158c1d229a425fe966b119d..d029009b6d602fe3ffa07ed69f2b268645a1824e 100644
--- a/src/plugins/valgrind/xmlprotocol/parser.cpp
+++ b/src/plugins/valgrind/xmlprotocol/parser.cpp
@@ -440,29 +440,27 @@ void Parser::Private::parseError()
         if (reader.isStartElement())
             lastAuxWhat++;
         const QStringRef name = reader.name();
-        if (name == QLatin1String("unique"))
+        if (name == QLatin1String("unique")) {
             e.setUnique(parseHex(blockingReadElementText(), QLatin1String("unique")));
-        else if (name == QLatin1String("tid"))
+        } else if (name == QLatin1String("tid")) {
             e.setTid(parseInt64(blockingReadElementText(), QLatin1String("error/tid")));
-        else if (name == QLatin1String("kind")) //TODO this is memcheck-specific:
+        } else if (name == QLatin1String("kind")) { //TODO this is memcheck-specific:
             e.setKind(parseErrorKind(blockingReadElementText()));
-        else if (name == QLatin1String("suppression"))
+        } else if (name == QLatin1String("suppression")) {
             e.setSuppression(parseSuppression());
-        else if (name == QLatin1String("xwhat")) {
+        } else if (name == QLatin1String("xwhat")) {
             const XWhat xw = parseXWhat();
             e.setWhat(xw.text);
             e.setLeakedBlocks(xw.leakedblocks);
             e.setLeakedBytes(xw.leakedbytes);
             e.setHelgrindThreadId(xw.hthreadid);
-        }
-        else if (name == QLatin1String("what"))
+        } else if (name == QLatin1String("what")) {
             e.setWhat(blockingReadElementText());
-        else if (name == QLatin1String("xauxwhat")) {
+        } else if (name == QLatin1String("xauxwhat")) {
             if (!currentAux.text.isEmpty())
                 auxs.push_back(currentAux);
             currentAux = parseXauxWhat();
-        }
-        else if (name == QLatin1String("auxwhat")) {
+        } else if (name == QLatin1String("auxwhat")) {
             const QString aux = blockingReadElementText();
             //concatenate multiple consecutive <auxwhat> tags
             if (lastAuxWhat > 1) {
@@ -476,12 +474,11 @@ void Parser::Private::parseError()
                 currentAux.text.append(aux);
             }
             lastAuxWhat = 0;
-        }
-        else if (name == QLatin1String("stack")) {
+        } else if (name == QLatin1String("stack")) {
             frames.push_back(parseStack());
-        }
-        else if (reader.isStartElement())
+        } else if (reader.isStartElement()) {
             reader.skipCurrentElement();
+        }
     }
 
     if (!currentAux.text.isEmpty())
diff --git a/src/plugins/vcsbase/vcsbaseclient.cpp b/src/plugins/vcsbase/vcsbaseclient.cpp
index e9f7d7a74cb5a5d8ec5250652084fbf33039bad4..14778f13ca5ad242687d2ce4dda2a7ddcc5f6b6e 100644
--- a/src/plugins/vcsbase/vcsbaseclient.cpp
+++ b/src/plugins/vcsbase/vcsbaseclient.cpp
@@ -600,13 +600,11 @@ Command *VcsBaseClient::createCommand(const QString &workingDirectory,
         if (editor) { // assume that the commands output is the important thing
             connect(cmd, SIGNAL(outputData(QByteArray)),
                     ::vcsOutputWindow(), SLOT(appendDataSilently(QByteArray)));
-        }
-        else {
+        } else {
             connect(cmd, SIGNAL(outputData(QByteArray)),
                     ::vcsOutputWindow(), SLOT(appendData(QByteArray)));
         }
-    }
-    else if (editor) {
+    } else if (editor) {
         connect(cmd, SIGNAL(outputData(QByteArray)),
                 editor, SLOT(setPlainTextData(QByteArray)));
     }
diff --git a/src/shared/cpaster/cgi.cpp b/src/shared/cpaster/cgi.cpp
index 0c64e02c52965d37783f8cbd8a2385a50225c55c..6bee94682eacfd04b5a811c45c21fee6e10a8eed 100644
--- a/src/shared/cpaster/cgi.cpp
+++ b/src/shared/cpaster/cgi.cpp
@@ -44,11 +44,11 @@ QString CGI::encodeURL(const QString &rawText)
         const char ch = *it;
         if (('A' <= ch && ch <= 'Z')
             || ('a' <= ch && ch <= 'z')
-            || ('0' <= ch && ch <= '9'))
+            || ('0' <= ch && ch <= '9')) {
             enc.append(QLatin1Char(ch));
-        else if (ch == ' ')
+        } else if (ch == ' ') {
             enc.append(QLatin1Char('+'));
-        else {
+        } else {
             switch (ch) {
             case '-': case '_':
             case '(': case ')':
diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp
index 7cf164d0f00c0799904e996f05788eff7f216157..ad9b2660462d230f9f8cd9916826be8b519b304d 100644
--- a/src/shared/help/bookmarkmanager.cpp
+++ b/src/shared/help/bookmarkmanager.cpp
@@ -236,8 +236,7 @@ void BookmarkDialog::customContextMenuRequested(const QPoint &point)
         if (index.isValid())
             name = index.data().toString();
         ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name));
-    }
-    else if (picked == renameItem) {
+    } else if (picked == renameItem) {
         BookmarkModel *model = bookmarkManager->treeBookmarkModel();
         if (QStandardItem *item = model->itemFromIndex(proxyIndex)) {
             item->setEditable(true);
@@ -397,15 +396,14 @@ void BookmarkWidget::customContextMenuRequested(const QPoint &point)
     if (!pickedAction)
         return;
 
-    if (pickedAction == showItem)
+    if (pickedAction == showItem) {
         emit linkActivated(data);
-    else if (pickedAction == showItemNewTab)
+    } else if (pickedAction == showItemNewTab) {
         emit createPage(QUrl(data), false);
-    else if (pickedAction == removeItem) {
+    } else if (pickedAction == removeItem) {
         bookmarkManager->removeBookmarkItem(treeView,
             filterBookmarkModel->mapToSource(index));
-    }
-    else if (pickedAction == renameItem) {
+    } else if (pickedAction == renameItem) {
         const QModelIndex &source = filterBookmarkModel->mapToSource(index);
         QStandardItem *item =
             bookmarkManager->treeBookmarkModel()->itemFromIndex(source);
diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp
index 60b86b7fc49d3de78ab07d70a81b1aa4c8f89de1..bbe713f899696edb1ac4028d93c0ed6c8317186f 100644
--- a/src/shared/help/indexwindow.cpp
+++ b/src/shared/help/indexwindow.cpp
@@ -149,9 +149,8 @@ bool IndexWindow::eventFilter(QObject *obj, QEvent *e)
             QAction *action = menu.exec();
             if (curTab == action)
                 m_indexWidget->activateCurrentItem();
-            else if (newTab == action) {
+            else if (newTab == action)
                 open(m_indexWidget, idx);
-            }
         }
     } else if (m_indexWidget && obj == m_indexWidget->viewport()
         && e->type() == QEvent::MouseButtonRelease) {
diff --git a/src/tools/valgrindfake/outputgenerator.cpp b/src/tools/valgrindfake/outputgenerator.cpp
index 98262773868644104c2fe2b1f39e338bffb22bb0..578b9c1d519e782feae6d5645ee00232fb0e6510 100644
--- a/src/tools/valgrindfake/outputgenerator.cpp
+++ b/src/tools/valgrindfake/outputgenerator.cpp
@@ -98,8 +98,7 @@ void OutputGenerator::produceRuntimeError()
         int i = 1 / zero;
         Q_UNUSED(i);
         Q_ASSERT(false);
-    }
-    else if (m_garbage) {
+    } else if (m_garbage) {
         std::cerr << "Writing garbage" << std::endl;
         blockingWrite(m_output, "<</GARBAGE = '\"''asdfaqre");
         m_output->flush();
diff --git a/tests/auto/debugger/tst_gdb.cpp b/tests/auto/debugger/tst_gdb.cpp
index 78f72cc3fa2167f195f0646e6f49fd03cd09cf88..c92eb37eac9cdaae0e552e32eb296e0329d32dcd 100644
--- a/tests/auto/debugger/tst_gdb.cpp
+++ b/tests/auto/debugger/tst_gdb.cpp
@@ -210,9 +210,9 @@ QString niceType(QString type)
             QRegExp re5(QString("map<%1, %2, std::less<%3>, %4\\s*>")
                 .arg(key, value, key, alloc));
             re5.setMinimal(true);
-            if (re5.indexIn(type) != -1)
+            if (re5.indexIn(type) != -1) {
                 type.replace(re5.cap(0), QString("map<%1, %2>").arg(key, value));
-            else {
+            } else {
                 QRegExp re7(QString("map<const %1, %2, std::less<const %3>, %4\\s*>")
                     .arg(key, value, key, alloc));
                 re7.setMinimal(true);
diff --git a/tests/manual/plain-cplusplus/Preprocessor.cpp b/tests/manual/plain-cplusplus/Preprocessor.cpp
index 2f1122df39b2f0c83b4397bfae83f5d20d28004b..4345d83a2a20a96382755510b8fe03414292c8d7 100644
--- a/tests/manual/plain-cplusplus/Preprocessor.cpp
+++ b/tests/manual/plain-cplusplus/Preprocessor.cpp
@@ -111,18 +111,16 @@ void Preprocessor::scanActualArgument(Token *tk, std::vector<Token> *tokens)
     int count = 0;
 
     while (tk->isNot(T_EOF_SYMBOL)) {
-        if (tk->is(T_LPAREN))
+        if (tk->is(T_LPAREN)) {
             ++count;
-
-        else if (tk->is(T_RPAREN)) {
+        } else if (tk->is(T_RPAREN)) {
             if (! count)
                 break;
 
             --count;
-        }
-
-        else if (! count && tk->is(T_COMMA))
+        } else if (! count && tk->is(T_COMMA)) {
             break;
+        }
 
         tokens->push_back(*tk);
         lex(tk);
@@ -165,9 +163,9 @@ _Lclassify:
                     for (size_t i = 0; i < body.size(); ++i) {
                         const Token &token = body[i];
 
-                        if (token.isNot(T_IDENTIFIER))
+                        if (token.isNot(T_IDENTIFIER)) {
                             expanded.push_back(token);
-                        else {
+                        } else {
                             const StringRef id = asStringRef(token);
                             size_t j = 0;
                             for (; j < macro->formals.size(); ++j) {
@@ -309,10 +307,9 @@ void Preprocessor::run(const char *source, unsigned size)
         lex(&tk);
 
         if (lineno != tk.lineno) {
-            if (lineno > tk.lineno || tk.lineno - lineno > 3)
+            if (lineno > tk.lineno || tk.lineno - lineno > 3) {
                 out << std::endl << "#line " << tk.lineno << " \"" << _currentFileName << "\"" << std::endl;
-
-            else {
+            } else {
                 for (unsigned i = lineno; i < tk.lineno; ++i)
                     out << std::endl;
             }
diff --git a/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp b/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp
index 371ac870d943ed2cefdbd0f530c91305f77ea2a2..b9ffdad96bc05d410076f7dca8c4d27cccc9efdf 100644
--- a/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp
+++ b/tests/tools/cplusplus-ast2png/cplusplus-ast2png.cpp
@@ -555,17 +555,17 @@ int main(int argc, char *argv[])
             exit(EXIT_FAILURE);
         }
         const QString parseAs = args.first();
-        if (parseAs == QLatin1String("declarator") || parseAs == QLatin1String("dr"))
+        if (parseAs == QLatin1String("declarator") || parseAs == QLatin1String("dr")) {
             optionParseMode = Document::ParseDeclarator;
-        else if (parseAs == QLatin1String("expression") || parseAs == QLatin1String("ex"))
+        } else if (parseAs == QLatin1String("expression") || parseAs == QLatin1String("ex")) {
             optionParseMode = Document::ParseExpression;
-        else if (parseAs == QLatin1String("declaration") || parseAs == QLatin1String("dn"))
+        } else if (parseAs == QLatin1String("declaration") || parseAs == QLatin1String("dn")) {
             optionParseMode = Document::ParseDeclaration;
-        else if (parseAs == QLatin1String("statement") || parseAs == QLatin1String("st"))
+        } else if (parseAs == QLatin1String("statement") || parseAs == QLatin1String("st")) {
             optionParseMode = Document::ParseStatement;
-        else if (parseAs == QLatin1String("translationunit") || parseAs == QLatin1String("tr"))
+        } else if (parseAs == QLatin1String("translationunit") || parseAs == QLatin1String("tr")) {
             optionParseMode = Document::ParseTranlationUnit;
-        else {
+        } else {
             std::cerr << "Error: Invalid ast for option \"-p\"." << std::endl;
             printUsage();
             exit(EXIT_FAILURE);