Changeset View
Changeset View
Standalone View
Standalone View
src/core/global.h
Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Line(s) | |||||
308 | */ | 308 | */ | ||
309 | enum PrivilegeOperationStatus { | 309 | enum PrivilegeOperationStatus { | ||
310 | OperationAllowed = 1, | 310 | OperationAllowed = 1, | ||
311 | OperationCanceled, | 311 | OperationCanceled, | ||
312 | OperationNotAllowed | 312 | OperationNotAllowed | ||
313 | }; | 313 | }; | ||
314 | 314 | | |||
315 | /** | 315 | /** | ||
316 | * Describes the fields that a stat command will retrieve | ||||
317 | * @see UDSEntry | ||||
318 | * @since 5.69 | ||||
319 | */ | ||||
320 | enum StatDetail { | ||||
kossebau: This injects generic terms like `Basic`, `User`, `Time`, `Acl`, etc. into the KIO namespace… | |||||
Yes it had been discussed and what you suggest was in a previous iteration : https://phabricator.kde.org/D25010?vs=69181&id=69385&whitespace=ignore-most#change-FL2qoDJhfEB5 Somehow I removed it : But I can't find why I did this, I guess it was a merging/synchronizing issue and lost those changes. Unless @dfaure you find a reason why I shouldn't do it, I will add those prefix back, since KF 5.69 is not yet out of the door, it is possible. meven: Yes it had been discussed and what you suggest was in a previous iteration : https… | |||||
321 | /// No field returned, useful to check if a file exists | ||||
322 | NoDetails = 0x0, | ||||
Naming should be explicit enough now. meven: Naming should be explicit enough now.
I still wonder about granularity if I should expose some… | |||||
323 | /// Filename, access, type, size, linkdest | ||||
324 | Basic = 0x1, | ||||
325 | /// uid, gid | ||||
326 | User = 0x2, | ||||
327 | /// atime, mtime, btime | ||||
328 | Time = 0x4, | ||||
329 | /// Resolve symlinks | ||||
330 | ResolveSymlink = 0x8, | ||||
331 | /// acl Data | ||||
332 | Acl = 0x10, | ||||
333 | /// dev, inode | ||||
334 | Inode = 0x20, | ||||
335 | | ||||
336 | /// Default value includes fields provided by other entries | ||||
337 | StatDefaultDetails = Basic | User | Time | Acl | ResolveSymlink, | ||||
338 | }; | ||||
339 | Q_DECLARE_FLAGS(StatDetails, StatDetail) | ||||
340 | | ||||
341 | Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::StatDetails) | ||||
342 | | ||||
343 | /** | ||||
316 | * Parses the string representation of the cache control option. | 344 | * Parses the string representation of the cache control option. | ||
317 | * | 345 | * | ||
318 | * @param cacheControl the string representation | 346 | * @param cacheControl the string representation | ||
319 | * @return the cache control value | 347 | * @return the cache control value | ||
320 | * @see getCacheControlString() | 348 | * @see getCacheControlString() | ||
321 | */ | 349 | */ | ||
322 | KIOCORE_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl); | 350 | KIOCORE_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl); | ||
323 | 351 | | |||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |
This injects generic terms like Basic, User, Time, Acl, etc. into the KIO namespace, with no futher hint that these belong to this very enum, resulting in potential wrong usages (due to completion-based coding when being convertable to int) or in potential conflicts with other future additions.
Sadly no time to follow the review. Had this been discussed before? Ideally those flags would get more explicit names, like BasicDetail (hm, what is basic actually), UserDetail, etc.
Could not find naming recommendations for current Qt, but here some old one, scroll to the section "Naming Enum Types and Values": https://doc.qt.io/archives/qq/qq13-apis.html#theartofnaming