• 首页
  • Qt文档
  • DTK文档
  • 玲珑文档
  • ddesktopentry_zh

    Class::DDesktopEntry

    暂无该属性


    Detailed Description

    Handling desktop entry files. DDesktopEntry provide method for handling XDG desktop entry read and write. The interface of this class is similar to QSettings.

    For more details about the spec itself, please refer to: https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html

    DDesktopEntry::qt_check_for_QGADGET_macro

    [public plain  ]

    void qt_check_for_QGADGET_macro()

    typedef DDesktopEntry::QtGadgetHelper

    DDesktopEntry::qt_static_metacall

    [private plain static ]

    void qt_static_metacall(QObject *, QMetaObject::Call , int , void **)

    DDesktopEntry::DDesktopEntry

    [public constructor  ]

    DDesktopEntry(const QString &filePath)

    DDesktopEntry::~DDesktopEntry

    [public destructor  ]

    ~DDesktopEntry()

    DDesktopEntry::save

    [public plain  ]

    bool save() const

    Write back data to the desktop entry file. Returns true if write success; otherwise returns false.

    DDesktopEntry::status

    [public plain  ]

    DDesktopEntry::Status status() const

    Get data parse status Returns a status code indicating the first error that was met by DDesktopEntry , or QSettings::NoError if no error occurred.

    Be aware that DDesktopEntry delays performing some operations.

    See also setStatus()

    DDesktopEntry::keys

    [public plain  ]

    QStringList keys(const QString &section) const

    Get a list of all section keys inside the given section. Returns all available section keys.

    DDesktopEntry::allGroups

    [public plain  ]

    QStringList allGroups(bool sorted) const

    Get a list of all section groups inside the desktop entry. If sorted is set to true, the returned result will keep the order as-is when reading the entry file.

    Returns all available section groups.

    DDesktopEntry::contains

    [public plain  ]

    bool contains(const QString &key, const QString &section) const

    Check if the desktop entry file have the given section contains the given key Returns true if the desktop entry contains the key in section; otherwise returns false.

    DDesktopEntry::name

    [public plain  ]

    QString name() const

    Returns the localized string value of the "Name" key under "Desktop Entry" section. It's equivalent to calling localizedValue ("Name").

    See also localizedValue() genericName() ddeDisplayName()

    DDesktopEntry::genericName

    [public plain  ]

    QString genericName() const

    Returns the localized string value of the "GenericName" key under "Desktop Entry" section. It's equivalent to calling localizedValue ("GenericName"). It will NOT fallback to "Name" if "GenericName" is not existed.

    See also localizedValue() name() ddeDisplayName()

    DDesktopEntry::ddeDisplayName

    [public plain  ]

    QString ddeDisplayName() const

    Display name specially for DDE applications. This will check "X-Deepin-Vendor" and will return the localized string value of "GenericName" if "X-Deepin-Vendor" is "deepin", or it will return the localized string value of "Name".

    See also localizedValue() name() genericName()

    DDesktopEntry::comment

    [public plain  ]

    QString comment() const

    Returns the localized string value of the "Comment" key under "Desktop Entry" section. It's equivalent to calling localizedValue ("Comment").

    See also localizedValue()

    DDesktopEntry::rawValue

    [public plain  ]

    QString rawValue(const QString &key, const QString &section, const QString &defaultValue) const

    Returns the raw string value associated with the given key in section. If the entry contains no item with the key, the function returns a default-constructed value.

    See also setRawValue() stringValue() localizedValue() stringListValue()

    DDesktopEntry::stringValue

    [public plain  ]

    QString stringValue(const QString &key, const QString &section, const QString &defaultValue) const

    Returns the unescaped string value associated with the given key in section. If the entry contains no item with the key, the function returns a default-constructed value.

    See also setStringValue() rawValue() localizedValue() stringListValue()

    DDesktopEntry::localizedValue

    [public plain  ]

    QString localizedValue(const QString &key, const QString &localeKey, const QString &section, const QString &defaultValue) const

    Returns the localized string value associated with the given key and localeKey in section. If the given localeKey can't be found, it will fallback to "C", if still cannot found, will fallback to the key without localeKey.

    If the entry contains no item with the key, the function returns a default-constructed value.

    See also setLocalizedValue() rawValue() stringValue() stringListValue()

    DDesktopEntry::localizedValue

    [public plain  ]

    QString localizedValue(const QString &key, const QLocale &locale, const QString &section, const QString &defaultValue) const

    Returns the localized string value associated with the given key and locale in section. If the given locale can't be found, it will fallback to "C", if still cannot found, will fallback to the key without a locale key.

    If the entry contains no item with the key, the function returns a default-constructed value.

    See also setLocalizedValue() rawValue() stringValue() stringListValue()

    DDesktopEntry::stringListValue

    [public plain  ]

    QStringList stringListValue(const QString &key, const QString &section) const

    Returns a list of strings associated with the given key in the given section. If the entry contains no item with the key, the function returns a empty string list.

    See also setRawValue() rawValue() stringValue() localizedValue()

    DDesktopEntry::setRawValue

    [public plain  ]

    bool setRawValue(const QString &value, const QString &key, const QString &section) See also rawValue()

    DDesktopEntry::setStringValue

    [public plain  ]

    bool setStringValue(const QString &value, const QString &key, const QString &section) See also stringValue()

    DDesktopEntry::setLocalizedValue

    [public plain  ]

    bool setLocalizedValue(const QString &value, const QString &localeKey, const QString &key, const QString &section) See also localizedValue()

    DDesktopEntry::removeEntry

    [public plain  ]

    bool removeEntry(const QString &key, const QString &section)

    DDesktopEntry::escape

    [public plain static ]

    QString & escape(QString &str)

    DDesktopEntry::escapeExec

    [public plain static ]

    QString & escapeExec(QString &str)

    DDesktopEntry::unescape

    [public plain static ]

    QString & unescape(QString &str, bool unescapeSemicolons)

    DDesktopEntry::unescapeExec

    [public plain static ]

    QString & unescapeExec(QString &str)

    DDesktopEntry::setStatus

    [protected plain  ]

    bool setStatus(const DDesktopEntry::Status &status) See also status()

    DDesktopEntry::d_func

    [private plain  ]

    DDesktopEntryPrivate * d_func()

    DDesktopEntry::d_func

    [private plain  ]

    const DDesktopEntryPrivate * d_func() const