changeset 3726:d85208a99af2

[gaim-migrate @ 3862] (12:18:46) Robot101: it switches the .desktop file to the new KDE/GNOME common vfolder format (12:18:48) Robot101: and location (12:19:01) Robot101: and it moves a function from util.c to aim.c and makes it static (12:19:08) Robot101: because it's only used by the main window and removes a function herman #ifdef 0'ed, and fixes a segfault in the docklet. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Thu, 17 Oct 2002 16:25:54 +0000
parents dd48b1ac5bd8
children dadb43e0bcae
files ChangeLog Makefile.am gaim.desktop src/aim.c src/buddy.c src/gaim.h src/multi.c src/prefs.c src/util.c
diffstat 9 files changed, 51 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Oct 17 05:06:15 2002 +0000
+++ b/ChangeLog	Thu Oct 17 16:25:54 2002 +0000
@@ -94,6 +94,8 @@
 	* Option to have AIM over oscar notify you if you have 
 	  unread mail (Thanks, Mark Doliner)
 	* Fix first message in tab not displaying bug (Thanks Etan Reisner)
+	* Switch the .desktop file to the new KDE/GNOME common vfolder 
+	  format (Thanks Robert McQueen).
 
 version 0.59 (06/24/2002):
 	* Hungarian translation added (Thanks, Sutto Zoltan)
--- a/Makefile.am	Thu Oct 17 05:06:15 2002 +0000
+++ b/Makefile.am	Thu Oct 17 16:25:54 2002 +0000
@@ -4,7 +4,7 @@
 dist-hook: gaim.spec
 	cp gaim.spec $(distdir)
 
-pixmapdir = $(datadir)/gnome/apps/Internet
+pixmapdir = $(datadir)/applications
 pixmap_DATA = gaim.desktop
 
 SUBDIRS = m4 sounds plugins pixmaps doc po intl src
--- a/gaim.desktop	Thu Oct 17 05:06:15 2002 +0000
+++ b/gaim.desktop	Thu Oct 17 16:25:54 2002 +0000
@@ -1,8 +1,9 @@
 [Desktop Entry]
+Encoding=UTF-8
 Name=Gaim
-Comment=Multi-protocol Instant Messaging Client 
-Exec=gaim 
+Comment=Multi-protocol Instant Messaging Client
+Exec=gaim
 Icon=gaim.png
-Info=Gaim
-Terminal=0
+Terminal=false
 Type=Application
+Categories=Application;Network;
--- a/src/aim.c	Thu Oct 17 05:06:15 2002 +0000
+++ b/src/aim.c	Thu Oct 17 16:25:54 2002 +0000
@@ -165,20 +165,44 @@
 	save_prefs();
 	serv_login(u);
 }
