summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2011-01-16 17:38:21 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2011-07-31 01:05:47 +0100
commit570e7e56d631d1acf9925d88222c2d7cccd31118 (patch)
tree6244877733002d27a14e0d89a510951565f018a7 /demos
parentb0e383168ce8dad8d2be535a6f5e162703f195ab (diff)
downloadlibgdata-570e7e56d631d1acf9925d88222c2d7cccd31118.tar.gz
demos: Fix assignments from invalid pointers
Diffstat (limited to 'demos')
-rw-r--r--demos/scrapbook/scrapbook.c13
-rw-r--r--demos/scrapbook/scrapbook.h8
2 files changed, 12 insertions, 9 deletions
diff --git a/demos/scrapbook/scrapbook.c b/demos/scrapbook/scrapbook.c
index de8b0a36..08488e03 100644
--- a/demos/scrapbook/scrapbook.c
+++ b/demos/scrapbook/scrapbook.c
@@ -75,7 +75,8 @@ video_selected (GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column,
button = gtk_button_new ();
gtk_widget_show (image);
gtk_container_add (GTK_CONTAINER (button), image);
- g_signal_connect (button, "clicked", G_CALLBACK (open_in_web_browser), gdata_youtube_video_get_player_uri (GDATA_YOUTUBE_VIDEO (video)));
+ g_signal_connect (button, "clicked", G_CALLBACK (open_in_web_browser),
+ (gpointer) gdata_youtube_video_get_player_uri (GDATA_YOUTUBE_VIDEO (video)));
gtk_table_attach_defaults (GTK_TABLE(self->main_data->table), button,
self->main_data->currentRow[self->main_data->currentCol],
self->main_data->currentRow[self->main_data->currentCol]+1,
@@ -251,9 +252,10 @@ yt_query_element (GDataEntry *entry, guint entry_key, guint entry_count, ScrapYT
{
GList *thumbnails;
GDataMediaThumbnail *thumbnail;
- gchar *title; /* the video's title */
- gchar *uri; /* the video's URI */
+ const gchar *title; /* the video's title */
+ const gchar *uri; /* the video's URI */
GFileInputStream *input_stream; /* this will be used to make a pixbuf to store the thumbnail */
+
title = gdata_entry_get_title (entry); /* self-explanatory, I hope */
uri = gdata_youtube_video_get_player_uri (GDATA_YOUTUBE_VIDEO (entry)); /* ditto */
g_print ("%s %s", title, uri);
@@ -394,8 +396,9 @@ start_new_youtube_search (GtkWidget *widget, ScrapData *first) /* *first is a po
static void
properties_set (GtkWidget *widget, ScrapProps *self)
{
- self->main_data->username = gtk_entry_get_text (GTK_ENTRY(self->username_entry));
- self->main_data->password = gtk_entry_get_text (GTK_ENTRY(self->password_entry));
+ self->main_data->username = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->username_entry)));
+ self->main_data->password = g_strdup (gtk_entry_get_text (GTK_ENTRY (self->password_entry)));
+
/* authenticate on youtube */
{
GError *error = NULL;
diff --git a/demos/scrapbook/scrapbook.h b/demos/scrapbook/scrapbook.h
index ffeb014b..bd51f217 100644
--- a/demos/scrapbook/scrapbook.h
+++ b/demos/scrapbook/scrapbook.h
@@ -71,9 +71,9 @@ struct _ScrapPUpload {
};
typedef struct _ScrapPicSearch { /* for finding pictures */
- gchar *title;
+ const gchar *title;
gchar *uri;
- gchar *user;
+ const gchar *user;
GdkPixbuf *thumbnail;
ScrapData *main_data;
ScrapPSearch *search_data;
@@ -86,7 +86,7 @@ typedef struct _ScrapPicSearch { /* for finding pictures */
struct _ScrapYTSearch { /* youtube search data */
GtkWidget *txt_entry;
- gchar *txt;
+ const gchar *txt;
GtkWidget *window;
GDataQuery *query;
gchar *title;
@@ -110,7 +110,7 @@ struct _ScrapPSearch { /* for finding albums */
ScrapData *main_data;
GtkWidget *button;
GtkWidget *user_entry;
- gchar *user;
+ const gchar *user;
ScrapPicSearch *pic;
};