|
|
KDE Desktop File Management.
See also: KConfigBase, KConfig
KDesktopFile ( const QString &fileName, bool readOnly = false,
const char * resType = "apps")
| KDesktopFile |
Constructs a KDesktopFile object and make it either read-write or read-only.
Parameters:
fileName | The name or path of the desktop file. If it
is not absolute, it will be located
using the resource type resType .
|
readOnly | Whether the object should be read-only. |
resType | Allows you to change what sort of resource
to search for if fileName is not absolute. For
instance, you might want to specify "config".
|
~KDesktopFile ()
| ~KDesktopFile |
[virtual]
Destructs the KDesktopFile object.
Writes back any dirty configuration entries.
bool isDesktopFile (const QString& path)
| isDesktopFile |
[static]
Checks whether this is really a desktop file.
The check is performed looking at the file extension (the file is not opened). Currently, valid extensions are ".kdelnk" and ".desktop".
Parameters:
path | the path of the file to check |
Returns: true if the file appears to be a desktop file.
bool isAuthorizedDesktopFile (const QString& path)
| isAuthorizedDesktopFile |
[static]
Checks whether the user is authorized to run this desktop file. By default users are authorized to run all desktop files but the KIOSK framework can be used to activate certain restrictions. See README.kiosk for more information.
Parameters:
path | the file to check |
Returns: true if the user is authorized to run the file
QString readType ()
| readType |
[const]
Returns the value of the "Type=" entry.
Returns: the type or QString::null if not specified
QString readIcon ()
| readIcon |
[const]
Returns the value of the "Icon=" entry.
Returns: the icon or QString::null if not specified
QString readName ()
| readName |
[const]
Returns the value of the "Name=" entry.
Returns: the name or QString::null if not specified
QString readComment ()
| readComment |
[const]
Returns the value of the "Comment=" entry.
Returns: the comment or QString::null if not specified
QString readGenericName ()
| readGenericName |
[const]
Returns the value of the "GenericName=" entry.
Returns: the generic name or QString::null if not specified
QString readPath ()
| readPath |
[const]
Returns the value of the "Path=" entry.
Returns: the path or QString::null if not specified
QString readDevice ()
| readDevice |
[const]
Returns the value of the "Dev=" entry.
Returns: the device or QString::null if not specified
QString readURL ()
| readURL |
[const]
Returns the value of the "URL=" entry.
Returns: the URL or QString::null if not specified
QStringList readActions ()
| readActions |
[const]
Returns a list of the "Actions=" entries.
Returns: the list of actions
void setActionGroup (const QString &group)
| setActionGroup |
Sets the desktop action group.
Parameters:
the | new action group |
bool hasActionGroup (const QString &group)
| hasActionGroup |
[const]
Returns true if the action group exists, false otherwise
Parameters:
the | action group to test |
Returns: true if the action group exists
bool hasLinkType ()
| hasLinkType |
[const]
Checks whether there is a "Type=Link" entry.
The link points to the "URL=" entry.
Returns: true if there is a "Type=Link" entry
bool hasApplicationType ()
| hasApplicationType |
[const]
Checks whether there is an entry "Type=Application".
Returns: true if there is a "Type=Application" entry
bool hasMimeTypeType ()
| hasMimeTypeType |
[const]
Checks whether there is an entry "Type=MimeType".
Returns: true if there is a "Type=MimeType" entry
bool hasDeviceType ()
| hasDeviceType |
[const]
Checks whether there is an entry "Type=FSDev".
Returns: true if there is a "Type=FSDev" entry
bool tryExec ()
| tryExec |
[const]
Checks whether the TryExec field contains a binary which is found on the local system.
Returns: true if TryExec contains an existing binary
QString fileName ()
| fileName |
[const]
Returns the file name.
Returns: The filename as passed to the constructor.
QString resource ()
| resource |
[const]
Returns the resource.
Returns: The resource type as passed to the constructor.
QString readDocPath ()
| readDocPath |
[const]
Returns the value of the "DocPath=" entry.
Returns: The value of the "DocPath=" entry.
QStringList sortOrder ()
| sortOrder |
[const]
Returns the entry of the "SortOrder=" entry.
Returns: the value of the "SortOrder=" entry.
void virtual_hook ( int id, void* data )
| virtual_hook |
[protected virtual]
Reimplemented from KConfig.