org.kde.koala

Class KDesktopFile

public class KDesktopFile extends KConfig

KDE Desktop File Management.

Author: Pietro Iglio

See Also: KConfigBase KConfig

UNKNOWN: KDE Desktop File Management class.

Constructor Summary
protected KDesktopFile(Class dummy)
KDesktopFile(String fileName, boolean readOnly, String resType)
Constructs a KDesktopFile object and make it either read-write or read-only.
KDesktopFile(String fileName, boolean readOnly)
KDesktopFile(String fileName)
Method Summary
StringclassName()
KConfigcopyTo(String file)
Copies all entries from this config object to a new KDesktopFile object that will save itself to file. Actual saving to file happens when the returned object is destructed or when sync() is called upon it.
voiddispose()
Delete the wrapped C++ instance ahead of finalize()
StringfileName()
Returns the file name.
protected voidfinalize()
Deletes the wrapped C++ instance
booleanhasActionGroup(String group)
Returns true if the action group exists, false otherwise
booleanhasApplicationType()
Checks whether there is an entry "Type=Application".
booleanhasDeviceType()
Checks whether there is an entry "Type=FSDev".
booleanhasLinkType()
Checks whether there is a "Type=Link" entry.
booleanhasMimeTypeType()
Checks whether there is an entry "Type=MimeType".
static booleanisAuthorizedDesktopFile(String path)
Checks whether the user is authorized to run this desktop file.
static booleanisDesktopFile(String path)
Checks whether this is really a desktop file.
booleanisDisposed()
Has the wrapped C++ instance been deleted?
static StringlocateLocal(String path)
Returns the location where changes for the .desktop file path should be written to.
QMetaObjectmetaObject()
ArrayListreadActions()
Returns a list of the "Actions=" entries.
StringreadComment()
Returns the value of the "Comment=" entry.
StringreadDevice()
Returns the value of the "Dev=" entry.
StringreadDocPath()
Returns the value of the "X-DocPath=" Or "DocPath=" entry.
StringreadGenericName()
Returns the value of the "GenericName=" entry.
StringreadIcon()
Returns the value of the "Icon=" entry.
StringreadName()
Returns the value of the "Name=" entry.
StringreadPath()
Returns the value of the "Path=" entry.
StringreadType()
Returns the value of the "Type=" entry.
StringreadURL()
Returns the value of the "URL=" entry.
Stringresource()
Returns the resource.
voidsetActionGroup(String group)
Sets the desktop action group.
ArrayListsortOrder()
Returns the entry of the "SortOrder=" entry.
booleantryExec()
Checks whether the TryExec field contains a binary which is found on the local system.

Constructor Detail

KDesktopFile

protected KDesktopFile(Class dummy)

KDesktopFile

public KDesktopFile(String fileName, boolean readOnly, String resType)
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".

UNKNOWN: Constructs a KDesktopFile object and make it either read-write or read-only.

KDesktopFile

public KDesktopFile(String fileName, boolean readOnly)

KDesktopFile

public KDesktopFile(String fileName)

Method Detail

className

public String className()

copyTo

public KConfig copyTo(String file)
Copies all entries from this config object to a new KDesktopFile object that will save itself to file. Actual saving to file happens when the returned object is destructed or when sync() is called upon it.

Parameters: file the new KDesktopFile object it will save itself to.

UNKNOWN: Copies all entries from this config object to a new KDesktopFile object that will save itself to file.

dispose

public void dispose()
Delete the wrapped C++ instance ahead of finalize()

fileName

public String fileName()
Returns the file name.

Returns: The filename as passed to the constructor.

UNKNOWN: Returns the file name.

finalize

protected void finalize()
Deletes the wrapped C++ instance

hasActionGroup

public boolean hasActionGroup(String group)
Returns true if the action group exists, false otherwise

Parameters: group the action group to test

Returns: true if the action group exists

UNKNOWN: Returns true if the action group exists, false otherwise

hasApplicationType

public boolean hasApplicationType()
Checks whether there is an entry "Type=Application".

