anjuta r4655 - in trunk: . plugins/document-manager plugins/file-loader plugins/glade plugins/gtodo plugins/patch plugins/project-manager



Author: sgranjoux
Date: Sat Jan 31 16:30:54 2009
New Revision: 4655
URL: http://svn.gnome.org/viewvc/anjuta?rev=4655&view=rev

Log:
	* plugins/file-loader/plugin.c,
	plugins/patch/patch-plugin.c,
	plugins/gtodo/libgtodo.c,
	plugins/gtodo/libgtodo.h,
	plugins/gtodo/todo_db.c,
	plugins/gtodo/add_edit_item.c,
	plugins/gtodo/egg-datetime.c,
	plugins/project-manager/plugin.c,
	plugins/document-manager/anjuta-docman.c,
	plugins/glade/designer-associations.c:
	Fix #560857 â GNOME Goal: Remove deprecated GLib symbols


Modified:
   trunk/ChangeLog
   trunk/plugins/document-manager/anjuta-docman.c
   trunk/plugins/file-loader/plugin.c
   trunk/plugins/glade/designer-associations.c
   trunk/plugins/gtodo/add_edit_item.c
   trunk/plugins/gtodo/egg-datetime.c
   trunk/plugins/gtodo/libgtodo.c
   trunk/plugins/gtodo/libgtodo.h
   trunk/plugins/gtodo/todo_db.c
   trunk/plugins/patch/patch-plugin.c
   trunk/plugins/project-manager/plugin.c

Modified: trunk/plugins/document-manager/anjuta-docman.c
==============================================================================
--- trunk/plugins/document-manager/anjuta-docman.c	(original)
+++ trunk/plugins/document-manager/anjuta-docman.c	Sat Jan 31 16:30:54 2009
@@ -1529,7 +1529,7 @@
 	order_struct aos,bos;
 	aos = *(order_struct*)a;
 	bos = *(order_struct*)b;
-	return (g_strcasecmp (aos.m_label, bos.m_label)); /* need g_utf8_collate() ? */
+	return (g_ascii_strcasecmp (aos.m_label, bos.m_label)); /* need g_utf8_collate() ? */
 }
 
 static void

Modified: trunk/plugins/file-loader/plugin.c
==============================================================================
--- trunk/plugins/file-loader/plugin.c	(original)
+++ trunk/plugins/file-loader/plugin.c	Sat Jan 31 16:30:54 2009
@@ -105,12 +105,15 @@
 							const gchar *errmsg)
 {
 	GtkWidget *parent;
+	gchar *basename;
 	
 	parent =
 		gtk_widget_get_toplevel (GTK_WIDGET(ANJUTA_PLUGIN (plugin)->shell));
+	basename = g_path_get_basename (uri);
 	anjuta_util_dialog_error (GTK_WINDOW (parent),
 							  _("Can not open \"%s\".\n\n%s"),
-							  g_basename (uri), errmsg);
+							  basename, errmsg);
+	g_free (basename);
 }
 
 static GList *
@@ -199,10 +202,12 @@
 	GtkWidget *dialog, *parent, *hbox, *label;
 	GtkWidget *options;
 	gchar *message;
+	gchar *basename;
 	AnjutaPluginManager *plugin_manager;
 	
 	plugin_manager = anjuta_shell_get_plugin_manager (ANJUTA_PLUGIN (plugin)->shell,
 													  NULL);
+	basename = g_path_get_basename (uri);
 	message = g_strdup_printf (_("<b>Cannot open \"%s\"</b>.\n\n"
 								 "There is no plugin, default action, or application "
 								 "configured to handle this file type.\n"
@@ -211,7 +216,9 @@
 								 "\n"
 								 "You may choose to try opening it with the following "
 								 "plugins or applications."),
-							   g_basename(uri), mime_type);
+							   basename, mime_type);
+	g_free (basename);
+
 	parent =
 		gtk_widget_get_toplevel (GTK_WIDGET(ANJUTA_PLUGIN (plugin)->shell));
 	dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (parent),

