Commit dc894d75 authored by Sebastien Granjoux's avatar Sebastien Granjoux

Fix #560857 – GNOME Goal: Remove deprecated GLib symbols

	* 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

svn path=/trunk/; revision=4655
parent 8b9a9d98
2009-01-31 Sébastien Granjoux <seb.sfo@free.fr>
* 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
2009-01-31 Sébastien Granjoux <seb.sfo@free.fr>
* (added) www/htdocs/update_news.html:
......@@ -1529,7 +1529,7 @@ do_ordertab1 (const void *a, const void *b)
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
......
......@@ -105,12 +105,15 @@ launch_application_failure (AnjutaFileLoaderPlugin *plugin,
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 @@ open_with_dialog (AnjutaFileLoaderPlugin *plugin, const gchar *uri,
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 @@ open_with_dialog (AnjutaFileLoaderPlugin *plugin, const gchar *uri,
"\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),
......
......@@ -256,8 +256,7 @@ designer_associations_unlock_notification (DesignerAssociations *self)
{
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),
......
......@@ -420,7 +420,7 @@ void add_edit_completed_toggled(GtkWidget *checkbox, GtkWidget *rlabel)
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);
}
......
......@@ -932,7 +932,7 @@ cal_set_today (EggDateTime *edt, GtkCalendar *calendar)
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);
......
......@@ -63,11 +63,13 @@ GTodoItem * gtodo_client_create_empty_todo_item(void)
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 @@ void gtodo_todo_item_free(GTodoItem *item)
}
/* 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 @@ gint32 gtodo_todo_item_check_due(GTodoItem *item)
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 @@ guint32 gtodo_todo_item_get_last_edited_date_as_julian(GTodoItem *item)
{
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 @@ gboolean gtodo_todo_item_set_stop_date_today(GTodoItem *item)
{
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 @@ GTodoItem * gtodo_client_get_todo_item_from_xml_ptr(GTodoClient *cl, xmlNodePtr
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 @@ gboolean gtodo_client_save_todo_item(GTodoClient *cl, GTodoItem *item)
}
/* 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);
}
......
......@@ -64,10 +64,10 @@ typedef struct _GTodoList{
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;
......
......@@ -250,7 +250,7 @@ get_all_past_purge (void)
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);
......
......@@ -176,10 +176,10 @@ on_ok_clicked (GtkButton *button, PatchPlugin* p_plugin)
}
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"),
......
......@@ -1183,6 +1183,7 @@ project_manager_load_gbf (ProjectManagerPlugin *pm_plugin)
AnjutaPluginManager *plugin_manager;
AnjutaStatus *status;
gchar *dirname;
gchar *basename;
const gchar *root_uri;
GError *error = NULL;
GList *descs = NULL;
......@@ -1254,7 +1255,8 @@ project_manager_load_gbf (ProjectManagerPlugin *pm_plugin)
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 @@ project_manager_load_gbf (ProjectManagerPlugin *pm_plugin)
/* 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 @@ project_manager_load_gbf (ProjectManagerPlugin *pm_plugin)
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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment