KFileItemListProperties

Search for usage in LXR

KFileItemListProperties Class Reference

#include <KFileItemListProperties>

Public Member Functions

 KFileItemListProperties ()
 
 KFileItemListProperties (const KFileItemList &items)
 
 KFileItemListProperties (const KFileItemListProperties &)
 
virtual ~KFileItemListProperties ()
 
bool isDirectory () const
 
bool isFile () const
 
bool isLocal () const
 
KFileItemList items () const
 
QString mimeGroup () const
 
QString mimeType () const
 
KFileItemListPropertiesoperator= (const KFileItemListProperties &other)
 
void setItems (const KFileItemList &items)
 
bool supportsDeleting () const
 
bool supportsMoving () const
 
bool supportsReading () const
 
bool supportsWriting () const
 
QList< QUrlurlList () const
 

Detailed Description

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

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.

Definition at line 38 of file kfileitemlistproperties.h.

Constructor & Destructor Documentation

◆ KFileItemListProperties() [1/3]

KFileItemListProperties::KFileItemListProperties ( )

Default constructor.

Use setItems to specify the items.

Definition at line 46 of file kfileitemlistproperties.cpp.

◆ KFileItemListProperties() [2/3]

KFileItemListProperties::KFileItemListProperties ( const KFileItemList & items)

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

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

Definition at line 51 of file kfileitemlistproperties.cpp.

◆ KFileItemListProperties() [3/3]

KFileItemListProperties::KFileItemListProperties ( const KFileItemListProperties & other)

Copy constructor.

Definition at line 115 of file kfileitemlistproperties.cpp.

◆ ~KFileItemListProperties()

KFileItemListProperties::~KFileItemListProperties ( )
virtual

Destructor.

Definition at line 126 of file kfileitemlistproperties.cpp.

Member Function Documentation

◆ isDirectory()

bool KFileItemListProperties::isDirectory ( ) const
Returns
true if all items are directories

Definition at line 165 of file kfileitemlistproperties.cpp.

◆ isFile()

bool KFileItemListProperties::isFile ( ) const
Returns
Whether all items are files, as reported by KFileItem::isFile().
Since
5.47

Definition at line 170 of file kfileitemlistproperties.cpp.

◆ isLocal()

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.

Definition at line 150 of file kfileitemlistproperties.cpp.

◆ items()

KFileItemList KFileItemListProperties::items ( ) const

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

Definition at line 155 of file kfileitemlistproperties.cpp.

◆ mimeGroup()

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

Definition at line 183 of file kfileitemlistproperties.cpp.

◆ mimeType()

QString KFileItemListProperties::mimeType ( ) const
Returns
the MIME type of all items, if they all have the same, otherwise an empty string

Definition at line 175 of file kfileitemlistproperties.cpp.

◆ operator=()

KFileItemListProperties & KFileItemListProperties::operator= ( const KFileItemListProperties & other)

Assignment operator.

Definition at line 120 of file kfileitemlistproperties.cpp.

◆ setItems()

void KFileItemListProperties::setItems ( const KFileItemList & items)

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

Definition at line 57 of file kfileitemlistproperties.cpp.

◆ supportsDeleting()

bool KFileItemListProperties::supportsDeleting ( ) const

Check if deleting capability is supported.

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

Definition at line 135 of file kfileitemlistproperties.cpp.

◆ supportsMoving()

bool KFileItemListProperties::supportsMoving ( ) const

Check if moving capability is supported.

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

Definition at line 145 of file kfileitemlistproperties.cpp.

◆ supportsReading()

bool KFileItemListProperties::supportsReading ( ) const

Check if reading capability is supported.

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

Definition at line 130 of file kfileitemlistproperties.cpp.

◆ supportsWriting()

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.

Definition at line 140 of file kfileitemlistproperties.cpp.

◆ urlList()

QList< QUrl > KFileItemListProperties::urlList ( ) const

List of urls, gathered from the fileitems.

Definition at line 160 of file kfileitemlistproperties.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:52 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.