Commit Graph

291 Commits

Author SHA1 Message Date
ComixHe
d35ef8ae1f feat: add property 'X_Deepin_Vender'
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-11-06 16:32:58 +08:00
ComixHe
e61c8ae17a fix: add checks before reading from value
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-11-06 13:21:43 +08:00
ComixHe
ff5f2062c3 fix: add necessary check before take execArgs
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-11-06 13:21:43 +08:00
ComixHe
03deb2c935 feat: add Method "KillAll"
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-11-05 23:38:29 +08:00
ComixHe
dd3cbd6a6e fix: complete dbus out args
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-30 17:45:55 +08:00
ComixHe
054feb9739 fix: add fallback when query mime type
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-30 16:24:34 +08:00
ComixHe
1fe387b5a3 refact: support query default application of a file or a mime type
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-30 16:21:19 +08:00
ComixHe
a929bed0b2 fix: detected error 'stack-use-after-scope'
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-25 17:54:55 +08:00
ComixHe
8f6628c5d2 feat: add ProcessGuesser1 service
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-19 15:33:12 +08:00
ComixHe
f796535233 fix: unescape exec before pass this arg to wordexp
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-19 15:16:40 +08:00
ComixHe
5597ba5c44 fix: compatible with gcc 11
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-18 13:59:27 +08:00
black-desk
fc5184bab4 fix: include QStringBuilder and improve api doc
log:
2023-10-17 11:44:02 +08:00
ComixHe
1f73eea404 feat: add desktopfilegenerator and method addUserApplication
1. change type of ActionName to 'a{sa{ss}}'
2. refactor the method of serialization

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-17 11:44:02 +08:00
ComixHe
aff8cff0ec refact: change underlying type of desktop entry
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-13 10:08:56 +08:00
ComixHe
de1bf515d8 feat: add Terminal and ScaleFactor property
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-11 17:24:08 +08:00
ComixHe
f63741b023 feat: add mimeManager Service
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-08 18:33:35 +08:00
ComixHe
8970298ad0 feat: support set application's working directory
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-08 14:44:31 +08:00
ComixHe
fb0fc0a8ee feat: support application hooks
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-10-07 17:14:48 +08:00
ComixHe
f233279466 fix: remove displayName and export name/genericName
issue: https://github.com/linuxdeepin/developer-center/issues/5765

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-28 16:30:56 +08:00
ComixHe
2b5fc291d4 fix: should't move singelSlot
add some comment

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-19 16:22:10 +08:00
ComixHe
bbe0551ffb fix: launch autostart application after scaleFactor has been set
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-19 13:17:25 +08:00
ComixHe
7d94a8b71d fix: relink to autostart when dekstopFile has been changed
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-15 15:02:19 +08:00
ComixHe
b2b5c23a2b feat: send PropertiesChanged after reset Application's entry
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-15 13:56:32 +08:00
ComixHe
51459ee33a feat: relay InstanceService PropertiesChanged signal
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-14 18:02:53 +08:00
ComixHe
6448481cfc refact: method Identify and CURD method of storage
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-14 17:41:16 +08:00
ComixHe
ebb5f613c4 refact: refactor method Identify and improve unit test
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-14 17:41:16 +08:00
ComixHe
bc7fbfb3a1 feat: add property Launcher, Orphaned
refactor some method which are related with systemd unit

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-14 17:41:16 +08:00
ComixHe
23dcd13f10 feat: support persistent stroage and lastLaunchedTime
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-14 17:41:16 +08:00
ComixHe
7b527c609b refact: use standard DBus interface
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-12 10:59:40 +08:00
ComixHe
6a95a97599 refact: use graphical-session.target's InvocationID to determine
autostart

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-12 10:59:40 +08:00
ComixHe
6368bf61cf fix: correct signal index
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-11 18:04:57 +08:00
ComixHe
49c13f943e feat: support cgroup v1 and v2
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-11 15:15:54 +08:00
ComixHe
98ef11dc27 refact: guarantee XDG_CONFIG_HOME is first element
and ensure that config dirs only has an XDG_CONFIG_HOME

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-11 15:15:54 +08:00
ComixHe
3f38233306 refact: use QFileInfo to get File's timeInfo
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-11 15:15:54 +08:00
ComixHe
dc96c21c7d feat: emit signal when AutoStart Changed
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-08 08:53:46 +00:00
ComixHe
ac71f99bc6
fix: Compatible with previous DEEPIN_WINE_SCALE handling
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-07 17:17:59 +08:00
ComixHe
55e3aa2fae feat: add property 'NoDisplay'
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-07 13:04:24 +08:00
ComixHe
2c1f35b820 fix: remove filed codes '%f'
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-07 10:41:00 +08:00
ComixHe
1776fa95d5 fix: interfaceRemoved isn't be emit after application uninstall
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-07 10:41:00 +08:00
ComixHe
6561747c7d refact: Compatible with Qt 6.2
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 17:01:06 +08:00
ComixHe
cc4c928dc1 feat: connect to system bus signal for monitor application changed
for dpkg

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 16:26:38 +08:00
ComixHe
7fa60d9b3d fix: application filter error
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 16:26:38 +08:00
ComixHe
8d033daf6b fix: Manual removal of symbolic links leads to state error
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 13:57:18 +08:00
ComixHe
4d6e399653 refact: method UpdateApplicationInfo change to ReloadApplications
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 13:57:18 +08:00
ComixHe
ebe218b70e fix: AM crashed when Launch failed
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 10:59:58 +08:00
ComixHe
897db2c85a feat: filter some application which shouldn't be shown
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-06 10:59:58 +08:00
black-desk
4ff60db556 refact: improve scanAutoStart
improve scanAutoStart
2023-09-05 11:48:14 +08:00
black-desk
7d0c5bb615 refact: remove IconMap
remove unused types
2023-09-05 11:48:14 +08:00
ComixHe
acba7b727e feat: support AutoStart
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-05 11:48:14 +08:00
ComixHe
30a03974f3 refact: refactor ApplicationService::Launch method
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-04 16:33:43 +08:00
ComixHe
68996388b1 fix: AM crashed when call update method but application can't found
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-04 16:33:43 +08:00
ComixHe
70c7b92e0e refact: return dbus error when application service's method failed
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-04 16:33:43 +08:00
ComixHe
94f7b3c01d fix: correct property check logic
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-01 17:15:40 +08:00
ComixHe
ca24d2d908 feat: add method SendToDesktop/RemoveFromDesktop, Property isOnDesktop
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-01 17:15:40 +08:00
ComixHe
40babe8aae refact!: change DBus Service Name and ObjectPath Name
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-01 17:15:40 +08:00
ComixHe
4c9d4491df refact: remove unnecessary open operation
fix AM can't access some dirs due to
systemd 254's sandboxing option: PrivateUser
is true by default.

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-09-01 15:58:16 +08:00
black-desk
d1bdab899d feat: add property installedTime,X-flatpak,X-linglong
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-31 16:55:35 +08:00
ComixHe
c99a1b5d6a fix: correct action key
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-31 16:55:35 +08:00
ComixHe
1fb4539792 feat: add env option and refactor command generate method
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-31 15:54:40 +08:00
ComixHe
8ab6adc290 feat: add categories for application service
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-30 16:08:59 +08:00
black-desk
3df26e4fc2 build: DDE_DEBUG_MODE->USE_DEBUG_DBUS_NAME
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-30 15:02:29 +08:00
ComixHe
f2d5b7b307 refact: remove static env instance
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-30 15:02:29 +08:00
ComixHe
d00cd17f2e refact: change DEBUG_MODE to DDE_DEBUG_MODE
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-29 15:20:25 +08:00
ComixHe
64454bd149 refact!: change property IconName to Icons
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-29 13:34:27 +08:00
ComixHe
26a0b67157 feat: filter service and scope by subState and app prefix
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-29 13:07:44 +08:00
black-desk
b0dd943e1d fix: adjust processUnitName
`<2` should be fine to make later two takeLast work fine and avoid crash.

It seems that `<3` will
make kde scope (without launcher in unit name) not working.
2023-08-29 10:19:32 +08:00
black-desk
6adc02375f feat: scan existing systemd unit
We should scan existing systemd unit when we start application manager.
As application manager crash and restarted later,
we can get the launched application instances back.
2023-08-29 10:07:26 +08:00
black-desk
02317993c8 fix: call "Subscribe" before connect to systemd
systemd will only send UnitNew/UnitRemoved after Subscribe called.
2023-08-29 10:07:26 +08:00
ComixHe
8a662314f2 fix: core dumped under Qt 6.4
call method metaObject of QMetaType will coredump under Qt 6.4

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-29 10:07:26 +08:00
black-desk
25a7acb6fd Revert "fix: core dumped under Qt 6.4"
Github bug makes me commit wrong content, revert it.

This reverts commit 6fae5a758b.
2023-08-29 10:06:57 +08:00
ComixHe
6fae5a758b fix: core dumped under Qt 6.4
1. call method metaObject of QMetaType will coredump under Qt 6.4
2. remove `std::terminate()` when AM can't connect to Systemd Signals.
3. call `Subscribe` before connecting to Systemd Signals to guarantee that
   systemd will send UnitNew and UnitRemoved.

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-29 09:58:02 +08:00
ComixHe
ce2148e5cd fix: incorrect behavior when parse and launch
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-25 18:23:21 +08:00
black-desk
3988e0c526 refact: improve desktop parsing 2023-08-25 18:23:21 +08:00
black-desk
a16754647a refact: introduce hasNonAsciiAndControlCharacters
Make regex thread_local.
2023-08-25 18:23:21 +08:00
black-desk
17536bca3b refact: add some comments to DesktopEntry::parseGroupHeader
1. remove extra - in that regex;
2. add some comments;
3. correct that typo in method name.
2023-08-25 18:23:21 +08:00
black-desk
9f6ab28672 feat: add a warning log for invalid locale 2023-08-25 18:23:21 +08:00
ComixHe
ccfb245419 refact: Desktop file parsing process and Application methods to
Properties

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-25 18:23:21 +08:00
ComixHe
9f2a8b6798 feat: add property "LastLaunchedTime"
1. reactor some utils implementation.
2. remove constexpr before `decltype(auto)` due to GCC bug.
refer: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102229

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-23 17:46:57 +08:00
ComixHe
2bdb9e99ee refact: optimize regular expression initialization
add profiling test.

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00
ComixHe
06ee5e5899 refact: DesktopFile's method and structure
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00
ComixHe
920594d6e5 refact: ApplicationService ctor and some member functions
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00
ComixHe
0e7d84f61d refact: change dbus api and service impl
1. change IconName and DisplayName to method
2. refactor impl of GetManagedObject and move it to global.h
3. refactor impl of JobService::status
4. add ut_job.cpp

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00
ComixHe
d49a99d252 feat: add objectManager interface
refact the way to get DBus interface from Qt Meta System

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00
ComixHe
bb83716d27 feat: change dbus interface api
1. remove method: Application, Launch. (ApplicationManager1)
2. add property: IconName, DisplayName. (Application1)
3. refact the way of construct ApplicationService.
4. if Desktop Entry Key `Hidden` is true, this application wouldn't
   export to DBus.

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-22 11:42:13 +08:00
ComixHe
a3dd315e33 test: add identify test
fix some bugs found in testing

Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-16 17:54:42 +08:00
ComixHe
de09f3dbc2 refact: add test-coverage.sh and some docs
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-16 17:54:42 +08:00
black-desk
c4c1d72568 refact: hidden escaped app id in dbus object path
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
black-desk
b0c3475a3d fix: correct getXDGDataDirs
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
ComixHe
2fa74e40e5 refact: change implementation of UpdateApplicationInfo
adjust the way of get XDG_DATA_DIRS.

Signed-off-by: ComixHe <heyuming@deepin.org>
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
black-desk
5183716873 refact: apply review suggestions
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
ComixHe
bc2bdf559e example: add launch application example
fix some bug while testing the example

Signed-off-by: ComixHe <heyuming@deepin.org>
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
ComixHe
722d0666d3 feat: add impl of updateApplicationInfo
1. change the way to traverse files
2. refact some code

Signed-off-by: ComixHe <heyuming@deepin.org>
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
ComixHe
799100436c feat: watch systemd unit new and remove to sync state
add default values to XDG_DATA_DIRS if it dosen't set

Signed-off-by: ComixHe <heyuming@deepin.org>
Signed-off-by: black-desk <me@black-desk.cn>
2023-08-14 13:39:05 +08:00
black-desk
4687265e65 refact: restructure project
1. adjust project structure;
2. use config.h to locate app-launch-helper binary.
2023-08-07 16:46:57 +08:00
ComixHe
fe284e78b6 feat: implementation of the major feature of dbus service
Log:
Signed-off-by: ComixHe <heyuming@deepin.org>
2023-08-07 16:46:57 +08:00
black-desk
857db2625a style: format code 2023-07-21 14:50:57 +08:00
heyuming
5fed3ed9f0 feat: add test for desktopentry and jobmanager
Log:
2023-07-21 14:50:57 +08:00
heyuming
d288752fb3 feat: finish dbus service: job/jobManager
Log:
2023-07-18 16:37:52 +08:00
heyuming
3a278bec79 feat: adjust dbus service structure
Log:
2023-07-17 16:20:15 +08:00
heyuming
6f598ab52b feat: add desktopentry class
Log:
2023-07-14 12:05:35 +08:00