Modified: trunk/plugins/glade/designer-associations.c
==============================================================================
--- trunk/plugins/glade/designer-associations.c	(original)
+++ trunk/plugins/glade/designer-associations.c	Sat Jan 31 16:30:54 2009
@@ -256,8 +256,7 @@
 {
 	self->priv->notification_lock --;
 	if (self->priv->notification_lock < 0)
-		g_critical ("Unbalanced lock stack detected in %s\n",
-		             G_GNUC_PRETTY_FUNCTION);
+		g_critical ("Unbalanced lock stack detected");
 	if (self->priv->notification_lock == 0 && self->priv->notification_pending)
 		g_signal_emit (self, designer_associations_signals[ITEM_NOTIFY],
 		               g_quark_from_static_string (DESIGNER_ASSOCIATIONS_DETAIL_LOADED),

Modified: trunk/plugins/gtodo/add_edit_item.c
==============================================================================
--- trunk/plugins/gtodo/add_edit_item.c	(original)
+++ trunk/plugins/gtodo/add_edit_item.c	Sat Jan 31 16:30:54 2009
@@ -420,7 +420,7 @@
 	gchar *tempstr;
 	if(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(checkbox))){
 		date = g_date_new();
-		g_date_set_time(date, time(NULL));
+		g_date_set_time_t(date, time(NULL));
 		stop_jul= g_date_get_julian(date);
 		g_date_free(date);
 	}

Modified: trunk/plugins/gtodo/egg-datetime.c
==============================================================================
--- trunk/plugins/gtodo/egg-datetime.c	(original)
+++ trunk/plugins/gtodo/egg-datetime.c	Sat Jan 31 16:30:54 2009
@@ -932,7 +932,7 @@
 	edt->priv->no_date = FALSE;
 
 	now = g_date_new();
-	g_date_set_time (now, time (NULL));
+	g_date_set_time_t (now, time (NULL));
 
 	year = g_date_get_year(now);
 	month = g_date_get_month(now);

Modified: trunk/plugins/gtodo/libgtodo.c
==============================================================================
--- trunk/plugins/gtodo/libgtodo.c	(original)
+++ trunk/plugins/gtodo/libgtodo.c	Sat Jan 31 16:30:54 2009
@@ -63,11 +63,13 @@
 GTodoItem * gtodo_client_create_new_todo_item(GTodoClient *cl)
 {
 	GTodoItem *item = gtodo_client_create_empty_todo_item();
+	time_t now = time(NULL);
+
 	/* give an nice "random" id */
-	item->id = (GTime)time(NULL);
+	item->id = (guint32)now;
 	/* set the start time */
 	item->start = g_date_new();
-	g_date_set_time(item->start, (GTime)item->id);
+	g_date_set_time_t(item->start, now);
 	return item;
 }
 
@@ -85,11 +87,12 @@
 }
 
 
-/* get the id from an todo item in guint32 (its an GTime, but a gtime is an gint32)..*/
-/* I made it a guint32 because there is no negative time here */
+/* get the id from an todo item in guint32 */
+/* I made it a guint because it is generated from a time and there is no 
+ * negative time */
 guint32 gtodo_todo_item_get_id(GTodoItem *item)
 {
-	return (guint32 )item->id;
+	return item->id;
 }
 
 /* set the notification flag for this todo item. */    
@@ -228,7 +231,7 @@
 	int i;
 	if(item->due == NULL) return GTODO_NO_DUE_DATE;
 	today = g_date_new();
-	g_date_set_time(today, time(NULL));
+	g_date_set_time_t(today, time(NULL));
 	i = g_date_days_between(item->due,today);
 	g_date_free(today);
 	return i;
@@ -257,7 +260,7 @@
 	{
 		GDate *date = g_date_new();
 		guint32 julian=1;
-		g_date_set_time(date, item->last_edited);
+		g_date_set_time_t(date, item->last_edited);
 		julian = g_date_get_julian(date);
 		g_date_free(date);
 		return julian;
@@ -355,7 +358,7 @@
 {
 	if(item == NULL) return FALSE;
 	if(item->stop == NULL) item->stop = g_date_new();
-	g_date_set_time(item->stop, time(NULL));
+	g_date_set_time_t(item->stop, time(NULL));
 	return TRUE;
 }
 /* get localized string.. this needs to be freed! */
@@ -547,7 +550,7 @@
 			if(temp != NULL)
 			{
 				guint64 i = g_ascii_strtoull((gchar *)temp, NULL, 0);
-				item->last_edited = (GTime) i;
+				item->last_edited = (time_t) i;
 				xmlFree(temp);
 			}
 		}
