Changeset View
Changeset View
Standalone View
Standalone View
src/core/kfileitem.h
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 49 | public: | |||
---|---|---|---|---|---|
87 | * | 87 | * | ||
88 | * When creating KFileItems out of the UDSEntry emitted by a KIO list job, | 88 | * When creating KFileItems out of the UDSEntry emitted by a KIO list job, | ||
89 | * use KFileItem(entry, listjob->url(), delayedMimeTypes, true); | 89 | * use KFileItem(entry, listjob->url(), delayedMimeTypes, true); | ||
90 | */ | 90 | */ | ||
91 | KFileItem(const KIO::UDSEntry &entry, const QUrl &itemOrDirUrl, | 91 | KFileItem(const KIO::UDSEntry &entry, const QUrl &itemOrDirUrl, | ||
92 | bool delayedMimeTypes = false, | 92 | bool delayedMimeTypes = false, | ||
93 | bool urlIsDirectory = false); | 93 | bool urlIsDirectory = false); | ||
94 | 94 | | |||
95 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
95 | /** | 96 | /** | ||
96 | * Creates an item representing a file, from all the necessary info for it. | 97 | * Creates an item representing a file, from all the necessary info for it. | ||
97 | * @param mode the file mode (according to stat() (e.g. S_IFDIR...) | 98 | * @param mode the file mode (according to stat() (e.g. S_IFDIR...) | ||
98 | * Set to KFileItem::Unknown if unknown. For local files, KFileItem will use stat(). | 99 | * Set to KFileItem::Unknown if unknown. For local files, KFileItem will use stat(). | ||
99 | * @param permissions the access permissions | 100 | * @param permissions the access permissions | ||
100 | * If you set both the mode and the permissions, you save a ::stat() for | 101 | * If you set both the mode and the permissions, you save a ::stat() for | ||
101 | * local files. | 102 | * local files. | ||
102 | * Set to KFileItem::Unknown if you don't know the mode or the permission. | 103 | * Set to KFileItem::Unknown if you don't know the mode or the permission. | ||
103 | * @param url the file url | 104 | * @param url the file url | ||
104 | * | 105 | * | ||
105 | * @param delayedMimeTypes specify if the mimetype of the given URL | 106 | * @param delayedMimeTypes specify if the mimetype of the given URL | ||
106 | * should be determined immediately or on demand | 107 | * should be determined immediately or on demand | ||
107 | * @deprecated since 5.0. Most callers gave Unknown for mode and permissions, | 108 | * @deprecated since 5.0. Most callers gave Unknown for mode and permissions, | ||
108 | * so just port to KFileItem(url) and setDelayedMimeTypes(true) if necessary. | 109 | * so just port to KFileItem(url) and setDelayedMimeTypes(true) if necessary. | ||
109 | */ | 110 | */ | ||
110 | #ifndef KIOCORE_NO_DEPRECATED | 111 | KIOCORE_DEPRECATED_VERSION(5, 0, "See API docs") | ||
111 | KIOCORE_DEPRECATED KFileItem(mode_t mode, mode_t permissions, const QUrl &url, | 112 | KFileItem(mode_t mode, mode_t permissions, const QUrl &url, | ||
112 | bool delayedMimeTypes = false); | 113 | bool delayedMimeTypes = false); | ||
113 | #endif | 114 | #endif | ||
114 | 115 | | |||
115 | /** | 116 | /** | ||
116 | * Creates an item representing a file, for which the mimetype is already known. | 117 | * Creates an item representing a file, for which the mimetype is already known. | ||
117 | * @param url the file url | 118 | * @param url the file url | ||
118 | * @param mimeType the name of the file's mimetype | 119 | * @param mimeType the name of the file's mimetype | ||
119 | * @param mode the mode (S_IFDIR...) | 120 | * @param mode the mode (S_IFDIR...) | ||
▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Line(s) | |||||
352 | /** | 353 | /** | ||
353 | * Requests the modification, access or creation time as a string, depending | 354 | * Requests the modification, access or creation time as a string, depending | ||
354 | * on @p which. | 355 | * on @p which. | ||
355 | * @param which the timestamp | 356 | * @param which the timestamp | ||
356 | * @returns a formatted string of the requested time. | 357 | * @returns a formatted string of the requested time. | ||
357 | * @see time | 358 | * @see time | ||
358 | */ | 359 | */ | ||
359 | QString timeString(FileTimes which = ModificationTime) const; | 360 | QString timeString(FileTimes which = ModificationTime) const; | ||
360 | #ifndef KIOCORE_NO_DEPRECATED | 361 | | ||
361 | KIOCORE_DEPRECATED QString timeString(unsigned int which) const; | 362 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) | ||
363 | KIOCORE_DEPRECATED_VERSION(4, 0, "Use KFileItem::timeString(FileTimes)") | ||||
364 | QString timeString(unsigned int which) const; | ||||
362 | #endif | 365 | #endif | ||
363 | 366 | | |||
364 | /** | 367 | /** | ||
365 | * Returns true if the file is a local file. | 368 | * Returns true if the file is a local file. | ||
366 | * @return true if the file is local, false otherwise | 369 | * @return true if the file is local, false otherwise | ||
367 | */ | 370 | */ | ||
368 | bool isLocalFile() const; | 371 | bool isLocalFile() const; | ||
369 | 372 | | |||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Line(s) | |||||
452 | 455 | | |||
453 | /** | 456 | /** | ||
454 | * Returns the string to be displayed in the statusbar, | 457 | * Returns the string to be displayed in the statusbar, | ||
455 | * e.g. when the mouse is over this item | 458 | * e.g. when the mouse is over this item | ||
456 | * @return the status bar information | 459 | * @return the status bar information | ||
457 | */ | 460 | */ | ||
458 | QString getStatusBarInfo() const; | 461 | QString getStatusBarInfo() const; | ||
459 | 462 | | |||
463 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) | ||||
460 | /** | 464 | /** | ||
461 | * Returns true if files can be dropped over this item. | 465 | * Returns true if files can be dropped over this item. | ||
462 | * Contrary to popular belief, not only dirs will return true :) | 466 | * Contrary to popular belief, not only dirs will return true :) | ||
463 | * Executables, .desktop files, will do so as well. | 467 | * Executables, .desktop files, will do so as well. | ||
464 | * @return true if you can drop files over the item | 468 | * @return true if you can drop files over the item | ||
465 | * | 469 | * | ||
466 | * @deprecated This logic is application-dependent, the behavior described above | 470 | * @deprecated Since 4.0. This logic is application-dependent, the behavior described above | ||
467 | * mostly makes sense for file managers only. | 471 | * mostly makes sense for file managers only. | ||
468 | * KDirModel has setDropsAllowed for similar (but configurable) logic. | 472 | * KDirModel has setDropsAllowed for similar (but configurable) logic. | ||
469 | */ | 473 | */ | ||
470 | #ifndef KIOCORE_NO_DEPRECATED | 474 | KIOCORE_DEPRECATED_VERSION(4, 0, "See API docs") | ||
471 | KIOCORE_DEPRECATED bool acceptsDrops() const; | 475 | bool acceptsDrops() const; | ||
472 | #endif | 476 | #endif | ||
473 | 477 | | |||
474 | /** | 478 | /** | ||
475 | * Returns the UDS entry. Used by the tree view to access all details | 479 | * Returns the UDS entry. Used by the tree view to access all details | ||
476 | * by position. | 480 | * by position. | ||
477 | * @return the UDS entry | 481 | * @return the UDS entry | ||
478 | */ | 482 | */ | ||
479 | KIO::UDSEntry entry() const; | 483 | KIO::UDSEntry entry() const; | ||
Show All 38 Lines | |||||
518 | bool operator<(const QUrl &other) const; | 522 | bool operator<(const QUrl &other) const; | ||
519 | 523 | | |||
520 | /** | 524 | /** | ||
521 | * Converts this KFileItem to a QVariant, this allows to use KFileItem | 525 | * Converts this KFileItem to a QVariant, this allows to use KFileItem | ||
522 | * in QVariant() constructor | 526 | * in QVariant() constructor | ||
523 | */ | 527 | */ | ||
524 | operator QVariant() const; | 528 | operator QVariant() const; | ||
525 | 529 | | |||
530 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(4, 0) | ||||
526 | /** | 531 | /** | ||
527 | * @deprecated simply use '=' | 532 | * @deprecated Since 4.0, simply use '=' | ||
528 | */ | 533 | */ | ||
529 | #ifndef KIOCORE_NO_DEPRECATED | 534 | KIOCORE_DEPRECATED_VERSION(4, 0, "Use KFileItem::operator=(const KFileItem&)") | ||
530 | KIOCORE_DEPRECATED void assign(const KFileItem &item); | 535 | void assign(const KFileItem &item); | ||
531 | #endif | 536 | #endif | ||
532 | 537 | | |||
533 | /** | 538 | /** | ||
534 | * Tries to give a local URL for this file item if possible. | 539 | * Tries to give a local URL for this file item if possible. | ||
535 | * The given boolean indicates if the returned url is local or not. | 540 | * The given boolean indicates if the returned url is local or not. | ||
536 | * \since 4.6 | 541 | * \since 4.6 | ||
537 | */ | 542 | */ | ||
538 | QUrl mostLocalUrl(bool *local = nullptr) const; | 543 | QUrl mostLocalUrl(bool *local = nullptr) const; | ||
539 | 544 | | |||
545 | #if KIOCORE_ENABLE_DEPRECATED_SINCE(5, 0) | ||||
540 | /** | 546 | /** | ||
541 | * @deprecated since 5.0 add '&' in front of your boolean argument | 547 | * @deprecated since 5.0 add '&' in front of your boolean argument | ||
542 | */ | 548 | */ | ||
543 | #ifndef KIOCORE_NO_DEPRECATED | 549 | KIOCORE_DEPRECATED_VERSION(5, 0, "Use KFileItem::mostLocalUrl(bool *)") | ||
544 | QUrl mostLocalUrl(bool &local) const { return mostLocalUrl(&local); } | 550 | QUrl mostLocalUrl(bool &local) const { return mostLocalUrl(&local); } | ||
545 | #endif | 551 | #endif | ||
546 | 552 | | |||
547 | /** | 553 | /** | ||
548 | * Return true if default-constructed | 554 | * Return true if default-constructed | ||
549 | */ | 555 | */ | ||
550 | bool isNull() const; | 556 | bool isNull() const; | ||
551 | 557 | | |||
▲ Show 20 Lines • Show All 73 Lines • Show Last 20 Lines |