Pages
API Documentation
On this page

KFileItemListProperties Class

Provides information about the common properties of a group of KFileItem objects. More...

  • Header: #include <KFileItemListProperties>
  • CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
    target_link_libraries(mytarget PRIVATE KF6::KIOCore)

List of all members, including inherited members

Public Functions

Detailed Description

Given a list of KFileItems, this class can determine (and cache) the common MIME type for all items, whether all items are directories, whether all items are readable, writable, etc. As soon as one file item does not support a specific capability (read, write etc.), it is marked as unsupported for all items.

This class is implicitly shared, which means it can be used as a value and copied around at almost no cost.

Member Function Documentation

KFileItemListProperties::KFileItemListProperties()

Default constructor. Use setItems to specify the items.

KFileItemListProperties::KFileItemListProperties(const KFileItemList &items)

Constructor that takes a KFileItemList and sets the capabilities supported by all the FileItems as true.

items The list of items that are to have their supported capabilities checked.

KFileItemListProperties::KFileItemListProperties(const KFileItemListProperties &)

Copy constructor

bool KFileItemListProperties::isDirectory() const

Returns true if all items are directories

bool KFileItemListProperties::isFile() const

Returns whether all items are files, as reported by KFileItem::isFile().

bool KFileItemListProperties::isLocal() const

Check if files are local

Returns true if all the FileItems are local, otherwise there is one or more remote file, so false.

KFileItemList KFileItemListProperties::items() const

List of fileitems passed to the constructor or to setItems().

See also setItems()

QString KFileItemListProperties::mimeGroup() const

Returns the MIME type group (e.g. "text") of all items, if they all have the same, otherwise an empty string

QString KFileItemListProperties::mimeType() const

Returns the MIME type of all items, if they all have the same, otherwise an empty string

void KFileItemListProperties::setItems(const KFileItemList &items)

Sets the items that are to have their supported capabilities checked.

See also items()

bool KFileItemListProperties::supportsDeleting() const

Check if deleting capability is supported

Returns true if all the FileItems can be deleted, otherwise false.

bool KFileItemListProperties::supportsMoving() const

Check if moving capability is supported

Returns true if all the FileItems can be moved, otherwise false.

bool KFileItemListProperties::supportsReading() const

Check if reading capability is supported

Returns true if all the FileItems can be read, otherwise false.

bool KFileItemListProperties::supportsWriting() const

Check if writing capability is supported (file managers use this mostly for directories)

Returns true if all the FileItems can be written to, otherwise false.

QList<QUrl> KFileItemListProperties::urlList() const

List of urls, gathered from the fileitems

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.