[totem/gnome-2-32] Add some sanity checks to TotemOpenLocation dialog
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/gnome-2-32] Add some sanity checks to TotemOpenLocation dialog
- Date: Wed, 4 Aug 2010 15:32:21 +0000 (UTC)
commit 4e390c1b93b802ab4102023e583f89f2fa48b0a7
Author: Alexander Saprykin <xelfium gmail com>
Date: Wed Jun 30 12:05:14 2010 +0400
Add some sanity checks to TotemOpenLocation dialog
Closes: bgo#623127
src/totem-open-location.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/totem-open-location.c b/src/totem-open-location.c
index 8fb4fa7..0397634 100644
--- a/src/totem-open-location.c
+++ b/src/totem-open-location.c
@@ -84,6 +84,9 @@ totem_open_location_match (GtkEntryCompletion *completion, const gchar *key, Gtk
/* Substring-match key against URI */
char *uri, *match;
+ g_return_val_if_fail (GTK_IS_TREE_MODEL (user_data), FALSE);
+ g_return_val_if_fail (iter != NULL, FALSE);
+
g_return_val_if_fail (key != NULL, FALSE);
gtk_tree_model_get (user_data, iter, 0, &uri, -1);
g_return_val_if_fail (uri != NULL, FALSE);
@@ -109,6 +112,8 @@ totem_open_location_get_uri (TotemOpenLocation *open_location)
{
char *uri;
+ g_return_val_if_fail (TOTEM_IS_OPEN_LOCATION (open_location), NULL);
+
uri = g_strdup (gtk_entry_get_text (open_location->priv->uri_entry));
if (strcmp (uri, "") == 0)
@@ -131,6 +136,8 @@ totem_open_location_set_from_clipboard (TotemOpenLocation *open_location)
GtkClipboard *clipboard;
gchar *clipboard_content;
+ g_return_val_if_fail (TOTEM_IS_OPEN_LOCATION (open_location), NULL);
+
/* Initialize the clipboard and get its content */
clipboard = gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (open_location)), GDK_SELECTION_CLIPBOARD);
clipboard_content = gtk_clipboard_wait_for_text (clipboard);
@@ -162,6 +169,8 @@ totem_open_location_new (Totem *totem)
GtkTreeModel *model;
GList *recent_items, *streams_recent_items = NULL;
+ g_return_val_if_fail (TOTEM_IS_OBJECT (totem), NULL);
+
open_location = TOTEM_OPEN_LOCATION (g_object_new (TOTEM_TYPE_OPEN_LOCATION, NULL));
if (open_location->priv->uri_container == NULL) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]