@@ -50,29 +50,23 @@ class DesktopEntry: public QObject {
50
50
Q_OBJECT;
51
51
Q_PROPERTY (QString id MEMBER mId CONSTANT);
52
52
// / Name of the specific application, such as "Firefox".
53
- Q_PROPERTY (QString name READ name NOTIFY nameChanged BINDABLE bindableName);
53
+ // clang-format off
54
+ Q_PROPERTY (QString name READ default WRITE default NOTIFY nameChanged BINDABLE bindableName);
54
55
// / Short description of the application, such as "Web Browser". May be empty.
55
- Q_PROPERTY (
56
- QString genericName READ genericName NOTIFY genericNameChanged BINDABLE bindableGenericName
57
- );
56
+ Q_PROPERTY (QString genericName READ default WRITE default NOTIFY genericNameChanged BINDABLE bindableGenericName);
58
57
// / Initial class or app id the app intends to use. May be useful for matching running apps
59
58
// / to desktop entries.
60
- Q_PROPERTY (
61
- QString startupClass READ startupClass NOTIFY startupClassChanged BINDABLE
62
- bindableStartupClass
63
- );
59
+ Q_PROPERTY (QString startupClass READ default WRITE default NOTIFY startupClassChanged BINDABLE bindableStartupClass);
64
60
// / If true, this application should not be displayed in menus and launchers.
65
- Q_PROPERTY (bool noDisplay READ noDisplay NOTIFY noDisplayChanged BINDABLE bindableNoDisplay);
61
+ Q_PROPERTY (bool noDisplay READ default WRITE default NOTIFY noDisplayChanged BINDABLE bindableNoDisplay);
66
62
// / Long description of the application, such as "View websites on the internet". May be empty.
67
- Q_PROPERTY (QString comment READ comment NOTIFY commentChanged BINDABLE bindableComment);
63
+ Q_PROPERTY (QString comment READ default WRITE default NOTIFY commentChanged BINDABLE bindableComment);
68
64
// / Name of the icon associated with this application. May be empty.
69
- Q_PROPERTY (QString icon READ icon NOTIFY iconChanged BINDABLE bindableIcon);
65
+ Q_PROPERTY (QString icon READ default WRITE default NOTIFY iconChanged BINDABLE bindableIcon);
70
66
// / The raw `Exec` string from the desktop entry.
71
67
// /
72
68
// / > [!WARNING] This cannot be reliably run as a command. See @@command for one you can run.
73
- Q_PROPERTY (
74
- QString execString READ execString NOTIFY execStringChanged BINDABLE bindableExecString
75
- );
69
+ Q_PROPERTY (QString execString READ default WRITE default NOTIFY execStringChanged BINDABLE bindableExecString);
76
70
// / The parsed `Exec` command in the desktop entry.
77
71
// /
78
72
// / The entry can be run with @@execute(), or by using this command in
@@ -81,24 +75,14 @@ class DesktopEntry: public QObject {
81
75
// / the invoked process. See @@execute() for details.
82
76
// /
83
77
// / > [!NOTE] The provided command does not invoke a terminal even if @@runInTerminal is true.
84
- Q_PROPERTY (QVector<QString> command READ command NOTIFY commandChanged BINDABLE bindableCommand);
78
+ Q_PROPERTY (QVector<QString> command READ default WRITE default NOTIFY commandChanged BINDABLE bindableCommand);
85
79
// / The working directory to execute from.
86
- Q_PROPERTY (
87
- QString workingDirectory READ workingDirectory NOTIFY workingDirectoryChanged BINDABLE
88
- bindableWorkingDirectory
89
- );
80
+ Q_PROPERTY (QString workingDirectory READ default WRITE default NOTIFY workingDirectoryChanged BINDABLE bindableWorkingDirectory);
90
81
// / If the application should run in a terminal.
91
- Q_PROPERTY (
92
- bool runInTerminal READ runInTerminal NOTIFY runInTerminalChanged BINDABLE
93
- bindableRunInTerminal
94
- );
95
- Q_PROPERTY (
96
- QVector<QString> categories READ categories NOTIFY categoriesChanged BINDABLE
97
- bindableCategories
98
- );
99
- Q_PROPERTY (
100
- QVector<QString> keywords READ keywords NOTIFY keywordsChanged BINDABLE bindableKeywords
101
- );
82
+ Q_PROPERTY (bool runInTerminal READ default WRITE default NOTIFY runInTerminalChanged BINDABLE bindableRunInTerminal);
83
+ Q_PROPERTY (QVector<QString> categories READ default WRITE default NOTIFY categoriesChanged BINDABLE bindableCategories);
84
+ Q_PROPERTY (QVector<QString> keywords READ default WRITE default NOTIFY keywordsChanged BINDABLE bindableKeywords);
85
+ // clang-format on
102
86
Q_PROPERTY (QVector<DesktopAction*> actions READ actions CONSTANT);
103
87
QML_ELEMENT;
104
88
QML_UNCREATABLE (" DesktopEntry instances must be retrieved from DesktopEntries" );
@@ -125,19 +109,6 @@ class DesktopEntry: public QObject {
125
109
[[nodiscard]] bool isValid () const ;
126
110
[[nodiscard]] QVector<DesktopAction*> actions () const ;
127
111
128
- [[nodiscard]] QString name () const { return this ->bName ; }
129
- [[nodiscard]] QString genericName () const { return this ->bGenericName ; }
130
- [[nodiscard]] QString startupClass () const { return this ->bStartupClass ; }
131
- [[nodiscard]] bool noDisplay () const { return this ->bNoDisplay ; }
132
- [[nodiscard]] QString comment () const { return this ->bComment ; }
133
- [[nodiscard]] QString icon () const { return this ->bIcon ; }
134
- [[nodiscard]] QString execString () const { return this ->bExecString ; }
135
- [[nodiscard]] QVector<QString> command () const { return this ->bCommand ; }
136
- [[nodiscard]] QString workingDirectory () const { return this ->bWorkingDirectory ; }
137
- [[nodiscard]] bool runInTerminal () const { return this ->bRunInTerminal ; }
138
- [[nodiscard]] QVector<QString> categories () const { return this ->bCategories ; }
139
- [[nodiscard]] QVector<QString> keywords () const { return this ->bKeywords ; }
140
-
141
112
[[nodiscard]] QBindable<QString> bindableName () const { return &this ->bName ; }
142
113
[[nodiscard]] QBindable<QString> bindableGenericName () const { return &this ->bGenericName ; }
143
114
[[nodiscard]] QBindable<QString> bindableStartupClass () const { return &this ->bStartupClass ; }
@@ -237,14 +208,13 @@ class DesktopEntry: public QObject {
237
208
class DesktopAction : public QObject {
238
209
Q_OBJECT;
239
210
Q_PROPERTY (QString id MEMBER mId CONSTANT);
240
- Q_PROPERTY (QString name READ name NOTIFY nameChanged BINDABLE bindableName);
241
- Q_PROPERTY (QString icon READ icon NOTIFY iconChanged BINDABLE bindableIcon);
211
+ // clang-format off
212
+ Q_PROPERTY (QString name READ default WRITE default NOTIFY nameChanged BINDABLE bindableName);
213
+ Q_PROPERTY (QString icon READ default WRITE default NOTIFY iconChanged BINDABLE bindableIcon);
242
214
// / The raw `Exec` string from the action.
243
215
// /
244
216
// / > [!WARNING] This cannot be reliably run as a command. See @@command for one you can run.
245
- Q_PROPERTY (
246
- QString execString READ execString NOTIFY execStringChanged BINDABLE bindableExecString
247
- );
217
+ Q_PROPERTY (QString execString READ default WRITE default NOTIFY execStringChanged BINDABLE bindableExecString);
248
218
// / The parsed `Exec` command in the action.
249
219
// /
250
220
// / The entry can be run with @@execute(), or by using this command in
@@ -253,7 +223,8 @@ class DesktopAction: public QObject {
253
223
// / the invoked process.
254
224
// /
255
225
// / > [!NOTE] The provided command does not invoke a terminal even if @@runInTerminal is true.
256
- Q_PROPERTY (QVector<QString> command READ command NOTIFY commandChanged BINDABLE bindableCommand);
226
+ Q_PROPERTY (QVector<QString> command READ default WRITE default NOTIFY commandChanged BINDABLE bindableCommand);
227
+ // clang-format on
257
228
QML_ELEMENT;
258
229
QML_UNCREATABLE (" DesktopAction instances must be retrieved from a DesktopEntry" );
259
230
@@ -269,11 +240,6 @@ class DesktopAction: public QObject {
269
240
// / and @@DesktopEntry.workingDirectory.
270
241
Q_INVOKABLE void execute () const ;
271
242
272
- [[nodiscard]] QString name () const { return this ->bName ; }
273
- [[nodiscard]] QString icon () const { return this ->bIcon ; }
274
- [[nodiscard]] QString execString () const { return this ->bExecString ; }
275
- [[nodiscard]] QVector<QString> command () const { return this ->bCommand ; }
276
-
277
243
[[nodiscard]] QBindable<QString> bindableName () const { return &this ->bName ; }
278
244
[[nodiscard]] QBindable<QString> bindableIcon () const { return &this ->bIcon ; }
279
245
[[nodiscard]] QBindable<QString> bindableExecString () const { return &this ->bExecString ; }
0 commit comments