Maintenance.

* Fix setting the GSETTINGS_SCHEMA_DIR environment variable.
* Use g_value_take_boxed() instead of deprecated
  g_value_set_boxed_take_ownership().
* Remove an unused variable.
* Clean up load_category() a bit.
This commit is contained in:
Přemysl Eric Janouch 2012-04-17 10:29:14 +02:00
parent 94f27cb38c
commit b0ecd81212
4 changed files with 12 additions and 18 deletions

View File

@ -98,7 +98,7 @@ ld_diagram_connection_get_property (GObject *object, guint property_id,
case PROP_POINTS: case PROP_POINTS:
points = ld_diagram_connection_get_points (self); points = ld_diagram_connection_get_points (self);
g_value_set_boxed_take_ownership (value, points); g_value_take_boxed (value, points);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);

View File

@ -2392,11 +2392,8 @@ on_scroll (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{ {
gdouble prev_x, prev_y; gdouble prev_x, prev_y;
gdouble new_x, new_y; gdouble new_x, new_y;
LdPoint point;
LdDiagramView *self; LdDiagramView *self;
point.x = event->x;
point.y = event->y;
self = LD_DIAGRAM_VIEW (widget); self = LD_DIAGRAM_VIEW (widget);
if (self->priv->operation != OPER_0 if (self->priv->operation != OPER_0

View File

@ -167,7 +167,7 @@ LoadCategoryData;
static LdSymbolCategory * static LdSymbolCategory *
load_category (LdLibrary *self, const gchar *path, const gchar *name) load_category (LdLibrary *self, const gchar *path, const gchar *name)
{ {
LdSymbolCategory *cat; LdSymbolCategory *cat = NULL;
gchar *icon_file, *category_file; gchar *icon_file, *category_file;
gchar *human_name; gchar *human_name;
LoadCategoryData data; LoadCategoryData data;
@ -200,13 +200,10 @@ load_category (LdLibrary *self, const gchar *path, const gchar *name)
g_free (human_name); g_free (human_name);
g_free (category_file); g_free (category_file);
g_free (icon_file);
return cat;
load_category_fail_2: load_category_fail_2:
g_free (icon_file); g_free (icon_file);
load_category_fail_1: load_category_fail_1:
return NULL; return cat;
} }
/* /*

View File

@ -106,6 +106,15 @@ main (int argc, char *argv[])
bind_textdomain_codeset (GETTEXT_DOMAIN, "UTF-8"); bind_textdomain_codeset (GETTEXT_DOMAIN, "UTF-8");
textdomain (GETTEXT_DOMAIN); textdomain (GETTEXT_DOMAIN);
#ifdef PROJECT_GSETTINGS_DIR
/* This is enabled when the build is set up for developing, so that the
* application can find its schema. It might also find use when
* installing the application into a location that's missing from
* g_get_system_data_dirs(), for example /usr/local or ~/.local.
*/
g_setenv ("GSETTINGS_SCHEMA_DIR", PROJECT_GSETTINGS_DIR, 0);
#endif /* PROJECT_GSETTINGS_DIR */
#ifdef _WIN32 #ifdef _WIN32
/* Don't be unneccessarily limited by the system ANSI codepage. */ /* Don't be unneccessarily limited by the system ANSI codepage. */
argv_overriden = get_utf8_args (&argc, &argv); argv_overriden = get_utf8_args (&argc, &argv);
@ -131,15 +140,6 @@ main (int argc, char *argv[])
} }
#endif #endif
#ifdef PROJECT_GSETTINGS_DIR
/* This is enabled when the build is set up for developing, so the
* application can find it's schema. It might also find use when
* installing the application into a location that's missing from
* g_get_system_data_dirs(), for example /usr/local or ~/.local.
*/
g_setenv ("GSETTINGS_SCHEMA_DIR", PROJECT_GSETTINGS_DIR, 0);
#endif /* PROJECT_GSETTINGS_DIR */
gtk_window_set_default_icon_name (PROJECT_NAME); gtk_window_set_default_icon_name (PROJECT_NAME);
/* TODO: Be able to open multiple files. */ /* TODO: Be able to open multiple files. */