• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KFile

KFilePlacesModel Class Reference

#include <kfileplacesmodel.h>

Inheritance diagram for KFilePlacesModel:

Inheritance graph
[legend]

List of all members.


Detailed Description

This class is a list view model.

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

Definition at line 40 of file kfileplacesmodel.h.


Public Types

enum  AdditionalRoles { UrlRole = 0x069CD12B, HiddenRole = 0x0741CAAC, SetupNeededRole = 0x059A935D }

Signals

void errorMessage (const QString &message)
void setupDone (const QModelIndex &index, bool success)

Public Member Functions

void addPlace (const QString &text, const KUrl &url, const QString &iconName=QString(), const QString &appName=QString())
KBookmark bookmarkForIndex (const QModelIndex &index) const
QModelIndex closestItem (const KUrl &url) const
int columnCount (const QModelIndex &parent=QModelIndex()) const
QVariant data (const QModelIndex &index, int role) const
Solid::Device deviceForIndex (const QModelIndex &index) const
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)
void editPlace (const QModelIndex &index, const QString &text, const KUrl &url, const QString &iconName=QString(), const QString &appName=QString())
Qt::ItemFlags flags (const QModelIndex &index) const
int hiddenCount () const
KIcon icon (const QModelIndex &index) const
QModelIndex index (int row, int column, const QModelIndex &parent=QModelIndex()) const
bool isDevice (const QModelIndex &index) const
bool isHidden (const QModelIndex &index) const
 KFilePlacesModel (QObject *parent=0)
QMimeData * mimeData (const QModelIndexList &indexes) const
QStringList mimeTypes () const
QModelIndex parent (const QModelIndex &child) const
void removePlace (const QModelIndex &index) const
void requestSetup (const QModelIndex &index)
void requestTeardown (const QModelIndex &index)
int rowCount (const QModelIndex &parent=QModelIndex()) const
void setPlaceHidden (const QModelIndex &index, bool hidden)
bool setupNeeded (const QModelIndex &index) const
Qt::DropActions supportedDropActions () const
QAction * teardownActionForIndex (const QModelIndex &index) const
QString text (const QModelIndex &index) const
KUrl url (const QModelIndex &index) const
 ~KFilePlacesModel ()

Member Enumeration Documentation

enum KFilePlacesModel::AdditionalRoles

Enumerator:
UrlRole 
HiddenRole 
SetupNeededRole 

Definition at line 44 of file kfileplacesmodel.h.


Constructor & Destructor Documentation

KFilePlacesModel::KFilePlacesModel ( QObject *  parent = 0  ) 

Definition at line 84 of file kfileplacesmodel.cpp.

KFilePlacesModel::~KFilePlacesModel (  ) 

Definition at line 140 of file kfileplacesmodel.cpp.


Member Function Documentation

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

Definition at line 581 of file kfileplacesmodel.cpp.

KBookmark KFilePlacesModel::bookmarkForIndex ( const QModelIndex &  index  )  const

Definition at line 194 of file kfileplacesmodel.cpp.

QModelIndex KFilePlacesModel::closestItem ( const KUrl &  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 249 of file kfileplacesmodel.cpp.

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

Get the number of columns for a model index.

Definition at line 242 of file kfileplacesmodel.cpp.

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

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

Return the device information for the give index.

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

Definition at line 208 of file kfileplacesmodel.cpp.

Solid::Device KFilePlacesModel::deviceForIndex ( const QModelIndex &  index  )  const

Definition at line 180 of file kfileplacesmodel.cpp.

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

Reimplemented from QAbstractItemModel.

Definition at line 502 of file kfileplacesmodel.cpp.

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

Definition at line 594 of file kfileplacesmodel.cpp.

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

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

Definition at line 451 of file kfileplacesmodel.cpp.

int KFilePlacesModel::hiddenCount (  )  const

Definition at line 648 of file kfileplacesmodel.cpp.

KIcon KFilePlacesModel::icon ( const QModelIndex &  index  )  const

Definition at line 155 of file kfileplacesmodel.cpp.

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

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

Definition at line 217 of file kfileplacesmodel.cpp.

bool KFilePlacesModel::isDevice ( const QModelIndex &  index  )  const

Definition at line 170 of file kfileplacesmodel.cpp.

bool KFilePlacesModel::isHidden ( const QModelIndex &  index  )  const

Definition at line 165 of file kfileplacesmodel.cpp.

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

Definition at line 478 of file kfileplacesmodel.cpp.

QStringList KFilePlacesModel::mimeTypes (  )  const

Definition at line 469 of file kfileplacesmodel.cpp.

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

Get the parent QModelIndex for the given model child.

Definition at line 228 of file kfileplacesmodel.cpp.

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

Definition at line 616 of file kfileplacesmodel.cpp.

void KFilePlacesModel::requestSetup ( const QModelIndex &  index  ) 

Definition at line 721 of file kfileplacesmodel.cpp.

void KFilePlacesModel::requestTeardown ( const QModelIndex &  index  ) 

Definition at line 700 of file kfileplacesmodel.cpp.

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

Get the number of rows for a model index.

Definition at line 234 of file kfileplacesmodel.cpp.

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

Definition at line 632 of file kfileplacesmodel.cpp.

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

bool KFilePlacesModel::setupNeeded ( const QModelIndex &  index  )  const

Definition at line 150 of file kfileplacesmodel.cpp.

Qt::DropActions KFilePlacesModel::supportedDropActions (  )  const

Definition at line 446 of file kfileplacesmodel.cpp.

QAction * KFilePlacesModel::teardownActionForIndex ( const QModelIndex &  index  )  const

Definition at line 662 of file kfileplacesmodel.cpp.

QString KFilePlacesModel::text ( const QModelIndex &  index  )  const

Definition at line 160 of file kfileplacesmodel.cpp.

KUrl KFilePlacesModel::url ( const QModelIndex &  index  )  const

Definition at line 145 of file kfileplacesmodel.cpp.


The documentation for this class was generated from the following files:
  • kfileplacesmodel.h
  • kfileplacesmodel.cpp

KFile

Skip menu "KFile"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal