Merge lp:~3v1n0/libappindicator/discord-indicator-crash-fix into lp:libappindicator/16.10
- discord-indicator-crash-fix
- Merge into trunk.16.10
Status: | Superseded |
---|---|
Proposed branch: | lp:~3v1n0/libappindicator/discord-indicator-crash-fix |
Merge into: | lp:libappindicator/16.10 |
Diff against target: |
1792 lines (+1068/-153) 13 files modified
bindings/Makefile.am (+3/-6) configure.ac (+3/-33) debian/changelog (+88/-0) debian/control (+12/-41) debian/libappindicator-dev.install (+0/-2) debian/rules (+5/-23) docs/reference/Makefile.am (+1/-1) example/simple-client-vala.vala (+1/-1) src/Makefile.am (+13/-17) src/app-indicator.c (+149/-21) src/indicator-desktop-shortcuts.c (+705/-0) src/indicator-desktop-shortcuts.h (+80/-0) tests/Makefile.am (+8/-8) |
To merge this branch: | bzr merge lp:~3v1n0/libappindicator/discord-indicator-crash-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Marco Trevisan (Treviño) | Approve | ||
Review via email: mp+381930@code.launchpad.net |
This proposal has been superseded by a proposal from 2020-04-08.
Commit message
Description of the change
Marco Trevisan (Treviño) (3v1n0) : | # |
- 294. By William Grant
-
Disable mono on riscv64 too
- 295. By Paul G <Unknown>
-
app-indicator: Don't pass unexpected parameter to signal emissions
cleaned up all g_signal_emit and g_signal_new calls so they correspond with
each other and make sense.No external API changes.
LP: #1867996
- 296. By Ash Holland <Unknown>
-
app-indicator: Only check for item numbers when iterating array
- 297. By Marco Trevisan (Treviño)
-
Update changelog
Unmerged revisions
- 297. By Marco Trevisan (Treviño)
-
Update changelog
- 296. By Ash Holland <Unknown>
-
app-indicator: Only check for item numbers when iterating array
- 295. By Paul G <Unknown>
-
app-indicator: Don't pass unexpected parameter to signal emissions
cleaned up all g_signal_emit and g_signal_new calls so they correspond with
each other and make sense.No external API changes.
LP: #1867996
- 294. By William Grant
-
Disable mono on riscv64 too
- 293. By Sebastien Bacher
-
releasing package libappindicator version 12.10.1+
18.04.20180322. 1-0ubuntu5 - 292. By Jeremy Bícha
-
Drop python-appindicator and gir1.2-
appindicator- 0.1 packages
(LP: #1740637) - 291. By Sebastien Bacher
-
releasing package libappindicator version 12.10.1+
18.04.20180322. 1-0ubuntu4 - 290. By Dimitri John Ledkov
-
releasing package libappindicator version 12.10.1+
18.04.20180322. 1-0ubuntu2 - 289. By Dimitri John Ledkov
-
Vendorize indicator-
desktop- shortcuts (convenience wrapper around
gdesktopappinfo) from libindicator project, to drop the dependency on
libindicator as none of the rest of it is used. - 288. By CI Train Bot Account
-
Releasing 12.10.1+
18.04.20180322. 1-0ubuntu1
Preview Diff
1 | === modified file 'bindings/Makefile.am' | |||
2 | --- bindings/Makefile.am 2012-06-10 07:32:04 +0000 | |||
3 | +++ bindings/Makefile.am 2020-04-08 18:54:42 +0000 | |||
4 | @@ -1,10 +1,7 @@ | |||
5 | 1 | SUBDIRS = | ||
6 | 2 | |||
7 | 1 | if USE_GTK3 | 3 | if USE_GTK3 |
14 | 2 | SUBDIRS = \ | 4 | SUBDIRS += vala |
9 | 3 | vala | ||
10 | 4 | else | ||
11 | 5 | SUBDIRS = \ | ||
12 | 6 | python \ | ||
13 | 7 | vala | ||
15 | 8 | endif | 5 | endif |
16 | 9 | 6 | ||
17 | 10 | if HAS_MONO | 7 | if HAS_MONO |
18 | 11 | 8 | ||
19 | === removed directory 'bindings/python' | |||
20 | === removed file 'bindings/python/Makefile.am' | |||
21 | === removed file 'bindings/python/__init__.py' | |||
22 | === removed file 'bindings/python/appindicator-arg-types.py' | |||
23 | === removed file 'bindings/python/appindicator.defs' | |||
24 | === removed file 'bindings/python/appindicator.override.in' | |||
25 | === removed file 'bindings/python/appindicatormodule.c' | |||
26 | === modified file 'configure.ac' | |||
27 | --- configure.ac 2013-01-29 17:50:13 +0000 | |||
28 | +++ configure.ac 2020-04-08 18:54:42 +0000 | |||
29 | @@ -44,7 +44,6 @@ | |||
30 | 44 | GTK3_REQUIRED_VERSION=2.91 | 44 | GTK3_REQUIRED_VERSION=2.91 |
31 | 45 | GLIB_REQUIRED_VERSION=2.35.4 | 45 | GLIB_REQUIRED_VERSION=2.35.4 |
32 | 46 | GIO_REQUIRED_VERSION=2.26 | 46 | GIO_REQUIRED_VERSION=2.26 |
33 | 47 | INDICATOR_REQUIRED_VERSION=0.4.93 | ||
34 | 48 | DBUSMENUGTK_REQUIRED_VERSION=0.5.90 | 47 | DBUSMENUGTK_REQUIRED_VERSION=0.5.90 |
35 | 49 | DBUS_GLIB_REQUIRED_VERSION=0.82 | 48 | DBUS_GLIB_REQUIRED_VERSION=0.82 |
36 | 50 | 49 | ||
37 | @@ -56,16 +55,16 @@ | |||
38 | 56 | AS_IF([test "x$with_gtk" = x3], | 55 | AS_IF([test "x$with_gtk" = x3], |
39 | 57 | [PKG_CHECK_MODULES(LIBRARY, gtk+-3.0 >= $GTK3_REQUIRED_VERSION | 56 | [PKG_CHECK_MODULES(LIBRARY, gtk+-3.0 >= $GTK3_REQUIRED_VERSION |
40 | 58 | glib-2.0 >= $GLIB_REQUIRED_VERSION | 57 | glib-2.0 >= $GLIB_REQUIRED_VERSION |
41 | 58 | gio-unix-2.0 | ||
42 | 59 | gio-2.0 >= $GIO_REQUIRED_VERSION | 59 | gio-2.0 >= $GIO_REQUIRED_VERSION |
43 | 60 | indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION | ||
44 | 61 | dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) | 60 | dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) |
45 | 62 | AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available]) | 61 | AC_DEFINE(HAVE_GTK3, 1, [whether gtk3 is available]) |
46 | 63 | ], | 62 | ], |
47 | 64 | [test "x$with_gtk" = x2], | 63 | [test "x$with_gtk" = x2], |
48 | 65 | [PKG_CHECK_MODULES(LIBRARY, gtk+-2.0 >= $GTK_REQUIRED_VERSION | 64 | [PKG_CHECK_MODULES(LIBRARY, gtk+-2.0 >= $GTK_REQUIRED_VERSION |
49 | 66 | glib-2.0 >= $GLIB_REQUIRED_VERSION | 65 | glib-2.0 >= $GLIB_REQUIRED_VERSION |
50 | 66 | gio-unix-2.0 | ||
51 | 67 | gio-2.0 >= $GIO_REQUIRED_VERSION | 67 | gio-2.0 >= $GIO_REQUIRED_VERSION |
52 | 68 | indicator-0.4 >= $INDICATOR_REQUIRED_VERSION | ||
53 | 69 | dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) | 68 | dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) |
54 | 70 | ], | 69 | ], |
55 | 71 | [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] | 70 | [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] |
56 | @@ -121,7 +120,7 @@ | |||
57 | 121 | RUNTIME=mono | 120 | RUNTIME=mono |
58 | 122 | fi | 121 | fi |
59 | 123 | 122 | ||
61 | 124 | AC_PATH_PROG(CSC, gmcs, no) | 123 | AC_PATH_PROG(CSC, mono-csc, no) |
62 | 125 | LIB_PREFIX=.so | 124 | LIB_PREFIX=.so |
63 | 126 | LIB_SUFFIX= | 125 | LIB_SUFFIX= |
64 | 127 | fi | 126 | fi |
65 | @@ -181,33 +180,6 @@ | |||
66 | 181 | with_localinstall="no" | 180 | with_localinstall="no" |
67 | 182 | AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [install all of the files localy instead of system directories (for distcheck)]), with_localinstall=$enableval, with_localinstall=no) | 181 | AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [install all of the files localy instead of system directories (for distcheck)]), with_localinstall=$enableval, with_localinstall=no) |
68 | 183 | 182 | ||
69 | 184 | ########################### | ||
70 | 185 | # Python | ||
71 | 186 | ########################### | ||
72 | 187 | |||
73 | 188 | PYGTK_REQUIRED=2.14.0 | ||
74 | 189 | PYGOBJECT_REQUIRED=0.22 | ||
75 | 190 | |||
76 | 191 | AM_PATH_PYTHON(2.3.5) | ||
77 | 192 | AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)]) | ||
78 | 193 | |||
79 | 194 | PKG_CHECK_MODULES(APPINDICATOR_PYTHON, | ||
80 | 195 | [ | ||
81 | 196 | pygtk-2.0 >= $PYGTK_REQUIRED | ||
82 | 197 | gtk+-2.0 >= $GTK_REQUIRED_VERSION | ||
83 | 198 | pygobject-2.0 >= $PYGOBJECT_REQUIRED | ||
84 | 199 | ]) | ||
85 | 200 | |||
86 | 201 | AC_MSG_CHECKING(for pygtk defs) | ||
87 | 202 | PYGTK_DEFSDIR=`$PKG_CONFIG --variable=defsdir pygtk-2.0` | ||
88 | 203 | AC_SUBST(PYGTK_DEFSDIR) | ||
89 | 204 | AC_MSG_RESULT($PYGTK_DEFSDIR) | ||
90 | 205 | |||
91 | 206 | AC_MSG_CHECKING(for pygtk codegen) | ||
92 | 207 | PYGTK_CODEGEN="$PYTHON `$PKG_CONFIG --variable=codegendir pygtk-2.0`/codegen.py" | ||
93 | 208 | AC_SUBST(PYGTK_CODEGEN) | ||
94 | 209 | AC_MSG_RESULT($PYGTK_CODEGEN) | ||
95 | 210 | |||
96 | 211 | ######################### | 183 | ######################### |
97 | 212 | # Check if build tests | 184 | # Check if build tests |
98 | 213 | ######################### | 185 | ######################### |
99 | @@ -239,8 +211,6 @@ | |||
100 | 239 | src/appindicator-0.1.pc | 211 | src/appindicator-0.1.pc |
101 | 240 | src/appindicator3-0.1.pc | 212 | src/appindicator3-0.1.pc |
102 | 241 | bindings/Makefile | 213 | bindings/Makefile |
103 | 242 | bindings/python/Makefile | ||
104 | 243 | bindings/python/appindicator.override | ||
105 | 244 | bindings/vala/Makefile | 214 | bindings/vala/Makefile |
106 | 245 | bindings/vala/examples/Makefile | 215 | bindings/vala/examples/Makefile |
107 | 246 | tests/Makefile | 216 | tests/Makefile |
108 | 247 | 217 | ||
109 | === modified file 'debian/changelog' | |||
110 | --- debian/changelog 2016-09-05 18:32:14 +0000 | |||
111 | +++ debian/changelog 2020-04-08 18:54:42 +0000 | |||
112 | @@ -1,3 +1,91 @@ | |||
113 | 1 | libappindicator (12.10.1+18.04.20180322.1-0ubuntu7) UNRELEASED; urgency=medium | ||
114 | 2 | |||
115 | 3 | [ Paul G ] | ||
116 | 4 | * app-indicator: Don't pass unexpected parameter to signal emissions | ||
117 | 5 | (LP: #1867996) | ||
118 | 6 | |||
119 | 7 | [ Ash Holland ] | ||
120 | 8 | * app-indicator: Only check for item numbers when iterating array | ||
121 | 9 | (LP: #1867996) | ||
122 | 10 | |||
123 | 11 | -- Marco Trevisan (Treviño) <marco@ubuntu.com> Wed, 08 Apr 2020 17:55:12 +0200 | ||
124 | 12 | |||
125 | 13 | libappindicator (12.10.1+18.04.20180322.1-0ubuntu6) focal; urgency=medium | ||
126 | 14 | |||
127 | 15 | * Disable mono on riscv64 too. | ||
128 | 16 | |||
129 | 17 | -- William Grant <wgrant@ubuntu.com> Mon, 06 Apr 2020 18:15:21 +1000 | ||
130 | 18 | |||
131 | 19 | libappindicator (12.10.1+18.04.20180322.1-0ubuntu5) focal; urgency=medium | ||
132 | 20 | |||
133 | 21 | * configure.ac: require gio-unix-2.0, it's need for gdesktopappinfo | ||
134 | 22 | which was added in one of the recent uploads | ||
135 | 23 | |||
136 | 24 | [ Jeremy Bicha ] | ||
137 | 25 | * Drop python-appindicator and gir1.2-appindicator-0.1 packages | ||
138 | 26 | (LP: #1740637) | ||
139 | 27 | |||
140 | 28 | -- Sebastien Bacher <seb128@ubuntu.com> Tue, 17 Dec 2019 15:36:01 +0100 | ||
141 | 29 | |||
142 | 30 | libappindicator (12.10.1+18.04.20180322.1-0ubuntu4) eoan; urgency=medium | ||
143 | 31 | |||
144 | 32 | * Don't build with -Werror. | ||
145 | 33 | * Drop hard coded dependency on multiarch-support. | ||
146 | 34 | |||
147 | 35 | -- Matthias Klose <doko@ubuntu.com> Sun, 01 Sep 2019 05:58:07 +0200 | ||
148 | 36 | |||
149 | 37 | libappindicator (12.10.1+18.04.20180322.1-0ubuntu2) disco; urgency=medium | ||
150 | 38 | |||
151 | 39 | * Vendorize indicator-desktop-shortcuts (convenience wrapper around | ||
152 | 40 | gdesktopappinfo) from libindicator project, to drop the dependency on | ||
153 | 41 | libindicator as none of the rest of it is used. | ||
154 | 42 | |||
155 | 43 | -- Dimitri John Ledkov <xnox@ubuntu.com> Thu, 21 Feb 2019 00:40:40 +0100 | ||
156 | 44 | |||
157 | 45 | libappindicator (12.10.1+18.04.20180322.1-0ubuntu1) bionic; urgency=medium | ||
158 | 46 | |||
159 | 47 | [ Unit 193 ] | ||
160 | 48 | * Have -dev package depend on libgtk2.0-dev or libgk-3-dev according | ||
161 | 49 | to its pkgconfig file (LP: #1757574) (LP: #1757574) | ||
162 | 50 | |||
163 | 51 | -- Jeremy Bicha <jbicha@ubuntu.com> Thu, 22 Mar 2018 01:16:11 +0000 | ||
164 | 52 | |||
165 | 53 | libappindicator (12.10.1+18.04.20180320-0ubuntu1) bionic; urgency=medium | ||
166 | 54 | |||
167 | 55 | [ Olivier Tilloy ] | ||
168 | 56 | * Fix build failures on bionic, (LP: #1757121) | ||
169 | 57 | |||
170 | 58 | -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 20 Mar 2018 12:48:14 +0000 | ||
171 | 59 | |||
172 | 60 | libappindicator (12.10.1+17.04.20170215-0ubuntu2) artful; urgency=medium | ||
173 | 61 | |||
174 | 62 | * debian/control: | ||
175 | 63 | - Downgrade libappindicator* recommending the indicator-application | ||
176 | 64 | service to suggests. Only some sessions wants it, while we still | ||
177 | 65 | link against the lib in multiple apps. | ||
178 | 66 | |||
179 | 67 | -- Didier Roche <didrocks@ubuntu.com> Wed, 19 Jul 2017 13:28:58 +0200 | ||
180 | 68 | |||
181 | 69 | libappindicator (12.10.1+17.04.20170215-0ubuntu1) zesty; urgency=medium | ||
182 | 70 | |||
183 | 71 | * app-indicator: don't append the snap prefix if the icon is saved in | ||
184 | 72 | a well known readable path | ||
185 | 73 | |||
186 | 74 | -- Marco Trevisan (Treviño) <mail@3v1n0.net> Wed, 15 Feb 2017 14:16:09 +0000 | ||
187 | 75 | |||
188 | 76 | libappindicator (12.10.1+17.04.20170213-0ubuntu1) zesty; urgency=medium | ||
189 | 77 | |||
190 | 78 | * AppIndicator: don't emit label cahanges when guide is still empty | ||
191 | 79 | |||
192 | 80 | -- Marco Trevisan (Treviño) <mail@3v1n0.net> Mon, 13 Feb 2017 17:16:38 +0000 | ||
193 | 81 | |||
194 | 82 | libappindicator (12.10.1+17.04.20161129-0ubuntu1) zesty; urgency=medium | ||
195 | 83 | |||
196 | 84 | * AppIndicator: fix icon and theme paths when running in $SNAP | ||
197 | 85 | environment (LP: #1600136) | ||
198 | 86 | |||
199 | 87 | -- Marco Trevisan (Treviño) <mail@3v1n0.net> Tue, 29 Nov 2016 18:04:06 +0000 | ||
200 | 88 | |||
201 | 1 | libappindicator (12.10.1+16.10.20160905-0ubuntu1) yakkety; urgency=medium | 89 | libappindicator (12.10.1+16.10.20160905-0ubuntu1) yakkety; urgency=medium |
202 | 2 | 90 | ||
203 | 3 | [ Alberts Muktupāvels ] | 91 | [ Alberts Muktupāvels ] |
204 | 4 | 92 | ||
205 | === modified file 'debian/control' | |||
206 | --- debian/control 2013-12-19 14:37:54 +0000 | |||
207 | +++ debian/control 2020-04-08 18:54:42 +0000 | |||
208 | @@ -1,31 +1,27 @@ | |||
209 | 1 | Source: libappindicator | 1 | Source: libappindicator |
210 | 2 | Section: gnome | 2 | Section: gnome |
211 | 3 | Priority: optional | 3 | Priority: optional |
212 | 4 | XS-Python-Version: all | ||
213 | 5 | Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com> | 4 | Maintainer: Ubuntu Desktop Team <ubuntu-desktop@lists.ubuntu.com> |
214 | 6 | Build-Depends: debhelper (>= 9), | 5 | Build-Depends: debhelper (>= 9), |
215 | 7 | dh-autoreconf, | 6 | dh-autoreconf, |
216 | 8 | python-all-dev, | ||
217 | 9 | at-spi2-core, | 7 | at-spi2-core, |
219 | 10 | cli-common-dev (>= 0.5.7) [!arm64 !ppc64el], | 8 | cli-common-dev (>= 0.5.7) [!arm64 !ppc64el !riscv64], |
220 | 9 | gnome-common, | ||
221 | 11 | gobject-introspection, | 10 | gobject-introspection, |
222 | 12 | intltool, | 11 | intltool, |
223 | 13 | gtk-doc-tools, | 12 | gtk-doc-tools, |
224 | 14 | libxml2-utils, | 13 | libxml2-utils, |
226 | 15 | libnunit-cil-dev [!arm64 !ppc64el], | 14 | libnunit-cil-dev [!arm64 !ppc64el !riscv64], |
227 | 16 | dbus-test-runner, | 15 | dbus-test-runner, |
228 | 17 | xvfb, | 16 | xvfb, |
229 | 18 | valac, | 17 | valac, |
231 | 19 | mono-devel (>= 2.4.3) [!arm64 !ppc64el], | 18 | mono-devel (>= 2.4.3) [!arm64 !ppc64el !riscv64], |
232 | 20 | libglib2.0-dev (>= 2.35.4), | 19 | libglib2.0-dev (>= 2.35.4), |
233 | 21 | libgtk-3-dev (>= 2.91.3), | 20 | libgtk-3-dev (>= 2.91.3), |
234 | 22 | libgtk2.0-dev (>= 2.12.0), | 21 | libgtk2.0-dev (>= 2.12.0), |
238 | 23 | python-gtk2-dev, | 22 | gtk-sharp2-gapi [!arm64 !ppc64el !riscv64], |
239 | 24 | gtk-sharp2-gapi [!arm64 !ppc64el], | 23 | libgtk2.0-cil-dev [!arm64 !ppc64el !riscv64], |
237 | 25 | libgtk2.0-cil-dev [!arm64 !ppc64el], | ||
240 | 26 | libdbus-glib-1-dev (>= 0.82), | 24 | libdbus-glib-1-dev (>= 0.82), |
241 | 27 | libindicator-dev (>= 0.3.90), | ||
242 | 28 | libindicator3-dev (>= 0.3.90), | ||
243 | 29 | libdbusmenu-glib-dev (>= 0.5.90), | 25 | libdbusmenu-glib-dev (>= 0.5.90), |
244 | 30 | libdbusmenu-gtk-dev (>= 0.5.90), | 26 | libdbusmenu-gtk-dev (>= 0.5.90), |
245 | 31 | libdbusmenu-gtk3-dev (>= 0.5.90), | 27 | libdbusmenu-gtk3-dev (>= 0.5.90), |
246 | @@ -35,54 +31,29 @@ | |||
247 | 35 | # If you aren't a member of ~indicator-applet-developers but need to upload | 31 | # If you aren't a member of ~indicator-applet-developers but need to upload |
248 | 36 | # packaging changes, just go ahead. ~indicator-applet-developers will notice | 32 | # packaging changes, just go ahead. ~indicator-applet-developers will notice |
249 | 37 | # and sync up the code again. | 33 | # and sync up the code again. |
266 | 38 | Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/libappindicator/trunk.13.04 | 34 | Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/libappindicator/trunk.16.10 |
267 | 39 | Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/libappindicator/trunk.13.04/files | 35 | Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/libappindicator/trunk.16.10/files |
252 | 40 | |||
253 | 41 | Package: python-appindicator | ||
254 | 42 | Section: python | ||
255 | 43 | Architecture: any | ||
256 | 44 | XB-Python-Version: ${python:Versions} | ||
257 | 45 | Depends: ${shlibs:Depends}, | ||
258 | 46 | ${misc:Depends}, | ||
259 | 47 | ${python:Depends}, | ||
260 | 48 | libappindicator1 (= ${binary:Version}), | ||
261 | 49 | python-gobject, | ||
262 | 50 | Provides: ${python:Provides}, | ||
263 | 51 | Description: Python bindings for libappindicator | ||
264 | 52 | This package provides Python bindings so that you can use libappindicator from | ||
265 | 53 | a Python program. | ||
268 | 54 | 36 | ||
269 | 55 | Package: libappindicator1 | 37 | Package: libappindicator1 |
270 | 56 | Section: libs | 38 | Section: libs |
271 | 57 | Architecture: any | 39 | Architecture: any |
272 | 58 | Pre-Depends: multiarch-support, | ||
273 | 59 | Depends: ${shlibs:Depends}, | 40 | Depends: ${shlibs:Depends}, |
274 | 60 | ${misc:Depends}, | 41 | ${misc:Depends}, |
276 | 61 | Recommends: indicator-application (>= 0.2.93), | 42 | Suggests: indicator-application (>= 0.2.93), |
277 | 62 | Description: Application Indicators | 43 | Description: Application Indicators |
278 | 63 | A library and indicator to take menus from applications and place them in | 44 | A library and indicator to take menus from applications and place them in |
279 | 64 | the panel. | 45 | the panel. |
280 | 65 | . | 46 | . |
281 | 66 | This package contains shared libraries to be used by applications. | 47 | This package contains shared libraries to be used by applications. |
282 | 67 | 48 | ||
283 | 68 | Package: gir1.2-appindicator-0.1 | ||
284 | 69 | Section: introspection | ||
285 | 70 | Architecture: any | ||
286 | 71 | Depends: ${misc:Depends}, | ||
287 | 72 | ${gir:Depends}, | ||
288 | 73 | Description: Typelib files for libappindicator1. | ||
289 | 74 | . | ||
290 | 75 | This package can be used by other packages using the GIRepository format | ||
291 | 76 | to generate dynamic bindings. | ||
292 | 77 | |||
293 | 78 | Package: libappindicator-dev | 49 | Package: libappindicator-dev |
294 | 79 | Section: libdevel | 50 | Section: libdevel |
295 | 80 | Architecture: any | 51 | Architecture: any |
296 | 81 | Depends: ${shlibs:Depends}, | 52 | Depends: ${shlibs:Depends}, |
297 | 82 | ${misc:Depends}, | 53 | ${misc:Depends}, |
298 | 83 | gir1.2-appindicator-0.1 (= ${binary:Version}), | ||
299 | 84 | libdbusmenu-glib-dev (>= 0.1.8), | 54 | libdbusmenu-glib-dev (>= 0.1.8), |
300 | 85 | libdbus-glib-1-dev (>= 0.76), | 55 | libdbus-glib-1-dev (>= 0.76), |
301 | 56 | libgtk2.0-dev, | ||
302 | 86 | libappindicator1 (= ${binary:Version}), | 57 | libappindicator1 (= ${binary:Version}), |
303 | 87 | Description: Application Indicators | 58 | Description: Application Indicators |
304 | 88 | A library and indicator to take menus from applications and place them in | 59 | A library and indicator to take menus from applications and place them in |
305 | @@ -103,10 +74,9 @@ | |||
306 | 103 | Package: libappindicator3-1 | 74 | Package: libappindicator3-1 |
307 | 104 | Section: libs | 75 | Section: libs |
308 | 105 | Architecture: any | 76 | Architecture: any |
309 | 106 | Pre-Depends: multiarch-support, | ||
310 | 107 | Depends: ${shlibs:Depends}, | 77 | Depends: ${shlibs:Depends}, |
311 | 108 | ${misc:Depends}, | 78 | ${misc:Depends}, |
313 | 109 | Recommends: indicator-application (>= 0.2.93), | 79 | Suggests: indicator-application (>= 0.2.93), |
314 | 110 | Description: Application Indicators | 80 | Description: Application Indicators |
315 | 111 | A library and indicator to take menus from applications and place them in | 81 | A library and indicator to take menus from applications and place them in |
316 | 112 | the panel. | 82 | the panel. |
317 | @@ -121,6 +91,7 @@ | |||
318 | 121 | gir1.2-appindicator3-0.1 (= ${binary:Version}), | 91 | gir1.2-appindicator3-0.1 (= ${binary:Version}), |
319 | 122 | libdbusmenu-glib-dev (>= 0.1.8), | 92 | libdbusmenu-glib-dev (>= 0.1.8), |
320 | 123 | libdbus-glib-1-dev (>= 0.76), | 93 | libdbus-glib-1-dev (>= 0.76), |
321 | 94 | libgtk-3-dev, | ||
322 | 124 | libappindicator3-1 (= ${binary:Version}), | 95 | libappindicator3-1 (= ${binary:Version}), |
323 | 125 | Description: Application Indicators | 96 | Description: Application Indicators |
324 | 126 | A library and indicator to take menus from applications and place them in | 97 | A library and indicator to take menus from applications and place them in |
325 | 127 | 98 | ||
326 | === removed file 'debian/gir1.2-appindicator-0.1.install' | |||
327 | === modified file 'debian/libappindicator-dev.install' | |||
328 | --- debian/libappindicator-dev.install 2012-11-27 02:18:17 +0000 | |||
329 | +++ debian/libappindicator-dev.install 2020-04-08 18:54:42 +0000 | |||
330 | @@ -1,5 +1,3 @@ | |||
331 | 1 | usr/include/libappindicator-0.1/* | 1 | usr/include/libappindicator-0.1/* |
332 | 2 | usr/lib/*/libappindicator.so | 2 | usr/lib/*/libappindicator.so |
333 | 3 | usr/lib/*/pkgconfig/appindicator-0.1.pc | 3 | usr/lib/*/pkgconfig/appindicator-0.1.pc |
334 | 4 | usr/share/gir-1.0/AppIndicator-0.1.gir | ||
335 | 5 | usr/share/vala/vapi/appindicator-0.1.vapi | ||
336 | 6 | 4 | ||
337 | === removed file 'debian/python-appindicator.install' | |||
338 | === modified file 'debian/rules' (properties changed: +x to -x) | |||
339 | --- debian/rules 2013-12-19 14:37:54 +0000 | |||
340 | +++ debian/rules 2020-04-08 18:54:42 +0000 | |||
341 | @@ -1,13 +1,12 @@ | |||
342 | 1 | #!/usr/bin/make -f | 1 | #!/usr/bin/make -f |
343 | 2 | 2 | ||
344 | 3 | FLAVORS = gtk2 gtk3 | 3 | FLAVORS = gtk2 gtk3 |
345 | 4 | PY_VERSIONS = $(shell pyversions --requested debian/control) | ||
346 | 5 | API_VERSION = 0.1 | 4 | API_VERSION = 0.1 |
347 | 6 | 5 | ||
348 | 7 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) | 6 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
349 | 8 | 7 | ||
350 | 9 | CONFIGURE_COMMON_FLAGS = --disable-scrollkeeper --enable-introspection | 8 | CONFIGURE_COMMON_FLAGS = --disable-scrollkeeper --enable-introspection |
352 | 10 | ifneq (,$(filter $(DEB_HOST_ARCH),arm64 ppc64el)) | 9 | ifneq (,$(filter $(DEB_HOST_ARCH),arm64 ppc64el riscv64)) |
353 | 11 | CONFIGURE_COMMON_FLAGS += --disable-mono-test | 10 | CONFIGURE_COMMON_FLAGS += --disable-mono-test |
354 | 12 | else | 11 | else |
355 | 13 | dh_extra_args = ,cli | 12 | dh_extra_args = ,cli |
356 | @@ -15,14 +14,12 @@ | |||
357 | 15 | CONFIGURE_FLAGS_gtk2 = --with-gtk=2 --enable-gtk-doc | 14 | CONFIGURE_FLAGS_gtk2 = --with-gtk=2 --enable-gtk-doc |
358 | 16 | CONFIGURE_FLAGS_gtk3 = --with-gtk=3 --enable-gtk-doc=no | 15 | CONFIGURE_FLAGS_gtk3 = --with-gtk=3 --enable-gtk-doc=no |
359 | 17 | 16 | ||
360 | 18 | export CSC=/usr/bin/mono-csc | ||
361 | 19 | |||
362 | 20 | export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 | 17 | export DPKG_GENSYMBOLS_CHECK_LEVEL = 4 |
363 | 21 | 18 | ||
364 | 22 | CFLAGS += -fPIC | 19 | CFLAGS += -fPIC |
365 | 23 | 20 | ||
366 | 24 | %: | 21 | %: |
368 | 25 | dh $@ --with autoreconf,python2,gir$(dh_extra_args) | 22 | dh $@ --with autoreconf,gir$(dh_extra_args) |
369 | 26 | 23 | ||
370 | 27 | override_dh_autoreconf: | 24 | override_dh_autoreconf: |
371 | 28 | NOCONFIGURE=1 dh_autoreconf ./autogen.sh | 25 | NOCONFIGURE=1 dh_autoreconf ./autogen.sh |
372 | @@ -32,24 +29,16 @@ | |||
373 | 32 | doconfigure-%: | 29 | doconfigure-%: |
374 | 33 | dh_auto_configure --builddirectory=build/$* -- $(CONFIGURE_FLAGS_$*) $(CONFIGURE_COMMON_FLAGS) | 30 | dh_auto_configure --builddirectory=build/$* -- $(CONFIGURE_FLAGS_$*) $(CONFIGURE_COMMON_FLAGS) |
375 | 34 | 31 | ||
376 | 35 | doconfigure-gtk2: $(PY_VERSIONS:%=doconfiguregtk2-%) | ||
377 | 36 | # GTK2 flavor configure was run on a per-python-version basis. | ||
378 | 37 | |||
379 | 38 | doconfiguregtk2-%: | 32 | doconfiguregtk2-%: |
382 | 39 | PYTHON=`which $*` \ | 33 | dh_auto_configure --builddirectory=build/gtk2 -- $(CONFIGURE_FLAGS_gtk2) $(CONFIGURE_COMMON_FLAGS) |
381 | 40 | dh_auto_configure --builddirectory=build/gtk2 -- $(CONFIGURE_FLAGS_gtk2) $(CONFIGURE_COMMON_FLAGS) | ||
383 | 41 | 34 | ||
384 | 42 | override_dh_auto_build: $(FLAVORS:%=dobuild-%) | 35 | override_dh_auto_build: $(FLAVORS:%=dobuild-%) |
385 | 43 | 36 | ||
386 | 44 | dobuild-%: | 37 | dobuild-%: |
387 | 45 | dh_auto_build --builddirectory=build/$* | 38 | dh_auto_build --builddirectory=build/$* |
388 | 46 | 39 | ||
389 | 47 | dobuild-gtk2: $(PY_VERSIONS:%=dobuildgtk2-%) | ||
390 | 48 | # GTK2 flavor build was run on a per-python-version basis. | ||
391 | 49 | |||
392 | 50 | dobuildgtk2-%: | 40 | dobuildgtk2-%: |
395 | 51 | PYTHON=`which $*` \ | 41 | dh_auto_build --builddirectory=build/gtk2 |
394 | 52 | dh_auto_build --builddirectory=build/gtk2 | ||
396 | 53 | 42 | ||
397 | 54 | override_dh_auto_install: $(FLAVORS:%=doinstall-%) | 43 | override_dh_auto_install: $(FLAVORS:%=doinstall-%) |
398 | 55 | 44 | ||
399 | @@ -61,9 +50,7 @@ | |||
400 | 61 | find debian/tmp -name \*.a -exec rm {} \; | 50 | find debian/tmp -name \*.a -exec rm {} \; |
401 | 62 | rm -rf debian/tmp/*/usr/lib/mono | 51 | rm -rf debian/tmp/*/usr/lib/mono |
402 | 63 | rm -rf debian/tmp/*/usr/share/vala/vapi/appindicator*-0.1.deps | 52 | rm -rf debian/tmp/*/usr/share/vala/vapi/appindicator*-0.1.deps |
403 | 64 | dh_install -ppython-appindicator --fail-missing --sourcedir=debian/tmp/gtk2 | ||
404 | 65 | dh_install -plibappindicator1 --fail-missing --sourcedir=debian/tmp/gtk2 | 53 | dh_install -plibappindicator1 --fail-missing --sourcedir=debian/tmp/gtk2 |
405 | 66 | dh_install -pgir1.2-appindicator-0.1 --fail-missing --sourcedir=debian/tmp/gtk2 | ||
406 | 67 | dh_install -plibappindicator-dev --fail-missing --sourcedir=debian/tmp/gtk2 | 54 | dh_install -plibappindicator-dev --fail-missing --sourcedir=debian/tmp/gtk2 |
407 | 68 | dh_install -plibappindicator-doc --fail-missing --sourcedir=debian/tmp/gtk2 | 55 | dh_install -plibappindicator-doc --fail-missing --sourcedir=debian/tmp/gtk2 |
408 | 69 | dh_install -plibappindicator3-1 --fail-missing --sourcedir=debian/tmp/gtk3 | 56 | dh_install -plibappindicator3-1 --fail-missing --sourcedir=debian/tmp/gtk3 |
409 | @@ -77,15 +64,10 @@ | |||
410 | 77 | dotest-%: | 64 | dotest-%: |
411 | 78 | dh_auto_test --builddirectory=build/$* -- | 65 | dh_auto_test --builddirectory=build/$* -- |
412 | 79 | 66 | ||
413 | 80 | |||
414 | 81 | dotest-gtk2: $(PY_VERSIONS:%=dotestgtk2-%) | ||
415 | 82 | # GTK2 flavor test was run on a per-python-version basis. | ||
416 | 83 | |||
417 | 84 | dotestgtk2-%: | 67 | dotestgtk2-%: |
418 | 85 | ps -ef | 68 | ps -ef |
419 | 86 | env | 69 | env |
422 | 87 | PYTHON=`which $*` \ | 70 | dh_auto_test --builddirectory=build/gtk2 -- |
421 | 88 | dh_auto_test --builddirectory=build/gtk2 -- | ||
423 | 89 | 71 | ||
424 | 90 | override_dh_auto_clean: | 72 | override_dh_auto_clean: |
425 | 91 | dh_auto_clean | 73 | dh_auto_clean |
426 | 92 | 74 | ||
427 | === modified file 'docs/reference/Makefile.am' | |||
428 | --- docs/reference/Makefile.am 2013-06-08 04:26:37 +0000 | |||
429 | +++ docs/reference/Makefile.am 2020-04-08 18:54:42 +0000 | |||
430 | @@ -33,7 +33,7 @@ | |||
431 | 33 | DOC_SOURCE_DIR=$(top_srcdir)/src | 33 | DOC_SOURCE_DIR=$(top_srcdir)/src |
432 | 34 | 34 | ||
433 | 35 | # Extra options to pass to gtkdoc-scangobj. Not normally needed. | 35 | # Extra options to pass to gtkdoc-scangobj. Not normally needed. |
435 | 36 | SCANGOBJ_OPTIONS=--nogtkinit --type-init-func="g_type_init()" | 36 | SCANGOBJ_OPTIONS=--type-init-func="g_type_init()" |
436 | 37 | 37 | ||
437 | 38 | # Extra options to supply to gtkdoc-scan. | 38 | # Extra options to supply to gtkdoc-scan. |
438 | 39 | # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" | 39 | # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" |
439 | 40 | 40 | ||
440 | === modified file 'example/simple-client-vala.vala' | |||
441 | --- example/simple-client-vala.vala 2012-03-21 18:02:41 +0000 | |||
442 | +++ example/simple-client-vala.vala 2020-04-08 18:54:42 +0000 | |||
443 | @@ -104,7 +104,7 @@ | |||
444 | 104 | print(@"Got scroll event! delta: $delta, direction: $direction\n"); | 104 | print(@"Got scroll event! delta: $delta, direction: $direction\n"); |
445 | 105 | }); | 105 | }); |
446 | 106 | 106 | ||
448 | 107 | Timeout.add_seconds(1, () => { | 107 | GLib.Timeout.add_seconds(1, () => { |
449 | 108 | percentage = (percentage + 1) % 100; | 108 | percentage = (percentage + 1) % 100; |
450 | 109 | if (can_haz_label) { | 109 | if (can_haz_label) { |
451 | 110 | ci.set_label(@"$(percentage+1)%", ""); | 110 | ci.set_label(@"$(percentage+1)%", ""); |
452 | 111 | 111 | ||
453 | === modified file 'src/Makefile.am' | |||
454 | --- src/Makefile.am 2013-12-19 14:37:54 +0000 | |||
455 | +++ src/Makefile.am 2020-04-08 18:54:42 +0000 | |||
456 | @@ -62,6 +62,8 @@ | |||
457 | 62 | dbus-shared.h \ | 62 | dbus-shared.h \ |
458 | 63 | generate-id.h \ | 63 | generate-id.h \ |
459 | 64 | generate-id.c \ | 64 | generate-id.c \ |
460 | 65 | indicator-desktop-shortcuts.c \ | ||
461 | 66 | indicator-desktop-shortcuts.h \ | ||
462 | 65 | gen-notification-item.xml.h \ | 67 | gen-notification-item.xml.h \ |
463 | 66 | gen-notification-item.xml.c \ | 68 | gen-notification-item.xml.c \ |
464 | 67 | gen-notification-watcher.xml.h \ | 69 | gen-notification-watcher.xml.h \ |
465 | @@ -71,12 +73,12 @@ | |||
466 | 71 | $(COVERAGE_LDFLAGS) \ | 73 | $(COVERAGE_LDFLAGS) \ |
467 | 72 | -version-info 1:0:0 \ | 74 | -version-info 1:0:0 \ |
468 | 73 | -no-undefined \ | 75 | -no-undefined \ |
470 | 74 | -export-symbols-regex "^[^_d].*" | 76 | -export-symbols-regex "^app_indicator_.*" |
471 | 75 | 77 | ||
472 | 76 | libappindicator_la_CFLAGS = \ | 78 | libappindicator_la_CFLAGS = \ |
473 | 77 | $(LIBRARY_CFLAGS) \ | 79 | $(LIBRARY_CFLAGS) \ |
474 | 78 | $(COVERAGE_CFLAGS) \ | 80 | $(COVERAGE_CFLAGS) \ |
476 | 79 | -Wall -Werror -Wno-error=deprecated-declarations \ | 81 | -Wall -Wno-error=deprecated-declarations \ |
477 | 80 | -DG_LOG_DOMAIN=\"libappindicator\" | 82 | -DG_LOG_DOMAIN=\"libappindicator\" |
478 | 81 | 83 | ||
479 | 82 | libappindicator_la_LIBADD = \ | 84 | libappindicator_la_LIBADD = \ |
480 | @@ -153,29 +155,23 @@ | |||
481 | 153 | $(addprefix $(srcdir)/,app-indicator.c) \ | 155 | $(addprefix $(srcdir)/,app-indicator.c) \ |
482 | 154 | $(addprefix $(srcdir)/,$(libappindicator_headers)) | 156 | $(addprefix $(srcdir)/,$(libappindicator_headers)) |
483 | 155 | 157 | ||
485 | 156 | AppIndicator$(VER)-0.1.gir: libappindicator$(VER).la | 158 | AppIndicator3-0.1.gir: libappindicator3.la |
486 | 157 | 159 | ||
488 | 158 | AppIndicator_0_1_gir_INCLUDES = \ | 160 | AppIndicator3_0_1_gir_INCLUDES = \ |
489 | 159 | GObject-2.0 \ | 161 | GObject-2.0 \ |
490 | 160 | $(GTKGIR) | 162 | $(GTKGIR) |
500 | 161 | AppIndicator_0_1_gir_CFLAGS = $(LIBRARY_CFLAGS) -I$(srcdir) -I$(top_builddir)/src | 163 | AppIndicator3_0_1_gir_CFLAGS = $(LIBRARY_CFLAGS) -I$(srcdir) -I$(top_builddir)/src |
501 | 162 | AppIndicator_0_1_gir_LIBS = libappindicator$(VER).la | 164 | AppIndicator3_0_1_gir_LIBS = libappindicator3.la |
502 | 163 | AppIndicator_0_1_gir_FILES = $(introspection_sources) | 165 | AppIndicator3_0_1_gir_FILES = $(introspection_sources) |
494 | 164 | # AppIndicator_0_1_gir_NAMESPACE = AppIndicator | ||
495 | 165 | |||
496 | 166 | AppIndicator3_0_1_gir_INCLUDES = $(AppIndicator_0_1_gir_INCLUDES) | ||
497 | 167 | AppIndicator3_0_1_gir_CFLAGS = $(AppIndicator_0_1_gir_CFLAGS) | ||
498 | 168 | AppIndicator3_0_1_gir_LIBS = $(AppIndicator_0_1_gir_LIBS) | ||
499 | 169 | AppIndicator3_0_1_gir_FILES = $(AppIndicator_0_1_gir_FILES) | ||
503 | 170 | # AppIndicator3_0_1_gir_NAMESPACE = AppIndicator | 166 | # AppIndicator3_0_1_gir_NAMESPACE = AppIndicator |
504 | 171 | 167 | ||
506 | 172 | INTROSPECTION_GIRS += AppIndicator$(VER)-0.1.gir | 168 | INTROSPECTION_GIRS += AppIndicator3-0.1.gir |
507 | 173 | 169 | ||
509 | 174 | AppIndicator$(VER)-0.1.metadata: AppIndicator$(VER)-0.1.gir | 170 | AppIndicator3-0.1.metadata: AppIndicator3-0.1.gir |
510 | 175 | cp -f $(srcdir)/$@.in $@ | 171 | cp -f $(srcdir)/$@.in $@ |
511 | 176 | 172 | ||
514 | 177 | BUILT_SOURCES += AppIndicator$(VER)-0.1.metadata | 173 | BUILT_SOURCES += AppIndicator3-0.1.metadata |
515 | 178 | CLEANFILES += AppIndicator$(VER)-0.1.metadata | 174 | CLEANFILES += AppIndicator3-0.1.metadata |
516 | 179 | 175 | ||
517 | 180 | girdir = $(datadir)/gir-1.0 | 176 | girdir = $(datadir)/gir-1.0 |
518 | 181 | gir_DATA = $(INTROSPECTION_GIRS) | 177 | gir_DATA = $(INTROSPECTION_GIRS) |
519 | 182 | 178 | ||
520 | === modified file 'src/app-indicator.c' | |||
521 | --- src/app-indicator.c 2015-07-02 17:03:37 +0000 | |||
522 | +++ src/app-indicator.c 2020-04-08 18:54:42 +0000 | |||
523 | @@ -36,7 +36,9 @@ | |||
524 | 36 | #include <libdbusmenu-gtk/client.h> | 36 | #include <libdbusmenu-gtk/client.h> |
525 | 37 | #include <libdbusmenu-gtk/parser.h> | 37 | #include <libdbusmenu-gtk/parser.h> |
526 | 38 | 38 | ||
528 | 39 | #include <libindicator/indicator-desktop-shortcuts.h> | 39 | #include "indicator-desktop-shortcuts.h" |
529 | 40 | |||
530 | 41 | #include <stdlib.h> | ||
531 | 40 | 42 | ||
532 | 41 | #include "app-indicator.h" | 43 | #include "app-indicator.h" |
533 | 42 | #include "app-indicator-enum-types.h" | 44 | #include "app-indicator-enum-types.h" |
534 | @@ -71,8 +73,11 @@ | |||
535 | 71 | AppIndicatorCategory category; | 73 | AppIndicatorCategory category; |
536 | 72 | AppIndicatorStatus status; | 74 | AppIndicatorStatus status; |
537 | 73 | gchar *icon_name; | 75 | gchar *icon_name; |
538 | 76 | gchar *absolute_icon_name; | ||
539 | 74 | gchar *attention_icon_name; | 77 | gchar *attention_icon_name; |
540 | 78 | gchar *absolute_attention_icon_name; | ||
541 | 75 | gchar *icon_theme_path; | 79 | gchar *icon_theme_path; |
542 | 80 | gchar *absolute_icon_theme_path; | ||
543 | 76 | DbusmenuServer *menuservice; | 81 | DbusmenuServer *menuservice; |
544 | 77 | GtkWidget *menu; | 82 | GtkWidget *menu; |
545 | 78 | GtkWidget *sec_activate_target; | 83 | GtkWidget *sec_activate_target; |
546 | @@ -190,6 +195,8 @@ | |||
547 | 190 | static void status_icon_menu_activate (GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data); | 195 | static void status_icon_menu_activate (GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data); |
548 | 191 | static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); | 196 | static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); |
549 | 192 | static gchar * append_panel_icon_suffix (const gchar * icon_name); | 197 | static gchar * append_panel_icon_suffix (const gchar * icon_name); |
550 | 198 | static gchar * get_real_theme_path (AppIndicator * self); | ||
551 | 199 | static gchar * append_snap_prefix (const gchar * path); | ||
552 | 193 | static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data); | 200 | static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data); |
553 | 194 | static void sec_activate_target_parent_changed(GtkWidget *menuitem, GtkWidget *old_parent, gpointer user_data); | 201 | static void sec_activate_target_parent_changed(GtkWidget *menuitem, GtkWidget *old_parent, gpointer user_data); |
554 | 195 | static GVariant * bus_get_prop (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * property, GError ** error, gpointer user_data); | 202 | static GVariant * bus_get_prop (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * property, GError ** error, gpointer user_data); |
555 | @@ -389,7 +396,7 @@ | |||
556 | 389 | "An additional place to look for icon names that may be installed by the application.", | 396 | "An additional place to look for icon names that may be installed by the application.", |
557 | 390 | NULL, | 397 | NULL, |
558 | 391 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); | 398 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); |
560 | 392 | 399 | ||
561 | 393 | /** | 400 | /** |
562 | 394 | * AppIndicator:connected: | 401 | * AppIndicator:connected: |
563 | 395 | * | 402 | * |
564 | @@ -501,7 +508,7 @@ | |||
565 | 501 | G_STRUCT_OFFSET (AppIndicatorClass, new_icon), | 508 | G_STRUCT_OFFSET (AppIndicatorClass, new_icon), |
566 | 502 | NULL, NULL, | 509 | NULL, NULL, |
567 | 503 | g_cclosure_marshal_VOID__VOID, | 510 | g_cclosure_marshal_VOID__VOID, |
569 | 504 | G_TYPE_NONE, 0, G_TYPE_NONE); | 511 | G_TYPE_NONE, 0); |
570 | 505 | 512 | ||
571 | 506 | /** | 513 | /** |
572 | 507 | * AppIndicator::new-attention-icon: | 514 | * AppIndicator::new-attention-icon: |
573 | @@ -515,7 +522,7 @@ | |||
574 | 515 | G_STRUCT_OFFSET (AppIndicatorClass, new_attention_icon), | 522 | G_STRUCT_OFFSET (AppIndicatorClass, new_attention_icon), |
575 | 516 | NULL, NULL, | 523 | NULL, NULL, |
576 | 517 | g_cclosure_marshal_VOID__VOID, | 524 | g_cclosure_marshal_VOID__VOID, |
578 | 518 | G_TYPE_NONE, 0, G_TYPE_NONE); | 525 | G_TYPE_NONE, 0); |
579 | 519 | 526 | ||
580 | 520 | /** | 527 | /** |
581 | 521 | * AppIndicator::new-status: | 528 | * AppIndicator::new-status: |
582 | @@ -563,7 +570,7 @@ | |||
583 | 563 | G_STRUCT_OFFSET (AppIndicatorClass, connection_changed), | 570 | G_STRUCT_OFFSET (AppIndicatorClass, connection_changed), |
584 | 564 | NULL, NULL, | 571 | NULL, NULL, |
585 | 565 | g_cclosure_marshal_VOID__BOOLEAN, | 572 | g_cclosure_marshal_VOID__BOOLEAN, |
587 | 566 | G_TYPE_NONE, 1, G_TYPE_BOOLEAN, G_TYPE_NONE); | 573 | G_TYPE_NONE, 1, G_TYPE_BOOLEAN); |
588 | 567 | 574 | ||
589 | 568 | /** | 575 | /** |
590 | 569 | * AppIndicator::new-icon-theme-path: | 576 | * AppIndicator::new-icon-theme-path: |
591 | @@ -640,6 +647,7 @@ | |||
592 | 640 | app_indicator_init (AppIndicator *self) | 647 | app_indicator_init (AppIndicator *self) |
593 | 641 | { | 648 | { |
594 | 642 | AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self); | 649 | AppIndicatorPrivate * priv = APP_INDICATOR_GET_PRIVATE(self); |
595 | 650 | self->priv = priv; | ||
596 | 643 | 651 | ||
597 | 644 | priv->id = NULL; | 652 | priv->id = NULL; |
598 | 645 | priv->clean_id = NULL; | 653 | priv->clean_id = NULL; |
599 | @@ -648,6 +656,7 @@ | |||
600 | 648 | priv->icon_name = NULL; | 656 | priv->icon_name = NULL; |
601 | 649 | priv->attention_icon_name = NULL; | 657 | priv->attention_icon_name = NULL; |
602 | 650 | priv->icon_theme_path = NULL; | 658 | priv->icon_theme_path = NULL; |
603 | 659 | priv->absolute_icon_theme_path = get_real_theme_path (self); | ||
604 | 651 | priv->menu = NULL; | 660 | priv->menu = NULL; |
605 | 652 | priv->menuservice = NULL; | 661 | priv->menuservice = NULL; |
606 | 653 | priv->ordering_index = 0; | 662 | priv->ordering_index = 0; |
607 | @@ -676,8 +685,6 @@ | |||
608 | 676 | (GBusNameVanishedCallback) name_vanished_handler, | 685 | (GBusNameVanishedCallback) name_vanished_handler, |
609 | 677 | self, NULL); | 686 | self, NULL); |
610 | 678 | 687 | ||
611 | 679 | self->priv = priv; | ||
612 | 680 | |||
613 | 681 | /* Start getting the session bus */ | 688 | /* Start getting the session bus */ |
614 | 682 | g_object_ref(self); /* ref for the bus creation callback */ | 689 | g_object_ref(self); /* ref for the bus creation callback */ |
615 | 683 | g_bus_get(G_BUS_TYPE_SESSION, NULL, bus_creation, self); | 690 | g_bus_get(G_BUS_TYPE_SESSION, NULL, bus_creation, self); |
616 | @@ -794,16 +801,31 @@ | |||
617 | 794 | priv->icon_name = NULL; | 801 | priv->icon_name = NULL; |
618 | 795 | } | 802 | } |
619 | 796 | 803 | ||
620 | 804 | if (priv->absolute_icon_name != NULL) { | ||
621 | 805 | g_free(priv->absolute_icon_name); | ||
622 | 806 | priv->absolute_icon_name = NULL; | ||
623 | 807 | } | ||
624 | 808 | |||
625 | 797 | if (priv->attention_icon_name != NULL) { | 809 | if (priv->attention_icon_name != NULL) { |
626 | 798 | g_free(priv->attention_icon_name); | 810 | g_free(priv->attention_icon_name); |
627 | 799 | priv->attention_icon_name = NULL; | 811 | priv->attention_icon_name = NULL; |
628 | 800 | } | 812 | } |
629 | 801 | 813 | ||
630 | 814 | if (priv->absolute_attention_icon_name != NULL) { | ||
631 | 815 | g_free(priv->absolute_attention_icon_name); | ||
632 | 816 | priv->absolute_attention_icon_name = NULL; | ||
633 | 817 | } | ||
634 | 818 | |||
635 | 802 | if (priv->icon_theme_path != NULL) { | 819 | if (priv->icon_theme_path != NULL) { |
636 | 803 | g_free(priv->icon_theme_path); | 820 | g_free(priv->icon_theme_path); |
637 | 804 | priv->icon_theme_path = NULL; | 821 | priv->icon_theme_path = NULL; |
638 | 805 | } | 822 | } |
640 | 806 | 823 | ||
641 | 824 | if (priv->absolute_icon_theme_path != NULL) { | ||
642 | 825 | g_free(priv->absolute_icon_theme_path); | ||
643 | 826 | priv->absolute_icon_theme_path = NULL; | ||
644 | 827 | } | ||
645 | 828 | |||
646 | 807 | if (priv->title != NULL) { | 829 | if (priv->title != NULL) { |
647 | 808 | g_free(priv->title); | 830 | g_free(priv->title); |
648 | 809 | priv->title = NULL; | 831 | priv->title = NULL; |
649 | @@ -976,6 +998,11 @@ | |||
650 | 976 | gchar * oldguide = priv->label_guide; | 998 | gchar * oldguide = priv->label_guide; |
651 | 977 | priv->label_guide = g_value_dup_string(value); | 999 | priv->label_guide = g_value_dup_string(value); |
652 | 978 | 1000 | ||
653 | 1001 | if (priv->label_guide != NULL && priv->label_guide[0] == '\0') { | ||
654 | 1002 | g_free(priv->label_guide); | ||
655 | 1003 | priv->label_guide = NULL; | ||
656 | 1004 | } | ||
657 | 1005 | |||
658 | 979 | if (g_strcmp0(oldguide, priv->label_guide) != 0) { | 1006 | if (g_strcmp0(oldguide, priv->label_guide) != 0) { |
659 | 980 | signal_label_change(APP_INDICATOR(object)); | 1007 | signal_label_change(APP_INDICATOR(object)); |
660 | 981 | } | 1008 | } |
661 | @@ -1188,8 +1215,14 @@ | |||
662 | 1188 | enum_value = g_enum_get_value ((GEnumClass *) g_type_class_ref (APP_INDICATOR_TYPE_INDICATOR_STATUS), priv->status); | 1215 | enum_value = g_enum_get_value ((GEnumClass *) g_type_class_ref (APP_INDICATOR_TYPE_INDICATOR_STATUS), priv->status); |
663 | 1189 | return g_variant_new_string(enum_value->value_nick ? enum_value->value_nick : ""); | 1216 | return g_variant_new_string(enum_value->value_nick ? enum_value->value_nick : ""); |
664 | 1190 | } else if (g_strcmp0(property, "IconName") == 0) { | 1217 | } else if (g_strcmp0(property, "IconName") == 0) { |
665 | 1218 | if (priv->absolute_icon_name) { | ||
666 | 1219 | return g_variant_new_string(priv->absolute_icon_name); | ||
667 | 1220 | } | ||
668 | 1191 | return g_variant_new_string(priv->icon_name ? priv->icon_name : ""); | 1221 | return g_variant_new_string(priv->icon_name ? priv->icon_name : ""); |
669 | 1192 | } else if (g_strcmp0(property, "AttentionIconName") == 0) { | 1222 | } else if (g_strcmp0(property, "AttentionIconName") == 0) { |
670 | 1223 | if (priv->absolute_attention_icon_name) { | ||
671 | 1224 | return g_variant_new_string(priv->absolute_attention_icon_name); | ||
672 | 1225 | } | ||
673 | 1193 | return g_variant_new_string(priv->attention_icon_name ? priv->attention_icon_name : ""); | 1226 | return g_variant_new_string(priv->attention_icon_name ? priv->attention_icon_name : ""); |
674 | 1194 | } else if (g_strcmp0(property, "Title") == 0) { | 1227 | } else if (g_strcmp0(property, "Title") == 0) { |
675 | 1195 | const gchar * output = NULL; | 1228 | const gchar * output = NULL; |
676 | @@ -1205,6 +1238,9 @@ | |||
677 | 1205 | } | 1238 | } |
678 | 1206 | return g_variant_new_string(output); | 1239 | return g_variant_new_string(output); |
679 | 1207 | } else if (g_strcmp0(property, "IconThemePath") == 0) { | 1240 | } else if (g_strcmp0(property, "IconThemePath") == 0) { |
680 | 1241 | if (priv->absolute_icon_theme_path) { | ||
681 | 1242 | return g_variant_new_string(priv->absolute_icon_theme_path); | ||
682 | 1243 | } | ||
683 | 1208 | return g_variant_new_string(priv->icon_theme_path ? priv->icon_theme_path : ""); | 1244 | return g_variant_new_string(priv->icon_theme_path ? priv->icon_theme_path : ""); |
684 | 1209 | } else if (g_strcmp0(property, "Menu") == 0) { | 1245 | } else if (g_strcmp0(property, "Menu") == 0) { |
685 | 1210 | if (priv->menuservice != NULL) { | 1246 | if (priv->menuservice != NULL) { |
686 | @@ -1244,7 +1280,7 @@ | |||
687 | 1244 | gchar * guide = priv->label_guide != NULL ? priv->label_guide : ""; | 1280 | gchar * guide = priv->label_guide != NULL ? priv->label_guide : ""; |
688 | 1245 | 1281 | ||
689 | 1246 | g_signal_emit(G_OBJECT(self), signals[NEW_LABEL], 0, | 1282 | g_signal_emit(G_OBJECT(self), signals[NEW_LABEL], 0, |
691 | 1247 | label, guide, TRUE); | 1283 | label, guide); |
692 | 1248 | if (priv->dbus_registration != 0 && priv->connection != NULL) { | 1284 | if (priv->dbus_registration != 0 && priv->connection != NULL) { |
693 | 1249 | GError * error = NULL; | 1285 | GError * error = NULL; |
694 | 1250 | 1286 | ||
695 | @@ -1460,7 +1496,7 @@ | |||
696 | 1460 | static void | 1496 | static void |
697 | 1461 | theme_changed_cb (GtkIconTheme * theme, gpointer user_data) | 1497 | theme_changed_cb (GtkIconTheme * theme, gpointer user_data) |
698 | 1462 | { | 1498 | { |
700 | 1463 | g_signal_emit (user_data, signals[NEW_ICON], 0, TRUE); | 1499 | g_signal_emit (user_data, signals[NEW_ICON], 0); |
701 | 1464 | 1500 | ||
702 | 1465 | AppIndicator * self = (AppIndicator *)user_data; | 1501 | AppIndicator * self = (AppIndicator *)user_data; |
703 | 1466 | AppIndicatorPrivate *priv = self->priv; | 1502 | AppIndicatorPrivate *priv = self->priv; |
704 | @@ -1571,19 +1607,23 @@ | |||
705 | 1571 | 1607 | ||
706 | 1572 | /* add the icon_theme_path once if needed */ | 1608 | /* add the icon_theme_path once if needed */ |
707 | 1573 | GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); | 1609 | GtkIconTheme *icon_theme = gtk_icon_theme_get_default(); |
709 | 1574 | if (self->priv->icon_theme_path != NULL) { | 1610 | const gchar *theme_path = self->priv->absolute_icon_theme_path ? |
710 | 1611 | self->priv->absolute_icon_theme_path : | ||
711 | 1612 | self->priv->icon_theme_path; | ||
712 | 1613 | |||
713 | 1614 | if (theme_path != NULL) { | ||
714 | 1575 | gchar **path; | 1615 | gchar **path; |
715 | 1576 | gint n_elements, i; | 1616 | gint n_elements, i; |
716 | 1577 | gboolean found=FALSE; | 1617 | gboolean found=FALSE; |
717 | 1578 | gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); | 1618 | gtk_icon_theme_get_search_path(icon_theme, &path, &n_elements); |
720 | 1579 | for (i=0; i< n_elements || path[i] == NULL; i++) { | 1619 | for (i=0; i< n_elements; i++) { |
721 | 1580 | if(g_strcmp0(path[i], self->priv->icon_theme_path) == 0) { | 1620 | if(g_strcmp0(path[i], theme_path) == 0) { |
722 | 1581 | found=TRUE; | 1621 | found=TRUE; |
723 | 1582 | break; | 1622 | break; |
724 | 1583 | } | 1623 | } |
725 | 1584 | } | 1624 | } |
726 | 1585 | if(!found) { | 1625 | if(!found) { |
728 | 1586 | gtk_icon_theme_append_search_path(icon_theme, self->priv->icon_theme_path); | 1626 | gtk_icon_theme_append_search_path(icon_theme, theme_path); |
729 | 1587 | } | 1627 | } |
730 | 1588 | g_strfreev (path); | 1628 | g_strfreev (path); |
731 | 1589 | } | 1629 | } |
732 | @@ -1607,8 +1647,12 @@ | |||
733 | 1607 | }; | 1647 | }; |
734 | 1608 | 1648 | ||
735 | 1609 | if (icon_name != NULL) { | 1649 | if (icon_name != NULL) { |
736 | 1650 | gchar *snapped_icon = append_snap_prefix(icon_name); | ||
737 | 1651 | |||
738 | 1610 | if (g_file_test(icon_name, G_FILE_TEST_EXISTS)) { | 1652 | if (g_file_test(icon_name, G_FILE_TEST_EXISTS)) { |
739 | 1611 | gtk_status_icon_set_from_file(icon, icon_name); | 1653 | gtk_status_icon_set_from_file(icon, icon_name); |
740 | 1654 | } else if (snapped_icon && g_file_test(snapped_icon, G_FILE_TEST_EXISTS)) { | ||
741 | 1655 | gtk_status_icon_set_from_file(icon, snapped_icon); | ||
742 | 1612 | } else { | 1656 | } else { |
743 | 1613 | gchar *longname = append_panel_icon_suffix(icon_name); | 1657 | gchar *longname = append_panel_icon_suffix(icon_name); |
744 | 1614 | 1658 | ||
745 | @@ -1620,6 +1664,8 @@ | |||
746 | 1620 | 1664 | ||
747 | 1621 | g_free(longname); | 1665 | g_free(longname); |
748 | 1622 | } | 1666 | } |
749 | 1667 | |||
750 | 1668 | g_free(snapped_icon); | ||
751 | 1623 | } | 1669 | } |
752 | 1624 | 1670 | ||
753 | 1625 | return; | 1671 | return; |
754 | @@ -1633,7 +1679,7 @@ | |||
755 | 1633 | GtkMenu * menu = app_indicator_get_menu(APP_INDICATOR(data)); | 1679 | GtkMenu * menu = app_indicator_get_menu(APP_INDICATOR(data)); |
756 | 1634 | if (menu == NULL) | 1680 | if (menu == NULL) |
757 | 1635 | return; | 1681 | return; |
759 | 1636 | 1682 | ||
760 | 1637 | gtk_menu_popup(menu, | 1683 | gtk_menu_popup(menu, |
761 | 1638 | NULL, /* Parent Menu */ | 1684 | NULL, /* Parent Menu */ |
762 | 1639 | NULL, /* Parent item */ | 1685 | NULL, /* Parent item */ |
763 | @@ -1681,7 +1727,7 @@ | |||
764 | 1681 | long_name = g_strdup (icon_name); | 1727 | long_name = g_strdup (icon_name); |
765 | 1682 | } | 1728 | } |
766 | 1683 | 1729 | ||
768 | 1684 | return long_name; | 1730 | return long_name; |
769 | 1685 | } | 1731 | } |
770 | 1686 | 1732 | ||
771 | 1687 | static gboolean | 1733 | static gboolean |
772 | @@ -1858,6 +1904,14 @@ | |||
773 | 1858 | if (g_strcmp0 (self->priv->attention_icon_name, icon_name) != 0) { | 1904 | if (g_strcmp0 (self->priv->attention_icon_name, icon_name) != 0) { |
774 | 1859 | g_free (self->priv->attention_icon_name); | 1905 | g_free (self->priv->attention_icon_name); |
775 | 1860 | self->priv->attention_icon_name = g_strdup (icon_name); | 1906 | self->priv->attention_icon_name = g_strdup (icon_name); |
776 | 1907 | |||
777 | 1908 | g_free(self->priv->absolute_attention_icon_name); | ||
778 | 1909 | self->priv->absolute_attention_icon_name = NULL; | ||
779 | 1910 | |||
780 | 1911 | if (icon_name && icon_name[0] == '/') { | ||
781 | 1912 | self->priv->absolute_attention_icon_name = append_snap_prefix (icon_name); | ||
782 | 1913 | } | ||
783 | 1914 | |||
784 | 1861 | changed = TRUE; | 1915 | changed = TRUE; |
785 | 1862 | } | 1916 | } |
786 | 1863 | 1917 | ||
787 | @@ -1868,7 +1922,7 @@ | |||
788 | 1868 | } | 1922 | } |
789 | 1869 | 1923 | ||
790 | 1870 | if (changed) { | 1924 | if (changed) { |
792 | 1871 | g_signal_emit (self, signals[NEW_ATTENTION_ICON], 0, TRUE); | 1925 | g_signal_emit (self, signals[NEW_ATTENTION_ICON], 0); |
793 | 1872 | 1926 | ||
794 | 1873 | if (self->priv->dbus_registration != 0 && self->priv->connection != NULL) { | 1927 | if (self->priv->dbus_registration != 0 && self->priv->connection != NULL) { |
795 | 1874 | GError * error = NULL; | 1928 | GError * error = NULL; |
796 | @@ -1933,6 +1987,14 @@ | |||
797 | 1933 | } | 1987 | } |
798 | 1934 | 1988 | ||
799 | 1935 | self->priv->icon_name = g_strdup(icon_name); | 1989 | self->priv->icon_name = g_strdup(icon_name); |
800 | 1990 | |||
801 | 1991 | g_free(self->priv->absolute_icon_name); | ||
802 | 1992 | self->priv->absolute_icon_name = NULL; | ||
803 | 1993 | |||
804 | 1994 | if (icon_name && icon_name[0] == '/') { | ||
805 | 1995 | self->priv->absolute_icon_name = append_snap_prefix (icon_name); | ||
806 | 1996 | } | ||
807 | 1997 | |||
808 | 1936 | changed = TRUE; | 1998 | changed = TRUE; |
809 | 1937 | } | 1999 | } |
810 | 1938 | 2000 | ||
811 | @@ -1946,7 +2008,7 @@ | |||
812 | 1946 | } | 2008 | } |
813 | 1947 | 2009 | ||
814 | 1948 | if (changed) { | 2010 | if (changed) { |
816 | 1949 | g_signal_emit (self, signals[NEW_ICON], 0, TRUE); | 2011 | g_signal_emit (self, signals[NEW_ICON], 0); |
817 | 1950 | 2012 | ||
818 | 1951 | if (self->priv->dbus_registration != 0 && self->priv->connection != NULL) { | 2013 | if (self->priv->dbus_registration != 0 && self->priv->connection != NULL) { |
819 | 1952 | GError * error = NULL; | 2014 | GError * error = NULL; |
820 | @@ -1994,6 +2056,66 @@ | |||
821 | 1994 | return; | 2056 | return; |
822 | 1995 | } | 2057 | } |
823 | 1996 | 2058 | ||
824 | 2059 | static const gchar * | ||
825 | 2060 | get_snap_prefix () | ||
826 | 2061 | { | ||
827 | 2062 | const gchar *snap = g_getenv ("SNAP"); | ||
828 | 2063 | return (snap && *snap != '\0') ? snap : NULL; | ||
829 | 2064 | } | ||
830 | 2065 | |||
831 | 2066 | static gchar * | ||
832 | 2067 | append_snap_prefix (const gchar *path) | ||
833 | 2068 | { | ||
834 | 2069 | gint i; | ||
835 | 2070 | gchar real_path[PATH_MAX]; | ||
836 | 2071 | const gchar *snap = get_snap_prefix (); | ||
837 | 2072 | |||
838 | 2073 | if (snap != NULL && path != NULL) { | ||
839 | 2074 | if (realpath (path, real_path) != NULL) { | ||
840 | 2075 | path = real_path; | ||
841 | 2076 | } | ||
842 | 2077 | |||
843 | 2078 | if (g_str_has_prefix (path, "/tmp/")) { | ||
844 | 2079 | g_warning ("Using '/tmp' paths in SNAP environment will lead to unreadable resources"); | ||
845 | 2080 | return NULL; | ||
846 | 2081 | } | ||
847 | 2082 | |||
848 | 2083 | if (g_str_has_prefix (path, snap) || | ||
849 | 2084 | g_str_has_prefix (path, g_get_home_dir ()) || | ||
850 | 2085 | g_str_has_prefix (path, g_get_user_cache_dir ()) || | ||
851 | 2086 | g_str_has_prefix (path, g_get_user_config_dir ()) || | ||
852 | 2087 | g_str_has_prefix (path, g_get_user_data_dir ()) || | ||
853 | 2088 | g_str_has_prefix (path, g_get_user_runtime_dir ())) { | ||
854 | 2089 | return g_strdup (path); | ||
855 | 2090 | } | ||
856 | 2091 | |||
857 | 2092 | for (i = 0; i < G_USER_N_DIRECTORIES; ++ i) { | ||
858 | 2093 | if (g_str_has_prefix (path, g_get_user_special_dir (i))) { | ||
859 | 2094 | return g_strdup (path); | ||
860 | 2095 | } | ||
861 | 2096 | } | ||
862 | 2097 | |||
863 | 2098 | return g_build_path (G_DIR_SEPARATOR_S, snap, path, NULL); | ||
864 | 2099 | } | ||
865 | 2100 | |||
866 | 2101 | return NULL; | ||
867 | 2102 | } | ||
868 | 2103 | |||
869 | 2104 | static gchar * | ||
870 | 2105 | get_real_theme_path (AppIndicator * self) | ||
871 | 2106 | { | ||
872 | 2107 | const gchar *theme_path = self->priv->icon_theme_path; | ||
873 | 2108 | gchar *snapped_path = append_snap_prefix (theme_path); | ||
874 | 2109 | |||
875 | 2110 | if (snapped_path != NULL) { | ||
876 | 2111 | return snapped_path; | ||
877 | 2112 | } else if (get_snap_prefix ()) { | ||
878 | 2113 | return g_build_path (G_DIR_SEPARATOR_S, g_get_user_data_dir (), "icons", NULL); | ||
879 | 2114 | } | ||
880 | 2115 | |||
881 | 2116 | return NULL; | ||
882 | 2117 | } | ||
883 | 2118 | |||
884 | 1997 | /** | 2119 | /** |
885 | 1998 | * app_indicator_set_icon_theme_path: | 2120 | * app_indicator_set_icon_theme_path: |
886 | 1999 | * @self: The #AppIndicator object to use | 2121 | * @self: The #AppIndicator object to use |
887 | @@ -2012,9 +2134,15 @@ | |||
888 | 2012 | 2134 | ||
889 | 2013 | self->priv->icon_theme_path = g_strdup(icon_theme_path); | 2135 | self->priv->icon_theme_path = g_strdup(icon_theme_path); |
890 | 2014 | 2136 | ||
892 | 2015 | g_signal_emit (self, signals[NEW_ICON_THEME_PATH], 0, self->priv->icon_theme_path, TRUE); | 2137 | g_free (self->priv->absolute_icon_theme_path); |
893 | 2138 | self->priv->absolute_icon_theme_path = get_real_theme_path (self); | ||
894 | 2139 | |||
895 | 2140 | g_signal_emit (self, signals[NEW_ICON_THEME_PATH], 0, self->priv->icon_theme_path); | ||
896 | 2016 | 2141 | ||
897 | 2017 | if (self->priv->dbus_registration != 0 && self->priv->connection != NULL) { | 2142 | if (self->priv->dbus_registration != 0 && self->priv->connection != NULL) { |
898 | 2143 | const gchar *theme_path = self->priv->absolute_icon_theme_path ? | ||
899 | 2144 | self->priv->absolute_icon_theme_path : | ||
900 | 2145 | self->priv->icon_theme_path; | ||
901 | 2018 | GError * error = NULL; | 2146 | GError * error = NULL; |
902 | 2019 | 2147 | ||
903 | 2020 | g_dbus_connection_emit_signal(self->priv->connection, | 2148 | g_dbus_connection_emit_signal(self->priv->connection, |
904 | @@ -2022,7 +2150,7 @@ | |||
905 | 2022 | self->priv->path, | 2150 | self->priv->path, |
906 | 2023 | NOTIFICATION_ITEM_DBUS_IFACE, | 2151 | NOTIFICATION_ITEM_DBUS_IFACE, |
907 | 2024 | "NewIconThemePath", | 2152 | "NewIconThemePath", |
909 | 2025 | g_variant_new("(s)", self->priv->icon_theme_path), | 2153 | g_variant_new("(s)", theme_path ? theme_path : ""), |
910 | 2026 | &error); | 2154 | &error); |
911 | 2027 | 2155 | ||
912 | 2028 | if (error != NULL) { | 2156 | if (error != NULL) { |
913 | @@ -2160,7 +2288,7 @@ | |||
914 | 2160 | 2288 | ||
915 | 2161 | g_return_if_fail (GTK_IS_WIDGET (menuitem)); | 2289 | g_return_if_fail (GTK_IS_WIDGET (menuitem)); |
916 | 2162 | 2290 | ||
918 | 2163 | priv->sec_activate_target = g_object_ref(G_OBJECT(menuitem)); | 2291 | priv->sec_activate_target = g_object_ref(menuitem); |
919 | 2164 | priv->sec_activate_enabled = widget_is_menu_child(self, menuitem); | 2292 | priv->sec_activate_enabled = widget_is_menu_child(self, menuitem); |
920 | 2165 | g_signal_connect(menuitem, "parent-set", G_CALLBACK(sec_activate_target_parent_changed), self); | 2293 | g_signal_connect(menuitem, "parent-set", G_CALLBACK(sec_activate_target_parent_changed), self); |
921 | 2166 | } | 2294 | } |
922 | 2167 | 2295 | ||
923 | === added file 'src/indicator-desktop-shortcuts.c' | |||
924 | --- src/indicator-desktop-shortcuts.c 1970-01-01 00:00:00 +0000 | |||
925 | +++ src/indicator-desktop-shortcuts.c 2020-04-08 18:54:42 +0000 | |||
926 | @@ -0,0 +1,705 @@ | |||
927 | 1 | /* | ||
928 | 2 | A small file to parse through the actions that are available | ||
929 | 3 | in the desktop file and making those easily usable. | ||
930 | 4 | |||
931 | 5 | Copyright 2010 Canonical Ltd. | ||
932 | 6 | |||
933 | 7 | Authors: | ||
934 | 8 | Ted Gould <ted@canonical.com> | ||
935 | 9 | |||
936 | 10 | This library is free software; you can redistribute it and/or | ||
937 | 11 | modify it under the terms of the GNU General Public License | ||
938 | 12 | version 3.0 as published by the Free Software Foundation. | ||
939 | 13 | |||
940 | 14 | This library is distributed in the hope that it will be useful, | ||
941 | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
942 | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
943 | 17 | GNU General Public License version 3.0 for more details. | ||
944 | 18 | |||
945 | 19 | You should have received a copy of the GNU General Public | ||
946 | 20 | License along with this library. If not, see | ||
947 | 21 | <http://www.gnu.org/licenses/>. | ||
948 | 22 | */ | ||
949 | 23 | |||
950 | 24 | #ifdef HAVE_CONFIG_H | ||
951 | 25 | #include "config.h" | ||
952 | 26 | #endif | ||
953 | 27 | |||
954 | 28 | #include <gio/gdesktopappinfo.h> | ||
955 | 29 | #include "indicator-desktop-shortcuts.h" | ||
956 | 30 | |||
957 | 31 | #define ACTIONS_KEY "Actions" | ||
958 | 32 | #define ACTION_GROUP_PREFIX "Desktop Action" | ||
959 | 33 | |||
960 | 34 | #define OLD_GROUP_SUFFIX "Shortcut Group" | ||
961 | 35 | #define OLD_SHORTCUTS_KEY "X-Ayatana-Desktop-Shortcuts" | ||
962 | 36 | #define OLD_ENVIRON_KEY "TargetEnvironment" | ||
963 | 37 | |||
964 | 38 | #define PROP_DESKTOP_FILE_S "desktop-file" | ||
965 | 39 | #define PROP_IDENTITY_S "identity" | ||
966 | 40 | |||
967 | 41 | typedef enum _actions_t actions_t; | ||
968 | 42 | enum _actions_t { | ||
969 | 43 | ACTIONS_NONE, | ||
970 | 44 | ACTIONS_XAYATANA, | ||
971 | 45 | ACTIONS_DESKTOP_SPEC | ||
972 | 46 | }; | ||
973 | 47 | |||
974 | 48 | typedef struct _IndicatorDesktopShortcutsPrivate IndicatorDesktopShortcutsPrivate; | ||
975 | 49 | struct _IndicatorDesktopShortcutsPrivate { | ||
976 | 50 | actions_t actions; | ||
977 | 51 | GKeyFile * keyfile; | ||
978 | 52 | gchar * identity; | ||
979 | 53 | GArray * nicks; | ||
980 | 54 | gchar * domain; | ||
981 | 55 | }; | ||
982 | 56 | |||
983 | 57 | enum { | ||
984 | 58 | PROP_0, | ||
985 | 59 | PROP_DESKTOP_FILE, | ||
986 | 60 | PROP_IDENTITY | ||
987 | 61 | }; | ||
988 | 62 | |||
989 | 63 | #define INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(o) \ | ||
990 | 64 | (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsPrivate)) | ||
991 | 65 | |||
992 | 66 | static void indicator_desktop_shortcuts_class_init (IndicatorDesktopShortcutsClass *klass); | ||
993 | 67 | static void indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self); | ||
994 | 68 | static void indicator_desktop_shortcuts_dispose (GObject *object); | ||
995 | 69 | static void indicator_desktop_shortcuts_finalize (GObject *object); | ||
996 | 70 | static void set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); | ||
997 | 71 | static void get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); | ||
998 | 72 | static void parse_keyfile (IndicatorDesktopShortcuts * ids); | ||
999 | 73 | static gboolean should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity, gboolean should_have_target); | ||
1000 | 74 | |||
1001 | 75 | G_DEFINE_TYPE (IndicatorDesktopShortcuts, indicator_desktop_shortcuts, G_TYPE_OBJECT); | ||
1002 | 76 | |||
1003 | 77 | /* Build up the class */ | ||
1004 | 78 | static void | ||
1005 | 79 | indicator_desktop_shortcuts_class_init (IndicatorDesktopShortcutsClass *klass) | ||
1006 | 80 | { | ||
1007 | 81 | GObjectClass *object_class = G_OBJECT_CLASS (klass); | ||
1008 | 82 | |||
1009 | 83 | g_type_class_add_private (klass, sizeof (IndicatorDesktopShortcutsPrivate)); | ||
1010 | 84 | |||
1011 | 85 | object_class->dispose = indicator_desktop_shortcuts_dispose; | ||
1012 | 86 | object_class->finalize = indicator_desktop_shortcuts_finalize; | ||
1013 | 87 | |||
1014 | 88 | /* Property funcs */ | ||
1015 | 89 | object_class->set_property = set_property; | ||
1016 | 90 | object_class->get_property = get_property; | ||
1017 | 91 | |||
1018 | 92 | g_object_class_install_property(object_class, PROP_DESKTOP_FILE, | ||
1019 | 93 | g_param_spec_string(PROP_DESKTOP_FILE_S, | ||
1020 | 94 | "The path of the desktop file to read", | ||
1021 | 95 | "A path to a desktop file that we'll look for shortcuts in.", | ||
1022 | 96 | NULL, | ||
1023 | 97 | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); | ||
1024 | 98 | g_object_class_install_property(object_class, PROP_IDENTITY, | ||
1025 | 99 | g_param_spec_string(PROP_IDENTITY_S, | ||
1026 | 100 | "The string that represents the identity that we're acting as.", | ||
1027 | 101 | "Used to process ShowIn and NotShownIn fields of the desktop shortcust to get the proper list.", | ||
1028 | 102 | NULL, | ||
1029 | 103 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); | ||
1030 | 104 | |||
1031 | 105 | return; | ||
1032 | 106 | } | ||
1033 | 107 | |||
1034 | 108 | /* Initialize instance data */ | ||
1035 | 109 | static void | ||
1036 | 110 | indicator_desktop_shortcuts_init (IndicatorDesktopShortcuts *self) | ||
1037 | 111 | { | ||
1038 | 112 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(self); | ||
1039 | 113 | |||
1040 | 114 | priv->keyfile = NULL; | ||
1041 | 115 | priv->identity = NULL; | ||
1042 | 116 | priv->domain = NULL; | ||
1043 | 117 | priv->nicks = g_array_new(TRUE, TRUE, sizeof(gchar *)); | ||
1044 | 118 | priv->actions = ACTIONS_NONE; | ||
1045 | 119 | |||
1046 | 120 | return; | ||
1047 | 121 | } | ||
1048 | 122 | |||
1049 | 123 | /* Clear object references */ | ||
1050 | 124 | static void | ||
1051 | 125 | indicator_desktop_shortcuts_dispose (GObject *object) | ||
1052 | 126 | { | ||
1053 | 127 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object); | ||
1054 | 128 | |||
1055 | 129 | if (priv->keyfile) { | ||
1056 | 130 | g_key_file_free(priv->keyfile); | ||
1057 | 131 | priv->keyfile = NULL; | ||
1058 | 132 | } | ||
1059 | 133 | |||
1060 | 134 | G_OBJECT_CLASS (indicator_desktop_shortcuts_parent_class)->dispose (object); | ||
1061 | 135 | return; | ||
1062 | 136 | } | ||
1063 | 137 | |||
1064 | 138 | /* Free all memory */ | ||
1065 | 139 | static void | ||
1066 | 140 | indicator_desktop_shortcuts_finalize (GObject *object) | ||
1067 | 141 | { | ||
1068 | 142 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object); | ||
1069 | 143 | |||
1070 | 144 | if (priv->identity != NULL) { | ||
1071 | 145 | g_free(priv->identity); | ||
1072 | 146 | priv->identity = NULL; | ||
1073 | 147 | } | ||
1074 | 148 | |||
1075 | 149 | if (priv->domain != NULL) { | ||
1076 | 150 | g_free(priv->domain); | ||
1077 | 151 | priv->domain = NULL; | ||
1078 | 152 | } | ||
1079 | 153 | |||
1080 | 154 | if (priv->nicks != NULL) { | ||
1081 | 155 | gint i; | ||
1082 | 156 | for (i = 0; i < priv->nicks->len; i++) { | ||
1083 | 157 | gchar * nick = g_array_index(priv->nicks, gchar *, i); | ||
1084 | 158 | g_free(nick); | ||
1085 | 159 | } | ||
1086 | 160 | g_array_free(priv->nicks, TRUE); | ||
1087 | 161 | priv->nicks = NULL; | ||
1088 | 162 | } | ||
1089 | 163 | |||
1090 | 164 | G_OBJECT_CLASS (indicator_desktop_shortcuts_parent_class)->finalize (object); | ||
1091 | 165 | return; | ||
1092 | 166 | } | ||
1093 | 167 | |||
1094 | 168 | /* Sets one of the two properties we have, only at construction though */ | ||
1095 | 169 | static void | ||
1096 | 170 | set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) | ||
1097 | 171 | { | ||
1098 | 172 | g_return_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(object)); | ||
1099 | 173 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object); | ||
1100 | 174 | |||
1101 | 175 | switch(prop_id) { | ||
1102 | 176 | case PROP_DESKTOP_FILE: { | ||
1103 | 177 | if (priv->keyfile != NULL) { | ||
1104 | 178 | g_key_file_free(priv->keyfile); | ||
1105 | 179 | priv->keyfile = NULL; | ||
1106 | 180 | priv->actions = ACTIONS_NONE; | ||
1107 | 181 | } | ||
1108 | 182 | |||
1109 | 183 | GError * error = NULL; | ||
1110 | 184 | GKeyFile * keyfile = g_key_file_new(); | ||
1111 | 185 | g_key_file_load_from_file(keyfile, g_value_get_string(value), G_KEY_FILE_NONE, &error); | ||
1112 | 186 | |||
1113 | 187 | if (error != NULL) { | ||
1114 | 188 | g_warning("Unable to load keyfile from file '%s': %s", g_value_get_string(value), error->message); | ||
1115 | 189 | g_error_free(error); | ||
1116 | 190 | g_key_file_free(keyfile); | ||
1117 | 191 | break; | ||
1118 | 192 | } | ||
1119 | 193 | |||
1120 | 194 | /* Always prefer the desktop spec if we can get it */ | ||
1121 | 195 | if (priv->actions == ACTIONS_NONE && g_key_file_has_key(keyfile, G_KEY_FILE_DESKTOP_GROUP, ACTIONS_KEY, NULL)) { | ||
1122 | 196 | priv->actions = ACTIONS_DESKTOP_SPEC; | ||
1123 | 197 | } | ||
1124 | 198 | |||
1125 | 199 | /* But fallback if we can't */ | ||
1126 | 200 | if (priv->actions == ACTIONS_NONE && g_key_file_has_key(keyfile, G_KEY_FILE_DESKTOP_GROUP, OLD_SHORTCUTS_KEY, NULL)) { | ||
1127 | 201 | priv->actions = ACTIONS_XAYATANA; | ||
1128 | 202 | g_warning("Desktop file '%s' is using a deprecated format for its actions that will be dropped soon.", g_value_get_string(value)); | ||
1129 | 203 | } | ||
1130 | 204 | |||
1131 | 205 | if (priv->actions == ACTIONS_NONE) { | ||
1132 | 206 | g_key_file_free(keyfile); | ||
1133 | 207 | break; | ||
1134 | 208 | } | ||
1135 | 209 | |||
1136 | 210 | priv->keyfile = keyfile; | ||
1137 | 211 | parse_keyfile(INDICATOR_DESKTOP_SHORTCUTS(object)); | ||
1138 | 212 | break; | ||
1139 | 213 | } | ||
1140 | 214 | case PROP_IDENTITY: | ||
1141 | 215 | if (priv->identity != NULL) { | ||
1142 | 216 | g_warning("Identity already set to '%s' and trying to set it to '%s'.", priv->identity, g_value_get_string(value)); | ||
1143 | 217 | return; | ||
1144 | 218 | } | ||
1145 | 219 | priv->identity = g_value_dup_string(value); | ||
1146 | 220 | parse_keyfile(INDICATOR_DESKTOP_SHORTCUTS(object)); | ||
1147 | 221 | break; | ||
1148 | 222 | /* *********************** */ | ||
1149 | 223 | default: | ||
1150 | 224 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
1151 | 225 | break; | ||
1152 | 226 | } | ||
1153 | 227 | |||
1154 | 228 | return; | ||
1155 | 229 | } | ||
1156 | 230 | |||
1157 | 231 | /* Gets either the desktop file our the identity. */ | ||
1158 | 232 | static void | ||
1159 | 233 | get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) | ||
1160 | 234 | { | ||
1161 | 235 | g_return_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(object)); | ||
1162 | 236 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(object); | ||
1163 | 237 | |||
1164 | 238 | switch(prop_id) { | ||
1165 | 239 | case PROP_IDENTITY: | ||
1166 | 240 | g_value_set_string(value, priv->identity); | ||
1167 | 241 | break; | ||
1168 | 242 | /* *********************** */ | ||
1169 | 243 | default: | ||
1170 | 244 | G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
1171 | 245 | break; | ||
1172 | 246 | } | ||
1173 | 247 | |||
1174 | 248 | return; | ||
1175 | 249 | } | ||
1176 | 250 | |||
1177 | 251 | /* Checks to see if we can, and if we can it goes through | ||
1178 | 252 | and parses the keyfile entries. */ | ||
1179 | 253 | static void | ||
1180 | 254 | parse_keyfile (IndicatorDesktopShortcuts * ids) | ||
1181 | 255 | { | ||
1182 | 256 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids); | ||
1183 | 257 | |||
1184 | 258 | if (priv->keyfile == NULL) { | ||
1185 | 259 | return; | ||
1186 | 260 | } | ||
1187 | 261 | |||
1188 | 262 | if (priv->identity == NULL) { | ||
1189 | 263 | return; | ||
1190 | 264 | } | ||
1191 | 265 | |||
1192 | 266 | /* Remove a previous translation domain if we had one | ||
1193 | 267 | from a previously parsed file. */ | ||
1194 | 268 | if (priv->domain != NULL) { | ||
1195 | 269 | g_free(priv->domain); | ||
1196 | 270 | priv->domain = NULL; | ||
1197 | 271 | } | ||
1198 | 272 | |||
1199 | 273 | /* Check to see if there is a custom translation domain that | ||
1200 | 274 | we should take into account. */ | ||
1201 | 275 | if (priv->domain == NULL && | ||
1202 | 276 | g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-GNOME-Gettext-Domain", NULL)) { | ||
1203 | 277 | priv->domain = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-GNOME-Gettext-Domain", NULL); | ||
1204 | 278 | } | ||
1205 | 279 | |||
1206 | 280 | if (priv->domain == NULL && | ||
1207 | 281 | g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL)) { | ||
1208 | 282 | priv->domain = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL); | ||
1209 | 283 | } | ||
1210 | 284 | |||
1211 | 285 | /* We need to figure out what we're looking for and what we want to | ||
1212 | 286 | look for in the rest of the file */ | ||
1213 | 287 | const gchar * list_name = NULL; | ||
1214 | 288 | const gchar * group_format = NULL; | ||
1215 | 289 | gboolean should_have_target = FALSE; | ||
1216 | 290 | |||
1217 | 291 | switch (priv->actions) { | ||
1218 | 292 | case ACTIONS_NONE: | ||
1219 | 293 | /* None, let's just get outta here */ | ||
1220 | 294 | return; | ||
1221 | 295 | case ACTIONS_XAYATANA: | ||
1222 | 296 | list_name = OLD_SHORTCUTS_KEY; | ||
1223 | 297 | group_format = "%s " OLD_GROUP_SUFFIX; | ||
1224 | 298 | should_have_target = TRUE; | ||
1225 | 299 | break; | ||
1226 | 300 | case ACTIONS_DESKTOP_SPEC: | ||
1227 | 301 | list_name = ACTIONS_KEY; | ||
1228 | 302 | group_format = ACTION_GROUP_PREFIX " %s"; | ||
1229 | 303 | should_have_target = FALSE; | ||
1230 | 304 | break; | ||
1231 | 305 | default: | ||
1232 | 306 | g_assert_not_reached(); | ||
1233 | 307 | return; | ||
1234 | 308 | } | ||
1235 | 309 | |||
1236 | 310 | /* Okay, we've got everything we need. Let's get it on! */ | ||
1237 | 311 | gint i; | ||
1238 | 312 | gsize num_nicks = 0; | ||
1239 | 313 | gchar ** nicks = g_key_file_get_string_list(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, list_name, &num_nicks, NULL); | ||
1240 | 314 | |||
1241 | 315 | /* If there is an error from get_string_list num_nicks should still | ||
1242 | 316 | be zero, so this loop will drop out. */ | ||
1243 | 317 | for (i = 0; i < num_nicks; i++) { | ||
1244 | 318 | /* g_debug("Looking at group nick %s", nicks[i]); */ | ||
1245 | 319 | gchar * groupname = g_strdup_printf(group_format, nicks[i]); | ||
1246 | 320 | if (!g_key_file_has_group(priv->keyfile, groupname)) { | ||
1247 | 321 | g_warning("Unable to find group '%s'", groupname); | ||
1248 | 322 | g_free(groupname); | ||
1249 | 323 | continue; | ||
1250 | 324 | } | ||
1251 | 325 | |||
1252 | 326 | if (!should_show(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, priv->identity, FALSE)) { | ||
1253 | 327 | g_free(groupname); | ||
1254 | 328 | continue; | ||
1255 | 329 | } | ||
1256 | 330 | |||
1257 | 331 | if (!should_show(priv->keyfile, groupname, priv->identity, should_have_target)) { | ||
1258 | 332 | g_free(groupname); | ||
1259 | 333 | continue; | ||
1260 | 334 | } | ||
1261 | 335 | |||
1262 | 336 | gchar * nickalloc = g_strdup(nicks[i]); | ||
1263 | 337 | g_array_append_val(priv->nicks, nickalloc); | ||
1264 | 338 | g_free(groupname); | ||
1265 | 339 | } | ||
1266 | 340 | |||
1267 | 341 | if (nicks != NULL) { | ||
1268 | 342 | g_strfreev(nicks); | ||
1269 | 343 | } | ||
1270 | 344 | |||
1271 | 345 | return; | ||
1272 | 346 | } | ||
1273 | 347 | |||
1274 | 348 | /* Checks the ONLY_SHOW_IN and NOT_SHOW_IN keys for a group to | ||
1275 | 349 | see if we should be showing ourselves. */ | ||
1276 | 350 | static gboolean | ||
1277 | 351 | should_show (GKeyFile * keyfile, const gchar * group, const gchar * identity, gboolean should_have_target) | ||
1278 | 352 | { | ||
1279 | 353 | if (should_have_target && g_key_file_has_key(keyfile, group, OLD_ENVIRON_KEY, NULL)) { | ||
1280 | 354 | /* If we've got this key, we're going to return here and not | ||
1281 | 355 | process the deprecated keys. */ | ||
1282 | 356 | gint j; | ||
1283 | 357 | gsize num_env = 0; | ||
1284 | 358 | gchar ** envs = g_key_file_get_string_list(keyfile, group, OLD_ENVIRON_KEY, &num_env, NULL); | ||
1285 | 359 | |||
1286 | 360 | for (j = 0; j < num_env; j++) { | ||
1287 | 361 | if (g_strcmp0(envs[j], identity) == 0) { | ||
1288 | 362 | break; | ||
1289 | 363 | } | ||
1290 | 364 | } | ||
1291 | 365 | |||
1292 | 366 | if (envs != NULL) { | ||
1293 | 367 | g_strfreev(envs); | ||
1294 | 368 | } | ||
1295 | 369 | |||
1296 | 370 | if (j == num_env) { | ||
1297 | 371 | return FALSE; | ||
1298 | 372 | } | ||
1299 | 373 | return TRUE; | ||
1300 | 374 | } | ||
1301 | 375 | |||
1302 | 376 | /* If there is a list of OnlyShowIn entries we need to check | ||
1303 | 377 | to see if we're in that list. If not, we drop this nick */ | ||
1304 | 378 | if (g_key_file_has_key(keyfile, group, G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, NULL)) { | ||
1305 | 379 | gint j; | ||
1306 | 380 | gsize num_only = 0; | ||
1307 | 381 | gchar ** onlies = g_key_file_get_string_list(keyfile, group, G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, &num_only, NULL); | ||
1308 | 382 | |||
1309 | 383 | for (j = 0; j < num_only; j++) { | ||
1310 | 384 | if (g_strcmp0(onlies[j], identity) == 0) { | ||
1311 | 385 | break; | ||
1312 | 386 | } | ||
1313 | 387 | } | ||
1314 | 388 | |||
1315 | 389 | if (onlies != NULL) { | ||
1316 | 390 | g_strfreev(onlies); | ||
1317 | 391 | } | ||
1318 | 392 | |||
1319 | 393 | if (j == num_only) { | ||
1320 | 394 | return FALSE; | ||
1321 | 395 | } | ||
1322 | 396 | } | ||
1323 | 397 | |||
1324 | 398 | /* If there is a NotShowIn entry we need to make sure that we're | ||
1325 | 399 | not in that list. If we are, we need to drop out. */ | ||
1326 | 400 | if (g_key_file_has_key(keyfile, group, G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN, NULL)) { | ||
1327 | 401 | gint j; | ||
1328 | 402 | gsize num_not = 0; | ||
1329 | 403 | gchar ** nots = g_key_file_get_string_list(keyfile, group, G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN, &num_not, NULL); | ||
1330 | 404 | |||
1331 | 405 | for (j = 0; j < num_not; j++) { | ||
1332 | 406 | if (g_strcmp0(nots[j], identity) == 0) { | ||
1333 | 407 | break; | ||
1334 | 408 | } | ||
1335 | 409 | } | ||
1336 | 410 | |||
1337 | 411 | if (nots != NULL) { | ||
1338 | 412 | g_strfreev(nots); | ||
1339 | 413 | } | ||
1340 | 414 | |||
1341 | 415 | if (j != num_not) { | ||
1342 | 416 | return FALSE; | ||
1343 | 417 | } | ||
1344 | 418 | } | ||
1345 | 419 | |||
1346 | 420 | return TRUE; | ||
1347 | 421 | } | ||
1348 | 422 | |||
1349 | 423 | /* Looks through the nicks to see if this one is in the list, | ||
1350 | 424 | and thus valid to use. */ | ||
1351 | 425 | static gboolean | ||
1352 | 426 | is_valid_nick (gchar ** list, const gchar * nick) | ||
1353 | 427 | { | ||
1354 | 428 | if (*list == NULL) | ||
1355 | 429 | return FALSE; | ||
1356 | 430 | /* g_debug("Checking Nick: %s", list[0]); */ | ||
1357 | 431 | if (g_strcmp0(list[0], nick) == 0) | ||
1358 | 432 | return TRUE; | ||
1359 | 433 | return is_valid_nick(&list[1], nick); | ||
1360 | 434 | } | ||
1361 | 435 | |||
1362 | 436 | /* API */ | ||
1363 | 437 | |||
1364 | 438 | /** | ||
1365 | 439 | indicator_desktop_shortcuts_new: | ||
1366 | 440 | @file: The desktop file that would be opened to | ||
1367 | 441 | find the actions. | ||
1368 | 442 | @identity: This is a string that represents the identity | ||
1369 | 443 | that should be used in searching those actions. It | ||
1370 | 444 | relates to the ShowIn and NotShownIn properties. | ||
1371 | 445 | |||
1372 | 446 | This function creates the basic object. It involves opening | ||
1373 | 447 | the file and parsing it. It could potentially block on IO. At | ||
1374 | 448 | the end of the day you'll have a fully functional object. | ||
1375 | 449 | |||
1376 | 450 | Return value: A new #IndicatorDesktopShortcuts object. | ||
1377 | 451 | */ | ||
1378 | 452 | IndicatorDesktopShortcuts * | ||
1379 | 453 | indicator_desktop_shortcuts_new (const gchar * file, const gchar * identity) | ||
1380 | 454 | { | ||
1381 | 455 | GObject * obj = g_object_new(INDICATOR_TYPE_DESKTOP_SHORTCUTS, | ||
1382 | 456 | PROP_DESKTOP_FILE_S, file, | ||
1383 | 457 | PROP_IDENTITY_S, identity, | ||
1384 | 458 | NULL); | ||
1385 | 459 | return INDICATOR_DESKTOP_SHORTCUTS(obj); | ||
1386 | 460 | } | ||
1387 | 461 | |||
1388 | 462 | /** | ||
1389 | 463 | indicator_desktop_shortcuts_get_nicks: | ||
1390 | 464 | @ids: The #IndicatorDesktopShortcuts object to look in | ||
1391 | 465 | |||
1392 | 466 | Give you the list of commands that are available for this desktop | ||
1393 | 467 | file given the identity that was passed in at creation. This will | ||
1394 | 468 | filter out the various items in the desktop file. These nicks can | ||
1395 | 469 | then be used as keys for working with the desktop file. | ||
1396 | 470 | |||
1397 | 471 | Return value: A #NULL terminated list of strings. This memory | ||
1398 | 472 | is managed by the @ids object. | ||
1399 | 473 | */ | ||
1400 | 474 | const gchar ** | ||
1401 | 475 | indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids) | ||
1402 | 476 | { | ||
1403 | 477 | g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL); | ||
1404 | 478 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids); | ||
1405 | 479 | return (const gchar **)priv->nicks->data; | ||
1406 | 480 | } | ||
1407 | 481 | |||
1408 | 482 | /** | ||
1409 | 483 | indicator_desktop_shortcuts_nick_get_name: | ||
1410 | 484 | @ids: The #IndicatorDesktopShortcuts object to look in | ||
1411 | 485 | @nick: Which command that we're referencing. | ||
1412 | 486 | |||
1413 | 487 | This function looks in a desktop file for a nick to find the | ||
1414 | 488 | user visible name for that shortcut. The @nick parameter | ||
1415 | 489 | should be gotten from #indicator_desktop_shortcuts_get_nicks | ||
1416 | 490 | though it's not required that the exact memory location | ||
1417 | 491 | be the same. | ||
1418 | 492 | |||
1419 | 493 | Return value: A user visible string for the shortcut or | ||
1420 | 494 | #NULL on error. | ||
1421 | 495 | */ | ||
1422 | 496 | gchar * | ||
1423 | 497 | indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, const gchar * nick) | ||
1424 | 498 | { | ||
1425 | 499 | g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), NULL); | ||
1426 | 500 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids); | ||
1427 | 501 | |||
1428 | 502 | g_return_val_if_fail(priv->actions != ACTIONS_NONE, NULL); | ||
1429 | 503 | g_return_val_if_fail(priv->keyfile != NULL, NULL); | ||
1430 | 504 | g_return_val_if_fail(is_valid_nick((gchar **)priv->nicks->data, nick), NULL); | ||
1431 | 505 | |||
1432 | 506 | const gchar * group_format = NULL; | ||
1433 | 507 | |||
1434 | 508 | switch (priv->actions) { | ||
1435 | 509 | case ACTIONS_XAYATANA: | ||
1436 | 510 | group_format = "%s " OLD_GROUP_SUFFIX; | ||
1437 | 511 | break; | ||
1438 | 512 | case ACTIONS_DESKTOP_SPEC: | ||
1439 | 513 | group_format = ACTION_GROUP_PREFIX " %s"; | ||
1440 | 514 | break; | ||
1441 | 515 | default: | ||
1442 | 516 | g_assert_not_reached(); | ||
1443 | 517 | return NULL; | ||
1444 | 518 | } | ||
1445 | 519 | |||
1446 | 520 | gchar * groupheader = g_strdup_printf(group_format, nick); | ||
1447 | 521 | if (!g_key_file_has_group(priv->keyfile, groupheader)) { | ||
1448 | 522 | g_warning("The group for nick '%s' doesn't exist anymore.", nick); | ||
1449 | 523 | g_free(groupheader); | ||
1450 | 524 | return NULL; | ||
1451 | 525 | } | ||
1452 | 526 | |||
1453 | 527 | if (!g_key_file_has_key(priv->keyfile, groupheader, G_KEY_FILE_DESKTOP_KEY_NAME, NULL)) { | ||
1454 | 528 | g_warning("No name available for nick '%s'", nick); | ||
1455 | 529 | g_free(groupheader); | ||
1456 | 530 | return NULL; | ||
1457 | 531 | } | ||
1458 | 532 | |||
1459 | 533 | gchar * name = NULL; | ||
1460 | 534 | gchar * keyvalue = g_key_file_get_string(priv->keyfile, | ||
1461 | 535 | groupheader, | ||
1462 | 536 | G_KEY_FILE_DESKTOP_KEY_NAME, | ||
1463 | 537 | NULL); | ||
1464 | 538 | gchar * localeval = g_key_file_get_locale_string(priv->keyfile, | ||
1465 | 539 | groupheader, | ||
1466 | 540 | G_KEY_FILE_DESKTOP_KEY_NAME, | ||
1467 | 541 | NULL, | ||
1468 | 542 | NULL); | ||
1469 | 543 | g_free(groupheader); | ||
1470 | 544 | |||
1471 | 545 | if (priv->domain != NULL && g_strcmp0(keyvalue, localeval) == 0) { | ||
1472 | 546 | name = g_strdup(g_dgettext(priv->domain, keyvalue)); | ||
1473 | 547 | g_free(localeval); | ||
1474 | 548 | } else { | ||
1475 | 549 | name = localeval; | ||
1476 | 550 | } | ||
1477 | 551 | |||
1478 | 552 | g_free(keyvalue); | ||
1479 | 553 | |||
1480 | 554 | return name; | ||
1481 | 555 | } | ||
1482 | 556 | |||
1483 | 557 | /** | ||
1484 | 558 | indicator_desktop_shortcuts_nick_exec_with_context: | ||
1485 | 559 | @ids: The #IndicatorDesktopShortcuts object to look in | ||
1486 | 560 | @nick: Which command that we're referencing. | ||
1487 | 561 | @launch_context: The #GAppLaunchContext to use for launching the shortcut | ||
1488 | 562 | |||
1489 | 563 | Here we take a @nick and try and execute the action that is | ||
1490 | 564 | associated with it. The @nick parameter should be gotten | ||
1491 | 565 | from #indicator_desktop_shortcuts_get_nicks though it's not | ||
1492 | 566 | required that the exact memory location be the same. | ||
1493 | 567 | |||
1494 | 568 | Return value: #TRUE on success or #FALSE on error. | ||
1495 | 569 | */ | ||
1496 | 570 | gboolean | ||
1497 | 571 | indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, const gchar * nick, GAppLaunchContext * launch_context) | ||
1498 | 572 | { | ||
1499 | 573 | GError * error = NULL; | ||
1500 | 574 | gchar * current_dir = NULL; | ||
1501 | 575 | |||
1502 | 576 | g_return_val_if_fail(INDICATOR_IS_DESKTOP_SHORTCUTS(ids), FALSE); | ||
1503 | 577 | IndicatorDesktopShortcutsPrivate * priv = INDICATOR_DESKTOP_SHORTCUTS_GET_PRIVATE(ids); | ||
1504 | 578 | |||
1505 | 579 | g_return_val_if_fail(priv->actions != ACTIONS_NONE, FALSE); | ||
1506 | 580 | g_return_val_if_fail(priv->keyfile != NULL, FALSE); | ||
1507 | 581 | g_return_val_if_fail(is_valid_nick((gchar **)priv->nicks->data, nick), FALSE); | ||
1508 | 582 | |||
1509 | 583 | const gchar * group_format = NULL; | ||
1510 | 584 | |||
1511 | 585 | switch (priv->actions) { | ||
1512 | 586 | case ACTIONS_XAYATANA: | ||
1513 | 587 | group_format = "%s " OLD_GROUP_SUFFIX; | ||
1514 | 588 | break; | ||
1515 | 589 | case ACTIONS_DESKTOP_SPEC: | ||
1516 | 590 | group_format = ACTION_GROUP_PREFIX " %s"; | ||
1517 | 591 | break; | ||
1518 | 592 | default: | ||
1519 | 593 | g_assert_not_reached(); | ||
1520 | 594 | return FALSE; | ||
1521 | 595 | } | ||
1522 | 596 | |||
1523 | 597 | gchar * groupheader = g_strdup_printf(group_format, nick); | ||
1524 | 598 | if (!g_key_file_has_group(priv->keyfile, groupheader)) { | ||
1525 | 599 | g_warning("The group for nick '%s' doesn't exist anymore.", nick); | ||
1526 | 600 | g_free(groupheader); | ||
1527 | 601 | return FALSE; | ||
1528 | 602 | } | ||
1529 | 603 | |||
1530 | 604 | if (!g_key_file_has_key(priv->keyfile, groupheader, G_KEY_FILE_DESKTOP_KEY_NAME, NULL)) { | ||
1531 | 605 | g_warning("No name available for nick '%s'", nick); | ||
1532 | 606 | g_free(groupheader); | ||
1533 | 607 | return FALSE; | ||
1534 | 608 | } | ||
1535 | 609 | |||
1536 | 610 | if (!g_key_file_has_key(priv->keyfile, groupheader, G_KEY_FILE_DESKTOP_KEY_EXEC, NULL)) { | ||
1537 | 611 | g_warning("No exec available for nick '%s'", nick); | ||
1538 | 612 | g_free(groupheader); | ||
1539 | 613 | return FALSE; | ||
1540 | 614 | } | ||
1541 | 615 | |||
1542 | 616 | /* If possible move to the proper launch path */ | ||
1543 | 617 | gchar * path = g_key_file_get_string(priv->keyfile, groupheader, | ||
1544 | 618 | G_KEY_FILE_DESKTOP_KEY_PATH, NULL); | ||
1545 | 619 | |||
1546 | 620 | if (path && *path != '\0') { | ||
1547 | 621 | current_dir = g_get_current_dir(); | ||
1548 | 622 | |||
1549 | 623 | if (chdir(path) < 0) { | ||
1550 | 624 | g_warning("Impossible to run action '%s' from path '%s'", nick, path); | ||
1551 | 625 | g_free(current_dir); | ||
1552 | 626 | g_free(groupheader); | ||
1553 | 627 | g_free(path); | ||
1554 | 628 | return FALSE; | ||
1555 | 629 | } | ||
1556 | 630 | } | ||
1557 | 631 | |||
1558 | 632 | /* Grab the name and the exec entries out of our current group */ | ||
1559 | 633 | gchar * name = g_key_file_get_locale_string(priv->keyfile, | ||
1560 | 634 | groupheader, | ||
1561 | 635 | G_KEY_FILE_DESKTOP_KEY_NAME, | ||
1562 | 636 | NULL, | ||
1563 | 637 | NULL); | ||
1564 | 638 | |||
1565 | 639 | gchar * exec = g_key_file_get_locale_string(priv->keyfile, | ||
1566 | 640 | groupheader, | ||
1567 | 641 | G_KEY_FILE_DESKTOP_KEY_EXEC, | ||
1568 | 642 | NULL, | ||
1569 | 643 | NULL); | ||
1570 | 644 | |||
1571 | 645 | GAppInfoCreateFlags flags = G_APP_INFO_CREATE_NONE; | ||
1572 | 646 | |||
1573 | 647 | if (launch_context) { | ||
1574 | 648 | flags |= G_APP_INFO_CREATE_SUPPORTS_STARTUP_NOTIFICATION; | ||
1575 | 649 | } | ||
1576 | 650 | |||
1577 | 651 | GAppInfo * appinfo = g_app_info_create_from_commandline(exec, name, flags, &error); | ||
1578 | 652 | g_free(groupheader); | ||
1579 | 653 | g_free(path); | ||
1580 | 654 | g_free(name); | ||
1581 | 655 | g_free(exec); | ||
1582 | 656 | |||
1583 | 657 | if (error != NULL) { | ||
1584 | 658 | g_warning("Unable to build Command line App info: %s", error->message); | ||
1585 | 659 | g_free(current_dir); | ||
1586 | 660 | g_error_free(error); | ||
1587 | 661 | return FALSE; | ||
1588 | 662 | } | ||
1589 | 663 | |||
1590 | 664 | if (appinfo == NULL) { | ||
1591 | 665 | g_warning("Unable to build Command line App info (unknown)"); | ||
1592 | 666 | g_free(current_dir); | ||
1593 | 667 | return FALSE; | ||
1594 | 668 | } | ||
1595 | 669 | |||
1596 | 670 | gboolean launched = g_app_info_launch(appinfo, NULL, launch_context, &error); | ||
1597 | 671 | |||
1598 | 672 | if (current_dir && chdir(current_dir) < 0) | ||
1599 | 673 | g_warning("Impossible to switch back to default work dir"); | ||
1600 | 674 | |||
1601 | 675 | |||
1602 | 676 | if (error != NULL) { | ||
1603 | 677 | g_warning("Unable to launch file from nick '%s': %s", nick, error->message); | ||
1604 | 678 | g_clear_error(&error); | ||
1605 | 679 | } | ||
1606 | 680 | |||
1607 | 681 | g_free(current_dir); | ||
1608 | 682 | g_object_unref(appinfo); | ||
1609 | 683 | |||
1610 | 684 | return launched; | ||
1611 | 685 | } | ||
1612 | 686 | |||
1613 | 687 | /** | ||
1614 | 688 | indicator_desktop_shortcuts_nick_exec: | ||
1615 | 689 | @ids: The #IndicatorDesktopShortcuts object to look in | ||
1616 | 690 | @nick: Which command that we're referencing. | ||
1617 | 691 | |||
1618 | 692 | Here we take a @nick and try and execute the action that is | ||
1619 | 693 | associated with it. The @nick parameter should be gotten | ||
1620 | 694 | from #indicator_desktop_shortcuts_get_nicks though it's not | ||
1621 | 695 | required that the exact memory location be the same. | ||
1622 | 696 | This function is deprecated and shouldn't be used in newly | ||
1623 | 697 | written code. | ||
1624 | 698 | |||
1625 | 699 | Return value: #TRUE on success or #FALSE on error. | ||
1626 | 700 | */ | ||
1627 | 701 | gboolean | ||
1628 | 702 | indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, const gchar * nick) | ||
1629 | 703 | { | ||
1630 | 704 | return indicator_desktop_shortcuts_nick_exec_with_context (ids, nick, NULL); | ||
1631 | 705 | } | ||
1632 | 0 | 706 | ||
1633 | === added file 'src/indicator-desktop-shortcuts.h' | |||
1634 | --- src/indicator-desktop-shortcuts.h 1970-01-01 00:00:00 +0000 | |||
1635 | +++ src/indicator-desktop-shortcuts.h 2020-04-08 18:54:42 +0000 | |||
1636 | @@ -0,0 +1,80 @@ | |||
1637 | 1 | /* | ||
1638 | 2 | A small file to parse through the actions that are available | ||
1639 | 3 | in the desktop file and making those easily usable. | ||
1640 | 4 | |||
1641 | 5 | Copyright 2010 Canonical Ltd. | ||
1642 | 6 | |||
1643 | 7 | Authors: | ||
1644 | 8 | Ted Gould <ted@canonical.com> | ||
1645 | 9 | |||
1646 | 10 | This library is free software; you can redistribute it and/or | ||
1647 | 11 | modify it under the terms of the GNU General Public License | ||
1648 | 12 | version 3.0 as published by the Free Software Foundation. | ||
1649 | 13 | |||
1650 | 14 | This library is distributed in the hope that it will be useful, | ||
1651 | 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
1652 | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
1653 | 17 | GNU General Public License version 3.0 for more details. | ||
1654 | 18 | |||
1655 | 19 | You should have received a copy of the GNU General Public | ||
1656 | 20 | License along with this library. If not, see | ||
1657 | 21 | <http://www.gnu.org/licenses/>. | ||
1658 | 22 | */ | ||
1659 | 23 | |||
1660 | 24 | #ifndef __INDICATOR_DESKTOP_SHORTCUTS_H__ | ||
1661 | 25 | #define __INDICATOR_DESKTOP_SHORTCUTS_H__ | ||
1662 | 26 | |||
1663 | 27 | #include <gio/gio.h> | ||
1664 | 28 | #include <glib.h> | ||
1665 | 29 | #include <glib-object.h> | ||
1666 | 30 | |||
1667 | 31 | G_BEGIN_DECLS | ||
1668 | 32 | |||
1669 | 33 | #define INDICATOR_TYPE_DESKTOP_SHORTCUTS (indicator_desktop_shortcuts_get_type ()) | ||
1670 | 34 | #define INDICATOR_DESKTOP_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcuts)) | ||
1671 | 35 | #define INDICATOR_DESKTOP_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsClass)) | ||
1672 | 36 | #define INDICATOR_IS_DESKTOP_SHORTCUTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS)) | ||
1673 | 37 | #define INDICATOR_IS_DESKTOP_SHORTCUTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_TYPE_DESKTOP_SHORTCUTS)) | ||
1674 | 38 | #define INDICATOR_DESKTOP_SHORTCUTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_TYPE_DESKTOP_SHORTCUTS, IndicatorDesktopShortcutsClass)) | ||
1675 | 39 | |||
1676 | 40 | typedef struct _IndicatorDesktopShortcuts IndicatorDesktopShortcuts; | ||
1677 | 41 | typedef struct _IndicatorDesktopShortcutsClass IndicatorDesktopShortcutsClass; | ||
1678 | 42 | |||
1679 | 43 | /** | ||
1680 | 44 | IndicatorDesktopShortcutsClass: | ||
1681 | 45 | @parent_class: Space for #GObjectClass | ||
1682 | 46 | |||
1683 | 47 | The vtable for our precious #IndicatorDesktopShortcutsClass. | ||
1684 | 48 | */ | ||
1685 | 49 | struct _IndicatorDesktopShortcutsClass { | ||
1686 | 50 | GObjectClass parent_class; | ||
1687 | 51 | }; | ||
1688 | 52 | |||
1689 | 53 | /** | ||
1690 | 54 | IndicatorDesktopShortcuts: | ||
1691 | 55 | @parent: The parent data from #GObject | ||
1692 | 56 | |||
1693 | 57 | The public data for an instance of the class | ||
1694 | 58 | #IndicatorDesktopShortcuts. | ||
1695 | 59 | */ | ||
1696 | 60 | struct _IndicatorDesktopShortcuts { | ||
1697 | 61 | GObject parent; | ||
1698 | 62 | }; | ||
1699 | 63 | |||
1700 | 64 | GType indicator_desktop_shortcuts_get_type (void); | ||
1701 | 65 | IndicatorDesktopShortcuts * indicator_desktop_shortcuts_new (const gchar * file, | ||
1702 | 66 | const gchar * identity); | ||
1703 | 67 | const gchar ** indicator_desktop_shortcuts_get_nicks (IndicatorDesktopShortcuts * ids); | ||
1704 | 68 | gchar * indicator_desktop_shortcuts_nick_get_name (IndicatorDesktopShortcuts * ids, | ||
1705 | 69 | const gchar * nick); | ||
1706 | 70 | gboolean indicator_desktop_shortcuts_nick_exec_with_context (IndicatorDesktopShortcuts * ids, | ||
1707 | 71 | const gchar * nick, | ||
1708 | 72 | GAppLaunchContext * launch_context); | ||
1709 | 73 | |||
1710 | 74 | GLIB_DEPRECATED_FOR(indicator_desktop_shortcuts_nick_exec_with_context) | ||
1711 | 75 | gboolean indicator_desktop_shortcuts_nick_exec (IndicatorDesktopShortcuts * ids, | ||
1712 | 76 | const gchar * nick); | ||
1713 | 77 | |||
1714 | 78 | G_END_DECLS | ||
1715 | 79 | |||
1716 | 80 | #endif | ||
1717 | 0 | 81 | ||
1718 | === modified file 'tests/Makefile.am' | |||
1719 | --- tests/Makefile.am 2013-12-19 14:37:54 +0000 | |||
1720 | +++ tests/Makefile.am 2020-04-08 18:54:42 +0000 | |||
1721 | @@ -32,7 +32,7 @@ | |||
1722 | 32 | test_libappindicator_CFLAGS = \ | 32 | test_libappindicator_CFLAGS = \ |
1723 | 33 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 33 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1724 | 34 | -DSRCDIR="\"$(srcdir)\"" \ | 34 | -DSRCDIR="\"$(srcdir)\"" \ |
1726 | 35 | -Wall -Werror -Wno-error=deprecated-declarations \ | 35 | -Wall -Wno-error=deprecated-declarations \ |
1727 | 36 | -I$(top_srcdir)/src | 36 | -I$(top_srcdir)/src |
1728 | 37 | 37 | ||
1729 | 38 | test_libappindicator_LDADD = \ | 38 | test_libappindicator_LDADD = \ |
1730 | @@ -49,7 +49,7 @@ | |||
1731 | 49 | 49 | ||
1732 | 50 | test_libappindicator_dbus_client_CFLAGS = \ | 50 | test_libappindicator_dbus_client_CFLAGS = \ |
1733 | 51 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 51 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1735 | 52 | -Wall -Werror -Wno-error=deprecated-declarations \ | 52 | -Wall -Wno-error=deprecated-declarations \ |
1736 | 53 | -I$(top_srcdir)/src | 53 | -I$(top_srcdir)/src |
1737 | 54 | 54 | ||
1738 | 55 | test_libappindicator_dbus_client_LDADD = \ | 55 | test_libappindicator_dbus_client_LDADD = \ |
1739 | @@ -66,7 +66,7 @@ | |||
1740 | 66 | 66 | ||
1741 | 67 | test_libappindicator_dbus_server_CFLAGS = \ | 67 | test_libappindicator_dbus_server_CFLAGS = \ |
1742 | 68 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 68 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1744 | 69 | -Wall -Werror -Wno-error=deprecated-declarations \ | 69 | -Wall -Wno-error=deprecated-declarations \ |
1745 | 70 | -I$(top_srcdir)/src | 70 | -I$(top_srcdir)/src |
1746 | 71 | 71 | ||
1747 | 72 | test_libappindicator_dbus_server_LDADD = \ | 72 | test_libappindicator_dbus_server_LDADD = \ |
1748 | @@ -83,7 +83,7 @@ | |||
1749 | 83 | 83 | ||
1750 | 84 | test_libappindicator_status_client_CFLAGS = \ | 84 | test_libappindicator_status_client_CFLAGS = \ |
1751 | 85 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 85 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1753 | 86 | -Wall -Werror -Wno-error=deprecated-declarations \ | 86 | -Wall -Wno-error=deprecated-declarations \ |
1754 | 87 | -I$(top_srcdir)/src | 87 | -I$(top_srcdir)/src |
1755 | 88 | 88 | ||
1756 | 89 | test_libappindicator_status_client_LDADD = \ | 89 | test_libappindicator_status_client_LDADD = \ |
1757 | @@ -100,7 +100,7 @@ | |||
1758 | 100 | 100 | ||
1759 | 101 | test_libappindicator_status_server_CFLAGS = \ | 101 | test_libappindicator_status_server_CFLAGS = \ |
1760 | 102 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 102 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1762 | 103 | -Wall -Werror -Wno-error=deprecated-declarations \ | 103 | -Wall -Wno-error=deprecated-declarations \ |
1763 | 104 | -I$(top_srcdir)/src | 104 | -I$(top_srcdir)/src |
1764 | 105 | 105 | ||
1765 | 106 | test_libappindicator_status_server_LDADD = \ | 106 | test_libappindicator_status_server_LDADD = \ |
1766 | @@ -116,7 +116,7 @@ | |||
1767 | 116 | 116 | ||
1768 | 117 | test_libappindicator_fallback_watcher_CFLAGS = \ | 117 | test_libappindicator_fallback_watcher_CFLAGS = \ |
1769 | 118 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 118 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1771 | 119 | -Wall -Werror -Wno-error=deprecated-declarations \ | 119 | -Wall -Wno-error=deprecated-declarations \ |
1772 | 120 | -I$(top_srcdir)/src | 120 | -I$(top_srcdir)/src |
1773 | 121 | 121 | ||
1774 | 122 | test_libappindicator_fallback_watcher_LDADD = \ | 122 | test_libappindicator_fallback_watcher_LDADD = \ |
1775 | @@ -128,7 +128,7 @@ | |||
1776 | 128 | 128 | ||
1777 | 129 | test_libappindicator_fallback_item_CFLAGS = \ | 129 | test_libappindicator_fallback_item_CFLAGS = \ |
1778 | 130 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 130 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1780 | 131 | -Wall -Werror -Wno-error=deprecated-declarations \ | 131 | -Wall -Wno-error=deprecated-declarations \ |
1781 | 132 | -I$(top_srcdir)/src | 132 | -I$(top_srcdir)/src |
1782 | 133 | 133 | ||
1783 | 134 | test_libappindicator_fallback_item_LDADD = \ | 134 | test_libappindicator_fallback_item_LDADD = \ |
1784 | @@ -198,7 +198,7 @@ | |||
1785 | 198 | 198 | ||
1786 | 199 | test_simple_app_CFLAGS = \ | 199 | test_simple_app_CFLAGS = \ |
1787 | 200 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ | 200 | $(TESTDEPS_CFLAGS) $(LIBRARY_CFLAGS) \ |
1789 | 201 | -Wall -Werror -Wno-error=deprecated-declarations \ | 201 | -Wall -Wno-error=deprecated-declarations \ |
1790 | 202 | -I$(top_srcdir)/src | 202 | -I$(top_srcdir)/src |
1791 | 203 | 203 | ||
1792 | 204 | test_simple_app_LDADD = \ | 204 | test_simple_app_LDADD = \ |