[]Struct gio::DesktopAppInfo

pub struct DesktopAppInfo(_, _);

DesktopAppInfo is an implementation of AppInfo based on desktop files.

Note that <gio/gdesktopappinfo.h> belongs to the UNIX-specific GIO interfaces, thus you have to use the gio-unix-2.0.pc pkg-config file when using it.

Implements

DesktopAppInfoExt, glib::object::ObjectExt, AppInfoExt

Methods

impl DesktopAppInfo[src]

pub fn search(search_string: &str) -> Vec<Vec<GString>>[src]

Searches desktop files for ones that match search_string.

The return value is an array of strvs. Each strv contains a list of applications that matched search_string with an equal score. The outer list is sorted by score so that the first strv contains the best-matching applications, and so on. The algorithm for determining matches is undefined and may change at any time.

search_string

the search string to use

Returns

a list of strvs. Free each item with g_strfreev and free the outer list with g_free.

impl DesktopAppInfo[src]

pub fn new(desktop_id: &str) -> Option<DesktopAppInfo>[src]

Creates a new DesktopAppInfo based on a desktop file id.

A desktop file id is the basename of the desktop file, including the .desktop extension. GIO is looking for a desktop file with this name in the applications subdirectories of the XDG data directories (i.e. the directories specified in the XDG_DATA_HOME and XDG_DATA_DIRS environment variables). GIO also supports the prefix-to-subdirectory mapping that is described in the Menu Spec (i.e. a desktop id of kde-foo.desktop will match /usr/share/applications/kde/foo.desktop).

desktop_id

the desktop file id

Returns

a new DesktopAppInfo, or None if no desktop file with that id exists.

pub fn new_from_filename<P: AsRef<Path>>(filename: P) -> Option<DesktopAppInfo>[src]

Creates a new DesktopAppInfo.

filename

the path of a desktop file, in the GLib filename encoding

Returns

a new DesktopAppInfo or None on error.

pub fn new_from_keyfile(key_file: &KeyFile) -> Option<DesktopAppInfo>[src]

Creates a new DesktopAppInfo.

key_file

an opened glib::KeyFile

Returns

a new DesktopAppInfo or None on error.

pub fn get_implementations(interface: &str) -> Vec<DesktopAppInfo>[src]

Gets all applications that implement interface.

An application implements an interface if that interface is listed in the Implements= line of the desktop file of the application.

interface

the name of the interface

Returns

a list of DesktopAppInfo objects.

Trait Implementations

impl Clone for DesktopAppInfo

impl Debug for DesktopAppInfo

impl Display for DesktopAppInfo[src]

impl Eq for DesktopAppInfo

impl Hash for DesktopAppInfo

impl IsA<AppInfo> for DesktopAppInfo

impl Ord for DesktopAppInfo

impl<T: ObjectType> PartialEq<T> for DesktopAppInfo

impl<T: ObjectType> PartialOrd<T> for DesktopAppInfo

impl StaticType for DesktopAppInfo

Auto Trait Implementations

impl RefUnwindSafe for DesktopAppInfo

impl !Send for DesktopAppInfo

impl !Sync for DesktopAppInfo

impl Unpin for DesktopAppInfo

impl UnwindSafe for DesktopAppInfo

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 
[src]

impl<T> Cast for T where
    T: ObjectType
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *const GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GList> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<'a, T> ToGlibContainerFromSlice<'a, *mut GPtrArray> for T where
    T: GlibPtrDefault + ToGlibPtr<'a, <T as GlibPtrDefault>::GlibType>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: ToValue + SetValue + Send + ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> ToValue for T where
    T: SetValue + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.