patches/gnome-session-19-remove-dup.diff
author yippi
Mon, 27 Sep 2010 21:07:51 +0000
changeset 20108 51df67ca9307
parent 16827 2b3e4805f74d
permissions -rw-r--r--
I had these modules listed as being owned by me, but they are really owned by wangke, correcting.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16810
c864ca9b831f 2009-10-19 Ghee Teo <[email protected]>
gheet
parents: 16592
diff changeset
     1
diff -urN -x'*.orig' gnome-session-2.28.0/gnome-session/gsm-manager.c ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/gsm-manager.c
c864ca9b831f 2009-10-19 Ghee Teo <[email protected]>
gheet
parents: 16592
diff changeset
     2
--- gnome-session-2.28.0/gnome-session/gsm-manager.c	2009-10-19 16:38:47.843586847 +0100
16827
2b3e4805f74d 2009-10-21 Ghee Teo <[email protected]>
gheet
parents: 16810
diff changeset
     3
+++ ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/gsm-manager.c	2009-10-21 11:07:57.284947656 +0100
2b3e4805f74d 2009-10-21 Ghee Teo <[email protected]>
gheet
parents: 16810
diff changeset
     4
@@ -3404,14 +3404,40 @@
16524
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     5
         }
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     6
 
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     7
         while ((name = g_dir_read_name (dir))) {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     8
-                char *desktop_file;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
     9
+                char  *desktop_file;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    10
+		char  **provides;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    11
+		GError *error=NULL;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    12
+	        gsize len;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    13
+		EggDesktopFile *egg_df;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    14
 
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    15
                 if (!g_str_has_suffix (name, ".desktop")) {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    16
                         continue;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    17
                 }
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    18
 
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    19
                 desktop_file = g_build_filename (path, name, NULL);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    20
-                gsm_manager_add_autostart_app (manager, desktop_file, NULL);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    21
+		egg_df = egg_desktop_file_new ( desktop_file , &error);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    22
+		if (egg_df == NULL)  {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    23
+			g_warning ("Could not parse desktop file %s: %s", desktop_file, error->message);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    24
+			g_error_free (error);
16592
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    25
+                	continue;
16524
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    26
+		}
16592
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    27
+		else {
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    28
+			error = NULL;
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    29
+			provides = NULL;
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    30
+			provides = egg_desktop_file_get_string_list (egg_df,
16524
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    31
+                                                     	GSM_AUTOSTART_APP_PROVIDES_KEY,
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    32
+                                                        &len, &error);
16592
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    33
+			if (!provides) {
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    34
+				g_debug ("GsmManager: *** desktop file: %s doesnot have Provides key\n", desktop_file);
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    35
+                		gsm_manager_add_autostart_app (manager, desktop_file, NULL);
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    36
+			}
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    37
+			else {
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    38
+				g_debug ("GsmManager: *** desktop file: %s provides %s\n", desktop_file, provides[0]);
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    39
+                		gsm_manager_add_autostart_app (manager, desktop_file, provides[0]);
d208d26ddc3d 2009-09-21 Ghee Teo <[email protected]>
gheet
parents: 16524
diff changeset
    40
+			}
16524
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    41
+			g_strfreev (provides);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    42
+			egg_desktop_file_free (egg_df);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    43
+		}
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    44
                 g_free (desktop_file);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    45
         }
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    46
 
16810
c864ca9b831f 2009-10-19 Ghee Teo <[email protected]>
gheet
parents: 16592
diff changeset
    47
diff -urN -x'*.orig' gnome-session-2.28.0/gnome-session/main.c ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/main.c
c864ca9b831f 2009-10-19 Ghee Teo <[email protected]>
gheet
parents: 16592
diff changeset
    48
--- gnome-session-2.28.0/gnome-session/main.c	2009-10-19 16:38:47.829824877 +0100
c864ca9b831f 2009-10-19 Ghee Teo <[email protected]>
gheet
parents: 16592
diff changeset
    49
+++ ../SUNWgnome-session-2.28.0.hacked/gnome-session-2.28.0/gnome-session/main.c	2009-10-19 16:43:20.143550467 +0100
16524
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    50
@@ -210,7 +210,8 @@
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    51
 }
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    52
 
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    53
 static void
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    54
-append_required_apps (GsmManager *manager)
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    55
+append_required_apps (GsmManager *manager,
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    56
+		      char      **autostart_dirs)
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    57
 {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    58
         GSList      *required_components;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    59
         GSList      *r;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    60
@@ -247,7 +248,7 @@
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    61
                 if (default_provider != NULL) {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    62
                         char *app_path;
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    63
 
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    64
-                        app_path = gsm_util_find_desktop_file_for_app_name (default_provider, NULL);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    65
+                        app_path = gsm_util_find_desktop_file_for_app_name (default_provider, autostart_dirs);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    66
                         if (app_path != NULL) {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    67
                                 gsm_manager_add_autostart_app (manager, app_path, component);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    68
                         } else {
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    69
@@ -308,7 +309,7 @@
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    70
         /* We do this at the end in case a saved session contains an
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    71
          * application that already provides one of the components. */
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    72
         append_default_apps (manager, default_session_key, autostart_dirs);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    73
-        append_required_apps (manager);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    74
+        append_required_apps (manager, autostart_dirs);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    75
 
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    76
         g_strfreev (autostart_dirs);
d52d53d71e0c 2009-09-10 Ghee Teo <[email protected]>
gheet
parents:
diff changeset
    77
 }