Differential D8317 Diff 20822 plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
Changeset View
Changeset View
Standalone View
Standalone View
plugins/custom-definesandincludes/compilerprovider/compilerprovider.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
43 | { | 43 | { | ||
44 | class NoCompiler : public ICompiler | 44 | class NoCompiler : public ICompiler | ||
45 | { | 45 | { | ||
46 | public: | 46 | public: | ||
47 | NoCompiler(): | 47 | NoCompiler(): | ||
48 | ICompiler(i18n("None"), QString(), QString(), false) | 48 | ICompiler(i18n("None"), QString(), QString(), false) | ||
49 | {} | 49 | {} | ||
50 | 50 | | |||
51 | QHash< QString, QString > defines(const QString&) const override | 51 | QHash< QString, QString > defines(Utils::LanguageType, const QString&) const override | ||
52 | { | 52 | { | ||
53 | return {}; | 53 | return {}; | ||
54 | } | 54 | } | ||
55 | 55 | | |||
56 | Path::List includes(const QString&) const override | 56 | Path::List includes(Utils::LanguageType, const QString&) const override | ||
57 | { | 57 | { | ||
58 | return {}; | 58 | return {}; | ||
59 | } | 59 | } | ||
60 | }; | 60 | }; | ||
61 | 61 | | |||
62 | static CompilerPointer createDummyCompiler() | 62 | static CompilerPointer createDummyCompiler() | ||
63 | { | 63 | { | ||
64 | static CompilerPointer compiler(new NoCompiler()); | 64 | static CompilerPointer compiler(new NoCompiler()); | ||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
134 | QHash<QString, QString> CompilerProvider::defines( ProjectBaseItem* item ) const | 134 | QHash<QString, QString> CompilerProvider::defines( ProjectBaseItem* item ) const | ||
135 | { | 135 | { | ||
136 | auto config = configForItem(item); | 136 | auto config = configForItem(item); | ||
137 | auto languageType = Utils::Cpp; | 137 | auto languageType = Utils::Cpp; | ||
138 | if (item) { | 138 | if (item) { | ||
139 | languageType = Utils::languageType(item->path(), config.parserArguments.parseAmbiguousAsCPP); | 139 | languageType = Utils::languageType(item->path(), config.parserArguments.parseAmbiguousAsCPP); | ||
140 | } | 140 | } | ||
141 | 141 | | |||
142 | return config.compiler->defines(languageType == Utils::C ? config.parserArguments.cArguments : config.parserArguments.cppArguments); | 142 | return config.compiler->defines(languageType, | ||
143 | languageType == Utils::C ? config.parserArguments.cArguments : config.parserArguments.cppArguments); | ||||
143 | } | 144 | } | ||
144 | 145 | | |||
145 | Path::List CompilerProvider::includes( ProjectBaseItem* item ) const | 146 | Path::List CompilerProvider::includes( ProjectBaseItem* item ) const | ||
146 | { | 147 | { | ||
147 | auto config = configForItem(item); | 148 | auto config = configForItem(item); | ||
148 | auto languageType = Utils::Cpp; | 149 | auto languageType = Utils::Cpp; | ||
149 | if (item) { | 150 | if (item) { | ||
150 | languageType = Utils::languageType(item->path(), config.parserArguments.parseAmbiguousAsCPP); | 151 | languageType = Utils::languageType(item->path(), config.parserArguments.parseAmbiguousAsCPP); | ||
151 | } | 152 | } | ||
152 | 153 | | |||
153 | return config.compiler->includes(languageType == Utils::C ? config.parserArguments.cArguments : config.parserArguments.cppArguments); | 154 | return config.compiler->includes(languageType, | ||
155 | languageType == Utils::C ? config.parserArguments.cArguments : config.parserArguments.cppArguments); | ||||
154 | } | 156 | } | ||
155 | 157 | | |||
156 | Path::List CompilerProvider::frameworkDirectories( ProjectBaseItem* /* item */ ) const | 158 | Path::List CompilerProvider::frameworkDirectories( ProjectBaseItem* /* item */ ) const | ||
157 | { | 159 | { | ||
158 | return {}; | 160 | return {}; | ||
159 | } | 161 | } | ||
160 | 162 | | |||
161 | IDefinesAndIncludesManager::Type CompilerProvider::type() const | 163 | IDefinesAndIncludesManager::Type CompilerProvider::type() const | ||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |