KFilePlacesModel

Search for usage in LXR

#include <KFilePlacesModel>

Inheritance diagram for KFilePlacesModel:

Public Types

enum  AdditionalRoles {
  UrlRole = 0x069CD12B , HiddenRole = 0x0741CAAC , SetupNeededRole = 0x059A935D , FixedDeviceRole = 0x332896C1 ,
  CapacityBarRecommendedRole = 0x1548C5C4 , GroupRole = 0x0a5b64ee , IconNameRole = 0x00a45c00 , GroupHiddenRole = 0x21a4b936 ,
  TeardownAllowedRole = 0x02533364 , EjectAllowedRole = 0x0A16AC5B , TeardownOverlayRecommendedRole = 0x032EDCCE , DeviceAccessibilityRole = 0x023FFD93
}
 
enum  DeviceAccessibility { SetupNeeded , SetupInProgress , Accessible , TeardownInProgress }
 
enum  GroupType {
  PlacesType , RemoteType , RecentlySavedType , SearchForType ,
  DevicesType , RemovableDevicesType , UnknownType , TagsType
}
 
- Public Types inherited from QAbstractItemModel
enum  CheckIndexOption
 
typedef  CheckIndexOptions
 
enum  LayoutChangeHint
 
- Public Types inherited from QObject
typedef  QObjectList
 

Properties

QStringList supportedSchemes
 
- Properties inherited from QObject
 objectName
 

Signals

void errorMessage (const QString &message)
 
void groupHiddenChanged (KFilePlacesModel::GroupType group, bool hidden)
 
void reloaded ()
 
void setupDone (const QModelIndex &index, bool success)
 
void supportedSchemesChanged ()
 
void teardownDone (const QModelIndex &index, Solid::ErrorType error, const QVariant &errorData)
 

Public Member Functions

 KFilePlacesModel (QObject *parent=nullptr)
 
Q_INVOKABLE void addPlace (const QString &text, const QUrl &url, const QString &iconName, const QString &appName, const QModelIndex &after)
 
Q_INVOKABLE void addPlace (const QString &text, const QUrl &url, const QString &iconName=QString(), const QString &appName=QString())
 
KBookmark bookmarkForIndex (const QModelIndex &index) const
 
KBookmark bookmarkForUrl (const QUrl &searchUrl) const
 
QModelIndex closestItem (const QUrl &url) const
 
int columnCount (const QModelIndex &parent=QModelIndex()) const override
 
QVariant data (const QModelIndex &index, int role) const override
 
Q_INVOKABLE KFilePlacesModel::DeviceAccessibility deviceAccessibility (const QModelIndex &index) const
 
Solid::Device deviceForIndex (const QModelIndex &index) const
 
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override
 
Q_INVOKABLE void editPlace (const QModelIndex &index, const QString &text, const QUrl &url, const QString &iconName=QString(), const QString &appName=QString())
 
Q_INVOKABLE QActionejectActionForIndex (const QModelIndex &index) const
 
Qt::ItemFlags flags (const QModelIndex &index) const override
 
Q_INVOKABLE QModelIndexList groupIndexes (const GroupType type) const
 
Q_INVOKABLE GroupType groupType (const QModelIndex &index) const
 
Q_INVOKABLE int hiddenCount () const
 
Q_INVOKABLE QIcon icon (const QModelIndex &index) const
 
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const override
 
Q_INVOKABLE bool isDevice (const QModelIndex &index) const
 
Q_INVOKABLE bool isEjectAllowed (const QModelIndex &index) const
 
Q_INVOKABLE bool isGroupHidden (const GroupType type) const
 
Q_INVOKABLE bool isGroupHidden (const QModelIndex &index) const
 
Q_INVOKABLE bool isHidden (const QModelIndex &index) const
 
Q_INVOKABLE bool isTeardownAllowed (const QModelIndex &index) const
 
Q_INVOKABLE bool isTeardownOverlayRecommended (const QModelIndex &index) const
 
QMimeDatamimeData (const QModelIndexList &indexes) const override
 
QStringList mimeTypes () const override
 
Q_INVOKABLE bool movePlace (int itemRow, int row)
 
QModelIndex parent (const QModelIndex &child) const override
 
Q_INVOKABLE QActionpartitionActionForIndex (const QModelIndex &index) const
 
Q_INVOKABLE void refresh () const
 
Q_INVOKABLE void removePlace (const QModelIndex &index) const
 
Q_INVOKABLE void requestEject (const QModelIndex &index)
 
Q_INVOKABLE void requestSetup (const QModelIndex &index)
 
Q_INVOKABLE void requestTeardown (const QModelIndex &index)
 
QHash< int, QByteArrayroleNames () const override
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 
Q_INVOKABLE void setGroupHidden (const GroupType type, bool hidden)
 
Q_INVOKABLE void setPlaceHidden (const QModelIndex &index, bool hidden)
 
void setSupportedSchemes (const QStringList &schemes)
 
Q_INVOKABLE bool setupNeeded (const QModelIndex &index) const
 
Qt::DropActions supportedDropActions () const override
 
QStringList supportedSchemes () const
 
Q_INVOKABLE QActionteardownActionForIndex (const QModelIndex &index) const
 
Q_INVOKABLE QString text (const QModelIndex &index) const
 
Q_INVOKABLE QUrl url (const QModelIndex &index) const
 
- Public Member Functions inherited from QAbstractItemModel
 QAbstractItemModel (QObject *parent)
 
virtual QModelIndex buddy (const QModelIndex &index) const const
 
virtual bool canDropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const const
 
virtual bool canFetchMore (const QModelIndex &parent) const const
 
bool checkIndex (const QModelIndex &index, CheckIndexOptions options) const const
 
virtual bool clearItemData (const QModelIndex &index)
 
void columnsAboutToBeInserted (const QModelIndex &parent, int first, int last)
 
void columnsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void columnsInserted (const QModelIndex &parent, int first, int last)
 
void columnsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationColumn)
 
void columnsRemoved (const QModelIndex &parent, int first, int last)
 
void dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList< int > &roles)
 
virtual void fetchMore (const QModelIndex &parent)
 
virtual bool hasChildren (const QModelIndex &parent) const const
 
bool hasIndex (int row, int column, const QModelIndex &parent) const const
 
virtual QVariant headerData (int section, Qt::Orientation orientation, int role) const const
 
void headerDataChanged (Qt::Orientation orientation, int first, int last)
 
bool insertColumn (int column, const QModelIndex &parent)
 
virtual bool insertColumns (int column, int count, const QModelIndex &parent)
 
bool insertRow (int row, const QModelIndex &parent)
 
virtual bool insertRows (int row, int count, const QModelIndex &parent)
 
virtual QMap< int, QVariantitemData (const QModelIndex &index) const const
 
