diff src/ticker.c @ 436:7d5f91c1ff20

[gaim-migrate @ 446] Add preference for showing/hiding the ticker. committer: Tailor Script <tailor@pidgin.im>
author Syd Logan <slogan>
date Sun, 25 Jun 2000 02:42:11 +0000
parents 634b93c7a473
children 881f5d538f15
line wrap: on
line diff
--- a/src/ticker.c	Sun Jun 25 01:57:58 2000 +0000
+++ b/src/ticker.c	Sun Jun 25 02:42:11 2000 +0000
@@ -48,6 +48,18 @@
 GList * BuddyTickerFindUser( char *name );
 int BuddyTickerMessageRemove( gpointer data );
 
+// this pref is startup only, so make a shadow here of settings at startup
+// code uses this variable, not display_prefs
+
+extern int display_options;
+int ticker_prefs;
+
+void
+SetTickerPrefs( void ) 
+{
+	ticker_prefs = display_options;
+}
+
 void
 BuddyTickerDestroyWindow( GtkWidget *window )
 {
@@ -95,11 +107,13 @@
 
 	if ( userclose == TRUE )
 		return;
+
+	BuddyTickerCreateWindow();
+
 	q = (GList *) BuddyTickerFindUser( name );
 	if ( q != (GList *) NULL )
 		return;
 
-	BuddyTickerCreateWindow();
 	p = (TickerData *) malloc( sizeof( TickerData ) );
 	p->hbox = (GtkWidget *) NULL;
 	p->label = (GtkWidget *) NULL;
@@ -144,7 +158,10 @@
 	if ( userclose == TRUE )
 		return;
 	p = (GList *) BuddyTickerFindUser( name );
-	data = (TickerData *) p->data;
+	if ( p )
+		data = (TickerData *) p->data;
+	else
+		return;
 	if ( data->pix == (GtkWidget *) NULL ) {
 		data->pix = gtk_pixmap_new( pm, bm );
 		gtk_box_pack_start_defaults( GTK_BOX( data->hbox ), data->pix );
@@ -204,7 +221,8 @@
 
 	while ( p ) {
 		q = (TickerData *) p->data;
-		BuddyTickerRemoveUser( q->buddy ); 
+		if ( q )
+			BuddyTickerRemoveUser( q->buddy ); 
 		p = tickerbuds;
 	}
 	userclose = FALSE;
@@ -215,12 +233,9 @@
 BuddyTickerClearList( void )
 {
 	GList *p = tickerbuds;
-	TickerData *q;
 
-	while ( p ) {
-		q = (TickerData *) p->data;
+	while ( p ) 
 		p = g_list_remove( p, p->data );
-	}
 	tickerbuds = (GList *) NULL;
 }