-#if 0
-static void dologin_all(GtkWidget *widget, GtkWidget *w)
+
+/* <name> is a comma-separated list of names, or NULL
+   if NULL and there is at least one user defined in .gaimrc, try to login.
+   if not NULL, parse <name> into separate strings, look up each one in 
+   .gaimrc and, if it's there, try to login.
+   returns:  0 if successful
+            -1 if no user was found that had a saved password
+*/
+static int dologin_named(char *name)
 {
 	struct aim_user *u;
-	GSList *users = aim_users;
+	char **names, **n;
+	int retval = -1;
 
-	while (users) {
-		u = users->data;
-		if (u->options & OPT_USR_AUTO)
+	if (name !=NULL) {	/* list of names given */
+		names = g_strsplit(name, ",", 32);
+		for (n = names; *n != NULL; n++) {
+			u = find_user(*n, -1);
+			if (u) {	/* found a user */
+				if (u->options & OPT_USR_REM_PASS) {
+					retval = 0;
+					serv_login(u);
+				}
+			}
+		}
+		g_strfreev(names);
+	} else {		/* no name given, use default */
+		u = (struct aim_user *)aim_users->data;
+		if (u->options & OPT_USR_REM_PASS) {
+			retval = 0;
 			serv_login(u);
-		users = users->next;
+		}
 	}
+
+	return retval;
 }
-#endif
+
+
 static void doenter(GtkWidget *widget, GtkWidget *w)
 {
 	if (widget == name) {
@@ -516,7 +540,7 @@
 int main(int argc, char *argv[])
 #endif
 {
-	int opt_acct = 0, opt_help = 0, opt_version = 0, opt_login = 0, opt_nologin = 0, do_login_ret = -1;
+	int opt_acct = 0, opt_help = 0, opt_version = 0, opt_login = 0, opt_nologin = 0, dologin_ret = -1;
 	char *opt_user_arg = NULL, *opt_login_arg = NULL;
 #if HAVE_SIGNAL_H
 	int sig_indx;	/* for setting up signal catching */
@@ -794,7 +818,7 @@
 
 	/* deal with --login */
 	if (opt_login) {
-		do_login_ret = do_auto_login(opt_login_arg);
+		dologin_ret = dologin_named(opt_login_arg);
 		if (opt_login_arg != NULL) {
 			g_free(opt_login_arg);
 			opt_login_arg = NULL;
@@ -806,7 +830,7 @@
 
 	if (opt_acct) {
 		account_editor(NULL, NULL);
-	} else if ((do_login_ret == -1) && !connections)
+	} else if ((dologin_ret == -1) && !connections)
 		show_login();
 #ifdef _WIN32
 	/* Various win32 initializations */
--- a/src/buddy.c	Thu Oct 17 05:06:15 2002 +0000
+++ b/src/buddy.c	Thu Oct 17 16:25:54 2002 +0000
@@ -2047,9 +2047,7 @@
 }
 
 void docklet_remove() {
-	if (docklet_count) {
-		docklet_count--;
-	}
+	docklet_count--;
 	debug_printf("docklet_count: %d\n",docklet_count);
 	if (!docklet_count) {
 		if (connections) {
@@ -2064,7 +2062,7 @@
 	/* Useful for the docklet plugin and also for the win32 tray icon*/
 	/* This is called when one of those is clicked--it will show/hide the 
 	   buddy list/login window--depending on which is active */
-	if (connections) {
+	if (connections && blist) {
 		if (GTK_WIDGET_VISIBLE(blist)) {
 			if (GAIM_WINDOW_ICONIFIED(blist)) {
 				unhide_buddy_list();
@@ -2074,6 +2072,9 @@
 		} else {
 			unhide_buddy_list();
 		}
+	} else if (connections) {
+		/* we're logging in or something... do nothing */
+		debug_printf("docklet_toggle called with connections but no blist!\n");
 	} else {
 		if (GTK_WIDGET_VISIBLE(mainwindow)) {
 			if (GAIM_WINDOW_ICONIFIED(mainwindow)) {
--- a/src/gaim.h	Thu Oct 17 05:06:15 2002 +0000
+++ b/src/gaim.h	Thu Oct 17 16:25:54 2002 +0000
@@ -456,7 +456,6 @@
 extern char *away_subs(char *, char *);
 extern char *stylize(gchar *, int);
 extern void show_usage (int, char *);
-extern int do_auto_login (char *);
 extern char *gaim_home_dir();
 extern char *gaim_user_dir();
 extern void strncpy_nohtml(gchar *, const gchar *, size_t);
--- a/src/multi.c	Thu Oct 17 05:06:15 2002 +0000
+++ b/src/multi.c	Thu Oct 17 16:25:54 2002 +0000
@@ -1138,9 +1138,7 @@
 	gaim_setup(gc);
 
 	gc->user->connecting = FALSE;
-	if (connecting_count) {
-		connecting_count--;
-	}
+	connecting_count--;
 	debug_printf("connecting_count: %d\n", connecting_count);
 
 	plugin_event(event_signon, gc);
@@ -1439,9 +1437,7 @@
 	   this user was ever on-line or not */
 	if (gc->user->connecting) {
 		gc->user->connecting = FALSE;
-		if (connecting_count) {
-			connecting_count--;
-		}
+		connecting_count--;
 	}
 	debug_printf("connecting_count: %d\n", connecting_count);
 	serv_close(gc);
--- a/src/prefs.c	Thu Oct 17 05:06:15 2002 +0000
+++ b/src/prefs.c	Thu Oct 17 16:25:54 2002 +0000
@@ -403,11 +403,6 @@
 	ret = gtk_vbox_new(FALSE, 18);
 	gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
 
-/* fixme: docklet
-	gaim_button(_("Automatically show buddy list on sign on"), &blist_options_new,
-		    OPT_BLIST_APP_BUDDY_SHOW, vbox);
-	gaim_button(_("Display Buddy List near applet"), &blist_options_new, OPT_BLIST_NEAR_APPLET, vbox); */
-
 	vbox = make_frame (ret, _("Buttons"));
 	gaim_button(_("_Hide IM/Info/Chat buttons"), &blist_options_new, OPT_BLIST_NO_BUTTONS, vbox);
 	gaim_button(_("Show _pictures on buttons"), &blist_options_new, OPT_BLIST_SHOW_BUTTON_XPM, vbox);
--- a/src/util.c	Thu Oct 17 05:06:15 2002 +0000
+++ b/src/util.c	Thu Oct 17 16:25:54 2002 +0000
@@ -806,7 +806,7 @@
 		       "  -w, --away[=MESG]   make away on signon (optional argument MESG specifies\n"
 		       "                      name of away message to use)\n"
 		       "  -l, --login[=NAME]  automatically login (optional argument NAME specifies\n"
-		       "                      account(s) to use)\n"
+		       "                      account(s) to use, seperated by commas)\n"
 		       "  -n, --loginwin      don't automatically login; show login window\n"
 		       "  -u, --user=NAME     use account NAME\n"
 		       "  -f, --file=FILE     use FILE as config\n"
@@ -820,43 +820,6 @@
 	}
 }
 
-
-/* <name> is a comma-separated list of names, or NULL
-   if NULL and there is at least one user defined in .gaimrc, try to login.
-   if not NULL, parse <name> into separate strings, look up each one in 
-   .gaimrc and, if it's there, try to login.
-   returns:  0 if successful
-            -1 if no user was found that had a saved password
-*/
-int do_auto_login(char *name)
-{
-	struct aim_user *u;
-	char **names, **n;
-	int retval = -1;
-
-	if (name !=NULL) {	/* list of names given */
-		names = g_strsplit(name, ",", 32);
-		for (n = names; *n != NULL; n++) {
-			u = find_user(*n, -1);
-			if (u) {	/* found a user */
-				if (u->options & OPT_USR_REM_PASS) {
-					retval = 0;
-					serv_login(u);
-				}
-			}
-		}
-		g_strfreev(names);
-	} else {		/* no name given, use default */
-		u = (struct aim_user *)aim_users->data;
-		if (u->options & OPT_USR_REM_PASS) {
-			retval = 0;
-			serv_login(u);
-		}
-	}
-
-	return retval;
-}
-
 GSList *message_split(char *message, int limit)
 {
 	static GSList *ret = NULL;