Returns: true if there is a "Type=Application" entry

UNKNOWN: Checks whether there is an entry "Type=Application".

hasDeviceType

public boolean hasDeviceType()
Checks whether there is an entry "Type=FSDev".

Returns: true if there is a "Type=FSDev" entry

UNKNOWN: Checks whether there is an entry "Type=FSDev".

hasLinkType

public boolean hasLinkType()
Checks whether there is a "Type=Link" entry. The link points to the "URL=" entry.

Returns: true if there is a "Type=Link" entry

UNKNOWN: Checks whether there is a "Type=Link" entry.

hasMimeTypeType

public boolean hasMimeTypeType()
Checks whether there is an entry "Type=MimeType".

Returns: true if there is a "Type=MimeType" entry

UNKNOWN: Checks whether there is an entry "Type=MimeType".

isAuthorizedDesktopFile

public static boolean isAuthorizedDesktopFile(String path)
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

UNKNOWN: Checks whether the user is authorized to run this desktop file.

isDesktopFile

public static boolean isDesktopFile(String path)
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.

UNKNOWN: Checks whether this is really a desktop file.

isDisposed

public boolean isDisposed()
Has the wrapped C++ instance been deleted?

locateLocal

public static String locateLocal(String path)
Returns the location where changes for the .desktop file path should be written to.

UNKNOWN: Returns the location where changes for the .

metaObject

public QMetaObject metaObject()

readActions

public ArrayList readActions()
Returns a list of the "Actions=" entries.

Returns: the list of actions

UNKNOWN: Returns a list of the "Actions=" entries.

readComment

public String readComment()
Returns the value of the "Comment=" entry.

Returns: the comment or null if not specified

UNKNOWN: Returns the value of the "Comment=" entry.

readDevice

public String readDevice()
Returns the value of the "Dev=" entry.

Returns: the device or null if not specified

UNKNOWN: Returns the value of the "Dev=" entry.

readDocPath

public String readDocPath()
Returns the value of the "X-DocPath=" Or "DocPath=" entry. X-DocPath should be used and DocPath is depreciated and will one day be not supported.

Returns: The value of the "X-DocPath=" Or "DocPath=" entry.

UNKNOWN: Returns the value of the "X-DocPath=" Or "DocPath=" entry.

readGenericName

public String readGenericName()
Returns the value of the "GenericName=" entry.

Returns: the generic name or null if not specified

UNKNOWN: Returns the value of the "GenericName=" entry.

readIcon

public String readIcon()
Returns the value of the "Icon=" entry.

Returns: the icon or null if not specified

UNKNOWN: Returns the value of the "Icon=" entry.

readName

public String readName()
Returns the value of the "Name=" entry.

Returns: the name or null if not specified

UNKNOWN: Returns the value of the "Name=" entry.

readPath

public String readPath()
Returns the value of the "Path=" entry.

Returns: the path or null if not specified

UNKNOWN: Returns the value of the "Path=" entry.

readType

public String readType()
Returns the value of the "Type=" entry.

Returns: the type or null if not specified

UNKNOWN: Returns the value of the "Type=" entry.

readURL

public String readURL()
Returns the value of the "URL=" entry.

Returns: the URL or null if not specified

UNKNOWN: Returns the value of the "URL=" entry.

resource

public String resource()
Returns the resource.

Returns: The resource type as passed to the constructor.

UNKNOWN: Returns the resource.

setActionGroup

public void setActionGroup(String group)
Sets the desktop action group.

Parameters: group the new action group

UNKNOWN: Sets the desktop action group.

sortOrder

public ArrayList sortOrder()
Returns the entry of the "SortOrder=" entry.

Returns: the value of the "SortOrder=" entry.

UNKNOWN: Returns the entry of the "SortOrder=" entry.

tryExec

public boolean tryExec()
Checks whether the TryExec field contains a binary which is found on the local system.

Returns: true if TryExec contains an existing binary

UNKNOWN: Checks whether the TryExec field contains a binary which is found on the local system.