aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-04-16 06:26:11 +0800
committerHans Petter <hansp@src.gnome.org>2003-04-16 06:26:11 +0800
commit1cddfbd5e59cc1de55072c79bf44447620f1ebc0 (patch)
tree27670c9e02b310900a6421fe1c7118a706344e73 /calendar/gui
parent824d2c8bfab90deba9ef28de90cac27adc1a6dfb (diff)
downloadgsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.tar
gsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.tar.gz
gsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.tar.bz2
gsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.tar.lz
gsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.tar.xz
gsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.tar.zst
gsoc2013-evolution-1cddfbd5e59cc1de55072c79bf44447620f1ebc0.zip
If we already have an evolution_dir, free the old one before setting it
2003-04-15 Hans Petter Jansson <hpj@ximian.com> * gui/calendar-component.c (owner_set_cb): If we already have an evolution_dir, free the old one before setting it anew. * gui/e-day-view-time-item.c (e_day_view_time_item_draw): Unref the metrics. * gui/e-day-view.c (e_day_view_style_set): Unref the metrics. (e_day_view_recalc_cell_sizes): We don't need font metrics here. (e_day_view_reshape_long_event): Ditto. * gui/e-meeting-model.c (init): Don't dup the string passed to e_table_without_hide(). * gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set): Unref the metrics. (e_meeting_time_selector_recalc_date_form): Doesn't need metrics. * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day): Unref the metrics. * gui/e-week-view.c (e_week_view_style_set): Unref metrics. (e_week_view_recalc_cell_sizes): Ditto. (e_week_view_reshape_event_span): Move Pango stuff to where it can't be leaked due to an early return. Unref metrics. * gui/weekday-picker.c (weekday_picker_style_set): Unref metrics. * gui/dialogs/meeting-page.c (meeting_page_finalize): Free default address. svn path=/trunk/; revision=20857
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-component.c4
-rw-r--r--calendar/gui/dialogs/meeting-page.c5
-rw-r--r--calendar/gui/e-day-view-time-item.c3
-rw-r--r--calendar/gui/e-day-view.c7
-rw-r--r--calendar/gui/e-meeting-model.c2
-rw-r--r--calendar/gui/e-meeting-time-sel.c4
-rw-r--r--calendar/gui/e-week-view-main-item.c2
-rw-r--r--calendar/gui/e-week-view.c18
-rw-r--r--calendar/gui/weekday-picker.c1
9 files changed, 28 insertions, 18 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 7380b7a91e..0d1e06236e 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -60,7 +60,7 @@
#define CREATE_MEETING_ID "meeting"
#define CREATE_TASK_ID "task"
-char *evolution_dir;
+char *evolution_dir = NULL;
EvolutionShellClient *global_shell_client = NULL;
extern ECompEditorRegistry *comp_editor_registry;
@@ -506,6 +506,8 @@ owner_set_cb (EvolutionShellComponent *shell_component,
const char *evolution_homedir,
gpointer user_data)
{
+ if (evolution_dir)
+ g_free (evolution_dir);
evolution_dir = g_strdup (evolution_homedir);
global_shell_client = shell_client;
}
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index cbc9dcdf4a..e786945f5f 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -278,6 +278,11 @@ meeting_page_finalize (GObject *object)
priv->xml = NULL;
}
+ if (priv->default_address) {
+ g_free (priv->default_address);
+ priv->default_address = NULL;
+ }
+
g_free (priv);
mpage->priv = NULL;
diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c
index 5613a15ec2..544d9383cf 100644
--- a/calendar/gui/e-day-view-time-item.c
+++ b/calendar/gui/e-day-view-time-item.c
@@ -436,6 +436,9 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item,
e_day_view_time_item_increment_time (&hour, &minute,
day_view->mins_per_row);
}
+
+ pango_font_metrics_unref (large_font_metrics);
+ pango_font_metrics_unref (small_font_metrics);
}
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index f403aeb6ca..90e8f28069 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1261,6 +1261,7 @@ e_day_view_style_set (GtkWidget *widget,
gtk_widget_set_usize (day_view->time_canvas, times_width, -1);
g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
}
@@ -1327,7 +1328,6 @@ e_day_view_recalc_cell_sizes (EDayView *day_view)
char buffer[128];
PangoFontDescription *font_desc;
PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
PangoLayout *layout;
gint pango_width;
@@ -1336,8 +1336,6 @@ e_day_view_recalc_cell_sizes (EDayView *day_view)
/* Set up Pango prerequisites */
font_desc = gtk_widget_get_style (GTK_WIDGET (day_view))->font_desc;
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
layout = pango_layout_new (pango_context);
/* Calculate the column sizes, using floating point so that pixels
@@ -5192,7 +5190,6 @@ e_day_view_reshape_long_event (EDayView *day_view,
gboolean show_icons = TRUE, use_max_width = FALSE;
PangoFontDescription *font_desc;
PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
PangoLayout *layout;
event = &g_array_index (day_view->long_events, EDayViewEvent,
@@ -5223,8 +5220,6 @@ e_day_view_reshape_long_event (EDayView *day_view,
/* Set up Pango prerequisites */
font_desc = gtk_widget_get_style (GTK_WIDGET (day_view))->font_desc;
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (day_view));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
layout = pango_layout_new (pango_context);
if (day_view->resize_drag_pos != E_DAY_VIEW_POS_NONE
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c
index e049b94661..ce6142fc7a 100644
--- a/calendar/gui/e-meeting-model.c
+++ b/calendar/gui/e-meeting-model.c
@@ -657,7 +657,7 @@ init (EMeetingModel *im)
free_gotten_key,
free_duplicated_key,
NULL));
- e_table_without_hide (priv->without, g_strdup ("delegator"));
+ e_table_without_hide (priv->without, "delegator");
/* FIXME We basically sink a ref otherwise the without table
* will own a ref to us and we will never get finalized */
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index e902d01f61..0b44e16350 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -958,6 +958,7 @@ e_meeting_time_selector_style_set (GtkWidget *widget,
GTK_LAYOUT (mts->display_main)->vadjustment->step_increment = mts->row_height;
g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
}
/* This draws a shadow around the top display and main display. */
@@ -2059,14 +2060,11 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts)
gchar buffer[128];
PangoFontDescription *font_desc;
PangoContext *pango_context;
- PangoFontMetrics *font_metrics;
PangoLayout *layout;
/* Set up Pango prerequisites */
font_desc = gtk_widget_get_style (GTK_WIDGET (mts))->font_desc;
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (mts));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
layout = pango_layout_new (pango_context);
/* Calculate the maximum date width we can fit into the display. */
diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c
index de0a4198fe..68a1681a32 100644
--- a/calendar/gui/e-week-view-main-item.c
+++ b/calendar/gui/e-week-view-main-item.c
@@ -377,6 +377,8 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem,
x + E_WEEK_VIEW_DATE_LINE_L_PAD, line_y,
right_edge, line_y);
}
+
+ pango_font_metrics_unref (font_metrics);
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index f893eeadb1..88de72c287 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -757,6 +757,7 @@ e_week_view_style_set (GtkWidget *widget,
week_view->pm_string);
g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
}
@@ -917,6 +918,8 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view)
else if (width / 2 > time_width)
week_view->time_format = E_WEEK_VIEW_TIME_START;
}
+
+ pango_font_metrics_unref (font_metrics);
}
@@ -2665,13 +2668,6 @@ e_week_view_reshape_event_span (EWeekView *week_view,
one_day_event = e_week_view_is_one_day_event (week_view, event_num);
- /* Set up Pango prerequisites */
- font_desc = gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc;
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
- font_metrics = pango_context_get_metrics (pango_context, font_desc,
- pango_context_get_language (pango_context));
- layout = pango_layout_new (pango_context);
-
/* If the span will not be visible destroy the canvas items and
return. */
if (!e_week_view_get_span_position (week_view, event_num, span_num,
@@ -2685,6 +2681,13 @@ e_week_view_reshape_event_span (EWeekView *week_view,
return;
}
+ /* Set up Pango prerequisites */
+ font_desc = gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc;
+ pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view));
+ font_metrics = pango_context_get_metrics (pango_context, font_desc,
+ pango_context_get_language (pango_context));
+ layout = pango_layout_new (pango_context);
+
/* If we are editing a long event we don't show the icons and the EText
item uses the maximum width available. */
if (!one_day_event && week_view->editing_event_num == event_num
@@ -2889,6 +2892,7 @@ e_week_view_reshape_event_span (EWeekView *week_view,
e_canvas_item_move_absolute (span->text_item, text_x, text_y);
g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
}
diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c
index fb77a2236f..1eb4d96f6a 100644
--- a/calendar/gui/weekday-picker.c
+++ b/calendar/gui/weekday-picker.c
@@ -402,6 +402,7 @@ weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_style)
configure_items (wp);
g_object_unref (layout);
+ pango_font_metrics_unref (font_metrics);
if (GTK_WIDGET_CLASS (parent_class)->style_set)
(* GTK_WIDGET_CLASS (parent_class)->style_set) (widget, previous_style);