patch to close #1

1 view
Skip to first unread message

Vern Sun

unread,
Mar 12, 2008, 10:38:25 AM3/12/08
to ic...@googlegroups.com
能够避免普通用户登录时引起程序崩溃的 patch

在 svn-r51 版本测试通过,验证后请关闭 #1

PS: 建议使用 astyle 工具对整个源码进行格式化,定义好的编码风格后,公布配置文件
(astylerc),如此可以避免因编码风格不同导致补丁文件中存在冗余信息的问题。

--
Vern
2008-03-12

close1.patch
signature.asc

lerosua

unread,
Mar 12, 2008, 11:16:57 AM3/12/08
to ic...@googlegroups.com
Fixed in svn-r52
Thanks;

astylerc 的问题,研究研究。还不知道怎么用哩。

>diff --git a/src/Bodies.cpp b/src/Bodies.cpp
>index 88ae8ea..797faf6 100644
>--- a/src/Bodies.cpp
>+++ b/src/Bodies.cpp
>@@ -12,7 +12,7 @@
> * Compiler: gcc
> *
> * Author: wind (xihe), xih...@gmail.com
>- * Company:
>+ * Company:
> *
> * =====================================================================================
> */
>@@ -43,7 +43,7 @@
> #include "sounds.h"
> using namespace std;
>
>-Bodies& Bodies::Get_Bodies()
>+Bodies& Bodies::Get_Bodies()
> {
> static Bodies bodies;
> return bodies;
>@@ -54,6 +54,8 @@ Bodies::Bodies()
> main_window = new MainWindow(*this);
> msg_window = new MsgWindow();
> statusIcon = new TrayIcon(main_window);
>+
>+ accountTag = NULL;
> }
>
> Bodies::~Bodies()
>@@ -136,6 +138,13 @@ void Bodies::loadAccountTag()
> try{
> ConfXml accoutxml;
> accountTag = accoutxml.xml_from_file(buf);
>+ if (!accountTag) {
>+ // TODO
>+ // 1. remove try..catch
>+ // 2. use macro define fpr..(err.., .., __FILE__, __LINE__)
>+ fprintf(stderr, "!!! %s:%d\n", __FILE__, __LINE__);
>+ throw;
>+ }
> }
> catch (exception& e)
> {
>@@ -151,7 +160,7 @@ bool Bodies::callback(Glib::IOCondition condition)
> ce=jclient->recv();
> //talkFT->loopRecv();
> //IBBSHandler.sendIBBData("lerosua icalk testing");
>-
>+
> }
> return true;
> }
>@@ -193,7 +202,7 @@ int Bodies::connect(const char *name, const char* passwd)
> PBUG("login\n");
> if(!server.empty())
> jclient->setServer(server);
>-
>+
> if(!portstring.empty())
> {
> int port = atoi(portstring.c_str());
>@@ -205,7 +214,7 @@ int Bodies::connect(const char *name, const char* passwd)
> FCAPS* se=new FCAPS(t) ;
> jclient->addPresenceExtension(se);
> */
>-
>+
>
> jclient->disco()->registerDiscoHandler(&discohandler);
> //bookMark= new TalkBookMark(jclient.get());
>@@ -226,7 +235,7 @@ int Bodies::connect(const char *name, const char* passwd)
> PBUG("connect error\n");
> return -1;
> }
>-
>+
> bool Bodies::login(const std::string name,const std::string passwd)
> {
> int mysock = -1;
>diff --git a/src/Makefile.am b/src/Makefile.am
>index 4b8962d..1821f1a 100644
>--- a/src/Makefile.am
>+++ b/src/Makefile.am
>@@ -1,6 +1,7 @@
> INCLUDES = \
> -I$(top_srcdir) \
> -I$(srcdir) \
>+ -g \
> -DDATA_DIR=\""${datadir}/icalk"\" \
> -DITALK_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
> @PACKAGE_CFLAGS@

signature.asc
Reply all
Reply to author
Forward
0 new messages