[maemo-commits] [maemo-commits] r12938 - in projects/haf/trunk/hildon-desktop: . src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jul 31 12:24:49 EEST 2007
Author: karoliina
Date: 2007-07-31 12:24:46 +0300 (Tue, 31 Jul 2007)
New Revision: 12938

Modified:
   projects/haf/trunk/hildon-desktop/ChangeLog
   projects/haf/trunk/hildon-desktop/src/main.c
Log:
2007-07-31  Karoliina Salminen <karoliina.t.salminen at nokia.com>

  * src/main.c: added stamp file creation & required includes for creat
	  The stamp file will be created as follows:
          Stamp directory: "/tmp/osso-appl-states/hildon-desktop/"
          Stamp file in the stamp directory: HILDON_DESKTOP_STAMP_DIR"/stamp"



Modified: projects/haf/trunk/hildon-desktop/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-31 09:10:07 UTC (rev 12937)
+++ projects/haf/trunk/hildon-desktop/ChangeLog	2007-07-31 09:24:46 UTC (rev 12938)
@@ -2,6 +2,10 @@
 
 	* libhildondesktop/libhildonmenu.c: line 645: fixed signedness compilation 
           warning which occurs on newer gcc compilers. Added cast to (gchar *) to key.
+        * src/main.c: added stamp file creation & required includes for creat
+	  The stamp file will be created as follows:
+          Stamp directory: "/tmp/osso-appl-states/hildon-desktop/"
+          Stamp file in the stamp directory: HILDON_DESKTOP_STAMP_DIR"/stamp"
 
 2007-07-30  Lucas Rocha  <lucas.rocha at nokia.com>
 

Modified: projects/haf/trunk/hildon-desktop/src/main.c
===================================================================
--- projects/haf/trunk/hildon-desktop/src/main.c	2007-07-31 09:10:07 UTC (rev 12937)
+++ projects/haf/trunk/hildon-desktop/src/main.c	2007-07-31 09:24:46 UTC (rev 12938)
@@ -32,15 +32,25 @@
 #include <gtk/gtk.h>
 #include <libgnomevfs/gnome-vfs.h>
 
+#include <sys/types.h> // Required for file io (creat etc.)
+#include <sys/stat.h> // required for file io
+#include <fcntl.h> // required for file io
+
 #include "hd-desktop.h"
+#include "hd-crash-manager.h"
 
 #define OSSO_USER_DIR        ".osso"
 #define HILDON_DESKTOP_GTKRC "current-gtk-theme.maemo_af_desktop"
 
+#define STAMP_DIR                     "/tmp/osso-appl-states/"
+#define HILDON_DESKTOP_STAMP_DIR      "/tmp/osso-appl-states/hildon-desktop/"
+#define HILDON_DESKTOP_STAMP_FILE     HILDON_DESKTOP_STAMP_DIR"/stamp"
+
 int main (int argc, char **argv)
 {
   GObject *desktop;
   gchar *gtkrc = NULL;
+  gboolean safe_mode = FALSE;
 
   g_thread_init (NULL);
   setlocale (LC_ALL, "");
@@ -51,6 +61,26 @@
 
   textdomain (GETTEXT_PACKAGE);
 
+  /* Check for safe mode */
+  /* Added by karoliina 31.7.2007 */
+  if (g_file_test (HILDON_DESKTOP_STAMP_FILE, G_FILE_TEST_EXISTS))
+  {
+      g_warning ("hildon-desktop did not exit properly on the previous "
+                  "session. All home plugins will be disabled.");
+      safe_mode = TRUE;
+  }
+  else
+  {
+      int fd;
+      mkdir (STAMP_DIR, 0755);
+      mkdir (HILDON_DESKTOP_STAMP_DIR, 0755);
+      fd = creat(HILDON_DESKTOP_STAMP_FILE, S_IRUSR|S_IWUSR);
+      if (fd >= 0)
+          close (fd);
+  }
+
+
+
   /* Read the maemo-af-desktop gtkrc file */
   gtkrc = g_build_filename (g_get_home_dir (), 
                             OSSO_USER_DIR,


More information about the maemo-commits mailing list