KDECore
#include <KUrl>

Public Types | |
| enum | DecodeOptions { PreferLocalUrls, PreferKdeUrls } |
Public Member Functions | |
| List () | |
| List (const KUrl &url) | |
| List (const QStringList &list) | |
| List (const QList< KUrl > &list) | |
| List (const QList< QUrl > &list) | |
| operator QList< QUrl > () const | |
| operator QVariant () const | |
| void | populateMimeData (QMimeData *mimeData, const KUrl::MetaDataMap &metaData=MetaDataMap(), MimeDataFlags flags=DefaultMimeDataFlags) const |
| void | populateMimeData (const KUrl::List &mostLocalUrls, QMimeData *mimeData, const KUrl::MetaDataMap &metaData=MetaDataMap(), MimeDataFlags flags=DefaultMimeDataFlags) const |
| QStringList | toStringList () const |
| QStringList | toStringList (KUrl::AdjustPathOption trailing) const |
Public Member Functions inherited from QList< KUrl > | |
| QList () | |
| QList (const QList< KUrl > &other) | |
| QList (std::initializer_list< KUrl > args) | |
| ~QList () | |
| void | append (const KUrl &value) |
| void | append (const QList< KUrl > &value) |
| const KUrl & | at (int i) const |
| KUrl & | back () |
| const KUrl & | back () const |
| iterator | begin () |
| const_iterator | begin () const |
| void | clear () |
| const_iterator | constBegin () const |
| const_iterator | constEnd () const |
| bool | contains (const KUrl &value) const |
| int | count (const KUrl &value) const |
| int | count () const |
| bool | empty () const |
| iterator | end () |
| const_iterator | end () const |
| bool | endsWith (const KUrl &value) const |
| iterator | erase (iterator pos) |
| iterator | erase (iterator begin, iterator end) |
| iterator | find (iterator from, const KUrl &t) |
| iterator | find (const KUrl &t) |
| const_iterator | find (const KUrl &t) const |
| const_iterator | find (const_iterator from, const KUrl &t) const |
| int | findIndex (const KUrl &t) const |
| KUrl & | first () |
| const KUrl & | first () const |
| KUrl & | front () |
| const KUrl & | front () const |
| int | indexOf (const KUrl &value, int from) const |
| void | insert (int i, const KUrl &value) |
| iterator | insert (iterator before, const KUrl &value) |
| bool | isEmpty () const |
| KUrl & | last () |
| const KUrl & | last () const |
| int | lastIndexOf (const KUrl &value, int from) const |
| int | length () const |
| QList< KUrl > | mid (int pos, int length) const |
| void | move (int from, int to) |
| bool | operator!= (const QList< KUrl > &other) const |
| QList< KUrl > | operator+ (const QList< KUrl > &other) const |
| QList< KUrl > & | operator+= (const QList< KUrl > &other) |
| QList< KUrl > & | operator+= (const KUrl &value) |
| QList< KUrl > & | operator<< (const KUrl &value) |
| QList< KUrl > & | operator<< (const QList< KUrl > &other) |
| QList< KUrl > & | operator= (const QList< KUrl > &other) |
| bool | operator== (const QList< KUrl > &other) const |
| KUrl & | operator[] (int i) |
| const KUrl & | operator[] (int i) const |
| void | pop_back () |
| void | pop_front () |
| void | prepend (const KUrl &value) |
| void | push_back (const KUrl &value) |
| void | push_front (const KUrl &value) |
| iterator | remove (iterator pos) |
| int | remove (const KUrl &t) |
| int | removeAll (const KUrl &value) |
| void | removeAt (int i) |
| void | removeFirst () |
| void | removeLast () |
| bool | removeOne (const KUrl &value) |
| void | replace (int i, const KUrl &value) |
| void | reserve (int alloc) |
| int | size () const |
| bool | startsWith (const KUrl &value) const |
| void | swap (int i, int j) |
| void | swap (QList< KUrl > &other) |
| KUrl | takeAt (int i) |
| KUrl | takeFirst () |
| KUrl | takeLast () |
| QSet< KUrl > | toSet () const |
| std::list< KUrl > | toStdList () const |
| QVector< KUrl > | toVector () const |
| KUrl | value (int i, const KUrl &defaultValue) const |
| KUrl | value (int i) const |
Static Public Member Functions | |
| static bool | canDecode (const QMimeData *mimeData) |
| static KUrl::List | fromMimeData (const QMimeData *mimeData, KUrl::MetaDataMap *metaData=0) |
| static KUrl::List | fromMimeData (const QMimeData *mimeData, DecodeOptions decodeOptions, KUrl::MetaDataMap *metaData=0) |
| static QStringList | mimeDataTypes () |
Static Public Member Functions inherited from QList< KUrl > | |
| QList< KUrl > | fromSet (const QSet< KUrl > &set) |
| QList< KUrl > | fromStdList (const std::list< KUrl > &list) |
| QList< KUrl > | fromVector (const QVector< KUrl > &vector) |
Additional Inherited Members | |
Public Attributes inherited from QList< KUrl > | |
| typedef | const_pointer |
| typedef | const_reference |
| typedef | ConstIterator |
| typedef | difference_type |
| typedef | Iterator |
| typedef | pointer |
| typedef | reference |
| typedef | size_type |
| typedef | value_type |
Detailed Description
KUrl::List is a QList that contains KUrls with a few convenience methods.
Member Enumeration Documentation
Flags to be used in fromMimeData.
- Since
- 4.2.3
| Enumerator | |
|---|---|
| PreferLocalUrls |
When the mimedata contains both KDE-style URLs (eg: desktop:/foo) and the "most local" version of the URLs (eg: file:///home/dfaure/Desktop/foo), decode it as local urls. Useful in paste/drop operations that end up calling KIO, so that urls from other users work as well. |
| PreferKdeUrls |
When the mimedata contains both KDE-style URLs (eg: desktop:/foo) and the "most local" version of the URLs (eg: file:///home/dfaure/Desktop/foo), decode it as the KDE-style URL. Useful in DnD code e.g. when moving icons, and the kde-style url is used as identifier for the icons. |
Constructor & Destructor Documentation
| KUrl::List::List | ( | const KUrl & | url | ) |
| KUrl::List::List | ( | const QStringList & | list | ) |
Creates a list that contains the URLs from the given QList<KUrl>.
- Parameters
-
list the list containing the URLs
Creates a list that contains the URLs from the given QList<KUrl>.
- Parameters
-
list the list containing the URLs
- Since
- 4.7
Member Function Documentation
|
static |
Extract a list of KUrls from the contents of mimeData.
Decoding will fail if mimeData does not contain any URLs, or if at least one extracted URL is not valid.
- Parameters
-
mimeData the mime data to extract from; cannot be 0 metaData optional pointer to a map holding the metadata
- Returns
- the list of urls
|
static |
Extract a list of KUrls from the contents of mimeData.
Decoding will fail if mimeData does not contain any URLs, or if at least one extracted URL is not valid.
- Parameters
-
mimeData the mime data to extract from; cannot be 0 decodeOptions options for decoding metaData optional pointer to a map holding the metadata
- Returns
- the list of urls
- Since
- 4.2.3
|
static |
Converts this KUrl::List into a list of QUrl instances.
- Since
- 4.7
| KUrl::List::operator QVariant | ( | ) | const |
Converts this KUrl::List to a QVariant, this allows to use KUrl::List in QVariant() constructor.
| void KUrl::List::populateMimeData | ( | QMimeData * | mimeData, |
| const KUrl::MetaDataMap & | metaData = MetaDataMap(), |
||
| MimeDataFlags | flags = DefaultMimeDataFlags |
||
| ) | const |
Adds URLs data into the given QMimeData.
By default, populateMimeData also exports the URLs as plain text, for e.g. dropping onto a text editor. But in some cases this might not be wanted, e.g. if adding other mime data which provides better plain text data.
WARNING: do not call this method multiple times on the same mimedata object, you can add urls only once. But you can add other things, e.g. images, XML...
- Parameters
-
mimeData the QMimeData instance used to drag or copy this URL metaData KIO metadata shipped in the mime data, which is used for instance to set a correct HTTP referrer (some websites require it for downloading e.g. an image) flags set NoTextExport to prevent setting plain/text data into mimeDataIn such a case, setExportAsText( false ) should be called.
| void KUrl::List::populateMimeData | ( | const KUrl::List & | mostLocalUrls, |
| QMimeData * | mimeData, | ||
| const KUrl::MetaDataMap & | metaData = MetaDataMap(), |
||
| MimeDataFlags | flags = DefaultMimeDataFlags |
||
| ) | const |
Adds URLs into the given QMimeData.
This should add both the KDE-style URLs (eg: desktop:/foo) and the "most local" version of the URLs (eg: file:///home/jbloggs/Desktop/foo) to the mimedata.
This method should be called on the KDE-style URLs.
- Parameters
-
mostLocalUrls the "most local" urls mimeData the mime data object to populate metaData KIO metadata shipped in the mime data, which is used for instance to set a correct HTTP referrer (some websites require it for downloading e.g. an image) flags set NoTextExport to prevent setting plain/text data into mimeData. In such a case,setExportAsText(false)should be called.
- Since
- 4.2
| QStringList KUrl::List::toStringList | ( | ) | const |
| QStringList KUrl::List::toStringList | ( | KUrl::AdjustPathOption | trailing | ) | const |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.
KDE API Reference
Public Member Functions inherited from