marlin r1292 - in trunk: marlin po
- From: iain svn gnome org
- To: svn-commits-list gnome org
- Subject: marlin r1292 - in trunk: marlin po
- Date: Sat, 4 Oct 2008 01:11:28 +0000 (UTC)
Author: iain
Date: Sat Oct 4 01:11:28 2008
New Revision: 1292
URL: http://svn.gnome.org/viewvc/marlin?rev=1292&view=rev
Log:
Fix some crashes that creeped in
Update some code
Modified:
trunk/marlin/ChangeLog
trunk/marlin/marlin-base-window.c
trunk/marlin/marlin-jack-play.c
trunk/marlin/marlin-level-ruler.c
trunk/marlin/marlin-sample.c
trunk/po/Makefile.in.in
Modified: trunk/marlin/marlin-base-window.c
==============================================================================
--- trunk/marlin/marlin-base-window.c (original)
+++ trunk/marlin/marlin-base-window.c Sat Oct 4 01:11:28 2008
@@ -2,7 +2,7 @@
/*
* Authors: Iain Holmes <iain gnome org>
*
- * Copyright 2005-2006 Iain Holmes
+ * Copyright 2005-2008 Iain Holmes
*
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Modified: trunk/marlin/marlin-jack-play.c
==============================================================================
--- trunk/marlin/marlin-jack-play.c (original)
+++ trunk/marlin/marlin-jack-play.c Sat Oct 4 01:11:28 2008
@@ -747,7 +747,7 @@
&status, server_name);
if (priv->client == NULL) {
/* Make error */
- if (*error != NULL) {
+ if (error && *error != NULL) {
*error = g_error_new (MARLIN_JACK_ERROR,
MARLIN_JACK_ERROR_NO_SERVER,
"Unable to run JACK server - JACK status was %d", status);
Modified: trunk/marlin/marlin-level-ruler.c
==============================================================================
--- trunk/marlin/marlin-level-ruler.c (original)
+++ trunk/marlin/marlin-level-ruler.c Sat Oct 4 01:11:28 2008
@@ -2,7 +2,7 @@
/*
* Authors: Iain Holmes <iain gnome org>
*
- * Copyright 2002-2006 Iain Holmes
+ * Copyright 2002-2008 Iain Holmes
*
* This file is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU Library General Public
@@ -52,7 +52,9 @@
int ofs;
};
-static GtkWidgetClass *parent_class = NULL;
+#define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MARLIN_LEVEL_RULER_TYPE, MarlinLevelRulerPrivate))
+G_DEFINE_TYPE (MarlinLevelRuler, marlin_level_ruler, GTK_TYPE_WIDGET);
+
static guint32 signals[LAST_SIGNAL];
#define DEFAULT_CHANNELS 2
@@ -62,20 +64,21 @@
static void
finalize (GObject *object)
{
- MarlinLevelRuler *ruler;
+ G_OBJECT_CLASS (marlin_level_ruler_parent_class)->finalize (object);
+}
- ruler = MARLIN_LEVEL_RULER (object);
+static void
+dispose (GObject *object)
+{
+ MarlinLevelRuler *ruler = (MarlinLevelRuler *) object;
+ MarlinLevelRulerPrivate *priv = ruler->priv;
- if (ruler->priv == NULL) {
- return;
+ if (priv->layout) {
+ g_object_unref (priv->layout);
+ priv->layout = NULL;
}
- g_object_unref (G_OBJECT (ruler->priv->layout));
-
- g_free (ruler->priv);
- ruler->priv = NULL;
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
+ G_OBJECT_CLASS (marlin_level_ruler_parent_class)->dispose (object);
}
static void
@@ -100,13 +103,13 @@
if (GTK_WIDGET_DRAWABLE (ruler)) {
GdkRectangle area;
GtkWidget *widget = GTK_WIDGET (ruler);
-
+
area.x = 0;
area.y = 0;
area.width = widget->allocation.width;
area.height = widget->allocation.height;
-
- gdk_window_invalidate_rect (widget->window, &area,
+
+ gdk_window_invalidate_rect (widget->window, &area,
FALSE);
}
@@ -117,13 +120,13 @@
if (GTK_WIDGET_DRAWABLE (ruler)) {
GdkRectangle area;
GtkWidget *widget = GTK_WIDGET (ruler);
-
+
area.x = 0;
area.y = 0;
area.width = widget->allocation.width;
area.height = widget->allocation.height;
-
- gdk_window_invalidate_rect (widget->window, &area,
+
+ gdk_window_invalidate_rect (widget->window, &area,
FALSE);
}
@@ -159,7 +162,7 @@
MarlinLevelRuler *ruler;
int extra, chan_height;
double f, d;
-
+
ruler = MARLIN_LEVEL_RULER (widget);
widget->allocation = *allocation;
@@ -189,8 +192,7 @@
gdk_window_invalidate_rect (widget->window, &area, FALSE);
}
-
- parent_class->size_allocate (widget, allocation);
+ GTK_WIDGET_CLASS (marlin_level_ruler_parent_class)->size_allocate (widget, allocation);
}
static void
@@ -302,7 +304,7 @@
}
pango_layout_get_size (priv->layout, &width, &height);
- gdk_draw_layout (widget->window,
+ gdk_draw_layout (widget->window,
widget->style->dark_gc[state_type],
area->x + (area->width - 7 - PANGO_PIXELS (width)),
yv - (PANGO_PIXELS (height) / 2),
@@ -322,7 +324,7 @@
str = g_strdup_printf ("<small><small>%f</small></small>",
/* (double) marlin_percent_to_db (-50)); */
0.0);
-
+
pango_layout_set_markup (priv->layout, str, -1);
g_free (str);
}
@@ -378,7 +380,7 @@
}
}
}
-
+
static int
expose_event (GtkWidget *widget,
GdkEventExpose *event)
@@ -395,7 +397,7 @@
g_free (rects);
}
-
+
return FALSE;
}
@@ -527,12 +529,12 @@
}
priv->base_offset += dy;
-
+
area.x = 0;
area.y = 0;
area.width = widget->allocation.width;
area.height = widget->allocation.height;
-
+
gdk_window_invalidate_rect (widget->window, &area, FALSE);
g_signal_emit (ruler, signals[BASELINE_CHANGED], 0, priv->base_offset);
@@ -542,35 +544,36 @@
}
static void
-class_init (MarlinLevelRulerClass *klass)
+marlin_level_ruler_class_init (MarlinLevelRulerClass *klass)
{
- GObjectClass *object_class;
- GtkWidgetClass *widget_class;
-
- object_class = G_OBJECT_CLASS (klass);
- widget_class = GTK_WIDGET_CLASS (klass);
+ GObjectClass *o_class;
+ GtkWidgetClass *w_class;
- object_class->finalize = finalize;
- object_class->set_property = set_property;
- object_class->get_property = get_property;
+ o_class = G_OBJECT_CLASS (klass);
+ w_class = GTK_WIDGET_CLASS (klass);
- widget_class->size_allocate = size_allocate;
- widget_class->size_request = size_request;
- widget_class->realize = realize;
- widget_class->expose_event = expose_event;
- widget_class->button_press_event = button_press_event;
- widget_class->button_release_event = button_release_event;
- widget_class->motion_notify_event = motion_notify_event;
+ o_class->finalize = finalize;
+ o_class->dispose = dispose;
+ o_class->set_property = set_property;
+ o_class->get_property = get_property;
+
+ w_class->size_allocate = size_allocate;
+ w_class->size_request = size_request;
+ w_class->realize = realize;
+ w_class->expose_event = expose_event;
+ w_class->button_press_event = button_press_event;
+ w_class->button_release_event = button_release_event;
+ w_class->motion_notify_event = motion_notify_event;
- parent_class = g_type_class_peek_parent (klass);
+ g_type_class_add_private (o_class, sizeof (MarlinLevelRulerPrivate));
- g_object_class_install_property (object_class,
+ g_object_class_install_property (o_class,
PROP_CHANNELS,
g_param_spec_uint ("channels",
"", "",
0, G_MAXUINT, 0,
G_PARAM_WRITABLE));
- g_object_class_install_property (object_class,
+ g_object_class_install_property (o_class,
PROP_LEVEL_DISPLAY,
g_param_spec_enum ("scale",
"", "",
@@ -589,36 +592,16 @@
}
static void
-init (MarlinLevelRuler *ruler)
+marlin_level_ruler_init (MarlinLevelRuler *ruler)
{
- ruler->priv = g_new0 (MarlinLevelRulerPrivate, 1);
- ruler->priv->channels = DEFAULT_CHANNELS;
- ruler->priv->vmin = DEFAULT_VMIN;
- ruler->priv->vmax = DEFAULT_VMAX;
- ruler->priv->level_display = MARLIN_SCALE_LINEAR;
- ruler->priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (ruler),
-
- "0");
-}
-
-GType
-marlin_level_ruler_get_type (void)
-{
- static GType type = 0;
-
- if (type == 0) {
- GTypeInfo info = {
- sizeof (MarlinLevelRulerClass), NULL, NULL,
- (GClassInitFunc) class_init, NULL, NULL,
- sizeof (MarlinLevelRuler), 0, (GInstanceInitFunc) init
- };
-
- type = g_type_register_static (GTK_TYPE_WIDGET,
- "MarlinLevelRuler",
- &info, 0);
- }
+ MarlinLevelRulerPrivate *priv;
- return type;
+ priv = ruler->priv = GET_PRIVATE (ruler);
+ priv->channels = DEFAULT_CHANNELS;
+ priv->vmin = DEFAULT_VMIN;
+ priv->vmax = DEFAULT_VMAX;
+ priv->level_display = MARLIN_SCALE_LINEAR;
+ priv->layout = gtk_widget_create_pango_layout (GTK_WIDGET (ruler), "0");
}
void
@@ -651,7 +634,7 @@
area.y = 0;
area.width = widget->allocation.width;
area.height = widget->allocation.height;
-
+
gdk_window_invalidate_rect (widget->window, &area, FALSE);
}
}
Modified: trunk/marlin/marlin-sample.c
==============================================================================
--- trunk/marlin/marlin-sample.c (original)
+++ trunk/marlin/marlin-sample.c Sat Oct 4 01:11:28 2008
@@ -147,7 +147,7 @@
static void
dispose (GObject *object)
{
- MarlinSample *sample = (MarlinSample *) sample;
+ MarlinSample *sample = (MarlinSample *) object;
MarlinSamplePrivate *priv = sample->priv;
if (priv->selection) {
@@ -271,7 +271,7 @@
WRITE_UNLOCK (priv->lock);
break;
-
+
case PROP_CHANNELS:
WRITE_LOCK (priv->lock);
@@ -291,7 +291,7 @@
} else {
for (i = 0; i < abs (dc); i++) {
MarlinChannel *channel;
-
+
channel = marlin_channel_new (priv->filename, &error);
if (channel == NULL) {
g_warning ("Error making channel");
@@ -302,7 +302,7 @@
g_ptr_array_add (priv->channel_data, channel);
}
}
-
+
WRITE_UNLOCK (priv->lock);
break;
@@ -320,13 +320,13 @@
case PROP_MARKER_MODEL:
model = g_value_get_object (value);
-
+
if (priv->markers == model) {
/* Don't need to do anything */
return;
}
- g_signal_handler_disconnect (priv->markers,
+ g_signal_handler_disconnect (priv->markers,
priv->change_id);
g_signal_handler_disconnect (priv->markers,
priv->add_id);
@@ -335,7 +335,7 @@
g_object_unref (G_OBJECT (priv->markers));
priv->markers = model;
- priv->change_id = g_signal_connect (priv->markers,
+ priv->change_id = g_signal_connect (priv->markers,
"marker-changed",
G_CALLBACK (marker_changed),
sample);
@@ -348,7 +348,7 @@
G_CALLBACK (marker_changed),
sample);
g_object_ref (G_OBJECT (priv->markers));
-
+
break;
case PROP_TAGLIST:
@@ -398,7 +398,7 @@
MarlinSample *sample;
MarlinSamplePrivate *priv;
char *title = NULL;
-
+
sample = MARLIN_SAMPLE (object);
priv = sample->priv;
@@ -431,7 +431,7 @@
g_value_set_string (value, sample->priv->realname);
} else {
char *realname;
-
+
realname = g_path_get_basename (sample->priv->filename);
g_value_set_string (value, realname);
g_free (realname);
@@ -439,13 +439,13 @@
}
} else {
char *realname;
-
+
realname = g_path_get_basename (sample->priv->filename);
g_value_set_string (value, realname);
g_free (realname);
}
break;
-
+
case PROP_CHANNELS:
g_value_set_uint (value, priv->channels);
break;
@@ -457,7 +457,7 @@
case PROP_LENGTH:
g_value_set_float (value, priv->length);
break;
-
+
case PROP_DIRTY:
g_value_set_boolean (value, sample->priv->dirty);
break;
@@ -465,7 +465,7 @@
case PROP_WRITABLE:
g_value_set_boolean (value, sample->priv->writable);
break;
-
+
case PROP_SELECTION:
g_value_set_object (value, sample->priv->selection);
break;
@@ -656,7 +656,7 @@
"channels", 2,
"sample-rate", 44100,
NULL);
-
+
return sample;
}
Modified: trunk/po/Makefile.in.in
==============================================================================
--- trunk/po/Makefile.in.in (original)
+++ trunk/po/Makefile.in.in Sat Oct 4 01:11:28 2008
@@ -1,10 +1,10 @@
# Makefile for program source directory in GNU NLS utilities package.
# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper gnu ai mit edu>
+# Copyright (C) 2004-2008 Rodney Dawes <dobey pwns gmail com>
#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
+# This file may be copied and used freely without restrictions. It may
+# be used in projects which are not available under a GNU Public License,
# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
#
# - Modified by Owen Taylor <otaylor redhat com> to use GETTEXT_PACKAGE
# instead of PACKAGE and to look for po2tbl in ./ not in intl/
@@ -12,7 +12,7 @@
# - Modified by jacob berkman <jacob ximian com> to install
# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
#
-# - Modified by Rodney Dawes <dobey novell com> for use with intltool
+# - Modified by Rodney Dawes <dobey pwns gmail com> for use with intltool
#
# We have the following line for use by intltoolize:
# INTLTOOL_MAKEFILE
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]