Code review comment for lp://qastaging/~didrocks/unity-2d/subdatadir

Revision history for this message
Aurélien Gâteau (agateau) wrote :

Works fine, thanks!

I have a few remarks regarding implementation, though:

# Coding style
This file is old and does not comply with unity-2d coding style, but we try to ensure new code does comply. Changes to do are:
- Use camelCase for variables
- Use curly braces for single line ifs
- Attach opening curly brace with the previous line (ie: "if (foo) {", not "if (foo)\n{")
- Whenever possible, use const refs for looping variables in Q_FOREACH

See the CODING file at the root of the repository

# Implementation
- What you are storing in m_xdg_data_dirs is no longer the list of data dirs, it is the list of application dirs. I would suggest renaming the variable to m_xdgApplicationDirs and implement the parsing this way:

Q_FOREACH(const QString& dirName, xdgString.split(':')) {
    m_xdgApplicationDirs << QDir::cleanPath(dirName + "/applications/");
}

- favoriteFromDesktopFilePath() is no longer a static method but it does not modify the object, so it should be marked "const".

review: Needs Fixing

« Back to merge proposal