void layoutAboutToBeChanged (const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
 
void layoutChanged (const QList< QPersistentModelIndex > &parents, QAbstractItemModel::LayoutChangeHint hint)
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const const
 
void modelAboutToBeReset ()
 
void modelReset ()
 
bool moveColumn (const QModelIndex &sourceParent, int sourceColumn, const QModelIndex &destinationParent, int destinationChild)
 
virtual bool moveColumns (const QModelIndex &sourceParent, int sourceColumn, int count, const QModelIndex &destinationParent, int destinationChild)
 
bool moveRow (const QModelIndex &sourceParent, int sourceRow, const QModelIndex &destinationParent, int destinationChild)
 
virtual bool moveRows (const QModelIndex &sourceParent, int sourceRow, int count, const QModelIndex &destinationParent, int destinationChild)
 
virtual void multiData (const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const const
 
bool removeColumn (int column, const QModelIndex &parent)
 
virtual bool removeColumns (int column, int count, const QModelIndex &parent)
 
bool removeRow (int row, const QModelIndex &parent)
 
virtual bool removeRows (int row, int count, const QModelIndex &parent)
 
virtual void revert ()
 
void rowsAboutToBeInserted (const QModelIndex &parent, int start, int end)
 
void rowsAboutToBeMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsAboutToBeRemoved (const QModelIndex &parent, int first, int last)
 
void rowsInserted (const QModelIndex &parent, int first, int last)
 
void rowsMoved (const QModelIndex &sourceParent, int sourceStart, int sourceEnd, const QModelIndex &destinationParent, int destinationRow)
 
void rowsRemoved (const QModelIndex &parent, int first, int last)
 
virtual bool setData (const QModelIndex &index, const QVariant &value, int role)
 
virtual bool setHeaderData (int section, Qt::Orientation orientation, const QVariant &value, int role)
 
virtual bool setItemData (const QModelIndex &index, const QMap< int, QVariant > &roles)
 
virtual QModelIndex sibling (int row, int column, const QModelIndex &index) const const
 
virtual void sort (int column, Qt::SortOrder order)
 
virtual QSize span (const QModelIndex &index) const const
 
virtual bool submit ()
 
virtual Qt::DropActions supportedDragActions () const const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static QUrl convertedUrl (const QUrl &url)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Public Attributes inherited from QAbstractItemModel
 DoNotUseParent
 
 HorizontalSortHint
 
 IndexIsValid
 
 NoLayoutChangeHint
 
 NoOption
 
 ParentIsInvalid
 
 VerticalSortHint
 
- Protected Member Functions inherited from QAbstractItemModel
void beginInsertColumns (const QModelIndex &parent, int first, int last)
 
void beginInsertRows (const QModelIndex &parent, int first, int last)
 
bool beginMoveColumns (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
bool beginMoveRows (const QModelIndex &sourceParent, int sourceFirst, int sourceLast, const QModelIndex &destinationParent, int destinationChild)
 
void beginRemoveColumns (const QModelIndex &parent, int first, int last)
 
void beginRemoveRows (const QModelIndex &parent, int first, int last)
 
void beginResetModel ()
 
void changePersistentIndex (const QModelIndex &from, const QModelIndex &to)
 
void changePersistentIndexList (const QModelIndexList &from, const QModelIndexList &to)
 
QModelIndex createIndex (int row, int column, const void *ptr) const const
 
QModelIndex createIndex (int row, int column, quintptr id) const const
 
void endInsertColumns ()
 
void endInsertRows ()
 
void endMoveColumns ()
 
void endMoveRows ()
 
void endRemoveColumns ()
 
void endRemoveRows ()
 
void endResetModel ()
 
QModelIndexList persistentIndexList () const const
 
virtual void resetInternalData ()
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

This class is a list view model.

Each entry represents a "place" where user can access files. Only relevant when used with QListView or QTableView.

Note
This class is since 6.0 re-entrant

Definition at line 38 of file kfileplacesmodel.h.

Member Enumeration Documentation

◆ AdditionalRoles

Enumerator
UrlRole 

roleName is "url".

See also
url()
HiddenRole 

roleName is "isHidden".

See also
isHidden()
SetupNeededRole 

roleName is "isSetupNeeded".

See also
setupNeeded()
FixedDeviceRole 

Whether the place is a fixed device (neither hotpluggable nor removable).

roleName is "isFixedDevice".

CapacityBarRecommendedRole 

Whether the place should have its free space displayed in a capacity bar.

roleName is "isCapacityBarRecommended".

GroupRole 

The name of the group, for example "Remote" or "Devices".

roleName is "group".

Since
5.40
IconNameRole 

roleName is "iconName".

See also
icon()
Since
5.41
GroupHiddenRole 

roleName is "isGroupHidden".

See also
isGroupHidden()
Since
5.42
TeardownAllowedRole 

roleName is "isTeardownAllowed".

See also
isTeardownAllowed().
Since
5.91
EjectAllowedRole 

roleName is "isEjectAllowed".

Since
5.94.
TeardownOverlayRecommendedRole 

roleName is "isTeardownOverlayRecommended".

See also
isTeardownOverlayRecommended()
Since
5.95
DeviceAccessibilityRole 

roleName is "deviceAccessibility".

See also
deviceAccessibility()
Since
5.99

Definition at line 47 of file kfileplacesmodel.h.

◆ DeviceAccessibility

enum KFilePlacesModel::DeviceAccessibility

Definition at line 130 of file kfileplacesmodel.h.

◆ GroupType

Describes the available group types used in this model.

Since
5.42
Enumerator
PlacesType 

"Places" section

RemoteType 

"Remote" section

RecentlySavedType 

"Recent" section

SearchForType 

"Search for" section

DevicesType 

"Devices" section

RemovableDevicesType 

"Removable Devices" section

UnknownType 

Unknown GroupType.

TagsType 

"Tags" section.

Since
5.54

Definition at line 118 of file kfileplacesmodel.h.

Property Documentation

◆ supportedSchemes

QStringList KFilePlacesModel::supportedSchemes
readwrite

Definition at line 42 of file kfileplacesmodel.h.

Constructor & Destructor Documentation

◆ KFilePlacesModel()

KFilePlacesModel::KFilePlacesModel ( QObject * parent = nullptr)
explicit

Definition at line 213 of file kfileplacesmodel.cpp.

Member Function Documentation

◆ addPlace() [1/2]

void KFilePlacesModel::addPlace ( const QString & text,
const QUrl & url,
const QString & iconName,
const QString & appName,
const QModelIndex & after )

Adds a new place to the model.

Parameters
textThe user-visible text for the place
urlThe URL of the place. It will be stored in its QUrl::FullyEncoded string format.
iconNameThe icon of the place
appNameIf set as the value of QCoreApplication::applicationName(), will make the place visible only in this application.
afterThe index after which the new place will be added.

Definition at line 1141 of file kfileplacesmodel.cpp.

◆ addPlace() [2/2]

void KFilePlacesModel::addPlace ( const QString & text,
const QUrl & url,
const QString & iconName = QString(),
const QString & appName = QString() )

Adds a new place to the model.

Parameters
textThe user-visible text for the place
urlThe URL of the place. It will be stored in its QUrl::FullyEncoded string format.
iconNameThe icon of the place
appNameIf set as the value of QCoreApplication::applicationName(), will make the place visible only in this application.

Definition at line 1136 of file kfileplacesmodel.cpp.

◆ bookmarkForIndex()

KBookmark KFilePlacesModel::bookmarkForIndex ( const QModelIndex & index) const
Returns
The KBookmark instance of the place at index index. If the index is not valid, a default KBookmark instance is returned.

Definition at line 574 of file kfileplacesmodel.cpp.

◆ bookmarkForUrl()

KBookmark KFilePlacesModel::bookmarkForUrl ( const QUrl & searchUrl) const
Returns
The KBookmark instance of the place with url searchUrl. If the bookmark corresponding to searchUrl is not found, a default KBookmark instance is returned.
Since
5.63

Definition at line 195 of file kfileplacesmodel.cpp.

◆ closestItem()

QModelIndex KFilePlacesModel::closestItem ( const QUrl & url) const

Returns the closest item for the URL url.

The closest item is defined as item which is equal to the URL or at least is a parent URL. If there are more than one possible parent URL candidates, the item which covers the bigger range of the URL is returned.

Example: the url is '/home/peter/Documents/Music'. Available items are:

  • /home/peter
  • /home/peter/Documents

The returned item will the one for '/home/peter/Documents'.

Definition at line 681 of file kfileplacesmodel.cpp.

◆ columnCount()

int KFilePlacesModel::columnCount ( const QModelIndex & parent = QModelIndex()) const
overridevirtual

Get the number of columns for a model index.

Implements QAbstractItemModel.

Definition at line 674 of file kfileplacesmodel.cpp.

◆ convertedUrl()

QUrl KFilePlacesModel::convertedUrl ( const QUrl & url)
static

Converts the URL, which contains "virtual" URLs for system-items like "timeline:/lastmonth" into a Query-URL "timeline:/2017-10" that will be handled by the corresponding KIO worker.

Virtual URLs for bookmarks are used to be independent from internal format changes.

Parameters
anurl
Returns
the converted URL, which can be handled by a KIO worker
Since
5.41

Definition at line 1124 of file kfileplacesmodel.cpp.

◆ data()

QVariant KFilePlacesModel::data ( const QModelIndex & index,
int role ) const
overridevirtual

Get a visible data based on Qt role for the given index.

Return the device information for the give index.

Parameters
indexThe QModelIndex which contains the row, column to fetch the data.
roleThe Interview data role(ex: Qt::DisplayRole).
Returns
the data for the given index and role.

Implements QAbstractItemModel.

Definition at line 612 of file kfileplacesmodel.cpp.

◆ deviceAccessibility()

KFilePlacesModel::DeviceAccessibility KFilePlacesModel::deviceAccessibility ( const QModelIndex & index) const
Returns
Whether this device is currently accessible or being (un)mounted.
Since
5.99

Definition at line 549 of file kfileplacesmodel.cpp.

◆ deviceForIndex()

Solid::Device KFilePlacesModel::deviceForIndex ( const QModelIndex & index) const
Returns
The solid device of the place at index index, if it is a device. Otherwise a default Solid::Device() instance is returned.
See also
isDevice()

Definition at line 559 of file kfileplacesmodel.cpp.

◆ dropMimeData()

bool KFilePlacesModel::dropMimeData ( const QMimeData * data,
Qt::DropAction action,
int row,
int column,
const QModelIndex & parent )
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1029 of file kfileplacesmodel.cpp.

◆ editPlace()

void KFilePlacesModel::editPlace ( const QModelIndex & index,
const QString & text,
const QUrl & url,
const QString & iconName = QString(),
const QString & appName = QString() )

Edits the place with index index.

Parameters
textThe new user-visible text for the place
urlThe new URL of the place
iconNameThe new icon of the place
appNameThe new application-local filter for the place (
See also
addPlace()).

Definition at line 1157 of file kfileplacesmodel.cpp.

◆ ejectActionForIndex()

QAction * KFilePlacesModel::ejectActionForIndex ( const QModelIndex & index) const
Returns
A QAction with a proper translated label that can be used to trigger the requestEject() method for the place at index index.
See also
requestEject()

Definition at line 1396 of file kfileplacesmodel.cpp.

◆ errorMessage

void KFilePlacesModel::errorMessage ( const QString & message)
signal

message An error message explaining what went wrong.

◆ flags()

Qt::ItemFlags KFilePlacesModel::flags ( const QModelIndex & index) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 979 of file kfileplacesmodel.cpp.

◆ groupHiddenChanged

void KFilePlacesModel::groupHiddenChanged ( KFilePlacesModel::GroupType group,
bool hidden )
signal

Emitted whenever the visibility of the group group changes.

Parameters
hiddenThe new visibility of the group.
See also
setGroupHidden()
Since
5.42

◆ groupIndexes()

QModelIndexList KFilePlacesModel::groupIndexes ( const GroupType type) const
Returns
The list of model indexes that have @ type as their group type.
See also
groupType()
Since
5.42

Definition at line 594 of file kfileplacesmodel.cpp.

◆ groupType()

KFilePlacesModel::GroupType KFilePlacesModel::groupType ( const QModelIndex & index) const
Returns
The group type of the place at index index.
Since
5.42

Definition at line 584 of file kfileplacesmodel.cpp.

◆ hiddenCount()

int KFilePlacesModel::hiddenCount ( ) const
Returns
The number of hidden places in the model.
See also
isHidden()

Definition at line 1320 of file kfileplacesmodel.cpp.

◆ icon()

QIcon KFilePlacesModel::icon ( const QModelIndex & index) const
Returns
The icon of the place at index index.

Definition at line 476 of file kfileplacesmodel.cpp.

◆ index()

QModelIndex KFilePlacesModel::index ( int row,
int column,
const QModelIndex & parent = QModelIndex() ) const
overridevirtual

Get the children model index for the given row and column.

Implements QAbstractItemModel.

Definition at line 626 of file kfileplacesmodel.cpp.

◆ isDevice()

bool KFilePlacesModel::isDevice ( const QModelIndex & index) const
Returns
Whether the place at index index is a device handled by Solid.
See also
deviceForIndex()

Definition at line 508 of file kfileplacesmodel.cpp.

◆ isEjectAllowed()

bool KFilePlacesModel::isEjectAllowed ( const QModelIndex & index) const
Returns
Whether the place is a device that can be ejected, e.g. it is a CD, DVD, etc.

It does not indicate whether the eject can succeed.

Since
5.94

Definition at line 529 of file kfileplacesmodel.cpp.

◆ isGroupHidden() [1/2]

bool KFilePlacesModel::isGroupHidden ( const GroupType type) const
Returns
Whether the group type type is hidden.
Since
5.42

Definition at line 492 of file kfileplacesmodel.cpp.

◆ isGroupHidden() [2/2]

bool KFilePlacesModel::isGroupHidden ( const QModelIndex & index) const
Returns
Whether the group of the place at index index is hidden.
Since
5.42

Definition at line 498 of file kfileplacesmodel.cpp.

◆ isHidden()

bool KFilePlacesModel::isHidden ( const QModelIndex & index) const
Returns
Whether the place at index index is hidden or is inside an hidden group.

Definition at line 486 of file kfileplacesmodel.cpp.

◆ isTeardownAllowed()

bool KFilePlacesModel::isTeardownAllowed ( const QModelIndex & index) const
Returns
Whether the place is a device that can be unmounted, e.g. it is mounted but does not point at system Root or the user's Home directory.

It does not indicate whether the teardown can succeed.

Since
5.91

Definition at line 519 of file kfileplacesmodel.cpp.

◆ isTeardownOverlayRecommended()

bool KFilePlacesModel::isTeardownOverlayRecommended ( const QModelIndex & index) const
Returns
Whether showing an inline teardown button is recommended, e.g. when it is a removable drive.
Since
5.95

Definition at line 539 of file kfileplacesmodel.cpp.

◆ mimeData()

QMimeData * KFilePlacesModel::mimeData ( const QModelIndexList & indexes) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 1003 of file kfileplacesmodel.cpp.

◆ mimeTypes()

QStringList KFilePlacesModel::mimeTypes ( ) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 994 of file kfileplacesmodel.cpp.

◆ movePlace()

bool KFilePlacesModel::movePlace ( int itemRow,
int row )

Move place at itemRow to a position before row.

Returns
Whether the place has been moved.
Since
5.41

Definition at line 1265 of file kfileplacesmodel.cpp.

◆ parent()

QModelIndex KFilePlacesModel::parent ( const QModelIndex & child) const
overridevirtual

Get the parent QModelIndex for the given model child.

Implements QAbstractItemModel.

Definition at line 639 of file kfileplacesmodel.cpp.

◆ partitionActionForIndex()

QAction * KFilePlacesModel::partitionActionForIndex ( const QModelIndex & index) const
Returns
A QAction with a proper translated label that can be used to open a partitioning menu for the device. nullptr if not a device.

Definition at line 1551 of file kfileplacesmodel.cpp.

◆ refresh()

void KFilePlacesModel::refresh ( ) const

Reload bookmark information.

Since
5.41

Definition at line 1119 of file kfileplacesmodel.cpp.

◆ reloaded

void KFilePlacesModel::reloaded ( )
signal

Called once the model has been reloaded.

Since
5.71

◆ removePlace()

void KFilePlacesModel::removePlace ( const QModelIndex & index) const

Deletes the place with index index from the model.

Definition at line 1208 of file kfileplacesmodel.cpp.

◆ requestEject()

void KFilePlacesModel::requestEject ( const QModelIndex & index)

Ejects the place at index index by triggering the eject functionality of its Solid device.

See also
deviceForIndex()

Definition at line 1426 of file kfileplacesmodel.cpp.

◆ requestSetup()

void KFilePlacesModel::requestSetup ( const QModelIndex & index)

Mounts the place at index index by triggering the setup functionality of its Solid device.

See also
deviceForIndex()

Definition at line 1453 of file kfileplacesmodel.cpp.

◆ requestTeardown()

void KFilePlacesModel::requestTeardown ( const QModelIndex & index)

Unmounts the place at index index by triggering the teardown functionality of its Solid device.

See also
deviceForIndex()

Definition at line 1409 of file kfileplacesmodel.cpp.

◆ roleNames()

QHash< int, QByteArray > KFilePlacesModel::roleNames ( ) const
overridevirtual

Reimplemented from QAbstractItemModel.

See also
AdditionalRoles

Reimplemented from QAbstractItemModel.

Definition at line 645 of file kfileplacesmodel.cpp.

◆ rowCount()

int KFilePlacesModel::rowCount ( const QModelIndex & parent = QModelIndex()) const
overridevirtual

Get the number of rows for a model index.

Implements QAbstractItemModel.

Definition at line 665 of file kfileplacesmodel.cpp.

◆ setGroupHidden()

void KFilePlacesModel::setGroupHidden ( const GroupType type,
bool hidden )

Changes the visibility of the group with type type.

Parameters
hiddenWhether the group should be hidden or visible.
See also
isGroupHidden()
Since
5.42

Definition at line 1254 of file kfileplacesmodel.cpp.

◆ setPlaceHidden()

void KFilePlacesModel::setPlaceHidden ( const QModelIndex & index,
bool hidden )

Changes the visibility of the place with index index, but only if the place is not inside an hidden group.

Parameters
hiddenWhether the place should be hidden or visible.
See also
isGroupHidden()

Definition at line 1230 of file kfileplacesmodel.cpp.

◆ setSupportedSchemes()

void KFilePlacesModel::setSupportedSchemes ( const QStringList & schemes)

Set the URL schemes that the file widget should allow navigating to.

If the returned list is empty, all schemes are supported. Examples for schemes are "file" or "ftp".

See also
QFileDialog::setSupportedSchemes
Since
5.43

Definition at line 1530 of file kfileplacesmodel.cpp.

◆ setupDone

void KFilePlacesModel::setupDone ( const QModelIndex & index,
bool success )
signal

Emitted after the Solid setup ends.

Parameters
successWhether the Solid setup has been successful.
See also
requestSetup()

◆ setupNeeded()

bool KFilePlacesModel::setupNeeded ( const QModelIndex & index) const
Returns
Whether the place at index index needs to be mounted before it can be used.

Definition at line 471 of file kfileplacesmodel.cpp.

◆ supportedDropActions()

Qt::DropActions KFilePlacesModel::supportedDropActions ( ) const
overridevirtual

Reimplemented from QAbstractItemModel.

Definition at line 974 of file kfileplacesmodel.cpp.

◆ supportedSchemes()

QStringList KFilePlacesModel::supportedSchemes ( ) const

Returns the URL schemes that the file widget should allow navigating to.

If the returned list is empty, all schemes are supported.

See also
QFileDialog::supportedSchemes
Since
5.43

Definition at line 1537 of file kfileplacesmodel.cpp.

◆ supportedSchemesChanged

void KFilePlacesModel::supportedSchemesChanged ( )
signal

Emitted whenever the list of supported schemes has been changed.

Since
5.94

◆ teardownActionForIndex()

QAction * KFilePlacesModel::teardownActionForIndex ( const QModelIndex & index) const
Returns
A QAction with a proper translated label that can be used to trigger the requestTeardown() method for the place at index index.
See also
requestTeardown()

Definition at line 1334 of file kfileplacesmodel.cpp.

◆ teardownDone

void KFilePlacesModel::teardownDone ( const QModelIndex & index,
Solid::ErrorType error,
const QVariant & errorData )
signal

Emitted after the teardown of a device ends.

Note
In case of an error, the errorMessage signal will also be emitted with a message describing the error.
Parameters
errorType of error that occurred, if any.
errorDataMore information about the error, if any.
Since
5.100

◆ text()

QString KFilePlacesModel::text ( const QModelIndex & index) const
Returns
The user-visible text of the place at index index.

Definition at line 481 of file kfileplacesmodel.cpp.

◆ url()

QUrl KFilePlacesModel::url ( const QModelIndex & index) const
Returns
The URL of the place at index index.

Definition at line 466 of file kfileplacesmodel.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 Fri Dec 20 2024 11:49:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.