Changeset View
Changeset View
Standalone View
Standalone View
src/core/kfileitem.h
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 49 | public: | |||
---|---|---|---|---|---|
58 | enum FileTimes { | 58 | enum FileTimes { | ||
59 | // warning: don't change without looking at the Private class | 59 | // warning: don't change without looking at the Private class | ||
60 | ModificationTime = 0, | 60 | ModificationTime = 0, | ||
61 | AccessTime = 1, | 61 | AccessTime = 1, | ||
62 | CreationTime = 2 | 62 | CreationTime = 2 | ||
63 | //ChangeTime | 63 | //ChangeTime | ||
64 | }; | 64 | }; | ||
65 | 65 | | |||
66 | enum MimeTypeDetermination { | ||||
67 | NormalMimeTypeDetermination = 0, | ||||
68 | SkipMimeTypeFromContent | ||||
69 | }; | ||||
70 | | ||||
66 | /** | 71 | /** | ||
67 | * Null KFileItem. Doesn't represent any file, only exists for convenience. | 72 | * Null KFileItem. Doesn't represent any file, only exists for convenience. | ||
68 | */ | 73 | */ | ||
69 | KFileItem(); | 74 | KFileItem(); | ||
70 | 75 | | |||
71 | /** | 76 | /** | ||
72 | * Creates an item representing a file, from a UDSEntry. | 77 | * Creates an item representing a file, from a UDSEntry. | ||
73 | * This is the preferred constructor when using KIO::listDir(). | 78 | * This is the preferred constructor when using KIO::listDir(). | ||
Show All 36 Lines | 113 | #endif | |||
110 | /** | 115 | /** | ||
111 | * Creates an item representing a file, for which the mimetype is already known. | 116 | * Creates an item representing a file, for which the mimetype is already known. | ||
112 | * @param url the file url | 117 | * @param url the file url | ||
113 | * @param mimeType the name of the file's mimetype | 118 | * @param mimeType the name of the file's mimetype | ||
114 | * @param mode the mode (S_IFDIR...) | 119 | * @param mode the mode (S_IFDIR...) | ||
115 | */ | 120 | */ | ||
116 | KFileItem(const QUrl &url, const QString &mimeType = QString(), mode_t mode = KFileItem::Unknown); // KF6 TODO: explicit! | 121 | KFileItem(const QUrl &url, const QString &mimeType = QString(), mode_t mode = KFileItem::Unknown); // KF6 TODO: explicit! | ||
117 | 122 | | |||
118 | /** | 123 | /** | ||
dfaure: booleans parameters are bad, please make it an enum.
https://wiki.qt. | |||||
124 | * Creates an item representing a file, with the option of skipping mime type determination. | ||||
125 | * @param url the file url | ||||
126 | * @param mimeTypeDetermination the mode of determining the mime type: | ||||
127 | * NormalMimeTypeDetermination by content if local file, i.e. access the file, | ||||
128 | * open and read part of it; | ||||
129 | * by QMimeDatabase::MatchMode::MatchExtension if not local. | ||||
130 | * SkipMimeTypeFromContent always by QMimeDatabase::MatchMode::MatchExtension, | ||||
131 | * i.e. won't access the file by stat() or opening it; | ||||
132 | * only suitable for files, directories won't be recognized. | ||||
133 | * @since 5.57 | ||||
134 | */ | ||||
135 | KFileItem(const QUrl &url, KFileItem::MimeTypeDetermination mimeTypeDetermination); | ||||
136 | | ||||
137 | /** | ||||
119 | * Copy constructor | 138 | * Copy constructor | ||
120 | */ | 139 | */ | ||
121 | KFileItem(const KFileItem&); | 140 | KFileItem(const KFileItem&); | ||
122 | 141 | | |||
123 | /** | 142 | /** | ||
124 | * Destructor | 143 | * Destructor | ||
125 | */ | 144 | */ | ||
126 | ~KFileItem(); | 145 | ~KFileItem(); | ||
▲ Show 20 Lines • Show All 479 Lines • Show Last 20 Lines |
booleans parameters are bad, please make it an enum.
https://wiki.qt.io/API_Design_Principles#The_Boolean_Parameter_Trap
+ docu missing including @since tag.