soc.2009.transport: a69d250f: use g_timeout_add_seconds instead of g_t...

hanzz at soc.pidgin.im hanzz at soc.pidgin.im
Thu Jul 16 04:25:30 EDT 2009


-----------------------------------------------------------------
Revision: a69d250f740814e5bda7994de2f3f183ab7390cc
Ancestor: 42e4dc9ea9616550576a8bc0c33f34f0181df2ee
Author: hanzz at soc.pidgin.im
Date: 2009-07-16T07:54:25
Branch: im.pidgin.soc.2009.transport
URL: http://d.pidgin.im/viewmtn/revision/info/a69d250f740814e5bda7994de2f3f183ab7390cc

Modified files:
        geventloop.cpp main.cpp

ChangeLog: 

use g_timeout_add_seconds instead of g_timeout_add

-------------- next part --------------
============================================================
--- geventloop.cpp	b77b6f54a53ad22e4844582f465d03e581ee23bc
+++ geventloop.cpp	d6b9a8ede41044d62c0b0d590af1a37836c2e285
@@ -93,13 +93,9 @@ static PurpleEventLoopUiOps eventLoopOps
 	input_add,
 	g_source_remove,
 	NULL,
-#if GLIB_CHECK_VERSION(2,14,0)
 	g_timeout_add_seconds,
-#else
 	NULL,
-#endif
 	NULL,
-	NULL,
 	NULL
 };
 
============================================================
--- main.cpp	c7fe3b4353b0445bfbe59c4215afadf7debce71c
+++ main.cpp	962598b1b4a71e4efd3e3091c08aebc2c1fe9d4b
@@ -313,20 +313,9 @@ static void buddyListUpdate(PurpleBuddyL
  */
 static void buddyListUpdate(PurpleBuddyList *blist, PurpleBlistNode *node){
 	if (node != NULL) {
-		switch(node->type) {
-			case PURPLE_BLIST_GROUP_NODE:
-				break;
-			
-			case PURPLE_BLIST_CONTACT_NODE:
-				break;
-
-			case PURPLE_BLIST_BUDDY_NODE: {
-				PurpleBuddy* buddy = (PurpleBuddy*)node;
-				GlooxMessageHandler::instance()->purpleBuddyChanged(buddy);
-				break;
-			}
-			default:
-				break;
+		if (node->type == PURPLE_BLIST_BUDDY_NODE) {
+			PurpleBuddy* buddy = (PurpleBuddy*)node;
+			GlooxMessageHandler::instance()->purpleBuddyChanged(buddy);
 		}
 	}
 }
@@ -713,7 +702,7 @@ void GlooxMessageHandler::purpleConnecti
 			}
 			else{
 				user->disconnected();
-				g_timeout_add(5000,&reconnect,g_strdup(user->jid().c_str()));
+				g_timeout_add_seconds(5,&reconnect,g_strdup(user->jid().c_str()));
 			}
 		}
 // 		}
@@ -918,7 +907,7 @@ void GlooxMessageHandler::purpleFileRece
 					data->from=remote_user+"@"+jid()+"/bot";
 					data->filename=localname;
 					data->name=filename;
-					g_timeout_add(1000,&sendFileToJabber,data);
+					g_timeout_add_seconds(1,&sendFileToJabber,data);
 					sql()->addDownload(basename,"1");
 				}
 				else {
@@ -1232,10 +1221,10 @@ void GlooxMessageHandler::handlePresence
 				if (protocol()->isMUC(NULL, stanza.to().bare())) {
 					std::string server = stanza.to().username().substr(stanza.to().username().find("%") + 1, stanza.to().username().length() - stanza.to().username().find("%"));
 					server = stanza.from().bare() + server;
-					g_timeout_add(15000,&connectUser,g_strdup(server.c_str()));
+					g_timeout_add_seconds(15,&connectUser,g_strdup(server.c_str()));
 				}
 				else
-					g_timeout_add(15000,&connectUser,g_strdup(stanza.from().bare().c_str()));
+					g_timeout_add_seconds(15,&connectUser,g_strdup(stanza.from().bare().c_str()));
 			}
 		}
 		if (stanza.presence() == Presence::Unavailable && stanza.to().username() == ""){
@@ -1285,7 +1274,7 @@ void GlooxMessageHandler::onDisconnect(C
 	Log().Get("gloox") << j->streamError();
 	Log().Get("gloox") << j->streamErrorText("default text");
 	if (j->streamError()==0 || j->streamError()==24){
-        	j->connect(false);
+		j->connect(false);
 		int mysock = dynamic_cast<ConnectionTCPClient*>( j->connectionImpl() )->socket();
 		connectIO = g_io_channel_unix_new(mysock);
 		g_io_add_watch(connectIO,(GIOCondition) READ_COND,&iter,NULL);


More information about the Commits mailing list