UDSEntry Class Reference
from PyKDE4.kio import *
Namespace: KIO
Detailed Description
Universal Directory Service
UDS entry is the data structure representing all the fields about a given URL (file or directory).
The KIO.listDir() and KIO:stat() operations use this data structure.
KIO defines a number of standard fields, see the UDS_XXX enums (see StandardFieldTypes). at the moment UDSEntry only provides fields with numeric indexes, but there might be named fields with string indexes in the future.
For instance, to retrieve the name of the entry, use:
QString displayName = entry.stringValue( KIO.UDSEntry.UDS_NAME );
To know the modification time of the file/url:
time_t mtime = entry.numberValue( KIO.UDSEntry.UDS_MODIFICATION_TIME, -1 ); if ( mtime != -1 ) ...
Enumerations | |
StandardFieldTypes | { UDS_STRING, UDS_NUMBER, UDS_TIME, UDS_SIZE, UDS_SIZE_LARGE, UDS_USER, UDS_ICON_NAME, UDS_GROUP, UDS_NAME, UDS_LOCAL_PATH, UDS_HIDDEN, UDS_ACCESS, UDS_MODIFICATION_TIME, UDS_ACCESS_TIME, UDS_CREATION_TIME, UDS_FILE_TYPE, UDS_LINK_DEST, UDS_URL, UDS_MIME_TYPE, UDS_GUESSED_MIME_TYPE, UDS_XML_PROPERTIES, UDS_EXTENDED_ACL, UDS_ACL_STRING, UDS_DEFAULT_ACL_STRING, UDS_DISPLAY_NAME, UDS_TARGET_URL, UDS_DISPLAY_TYPE, UDS_NEPOMUK_URI, UDS_ICON_OVERLAY_NAMES, UDS_NEPOMUK_QUERY, UDS_COMMENT, UDS_DEVICE_ID, UDS_INODE, UDS_EXTRA, UDS_EXTRA_END } |
Methods | |
__init__ (self) | |
__init__ (self, KIO.UDSEntry other) | |
clear (self) | |
bool | contains (self, long field) |
int | count (self) |
insert (self, long field, QString value) | |
insert (self, long field, long l) | |
bool | isDir (self) |
bool | isLink (self) |
[long] | listFields (self) |
long | numberValue (self, long field, long defaultValue=0) |
bool | remove (self, long field) |
QString | stringValue (self, long field) |
Method Documentation
__init__ | ( | self ) |
__init__ | ( | self, | ||
KIO.UDSEntry | other | |||
) |
clear | ( | self ) |
remove all fields
bool contains | ( | self, | ||
long | field | |||
) |
check existence of a field
- Parameters:
-
field
int count | ( | self ) |
count fields
- Returns:
- the number of fields
insert | ( | self, | ||
long | field, | |||
QString | value | |||
) |
insert field with string value
- Parameters:
-
field numeric tield id l value to set
insert | ( | self, | ||
long | field, | |||
long | l | |||
) |
insert field with string value
- Parameters:
-
field numeric tield id l value to set
bool isDir | ( | self ) |
bool isLink | ( | self ) |
[long] listFields | ( | self ) |
lists all fields
long numberValue | ( | self, | ||
long | field, | |||
long | defaultValue=0 | |||
) |
- Returns:
- value of a numeric field
bool remove | ( | self, | ||
long | field | |||
) |
remove a field with a certain numeric id
- Parameters:
-
field numeric type id
QString stringValue | ( | self, | ||
long | field | |||
) |
- Returns:
- value of a textual field
Enumeration Documentation
StandardFieldTypes |
Constants used to specify the type of a UDSField.
- Enumerator:
-
UDS_STRING = 0x01000000 UDS_NUMBER = 0x02000000 UDS_TIME = 0x04000000|UDS_NUMBER UDS_SIZE = 1|UDS_NUMBER UDS_SIZE_LARGE = 2|UDS_NUMBER UDS_USER = 3|UDS_STRING UDS_ICON_NAME = 4|UDS_STRING UDS_GROUP = 5|UDS_STRING UDS_NAME = 6|UDS_STRING UDS_LOCAL_PATH = 7|UDS_STRING UDS_HIDDEN = 8|UDS_NUMBER UDS_ACCESS = 9|UDS_NUMBER UDS_MODIFICATION_TIME = 10|UDS_TIME UDS_ACCESS_TIME = 11|UDS_TIME UDS_CREATION_TIME = 12|UDS_TIME UDS_FILE_TYPE = 13|UDS_NUMBER UDS_LINK_DEST = 14|UDS_STRING UDS_URL = 15|UDS_STRING UDS_MIME_TYPE = 16|UDS_STRING UDS_GUESSED_MIME_TYPE = 17|UDS_STRING UDS_XML_PROPERTIES = 18|UDS_STRING UDS_EXTENDED_ACL = 19|UDS_NUMBER UDS_ACL_STRING = 20|UDS_STRING UDS_DEFAULT_ACL_STRING = 21|UDS_STRING UDS_DISPLAY_NAME = 22|UDS_STRING UDS_TARGET_URL = 23|UDS_STRING UDS_DISPLAY_TYPE = 24|UDS_STRING UDS_NEPOMUK_URI = 25|UDS_STRING UDS_ICON_OVERLAY_NAMES = 26|UDS_STRING UDS_NEPOMUK_QUERY = 27|UDS_STRING UDS_COMMENT = 28|UDS_STRING UDS_DEVICE_ID = 29|UDS_NUMBER UDS_INODE = 30|UDS_NUMBER UDS_EXTRA = 100|UDS_STRING UDS_EXTRA_END = 140|UDS_STRING