Changeset View
Changeset View
Standalone View
Standalone View
src/lib/repository.h
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 132 | public: | |||
---|---|---|---|---|---|
159 | * the definition files. If multiple matches are found, the one with the | 159 | * the definition files. If multiple matches are found, the one with the | ||
160 | * highest priority is returned. | 160 | * highest priority is returned. | ||
161 | * | 161 | * | ||
162 | * If no match is found, Definition::isValid() of the returned instance | 162 | * If no match is found, Definition::isValid() of the returned instance | ||
163 | * returns false. | 163 | * returns false. | ||
164 | */ | 164 | */ | ||
165 | Definition definitionForFileName(const QString &fileName) const; | 165 | Definition definitionForFileName(const QString &fileName) const; | ||
166 | 166 | | |||
167 | /** | ||||
168 | * Returns all Definition%s for the file named @p fileName. | ||||
169 | * The match is performed based on the \e extensions and @e mimetype of | ||||
170 | * the definition files. | ||||
171 | * | ||||
172 | * @since 5.56 | ||||
173 | */ | ||||
174 | QVector<Definition> definitionsForFileName(const QString &fileName) const; | ||||
175 | | ||||
167 | /** | 176 | /** | ||
dhaumann: As I understand, this currently is unsorted. Wouldn't it make sense to sort the returned vector… | |||||
168 | * Returns the best matching Definition to the type named @p mimeType | 177 | * Returns the best matching Definition to the type named @p mimeType | ||
169 | * | 178 | * | ||
170 | * If no match is found, Definition::isValid() of the returned instance | 179 | * If no match is found, Definition::isValid() of the returned instance | ||
171 | * returns false. | 180 | * returns false. | ||
172 | * | 181 | * | ||
173 | * @since 5.50 | 182 | * @since 5.50 | ||
174 | */ | 183 | */ | ||
175 | Definition definitionForMimeType(const QString &mimeType) const; | 184 | Definition definitionForMimeType(const QString &mimeType) const; | ||
176 | 185 | | |||
186 | /** | ||||
187 | * Returns all Definition%s to the type named @p mimeType | ||||
188 | * | ||||
189 | * @since 5.56 | ||||
190 | */ | ||||
191 | QVector<Definition> definitionsForMimeType(const QString &mimeType) const; | ||||
192 | | ||||
177 | /** | 193 | /** | ||
178 | * Returns all available Definition%s. | 194 | * Returns all available Definition%s. | ||
179 | * Definition%ss are ordered by translated section and translated names, | 195 | * Definition%ss are ordered by translated section and translated names, | ||
180 | * for consistent displaying. | 196 | * for consistent displaying. | ||
181 | */ | 197 | */ | ||
182 | QVector<Definition> definitions() const; | 198 | QVector<Definition> definitions() const; | ||
183 | 199 | | |||
184 | /** | 200 | /** | ||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |
As I understand, this currently is unsorted. Wouldn't it make sense to sort the returned vector by priority?
This information is also missing currently in the API documentation: I had to read the code to understand whether the Definitions in the QVector are sorted or not. Same for definitionsForMimeType().
Any comments?