After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 693622 - don't show nameless faceless apps
don't show nameless faceless apps
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Notifications
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
3.10
Depends on:
Blocks:
 
 
Reported: 2013-02-11 22:21 UTC by Matthias Clasen
Modified: 2015-05-11 16:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (33.19 KB, image/png)
2013-02-11 22:21 UTC, Matthias Clasen
  Details
do not show nameless apps (12.00 KB, application/octet-stream)
2015-04-30 13:13 UTC, mhatina
  Details
do not show nameless apps (1.33 KB, patch)
2015-04-30 13:19 UTC, mhatina
none Details | Review
do not show nameless apps (1.35 KB, patch)
2015-05-04 08:12 UTC, mhatina
none Details | Review
do not show nameless apps (1.34 KB, patch)
2015-05-04 08:30 UTC, mhatina
none Details | Review
do not show nameless apps (1.34 KB, patch)
2015-05-04 08:31 UTC, mhatina
committed Details | Review

Description Matthias Clasen 2013-02-11 22:21:47 UTC
Created attachment 235750 [details]
screenshot

I have three lines without an icon or name in my notification panel, see screenshot. IMO, we shouldn't show apps that we can't find a proper desktop file for.
Comment 1 mhatina 2015-04-30 13:13:54 UTC
Created attachment 302650 [details]
do not show nameless apps
Comment 2 Bastien Nocera 2015-04-30 13:15:56 UTC
Comment on attachment 302650 [details]
do not show nameless apps

This is garbage, not a patch. Looks like a VIM buffer.
Comment 3 mhatina 2015-04-30 13:19:44 UTC
Created attachment 302651 [details] [review]
do not show nameless apps

My bad, got little distracted by advanced working hour.
Comment 4 Bastien Nocera 2015-04-30 13:21:30 UTC
Review of attachment 302651 [details] [review]:

::: panels/notifications/cc-notifications-panel.c
@@ +260,3 @@
 
+  app_name = g_app_info_get_name (app->app_info);
+  if (strlen (app_name) == 0)

That will crash if app_name is NULL.

if (app_name == NULL || *app_name == '\0')
   return;

This checks for whether app_name is NULL or an empty string.
Comment 5 mhatina 2015-05-04 08:12:53 UTC
Created attachment 302837 [details] [review]
do not show nameless apps

Good point. Fixed.
Comment 6 Bastien Nocera 2015-05-04 08:27:42 UTC
Review of attachment 302837 [details] [review]:

::: panels/notifications/cc-notifications-panel.c
@@ +260,3 @@
 
+  app_name = g_app_info_get_name (app->app_info);
+  if (app_name == NULL || app_name[0] == '\0')

I prefer "*app_name == '\0' instead (otherwise I would have used that in my review comment...)
Comment 7 mhatina 2015-05-04 08:30:38 UTC
Created attachment 302840 [details] [review]
do not show nameless apps
Comment 8 mhatina 2015-05-04 08:31:24 UTC
Created attachment 302841 [details] [review]
do not show nameless apps
Comment 9 Bastien Nocera 2015-05-04 08:32:01 UTC
Review of attachment 302841 [details] [review]:

Looks good. Please cherry-pick in gnome-3-14 as well.
Comment 10 Marek Kašík 2015-05-11 16:27:28 UTC
Comment on attachment 302841 [details] [review]
do not show nameless apps

(In reply to Bastien Nocera from comment #9)
> Review of attachment 302841 [details] [review] [review]:
> 
> Looks good. Please cherry-pick in gnome-3-14 as well.

I've pushed the patch into master and gnome-3-14 branches. I've also added 'const' in front of the 'gchar *app_name' to avoid the warning about discarding of const qualifier.