Changeset View
Changeset View
Standalone View
Standalone View
src/propertyinfo.h
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 43 | public: | |||
---|---|---|---|---|---|
80 | bool shouldBeIndexed() const; | 80 | bool shouldBeIndexed() const; | ||
81 | 81 | | |||
82 | /** | 82 | /** | ||
83 | * Construct a PropertyInfo from the internal property name. | 83 | * Construct a PropertyInfo from the internal property name. | ||
84 | * The internal property name is case insensitive | 84 | * The internal property name is case insensitive | ||
85 | */ | 85 | */ | ||
86 | static PropertyInfo fromName(const QString& name); | 86 | static PropertyInfo fromName(const QString& name); | ||
87 | 87 | | |||
88 | /** | ||||
89 | * Returns the value of the property as a QString with added formatting, | ||||
90 | * added units if needed, and translated enums. | ||||
91 | * @since 5.54 | ||||
92 | */ | ||||
93 | QString formatAsDisplayString(const QVariant& value) const; | ||||
bruns: I think you should hand in a KFormat here if you want to avoid constructing a new one for each… | |||||
I decided against that and used a local KFormat. Baloo-Widgets would need bigger changes otherwise as it handles everything on a per property basis, and currently already constructs a KFormat per property. It's also not used everywhere in the display functions. Others also seem to construct it locally, so I guess it's not expensive. astippich: I decided against that and used a local KFormat. Baloo-Widgets would need bigger changes… | |||||
94 | | ||||
88 | private: | 95 | private: | ||
89 | class Private; | 96 | class Private; | ||
90 | Private* d; | 97 | Private* d; | ||
91 | }; | 98 | }; | ||
92 | 99 | | |||
93 | } | 100 | } | ||
94 | #endif // _KFILEMETADATA_PROPERTYINFO_H | 101 | #endif // _KFILEMETADATA_PROPERTYINFO_H |
I think you should hand in a KFormat here if you want to avoid constructing a new one for each value.