[Differential] [Request, 49 lines] D4101: Remove uneeded if-guard
Tomaz Canabrava
noreply at phabricator.kde.org
Thu Jan 12 13:30:31 UTC 2017
tcanabrava created this revision.
tcanabrava added reviewers: kfunk, apol.
Restricted Application added a subscriber: kdevelop-devel.
REVISION SUMMARY
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
REPOSITORY
R32 KDevelop
BRANCH
cleanup
REVISION DETAIL
https://phabricator.kde.org/D4101
AFFECTED FILES
app/main.cpp
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: tcanabrava, kfunk, apol
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20170112/8c457411/attachment.html>
More information about the KDevelop-devel
mailing list