Changeset View
Changeset View
Standalone View
Standalone View
src/core/global.h
Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Line(s) | |||||
89 | /** | 89 | /** | ||
90 | * Convert @p seconds to a string representing number of days, hours, minutes and seconds | 90 | * Convert @p seconds to a string representing number of days, hours, minutes and seconds | ||
91 | * | 91 | * | ||
92 | * @param seconds number of seconds to convert | 92 | * @param seconds number of seconds to convert | ||
93 | * @return string representation in a locale depending format | 93 | * @return string representation in a locale depending format | ||
94 | */ | 94 | */ | ||
95 | KIOCORE_EXPORT QString convertSeconds(unsigned int seconds); | 95 | KIOCORE_EXPORT QString convertSeconds(unsigned int seconds); | ||
96 | 96 | | |||
97 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 4) | ||||
97 | /** | 98 | /** | ||
98 | * Calculates remaining time from total size, processed size and speed. | 99 | * Calculates remaining time from total size, processed size and speed. | ||
99 | * Warning: As QTime is limited to 23:59:59, use calculateRemainingSeconds() instead | | |||
100 | * | 100 | * | ||
101 | * @param totalSize total size in bytes | 101 | * @param totalSize total size in bytes | ||
102 | * @param processedSize processed size in bytes | 102 | * @param processedSize processed size in bytes | ||
103 | * @param speed speed in bytes per second | 103 | * @param speed speed in bytes per second | ||
104 | * @return calculated remaining time | 104 | * @return calculated remaining time | ||
105 | * @deprecated Since 3.4, use calculateRemainingSeconds() instead, as QTime is limited to 23:59:59 | ||||
dfaure: LOL 3.4 was long ago ;)
good find :) | |||||
Thankfully phabricator and its locate-file, go-to-version-before-commit & tags listing for commit was helpful here to good degrees, so that usually tool < 1 min to find where the deprecation happened. https://phabricator.kde.org/source/kdelibs/repository/frameworks/ is currently still highranked by my firefox ;) kossebau: Thankfully phabricator and its locate-file, go-to-version-before-commit & tags listing for… | |||||
105 | */ | 106 | */ | ||
106 | #ifndef KIOCORE_NO_DEPRECATED | 107 | KIOCORE_DEPRECATED_VERSION(3, 4, "Use KIO::calculateRemainingSeconds(KIO::filesize_t, KIO::filesize_t, KIO::filesize_t") | ||
107 | KIOCORE_DEPRECATED_EXPORT QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed); | 108 | KIOCORE_EXPORT QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed); | ||
108 | #endif | 109 | #endif | ||
109 | 110 | | |||
110 | /** | 111 | /** | ||
111 | * Helper for showing information about a set of files and directories | 112 | * Helper for showing information about a set of files and directories | ||
112 | * @param items the number of items (= @p files + @p dirs + number of symlinks :) | 113 | * @param items the number of items (= @p files + @p dirs + number of symlinks :) | ||
113 | * @param files the number of files | 114 | * @param files the number of files | ||
114 | * @param dirs the number of dirs | 115 | * @param dirs the number of dirs | ||
115 | * @param size the sum of the size of the @p files | 116 | * @param size the sum of the size of the @p files | ||
Show All 14 Lines | |||||
130 | * Decodes (from the filename to the text displayed) | 131 | * Decodes (from the filename to the text displayed) | ||
131 | * This doesn't do anything anymore, it used to do the opposite of encodeFileName | 132 | * This doesn't do anything anymore, it used to do the opposite of encodeFileName | ||
132 | * when encodeFileName was using %2F for '/'. | 133 | * when encodeFileName was using %2F for '/'. | ||
133 | * @param str the file name to decode | 134 | * @param str the file name to decode | ||
134 | * @return the decoded file name | 135 | * @return the decoded file name | ||
135 | */ | 136 | */ | ||
136 | KIOCORE_EXPORT QString decodeFileName(const QString &str); | 137 | KIOCORE_EXPORT QString decodeFileName(const QString &str); | ||
137 | 138 | | |||
139 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 61) | ||||
138 | /** | 140 | /** | ||
139 | * Given a directory path and a filename (which usually exists already), | 141 | * Given a directory path and a filename (which usually exists already), | ||
140 | * this function returns a suggested name for a file that doesn't exist | 142 | * this function returns a suggested name for a file that doesn't exist | ||
141 | * in that directory. The existence is only checked for local urls though. | 143 | * in that directory. The existence is only checked for local urls though. | ||
142 | * The suggested file name is of the form "foo 1", "foo 2" etc. | 144 | * The suggested file name is of the form "foo 1", "foo 2" etc. | ||
143 | * @since 5.0 | 145 | * @since 5.0 | ||
144 | * @deprecated since 5.61, use KFileUtils::suggestName() from KCoreAddons | 146 | * @deprecated since 5.61, use KFileUtils::suggestName() from KCoreAddons | ||
145 | */ | 147 | */ | ||
146 | #ifndef KIOCORE_NO_DEPRECATED | 148 | KIOCORE_DEPRECATED_VERSION(5, 61, "Use KFileUtils::suggestName(const QUrl &, const QString &) from KCoreAddons") | ||
147 | KIOCORE_DEPRECATED_EXPORT QString suggestName(const QUrl &baseURL, const QString &oldName); | 149 | KIOCORE_EXPORT QString suggestName(const QUrl &baseURL, const QString &oldName); | ||
148 | #endif | 150 | #endif | ||
149 | 151 | | |||
150 | /** | 152 | /** | ||
151 | * Error codes that can be emitted by KIO. | 153 | * Error codes that can be emitted by KIO. | ||
152 | */ | 154 | */ | ||
153 | enum Error { | 155 | enum Error { | ||
154 | ERR_CANNOT_OPEN_FOR_READING = KJob::UserDefinedError + 1, | 156 | ERR_CANNOT_OPEN_FOR_READING = KJob::UserDefinedError + 1, | ||
155 | ERR_CANNOT_OPEN_FOR_WRITING = KJob::UserDefinedError + 2, | 157 | ERR_CANNOT_OPEN_FOR_WRITING = KJob::UserDefinedError + 2, | ||
Show All 11 Lines | |||||
167 | ERR_UNKNOWN_HOST = KJob::UserDefinedError + 14, | 169 | ERR_UNKNOWN_HOST = KJob::UserDefinedError + 14, | ||
168 | ERR_ACCESS_DENIED = KJob::UserDefinedError + 15, | 170 | ERR_ACCESS_DENIED = KJob::UserDefinedError + 15, | ||
169 | ERR_WRITE_ACCESS_DENIED = KJob::UserDefinedError + 16, | 171 | ERR_WRITE_ACCESS_DENIED = KJob::UserDefinedError + 16, | ||
170 | ERR_CANNOT_ENTER_DIRECTORY = KJob::UserDefinedError + 17, | 172 | ERR_CANNOT_ENTER_DIRECTORY = KJob::UserDefinedError + 17, | ||
171 | ERR_PROTOCOL_IS_NOT_A_FILESYSTEM = KJob::UserDefinedError + 18, | 173 | ERR_PROTOCOL_IS_NOT_A_FILESYSTEM = KJob::UserDefinedError + 18, | ||
172 | ERR_CYCLIC_LINK = KJob::UserDefinedError + 19, | 174 | ERR_CYCLIC_LINK = KJob::UserDefinedError + 19, | ||
173 | ERR_USER_CANCELED = KJob::KilledJobError, | 175 | ERR_USER_CANCELED = KJob::KilledJobError, | ||
174 | ERR_CYCLIC_COPY = KJob::UserDefinedError + 21, | 176 | ERR_CYCLIC_COPY = KJob::UserDefinedError + 21, | ||
175 | ERR_COULD_NOT_CREATE_SOCKET = KJob::UserDefinedError + 22, ///< @deprecated | 177 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
178 | ERR_COULD_NOT_CREATE_SOCKET = KJob::UserDefinedError + 22, ///< @deprecated Since 5.0, use ERR_CANNOT_CREATE_SOCKET | ||||
179 | #endif | ||||
176 | ERR_CANNOT_CREATE_SOCKET = KJob::UserDefinedError + 22, | 180 | ERR_CANNOT_CREATE_SOCKET = KJob::UserDefinedError + 22, | ||
177 | ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23, ///< @deprecated | 181 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
182 | ERR_COULD_NOT_CONNECT = KJob::UserDefinedError + 23, ///< @deprecated Since 5.0, use ERR_CANNOT_CONNECT | ||||
183 | #endif | ||||
178 | ERR_CANNOT_CONNECT = KJob::UserDefinedError + 23, | 184 | ERR_CANNOT_CONNECT = KJob::UserDefinedError + 23, | ||
179 | ERR_CONNECTION_BROKEN = KJob::UserDefinedError + 24, | 185 | ERR_CONNECTION_BROKEN = KJob::UserDefinedError + 24, | ||
180 | ERR_NOT_FILTER_PROTOCOL = KJob::UserDefinedError + 25, | 186 | ERR_NOT_FILTER_PROTOCOL = KJob::UserDefinedError + 25, | ||
181 | ERR_COULD_NOT_MOUNT = KJob::UserDefinedError + 26, ///< @deprecated | 187 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
188 | ERR_COULD_NOT_MOUNT = KJob::UserDefinedError + 26, ///< @deprecated Since 5.0, use ERR_CANNOT_MOUNT | ||||
189 | #endif | ||||
182 | ERR_CANNOT_MOUNT = KJob::UserDefinedError + 26, | 190 | ERR_CANNOT_MOUNT = KJob::UserDefinedError + 26, | ||
183 | ERR_COULD_NOT_UNMOUNT = KJob::UserDefinedError + 27, ///< @deprecated | 191 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
192 | ERR_COULD_NOT_UNMOUNT = KJob::UserDefinedError + 27, ///< @deprecated Since 5.0, use ERR_CANNOT_UNMOUNT | ||||
193 | #endif | ||||
184 | ERR_CANNOT_UNMOUNT = KJob::UserDefinedError + 27, | 194 | ERR_CANNOT_UNMOUNT = KJob::UserDefinedError + 27, | ||
185 | ERR_COULD_NOT_READ = KJob::UserDefinedError + 28, ///< @deprecated | 195 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
196 | ERR_COULD_NOT_READ = KJob::UserDefinedError + 28, ///< @deprecated Since 5.0, use ERR_CANNOT_READ | ||||
197 | #endif | ||||
186 | ERR_CANNOT_READ = KJob::UserDefinedError + 28, | 198 | ERR_CANNOT_READ = KJob::UserDefinedError + 28, | ||
187 | ERR_COULD_NOT_WRITE = KJob::UserDefinedError + 29, ///< @deprecated | 199 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
200 | ERR_COULD_NOT_WRITE = KJob::UserDefinedError + 29, ///< @deprecated Since 5.0, use ERR_CANNOT_WRITE | ||||
201 | #endif | ||||
188 | ERR_CANNOT_WRITE = KJob::UserDefinedError + 29, | 202 | ERR_CANNOT_WRITE = KJob::UserDefinedError + 29, | ||
189 | ERR_COULD_NOT_BIND = KJob::UserDefinedError + 30, ///< @deprecated | 203 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
204 | ERR_COULD_NOT_BIND = KJob::UserDefinedError + 30, ///< @deprecated Since 5.0, use ERR_CANNOT_BIND | ||||
205 | #endif | ||||
190 | ERR_CANNOT_BIND = KJob::UserDefinedError + 30, | 206 | ERR_CANNOT_BIND = KJob::UserDefinedError + 30, | ||
191 | ERR_COULD_NOT_LISTEN = KJob::UserDefinedError + 31, ///< @deprecated | 207 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
208 | ERR_COULD_NOT_LISTEN = KJob::UserDefinedError + 31, ///< @deprecated Since 5.0, use ERR_CANNOT_LISTEN | ||||
209 | #endif | ||||
192 | ERR_CANNOT_LISTEN = KJob::UserDefinedError + 31, | 210 | ERR_CANNOT_LISTEN = KJob::UserDefinedError + 31, | ||
193 | ERR_COULD_NOT_ACCEPT = KJob::UserDefinedError + 32, ///< @deprecated | 211 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
212 | ERR_COULD_NOT_ACCEPT = KJob::UserDefinedError + 32, ///< @deprecated Since 5.0, use ERR_CANNOT_ACCEPT | ||||
213 | #endif | ||||
194 | ERR_CANNOT_ACCEPT = KJob::UserDefinedError + 32, | 214 | ERR_CANNOT_ACCEPT = KJob::UserDefinedError + 32, | ||
195 | ERR_COULD_NOT_LOGIN = KJob::UserDefinedError + 33, ///< @deprecated | 215 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
216 | ERR_COULD_NOT_LOGIN = KJob::UserDefinedError + 33, ///< @deprecated Since 5.0, use ERR_CANNOT_LOGIN | ||||
217 | #endif | ||||
196 | ERR_CANNOT_LOGIN = KJob::UserDefinedError + 33, | 218 | ERR_CANNOT_LOGIN = KJob::UserDefinedError + 33, | ||
197 | ERR_COULD_NOT_STAT = KJob::UserDefinedError + 34, ///< @deprecated | 219 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
220 | ERR_COULD_NOT_STAT = KJob::UserDefinedError + 34, ///< @deprecated Since 5.0, use ERR_CANNOT_STAT | ||||
221 | #endif | ||||
198 | ERR_CANNOT_STAT = KJob::UserDefinedError + 34, | 222 | ERR_CANNOT_STAT = KJob::UserDefinedError + 34, | ||
199 | ERR_COULD_NOT_CLOSEDIR = KJob::UserDefinedError + 35, ///< @deprecated | 223 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
224 | ERR_COULD_NOT_CLOSEDIR = KJob::UserDefinedError + 35, ///< @deprecated Since 5.0, use ERR_CANNOT_CLOSEDIR | ||||
225 | #endif | ||||
200 | ERR_CANNOT_CLOSEDIR = KJob::UserDefinedError + 35, | 226 | ERR_CANNOT_CLOSEDIR = KJob::UserDefinedError + 35, | ||
201 | ERR_COULD_NOT_MKDIR = KJob::UserDefinedError + 37, ///< @deprecated | 227 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
228 | ERR_COULD_NOT_MKDIR = KJob::UserDefinedError + 37, ///< @deprecated Since 5.0, use ERR_CANNOT_MKDIR | ||||
229 | #endif | ||||
202 | ERR_CANNOT_MKDIR = KJob::UserDefinedError + 37, | 230 | ERR_CANNOT_MKDIR = KJob::UserDefinedError + 37, | ||
203 | ERR_COULD_NOT_RMDIR = KJob::UserDefinedError + 38, ///< @deprecated | 231 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
232 | ERR_COULD_NOT_RMDIR = KJob::UserDefinedError + 38, ///< @deprecated Since 5.0, use ERR_CANNOT_RMDIR | ||||
233 | #endif | ||||
204 | ERR_CANNOT_RMDIR = KJob::UserDefinedError + 38, | 234 | ERR_CANNOT_RMDIR = KJob::UserDefinedError + 38, | ||
205 | ERR_CANNOT_RESUME = KJob::UserDefinedError + 39, | 235 | ERR_CANNOT_RESUME = KJob::UserDefinedError + 39, | ||
206 | ERR_CANNOT_RENAME = KJob::UserDefinedError + 40, | 236 | ERR_CANNOT_RENAME = KJob::UserDefinedError + 40, | ||
207 | ERR_CANNOT_CHMOD = KJob::UserDefinedError + 41, | 237 | ERR_CANNOT_CHMOD = KJob::UserDefinedError + 41, | ||
208 | ERR_CANNOT_DELETE = KJob::UserDefinedError + 42, | 238 | ERR_CANNOT_DELETE = KJob::UserDefinedError + 42, | ||
209 | // The text argument is the protocol that the dead slave supported. | 239 | // The text argument is the protocol that the dead slave supported. | ||
210 | // This means for example: file, ftp, http, ... | 240 | // This means for example: file, ftp, http, ... | ||
211 | ERR_SLAVE_DIED = KJob::UserDefinedError + 43, | 241 | ERR_SLAVE_DIED = KJob::UserDefinedError + 43, | ||
212 | ERR_OUT_OF_MEMORY = KJob::UserDefinedError + 44, | 242 | ERR_OUT_OF_MEMORY = KJob::UserDefinedError + 44, | ||
213 | ERR_UNKNOWN_PROXY_HOST = KJob::UserDefinedError + 45, | 243 | ERR_UNKNOWN_PROXY_HOST = KJob::UserDefinedError + 45, | ||
214 | ERR_COULD_NOT_AUTHENTICATE = KJob::UserDefinedError + 46, ///< @deprecated | 244 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
245 | ERR_COULD_NOT_AUTHENTICATE = KJob::UserDefinedError + 46, ///< @deprecated Since 5.0, use ERR_CANNOT_AUTHENTICATE | ||||
246 | #endif | ||||
215 | ERR_CANNOT_AUTHENTICATE = KJob::UserDefinedError + 46, | 247 | ERR_CANNOT_AUTHENTICATE = KJob::UserDefinedError + 46, | ||
216 | ERR_ABORTED = KJob::UserDefinedError + 47, ///< Action got aborted from application side | 248 | ERR_ABORTED = KJob::UserDefinedError + 47, ///< Action got aborted from application side | ||
217 | ERR_INTERNAL_SERVER = KJob::UserDefinedError + 48, | 249 | ERR_INTERNAL_SERVER = KJob::UserDefinedError + 48, | ||
218 | ERR_SERVER_TIMEOUT = KJob::UserDefinedError + 49, | 250 | ERR_SERVER_TIMEOUT = KJob::UserDefinedError + 49, | ||
219 | ERR_SERVICE_NOT_AVAILABLE = KJob::UserDefinedError + 50, | 251 | ERR_SERVICE_NOT_AVAILABLE = KJob::UserDefinedError + 50, | ||
220 | ERR_UNKNOWN = KJob::UserDefinedError + 51, | 252 | ERR_UNKNOWN = KJob::UserDefinedError + 51, | ||
221 | // (was a warning) ERR_CHECKSUM_MISMATCH = 52, | 253 | // (was a warning) ERR_CHECKSUM_MISMATCH = 52, | ||
222 | ERR_UNKNOWN_INTERRUPT = KJob::UserDefinedError + 53, | 254 | ERR_UNKNOWN_INTERRUPT = KJob::UserDefinedError + 53, | ||
Show All 11 Lines | |||||
234 | ///< by the standard email app and all hrefs | 266 | ///< by the standard email app and all hrefs | ||
235 | ///< will be handled by the standard browser. | 267 | ///< will be handled by the standard browser. | ||
236 | ///< <a href="exec:/khelpcenter ?" will be | 268 | ///< <a href="exec:/khelpcenter ?" will be | ||
237 | ///< forked. | 269 | ///< forked. | ||
238 | ERR_UPGRADE_REQUIRED = KJob::UserDefinedError + 64, ///< A transport upgrade is required to access this | 270 | ERR_UPGRADE_REQUIRED = KJob::UserDefinedError + 64, ///< A transport upgrade is required to access this | ||
239 | ///< object. For instance, TLS is demanded by | 271 | ///< object. For instance, TLS is demanded by | ||
240 | ///< the server in order to continue. | 272 | ///< the server in order to continue. | ||
241 | ERR_POST_DENIED = KJob::UserDefinedError + 65, ///< Issued when trying to POST data to a certain Ports | 273 | ERR_POST_DENIED = KJob::UserDefinedError + 65, ///< Issued when trying to POST data to a certain Ports | ||
242 | ERR_COULD_NOT_SEEK = KJob::UserDefinedError + 66, ///< @deprecated | 274 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||
275 | ERR_COULD_NOT_SEEK = KJob::UserDefinedError + 66, ///< @deprecated Since 5.0, use ERR_CANNOT_SEEK | ||||
276 | #endif | ||||
243 | // see job.cpp | 277 | // see job.cpp | ||
244 | ERR_CANNOT_SEEK = KJob::UserDefinedError + 66, | 278 | ERR_CANNOT_SEEK = KJob::UserDefinedError + 66, | ||
245 | ERR_CANNOT_SETTIME = KJob::UserDefinedError + 67, ///< Emitted by setModificationTime | 279 | ERR_CANNOT_SETTIME = KJob::UserDefinedError + 67, ///< Emitted by setModificationTime | ||
246 | ERR_CANNOT_CHOWN = KJob::UserDefinedError + 68, | 280 | ERR_CANNOT_CHOWN = KJob::UserDefinedError + 68, | ||
247 | ERR_POST_NO_SIZE = KJob::UserDefinedError + 69, | 281 | ERR_POST_NO_SIZE = KJob::UserDefinedError + 69, | ||
248 | ERR_DROP_ON_ITSELF = KJob::UserDefinedError + 70, ///< from KIO::DropJob, @since 5.6 | 282 | ERR_DROP_ON_ITSELF = KJob::UserDefinedError + 70, ///< from KIO::DropJob, @since 5.6 | ||
249 | ERR_CANNOT_MOVE_INTO_ITSELF = KJob::UserDefinedError + 71, ///< emitted by KIO::move, @since 5.18 | 283 | ERR_CANNOT_MOVE_INTO_ITSELF = KJob::UserDefinedError + 71, ///< emitted by KIO::move, @since 5.18 | ||
250 | ERR_PASSWD_SERVER = KJob::UserDefinedError + 72, ///< returned by SlaveBase::openPasswordDialogV2, @since 5.24 | 284 | ERR_PASSWD_SERVER = KJob::UserDefinedError + 72, ///< returned by SlaveBase::openPasswordDialogV2, @since 5.24 | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |
LOL 3.4 was long ago ;)
good find :)