KIO

global.h
1 /*
2  This file is part of the KDE libraries
3  SPDX-FileCopyrightText: 2000-2005 David Faure <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.0-only
6 */
7 #ifndef KIO_GLOBAL_H
8 #define KIO_GLOBAL_H
9 
10 #include "kiocore_export.h"
11 
12 #include <QFile> // for QFile::Permissions
13 #include <QString>
14 
15 #include <KJob>
16 
17 #include "jobtracker.h" // for source compat
18 #include "metadata.h" // for source compat
19 
20 class QUrl;
21 
22 class QTime;
23 
24 #if defined(Q_OS_WIN) && defined(Q_CC_MSVC)
25 // on windows ssize_t is not defined, only SSIZE_T exists
26 #include <basetsd.h>
27 typedef SSIZE_T ssize_t;
28 #endif
29 
30 /**
31  * @short A namespace for KIO globals
32  *
33  */
34 namespace KIO
35 {
36 /// 64-bit file offset
37 typedef qlonglong fileoffset_t;
38 /// 64-bit file size
39 typedef qulonglong filesize_t;
40 
41 /**
42  * Converts @p size from bytes to the string representation.
43  *
44  * @param size size in bytes
45  * @return converted size as a string - e.g. 123.4 KiB , 12.0 MiB
46  */
47 KIOCORE_EXPORT QString convertSize(KIO::filesize_t size);
48 
49 /**
50  * Converts a size to a string representation
51  * Not unlike QString::number(...)
52  *
53  * @param size size in bytes
54  * @return converted size as a string - e.g. 123456789
55  */
56 KIOCORE_EXPORT QString number(KIO::filesize_t size);
57 
58 /**
59  * Converts size from kibi-bytes (2^10) to the string representation.
60  *
61  * @param kibSize size in kibi-bytes (2^10)
62  * @return converted size as a string - e.g. 123.4 KiB , 12.0 MiB
63  */
64 KIOCORE_EXPORT QString convertSizeFromKiB(KIO::filesize_t kibSize);
65 
66 /**
67  * Calculates remaining time in seconds from total size, processed size and speed.
68  *
69  * @param totalSize total size in bytes
70  * @param processedSize processed size in bytes
71  * @param speed speed in bytes per second
72  * @return calculated remaining time in seconds
73  */
74 KIOCORE_EXPORT unsigned int calculateRemainingSeconds(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed);
75 
76 /**
77  * Convert @p seconds to a string representing number of days, hours, minutes and seconds
78  *
79  * @param seconds number of seconds to convert
80  * @return string representation in a locale depending format
81  */
82 KIOCORE_EXPORT QString convertSeconds(unsigned int seconds);
83 
84 #if KIOCORE_ENABLE_DEPRECATED_SINCE(3, 4)
85 /**
86  * Calculates remaining time from total size, processed size and speed.
87  *
88  * @param totalSize total size in bytes
89  * @param processedSize processed size in bytes
90  * @param speed speed in bytes per second
91  * @return calculated remaining time
92  * @deprecated Since 3.4, use calculateRemainingSeconds() instead, as QTime is limited to 23:59:59
93  */
94 KIOCORE_EXPORT
95 KIOCORE_DEPRECATED_VERSION(3, 4, "Use KIO::calculateRemainingSeconds(KIO::filesize_t, KIO::filesize_t, KIO::filesize_t")
96 QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed);
97 #endif
98 
99 /**
100  * Helper for showing information about a set of files and directories
101  * @param items the number of items (= @p files + @p dirs + number of symlinks :)
102  * @param files the number of files
103  * @param dirs the number of dirs
104  * @param size the sum of the size of the @p files
105  * @param showSize whether to show the size in the result
106  * @return the summary string
107  */
108 KIOCORE_EXPORT QString itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize);
109 
110 /**
111  * Encodes (from the text displayed to the real filename)
112  * This translates '/' into a "unicode fraction slash", QChar(0x2044).
113  * Used by KIO::link, for instance.
114  * @param str the file name to encode
115  * @return the encoded file name
116  */
117 KIOCORE_EXPORT QString encodeFileName(const QString &str);
118 /**
119  * Decodes (from the filename to the text displayed)
120  * This doesn't do anything anymore, it used to do the opposite of encodeFileName
121  * when encodeFileName was using %2F for '/'.
122  * @param str the file name to decode
123  * @return the decoded file name
124  */
125 KIOCORE_EXPORT QString decodeFileName(const QString &str);
126 
127 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 61)
128 /**
129  * Given a directory path and a filename (which usually exists already),
130  * this function returns a suggested name for a file that doesn't exist
131  * in that directory. The existence is only checked for local urls though.
132  * The suggested file name is of the form "foo 1", "foo 2" etc.
133  * @since 5.0
134  * @deprecated since 5.61, use KFileUtils::suggestName() from KCoreAddons
135  */
136 KIOCORE_EXPORT
137 KIOCORE_DEPRECATED_VERSION(5, 61, "Use KFileUtils::suggestName(const QUrl &, const QString &) from KCoreAddons")
138 QString suggestName(const QUrl &baseURL, const QString &oldName);
139 #endif
140 
141 /**
142  * Error codes that can be emitted by KIO.
143  */
144 enum Error {
145  ERR_CANNOT_OPEN_FOR_READING = KJob::UserDefinedError + 1,
146  ERR_CANNOT_OPEN_FOR_WRITING = KJob::UserDefinedError + 2,
147  ERR_CANNOT_LAUNCH_PROCESS = KJob::UserDefinedError + 3,
148  ERR_INTERNAL = KJob::UserDefinedError + 4,
149  ERR_MALFORMED_URL = KJob::UserDefinedError + 5,
150  ERR_UNSUPPORTED_PROTOCOL = KJob::UserDefinedError + 6,
151  ERR_NO_SOURCE_PROTOCOL = KJob::UserDefinedError + 7,
152  ERR_UNSUPPORTED_ACTION = KJob::UserDefinedError + 8,
153  ERR_IS_DIRECTORY = KJob::UserDefinedError + 9, ///< ... where a file was expected
154  ERR_IS_FILE = KJob::UserDefinedError + 10, ///< ... where a directory was expected (e.g. listing)
155  ERR_DOES_NOT_EXIST = KJob::UserDefinedError + 11,
156  ERR_FILE_ALREADY_EXIST = KJob::UserDefinedError + 12,
157  ERR_DIR_ALREADY_EXIST = KJob::UserDefinedError + 13,
158  ERR_UNKNOWN_HOST = KJob::UserDefinedError + 14,
159  ERR_ACCESS_DENIED = KJob::UserDefinedError + 15,
160  ERR_WRITE_ACCESS_DENIED = KJob::UserDefinedError + 16,
161  ERR_CANNOT_ENTER_DIRECTORY = KJob::UserDefinedError + 17,
162  ERR_PROTOCOL_IS_NOT_A_FILESYSTEM = KJob::UserDefinedError + 18,
163  ERR_CYCLIC_LINK = KJob::UserDefinedError + 19,
164  ERR_USER_CANCELED = KJob::KilledJobError,
165  ERR_CYCLIC_COPY = KJob::UserDefinedError + 21,
166 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
167  ERR_COULD_NOT_CREATE_SOCKET KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_CREATE_SOCKET.") =
168  KJob::UserDefinedError + 22, ///< @deprecated Since 5.0, use ERR_CANNOT_CREATE_SOCKET
169 #endif
170  ERR_CANNOT_CREATE_SOCKET = KJob::UserDefinedError + 22,
171 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
172  ERR_COULD_NOT_CONNECT KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_CONNECT.") =
173  KJob::UserDefinedError + 23, ///< @deprecated Since 5.0, use ERR_CANNOT_CONNECT
174 #endif
175  ERR_CANNOT_CONNECT = KJob::UserDefinedError + 23,
176  ERR_CONNECTION_BROKEN = KJob::UserDefinedError + 24,
177  ERR_NOT_FILTER_PROTOCOL = KJob::UserDefinedError + 25,
178 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
179  ERR_COULD_NOT_MOUNT KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_MOUNT.") =
180  KJob::UserDefinedError + 26, ///< @deprecated Since 5.0, use ERR_CANNOT_MOUNT
181 #endif
182  ERR_CANNOT_MOUNT = KJob::UserDefinedError + 26,
183 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
184  ERR_COULD_NOT_UNMOUNT KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_UNMOUNT.") =
185  KJob::UserDefinedError + 27, ///< @deprecated Since 5.0, use ERR_CANNOT_UNMOUNT
186 #endif
187  ERR_CANNOT_UNMOUNT = KJob::UserDefinedError + 27,
188 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
189  ERR_COULD_NOT_READ KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_READ.") =
190  KJob::UserDefinedError + 28, ///< @deprecated Since 5.0, use ERR_CANNOT_READ
191 #endif
192  ERR_CANNOT_READ = KJob::UserDefinedError + 28,
193 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
194  ERR_COULD_NOT_WRITE KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_WRITE.") =
195  KJob::UserDefinedError + 29, ///< @deprecated Since 5.0, use ERR_CANNOT_WRITE
196 #endif
197  ERR_CANNOT_WRITE = KJob::UserDefinedError + 29,
198 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
199  ERR_COULD_NOT_BIND KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_BIND.") =
200  KJob::UserDefinedError + 30, ///< @deprecated Since 5.0, use ERR_CANNOT_BIND
201 #endif
202  ERR_CANNOT_BIND = KJob::UserDefinedError + 30,
203 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
204  ERR_COULD_NOT_LISTEN KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_LISTEN.") =
205  KJob::UserDefinedError + 31, ///< @deprecated Since 5.0, use ERR_CANNOT_LISTEN
206 #endif
207  ERR_CANNOT_LISTEN = KJob::UserDefinedError + 31,
208 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
209  ERR_COULD_NOT_ACCEPT KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_ACCEPT.") =
210  KJob::UserDefinedError + 32, ///< @deprecated Since 5.0, use ERR_CANNOT_ACCEPT
211 #endif
212  ERR_CANNOT_ACCEPT = KJob::UserDefinedError + 32,
213 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
214  ERR_COULD_NOT_LOGIN KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_LOGIN.") =
215  KJob::UserDefinedError + 33, ///< @deprecated Since 5.0, use ERR_CANNOT_LOGIN
216 #endif
217  ERR_CANNOT_LOGIN = KJob::UserDefinedError + 33,
218 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
219  ERR_COULD_NOT_STAT KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_STAT.") =
220  KJob::UserDefinedError + 34, ///< @deprecated Since 5.0, use ERR_CANNOT_STAT
221 #endif
222  ERR_CANNOT_STAT = KJob::UserDefinedError + 34,
223 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
224  ERR_COULD_NOT_CLOSEDIR KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_CLOSEDIR.") =
225  KJob::UserDefinedError + 35, ///< @deprecated Since 5.0, use ERR_CANNOT_CLOSEDIR
226 #endif
227  ERR_CANNOT_CLOSEDIR = KJob::UserDefinedError + 35,
228 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
229  ERR_COULD_NOT_MKDIR KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_AUTHENTICATE.") =
230  KJob::UserDefinedError + 37, ///< @deprecated Since 5.0, use ERR_CANNOT_MKDIR
231 #endif
232  ERR_CANNOT_MKDIR = KJob::UserDefinedError + 37,
233 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
234  ERR_COULD_NOT_RMDIR KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_RMDIR.") =
235  KJob::UserDefinedError + 38, ///< @deprecated Since 5.0, use ERR_CANNOT_RMDIR
236 #endif
237  ERR_CANNOT_RMDIR = KJob::UserDefinedError + 38,
238  ERR_CANNOT_RESUME = KJob::UserDefinedError + 39,
239  ERR_CANNOT_RENAME = KJob::UserDefinedError + 40,
240  ERR_CANNOT_CHMOD = KJob::UserDefinedError + 41,
241  ERR_CANNOT_DELETE = KJob::UserDefinedError + 42,
242  // The text argument is the protocol that the dead slave supported.
243  // This means for example: file, ftp, http, ...
244  ERR_SLAVE_DIED = KJob::UserDefinedError + 43,
245  ERR_OUT_OF_MEMORY = KJob::UserDefinedError + 44,
246  ERR_UNKNOWN_PROXY_HOST = KJob::UserDefinedError + 45,
247 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
248  ERR_COULD_NOT_AUTHENTICATE KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_AUTHENTICATE.") =
249  KJob::UserDefinedError + 46, ///< @deprecated Since 5.0, use ERR_CANNOT_AUTHENTICATE
250 #endif
251  ERR_CANNOT_AUTHENTICATE = KJob::UserDefinedError + 46,
252  ERR_ABORTED = KJob::UserDefinedError + 47, ///< Action got aborted from application side
253  ERR_INTERNAL_SERVER = KJob::UserDefinedError + 48,
254  ERR_SERVER_TIMEOUT = KJob::UserDefinedError + 49,
255  ERR_SERVICE_NOT_AVAILABLE = KJob::UserDefinedError + 50,
256  ERR_UNKNOWN = KJob::UserDefinedError + 51,
257  // (was a warning) ERR_CHECKSUM_MISMATCH = 52,
258  ERR_UNKNOWN_INTERRUPT = KJob::UserDefinedError + 53,
259  ERR_CANNOT_DELETE_ORIGINAL = KJob::UserDefinedError + 54,
260  ERR_CANNOT_DELETE_PARTIAL = KJob::UserDefinedError + 55,
261  ERR_CANNOT_RENAME_ORIGINAL = KJob::UserDefinedError + 56,
262  ERR_CANNOT_RENAME_PARTIAL = KJob::UserDefinedError + 57,
263  ERR_NEED_PASSWD = KJob::UserDefinedError + 58,
264  ERR_CANNOT_SYMLINK = KJob::UserDefinedError + 59,
265  ERR_NO_CONTENT = KJob::UserDefinedError + 60, ///< Action succeeded but no content will follow.
266  ERR_DISK_FULL = KJob::UserDefinedError + 61,
267  ERR_IDENTICAL_FILES = KJob::UserDefinedError + 62, ///< src==dest when moving/copying
268  ERR_SLAVE_DEFINED = KJob::UserDefinedError + 63, ///< for slave specified errors that can be
269  ///< rich text. Email links will be handled
270  ///< by the standard email app and all hrefs
271  ///< will be handled by the standard browser.
272  ///< <a href="exec:/khelpcenter ?" will be
273  ///< forked.
274  ERR_UPGRADE_REQUIRED = KJob::UserDefinedError + 64, ///< A transport upgrade is required to access this
275  ///< object. For instance, TLS is demanded by
276  ///< the server in order to continue.
277  ERR_POST_DENIED = KJob::UserDefinedError + 65, ///< Issued when trying to POST data to a certain Ports
278 #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0)
279  ERR_COULD_NOT_SEEK KIOCORE_ENUMERATOR_DEPRECATED_VERSION_BELATED(5, 82, 5, 0, "Use ERR_CANNOT_SEEK.") =
280  KJob::UserDefinedError + 66, ///< @deprecated Since 5.0, use ERR_CANNOT_SEEK
281 #endif
282  // see job.cpp
283  ERR_CANNOT_SEEK = KJob::UserDefinedError + 66,
284  ERR_CANNOT_SETTIME = KJob::UserDefinedError + 67, ///< Emitted by setModificationTime
285  ERR_CANNOT_CHOWN = KJob::UserDefinedError + 68,
286  ERR_POST_NO_SIZE = KJob::UserDefinedError + 69,
287  ERR_DROP_ON_ITSELF = KJob::UserDefinedError + 70, ///< from KIO::DropJob, @since 5.6
288  ERR_CANNOT_MOVE_INTO_ITSELF = KJob::UserDefinedError + 71, ///< emitted by KIO::move, @since 5.18
289  ERR_PASSWD_SERVER = KJob::UserDefinedError + 72, ///< returned by SlaveBase::openPasswordDialogV2, @since 5.24
290  ERR_CANNOT_CREATE_SLAVE = KJob::UserDefinedError + 73, ///< used by Slave::createSlave, @since 5.30
291  ERR_FILE_TOO_LARGE_FOR_FAT32 = KJob::UserDefinedError + 74, ///< @since 5.54
292  ERR_OWNER_DIED = KJob::UserDefinedError
293  + 75, ///< Value used between kuiserver and views when the job owner disappears unexpectedly. It should not be emitted by slaves. @since 5.54
294  ERR_PRIVILEGE_NOT_REQUIRED = KJob::UserDefinedError + 76, ///< used by file ioslave, @since 5.60
295  ERR_CANNOT_TRUNCATE = KJob::UserDefinedError + 77, // used by FileJob::truncate, @since 5.66
296 };
297 
298 /**
299  * Specifies how to use the cache.
300  * @see parseCacheControl()
301  * @see getCacheControlString()
302  */
304  CC_CacheOnly, ///< Fail request if not in cache
305  CC_Cache, ///< Use cached entry if available
306  CC_Verify, ///< Validate cached entry with remote site if expired
307  CC_Refresh, ///< Always validate cached entry with remote site
308  CC_Reload, ///< Always fetch from remote site.
309 };
310 
311 /**
312  * Specifies privilege file operation status.
313  * @since 5.43
314  */
316  OperationAllowed = 1,
317  OperationCanceled,
318  OperationNotAllowed,
319 };
320 
321 /**
322  * Describes the fields that a stat command will retrieve
323  * @see UDSEntry
324  * @see StatDetails
325  * @since 5.69
326  */
328  /// No field returned, useful to check if a file exists
330  /// Filename, access, type, size, linkdest
331  StatBasic = 0x1,
332  /// uid, gid
333  StatUser = 0x2,
334  /// atime, mtime, btime
335  StatTime = 0x4,
336  /// Resolve symlinks
338  /// acl Data
339  StatAcl = 0x10,
340  /// dev, inode
341  StatInode = 0x20,
342  /// recursive size @since 5.70
344  /// mime type @since 5.82
345  StatMimeType = 0x80,
346 
347  /// Default value includes fields provided by other entries
349 };
350 /**
351  * Stores a combination of #StatDetail values.
352  */
353 Q_DECLARE_FLAGS(StatDetails, StatDetail)
354 
355 Q_DECLARE_OPERATORS_FOR_FLAGS(KIO::StatDetails)
356 
357 /**
358  * Parses the string representation of the cache control option.
359  *
360  * @param cacheControl the string representation
361  * @return the cache control value
362  * @see getCacheControlString()
363  */
364 KIOCORE_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl);
365 
366 /**
367  * Returns a string representation of the given cache control method.
368  *
369  * @param cacheControl the cache control method
370  * @return the string representation
371  * @see parseCacheControl()
372  */
373 KIOCORE_EXPORT QString getCacheControlString(KIO::CacheControl cacheControl);
374 
375 /**
376  * Return the "favicon" (see http://www.favicon.com) for the given @p url,
377  * if available. Does NOT attempt to download the favicon, it only returns
378  * one that is already available.
379  *
380  * If unavailable, returns QString().
381  * Use KIO::FavIconRequestJob instead of this method if you can wait
382  * for the favicon to be downloaded.
383  *
384  * @param url the URL of the favicon
385  * @return the path to the icon (to be passed to QIcon()), or QString()
386  *
387  * @since 5.0
388  */
389 KIOCORE_EXPORT QString favIconForUrl(const QUrl &url);
390 
391 /**
392  * Converts KIO file permissions from mode_t to QFile::Permissions format.
393  *
394  * This is a convenience function for converting KIO permissions parameter from
395  * mode_t to QFile::Permissions.
396  *
397  * @param permissions KIO file permissions.
398  *
399  * @return -1 if @p permissions is -1, otherwise its OR'ed QFile::Permission equivalent.
400  * @since 4.12
401  */
402 KIOCORE_EXPORT QFile::Permissions convertPermissions(int permissions);
403 
404 /**
405  * Return the icon name for a URL.
406  * Most of the time this returns the MIME type icon,
407  * but also has fallback to favicon and protocol-specific icon.
408  *
409  * Pass this to QIcon::fromTheme().
410  *
411  * @since 5.0
412  */
413 KIOCORE_EXPORT QString iconNameForUrl(const QUrl &url);
414 
415 /**
416  * This function is useful to implement the "Up" button in a file manager for example.
417  *
418  * @return a URL that is a level higher
419  *
420  * @since 5.0
421  */
422 KIOCORE_EXPORT QUrl upUrl(const QUrl &url);
423 
424 }
425 #endif
Value used between kuiserver and views when the job owner disappears unexpectedly. It should not be emitted by slaves.
Definition: global.h:292
Fail request if not in cache.
Definition: global.h:304
KIOCORE_EXPORT QString getCacheControlString(KIO::CacheControl cacheControl)
Returns a string representation of the given cache control method.
Definition: global.cpp:182
qulonglong filesize_t
64-bit file size
Definition: global.h:39
KIOCORE_EXPORT QString encodeFileName(const QString &str)
Encodes (from the text displayed to the real filename) This translates &#39;/&#39; into a "unicode fraction s...
Definition: global.cpp:139
for slave specified errors that can be
Definition: global.h:268
A transport upgrade is required to access this.
Definition: global.h:274
KIOCORE_EXPORT QTime calculateRemaining(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed)
Calculates remaining time from total size, processed size and speed.
Definition: global.cpp:88
acl Data
Definition: global.h:339
A namespace for KIO globals.
Error
Error codes that can be emitted by KIO.
Definition: global.h:144
No field returned, useful to check if a file exists.
Definition: global.h:329
KIOCORE_EXPORT QUrl upUrl(const QUrl &url)
This function is useful to implement the "Up" button in a file manager for example.
Definition: global.cpp:261
used by file ioslave,
Definition: global.h:294
Always fetch from remote site.
Definition: global.h:308
KIOCORE_EXPORT QString convertSize(KIO::filesize_t size)
Converts size from bytes to the string representation.
Definition: global.cpp:43
KIOCORE_EXPORT QString convertSeconds(unsigned int seconds)
Convert seconds to a string representing number of days, hours, minutes and seconds.
Definition: global.cpp:71
KIOCORE_EXPORT QString number(KIO::filesize_t size)
Converts a size to a string representation Not unlike QString::number(...)
Definition: global.cpp:55
KIOCORE_EXPORT unsigned int calculateRemainingSeconds(KIO::filesize_t totalSize, KIO::filesize_t processedSize, KIO::filesize_t speed)
Calculates remaining time in seconds from total size, processed size and speed.
Definition: global.cpp:62
KIOCORE_EXPORT QString convertSizeFromKiB(KIO::filesize_t kibSize)
Converts size from kibi-bytes (2^10) to the string representation.
Definition: global.cpp:50
Filename, access, type, size, linkdest.
Definition: global.h:331
used by Slave::createSlave,
Definition: global.h:290
... where a file was expected
Definition: global.h:153
uid, gid
Definition: global.h:333
dev, inode
Definition: global.h:341
CacheControl
Specifies how to use the cache.
Definition: global.h:303
returned by SlaveBase::openPasswordDialogV2,
Definition: global.h:289
KIOCORE_EXPORT QString favIconForUrl(const QUrl &url)
Return the "favicon" (see http://www.favicon.com) for the given url, if available.
Definition: global.cpp:203
KIOCORE_EXPORT QString decodeFileName(const QString &str)
Decodes (from the filename to the text displayed) This doesn&#39;t do anything anymore, it used to do the opposite of encodeFileName when encodeFileName was using %2F for &#39;/&#39;.
Definition: global.cpp:146
Resolve symlinks.
Definition: global.h:337
src==dest when moving/copying
Definition: global.h:267
KIOCORE_EXPORT KIO::CacheControl parseCacheControl(const QString &cacheControl)
Parses the string representation of the cache control option.
Definition: global.cpp:158
qlonglong fileoffset_t
64-bit file offset
Definition: global.h:37
emitted by KIO::move,
Definition: global.h:288
... where a directory was expected (e.g. listing)
Definition: global.h:154
recursive size
Definition: global.h:343
Use cached entry if available.
Definition: global.h:305
Always validate cached entry with remote site.
Definition: global.h:307
Validate cached entry with remote site if expired.
Definition: global.h:306
mime type
Definition: global.h:345
PrivilegeOperationStatus
Specifies privilege file operation status.
Definition: global.h:315
StatDetail
Describes the fields that a stat command will retrieve.
Definition: global.h:327
Action succeeded but no content will follow.
Definition: global.h:265
KIOCORE_EXPORT QString itemsSummaryString(uint items, uint files, uint dirs, KIO::filesize_t size, bool showSize)
Helper for showing information about a set of files and directories.
Definition: global.cpp:113
from KIO::DropJob,
Definition: global.h:287
Action got aborted from application side.
Definition: global.h:252
Issued when trying to POST data to a certain Ports.
Definition: global.h:277
Default value includes fields provided by other entries.
Definition: global.h:348
Emitted by setModificationTime.
Definition: global.h:284
atime, mtime, btime
Definition: global.h:335
KIOCORE_EXPORT QFile::Permissions convertPermissions(int permissions)
Converts KIO file permissions from mode_t to QFile::Permissions format.
Definition: job_error.cpp:1256
KIOCORE_EXPORT QString iconNameForUrl(const QUrl &url)
Return the icon name for a URL.
Definition: global.cpp:212
KIOCORE_EXPORT QString suggestName(const QUrl &baseURL, const QString &oldName)
Given a directory path and a filename (which usually exists already), this function returns a suggest...
Definition: global.cpp:280
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Wed May 12 2021 23:00:24 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.