feat: add startupwmclass prop export
log: as title
This commit is contained in:
parent
5b99e9e4b9
commit
230636f2e1
@ -117,6 +117,14 @@
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QStringMap"/>
|
||||
</property>
|
||||
|
||||
<property name="StartupWMClass" type="s" access="read">
|
||||
<annotation
|
||||
name="org.freedesktop.DBus.Description"
|
||||
value="The meaning of this property's type is same as which in StartupWMClass."
|
||||
/>
|
||||
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QStringMap"/>
|
||||
</property>
|
||||
|
||||
<method name="Launch">
|
||||
<arg type="s" name="action" direction="in" />
|
||||
<arg type="as" name="fields" direction="in" />
|
||||
|
@ -559,6 +559,12 @@ bool ApplicationService::terminal() const noexcept
|
||||
return false;
|
||||
}
|
||||
|
||||
QString ApplicationService::startupWMClass() const noexcept
|
||||
{
|
||||
auto value = findEntryValue(DesktopFileEntryKey, "StartupWMClass", EntryValueType::String);
|
||||
return value.isNull() ? QString{} : value.toString();
|
||||
}
|
||||
|
||||
qint64 ApplicationService::installedTime() const noexcept
|
||||
{
|
||||
return m_installedTime;
|
||||
@ -894,6 +900,7 @@ void ApplicationService::resetEntry(DesktopEntry *newEntry) noexcept
|
||||
emit terminalChanged();
|
||||
emit environChanged();
|
||||
emit launchedTimesChanged();
|
||||
emit startupWMClassChanged();
|
||||
}
|
||||
|
||||
std::optional<QStringList> ApplicationService::unescapeExecArgs(const QString &str) noexcept
|
||||
|
@ -74,6 +74,9 @@ public:
|
||||
Q_PROPERTY(bool Terminal READ terminal NOTIFY terminalChanged)
|
||||
[[nodiscard]] bool terminal() const noexcept;
|
||||
|
||||
Q_PROPERTY(QString StartupWMClass READ startupWMClass NOTIFY startupWMClassChanged)
|
||||
[[nodiscard]] QString startupWMClass() const noexcept;
|
||||
|
||||
// FIXME:
|
||||
// This property should implement with fuse guarded
|
||||
// $XDG_CONFIG_HOME/autostart/. Current implementation has some problems,
|
||||
@ -163,6 +166,7 @@ Q_SIGNALS:
|
||||
void terminalChanged();
|
||||
void environChanged();
|
||||
void launchedTimesChanged();
|
||||
void startupWMClassChanged();
|
||||
|
||||
private:
|
||||
friend class ApplicationManager1Service;
|
||||
|
Loading…
Reference in New Issue
Block a user