Changeset View
Changeset View
Standalone View
Standalone View
plugins/custom-definesandincludes/compilerprovider/settingsmanager.h
Show All 32 Lines | |||||
33 | 33 | | |||
34 | namespace KDevelop { | 34 | namespace KDevelop { | ||
35 | class IProject; | 35 | class IProject; | ||
36 | class ProjectBaseItem; | 36 | class ProjectBaseItem; | ||
37 | } | 37 | } | ||
38 | 38 | | |||
39 | struct ParserArguments | 39 | struct ParserArguments | ||
40 | { | 40 | { | ||
41 | QString cArguments; | 41 | public: | ||
42 | QString cppArguments; | 42 | const QString& operator[](Utils::LanguageType languageType) const | ||
mwolff: rename to `argumentsForLanguage`, or make it an `operator[]() const` | |||||
In fact I had this as operator[] originally, but the problem was that get and set have slightly different domains as of now. Meaning that there are some languages for which we don't have a setting, but instead just return an empty string. (See argumentsForPath in plugins/custom-definesandincludes/definesandincludesmanager.cpp) I agree that this is a bit weird, but I'm not sure how to handle it. Do we want to persist options for Objective C as well? And why do we have Other? aaronpuchert: In fact I had this as `operator[]` originally, but the problem was that `get` and `set` have… | |||||
43 | QString openClArguments; | 43 | { | ||
rename to setArgumentsForLanguage, and rename arg to arguments. alternatively think about adding an QString& operator[]() mwolff: rename to `setArgumentsForLanguage`, and rename `arg` to `arguments`. alternatively think about… | |||||
44 | QString cudaArguments; | 44 | Q_ASSERT(languageType >= Utils::C && languageType < Utils::Other); | ||
45 | return arguments[languageType]; | ||||
46 | } | ||||
47 | | ||||
48 | QString& operator[](Utils::LanguageType languageType) | ||||
49 | { | ||||
50 | Q_ASSERT(languageType >= Utils::C && languageType < Utils::Other); | ||||
51 | return arguments[languageType]; | ||||
52 | } | ||||
53 | | ||||
54 | /// Is any of arguments empty? | ||||
mwolff: missing word: "the" | |||||
55 | bool isAnyEmpty() const; | ||||
56 | | ||||
57 | private: | ||||
58 | QString arguments[Utils::Other]; | ||||
59 | | ||||
60 | public: | ||||
45 | bool parseAmbiguousAsCPP; | 61 | bool parseAmbiguousAsCPP; | ||
46 | }; | 62 | }; | ||
47 | 63 | | |||
48 | Q_DECLARE_METATYPE(ParserArguments); | 64 | Q_DECLARE_METATYPE(ParserArguments); | ||
49 | 65 | | |||
50 | struct ConfigEntry | 66 | struct ConfigEntry | ||
51 | { | 67 | { | ||
52 | QString path; | 68 | QString path; | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
rename to argumentsForLanguage, or make it an operator[]() const