Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/kfileitemdelegate.cpp
Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Line(s) | 224 | QString KFileItemDelegate::Private::information(const QStyleOptionViewItem &option, const QModelIndex &index, | |||
---|---|---|---|---|---|
225 | const KFileItem &item) const | 225 | const KFileItem &item) const | ||
226 | { | 226 | { | ||
227 | QString string; | 227 | QString string; | ||
228 | 228 | | |||
229 | if (informationList.isEmpty() || item.isNull() || !isListView(option)) { | 229 | if (informationList.isEmpty() || item.isNull() || !isListView(option)) { | ||
230 | return string; | 230 | return string; | ||
231 | } | 231 | } | ||
232 | 232 | | |||
233 | foreach (KFileItemDelegate::Information info, informationList) { | 233 | for (KFileItemDelegate::Information info : informationList) { | ||
dfaure: not needed, method is const and informationList is a member | |||||
"member" is what made that concept finally click in my head; (I kept thinking calling begin() on a qt container won't call the const overload, but it will if the container is a member and the this pointer is a pointer to const). ahmadsamir: "member" is what made that concept finally click in my head; (I kept thinking calling begin()… | |||||
234 | if (info == KFileItemDelegate::NoInformation) { | 234 | if (info == KFileItemDelegate::NoInformation) { | ||
235 | continue; | 235 | continue; | ||
236 | } | 236 | } | ||
237 | 237 | | |||
238 | if (!string.isEmpty()) { | 238 | if (!string.isEmpty()) { | ||
239 | string += QChar::LineSeparator; | 239 | string += QChar::LineSeparator; | ||
240 | } | 240 | } | ||
241 | 241 | | |||
▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | |||||
294 | 294 | | |||
295 | case KFileItemDelegate::Comment: | 295 | case KFileItemDelegate::Comment: | ||
296 | string += item.comment(); | 296 | string += item.comment(); | ||
297 | break; | 297 | break; | ||
298 | 298 | | |||
299 | default: | 299 | default: | ||
300 | break; | 300 | break; | ||
301 | } // switch (info) | 301 | } // switch (info) | ||
302 | } // foreach (info, list) | 302 | } // for (info, list) | ||
303 | 303 | | |||
304 | return string; | 304 | return string; | ||
305 | } | 305 | } | ||
306 | 306 | | |||
307 | // Returns the KFileItem for the index | 307 | // Returns the KFileItem for the index | ||
308 | KFileItem KFileItemDelegate::Private::fileItem(const QModelIndex &index) const | 308 | KFileItem KFileItemDelegate::Private::fileItem(const QModelIndex &index) const | ||
309 | { | 309 | { | ||
310 | const QVariant value = index.data(KDirModel::FileItemRole); | 310 | const QVariant value = index.data(KDirModel::FileItemRole); | ||
▲ Show 20 Lines • Show All 1298 Lines • Show Last 20 Lines |
not needed, method is const and informationList is a member