Remove uneeded if-guard

Authored by tcanabrava on Jan 12 2017, 1:30 PM.



The GUIenabled variable is just used if not in KDEVELOP_SINGLE_APP
mode, but silencing the warning with unguarded-ifs unclutters the
code a bit and has no sideeffects.

Use brace-initialization for QStringList

No need to test for isEmpty before using Q_FOREACH

If the container is empty, it will just do anything
on the foreach macro. this also reduces the indentation
level a bit.

Rename variable p to project

The outer loop has a variable named p, and while C++ accepts
that inner variables have biggest priority than outer
variables, this could be a potential human mistake.

Replace 8 ocorrencies of const char* to QString to a single QString

QString is UTF_16 internally, so creating just one QString
for a given string is better than runtime-creating a few more
via const char*.

Test Plan

compiled and tested

Diff Detail

R32 KDevelop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
tcanabrava updated this revision to Diff 10095.Jan 12 2017, 1:30 PM
tcanabrava retitled this revision from to Remove uneeded if-guard.
tcanabrava updated this object.
tcanabrava edited the test plan for this revision. (Show Details)
tcanabrava added reviewers: kfunk, apol.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJan 12 2017, 1:30 PM
kfunk accepted this revision.Jan 12 2017, 1:43 PM
kfunk edited edge metadata.
kfunk added inline comments.

While at it, could change this to projectName, too

This revision is now accepted and ready to land.Jan 12 2017, 1:43 PM
tcanabrava updated this revision to Diff 10097.Jan 12 2017, 1:43 PM
tcanabrava edited edge metadata.
  • Use const-ref on foreach
  • if/else chain to ternary in small code.
tcanabrava updated this revision to Diff 10099.Jan 12 2017, 1:45 PM
  • Change p to projectName
This revision was automatically updated to reflect the committed changes.