@@ -1114,7 +1117,7 @@
 			}
 			/* last edited (to the start date attribute) */
 			{
-				temp1 = g_strdup_printf("%u", (GTime)time(NULL));
+				temp1 = g_strdup_printf("%u", time(NULL));
 				xmlSetProp(newa, (xmlChar *)"last_edited", (xmlChar *)temp1);
 				g_free(temp1);
 			}

Modified: trunk/plugins/gtodo/libgtodo.h
==============================================================================
--- trunk/plugins/gtodo/libgtodo.h	(original)
+++ trunk/plugins/gtodo/libgtodo.h	Sat Jan 31 16:30:54 2009
@@ -64,10 +64,10 @@
 typedef struct _GTotoItem{
 	/* ID of todo item.  This one should be unique */
 	/* for now I made it the time.. that should be unique enough for my purpose */
-	GTime id;
+	guint32 id;
 
 	/* last edited, probly needed for syncing and stuff */
-	GTime last_edited;
+	time_t last_edited;
 
 	/* Creation Date.  And possible end date */
 	GDate *start;

Modified: trunk/plugins/gtodo/todo_db.c
==============================================================================
--- trunk/plugins/gtodo/todo_db.c	(original)
+++ trunk/plugins/gtodo/todo_db.c	Sat Jan 31 16:30:54 2009
@@ -250,7 +250,7 @@
 	GTodoItem *item;
 	guint today = 0;
 	GDate *date = g_date_new ();
-	g_date_set_time (date, time (NULL));
+	g_date_set_time_t (date, time (NULL));
 	if (g_date_valid (date) == FALSE)
 	{
 		g_date_free (date);

Modified: trunk/plugins/patch/patch-plugin.c
==============================================================================
--- trunk/plugins/patch/patch-plugin.c	(original)
+++ trunk/plugins/patch/patch-plugin.c	Sat Jan 31 16:30:54 2009
@@ -176,10 +176,10 @@
 	}
 	
 	if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(p_plugin->dry_run_check)))
-		g_string_sprintf (command, "patch --dry-run -d %s -p %d -f -i %s",
+		g_string_printf (command, "patch --dry-run -d %s -p %d -f -i %s",
 				  directory, patch_level, patch_file);
 	else
-		g_string_sprintf (command, "patch -d %s -p %d -f -i %s",
+		g_string_printf (command, "patch -d %s -p %d -f -i %s",
 				  directory, patch_level, patch_file);
 	
 	message = g_strdup_printf (_("Patching %s using %s\n"), 

Modified: trunk/plugins/project-manager/plugin.c
==============================================================================
--- trunk/plugins/project-manager/plugin.c	(original)
+++ trunk/plugins/project-manager/plugin.c	Sat Jan 31 16:30:54 2009
@@ -1183,6 +1183,7 @@
 	AnjutaPluginManager *plugin_manager;
 	AnjutaStatus *status;
 	gchar *dirname;
+	gchar *basename;
 	const gchar *root_uri;
 	GError *error = NULL;
 	GList *descs = NULL;
@@ -1254,7 +1255,8 @@
 	
 	status = anjuta_shell_get_status (ANJUTA_PLUGIN (pm_plugin)->shell, NULL);
 	anjuta_status_progress_add_ticks (status, 1);
-	anjuta_status_push (status, _("Loading project: %s"), g_basename (dirname));
+	basename = g_path_get_basename (dirname);
+	anjuta_status_push (status, _("Loading project: %s"), basename);
 	anjuta_status_busy_push (status);
 	
 	DEBUG_PRINT ("loading project %s\n\n", dirname);
@@ -1281,6 +1283,7 @@
 		/* g_propagate_error (err, error); */
 		g_object_unref (pm_plugin->project);
 		pm_plugin->project = NULL;
+		g_free (basename);
 		g_free (dirname);
 		/* gtk_widget_destroy (progress_win); */
 		anjuta_status_pop (status);
@@ -1295,9 +1298,10 @@
 								 pm_plugin->scrolledwindow,
 								 NULL);
 	
-	anjuta_status_set_default (status, _("Project"), g_basename (dirname));
+	anjuta_status_set_default (status, _("Project"), basename);
 	anjuta_status_pop (status);
 	anjuta_status_busy_pop (status);
+	g_free (basename);
 	g_free (dirname);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]