[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KExtendedSocket::reset()
From:       Thiago Macieira <thiagom () wanadoo ! fr>
Date:       2002-08-06 23:02:14
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rob Kaper wrote:
>Alas, still not working. FYI, my connect slot does
>
>    setAddress(host, port);
>    enableRead(true);
>    startAsyncConnect();
>
>within AtlantikNetwork, which inherits KExtendedSocket(0, 0,
>KExtendedSocket::inputBufferedSocket)

I have fixed the problem. I've committed Waldo's patch to KExtendedSocket as 
it was sent here. There were no problems with it.

On the other hand, I've created this patch for Atlantik. The problem with 
reconnecting wasn't KExtendedSocket's fault, but a small whoops in Atlantik: 
the signal for the "Connect" button was set only the first time the widget 
was created.

The patch looks big, but it's just the indentation.

- -- 
  Thiago Macieira - UFOT Registry number: 1001
 thiagom@mail.com
   ICQ UIN: 1967141  PGP/GPG: 0x6EF45358
     Registered Linux user #65028
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9UFWiM/XwBW70U1gRAhdzAJwPW8a/NQLRsgrxs+4x7CoLmprcnACffKWv
HSxij8gbXVeLb2ssuPHYpUE=
=eYiS
-----END PGP SIGNATURE-----

["atlantik.diff" (text/x-diff)]

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.117
diff -u -3 -p -r1.117 atlantik.cpp
--- atlantik.cpp	2002/08/02 14:26:42	1.117
+++ atlantik.cpp	2002/08/06 14:19:21
@@ -475,35 +475,34 @@ void Atlantik::initNetworkObject()
 	if (m_atlantikNetwork)
 	{
 		m_atlantikNetwork->reset();
-		return;
-		m_atlantikNetwork->closeNow();
-		delete m_atlantikNetwork;
 	}
+	else
+	{
+	        m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore, this, \
"atlantikNetwork"); +		connect(m_atlantikNetwork, SIGNAL(msgInfo(QString)), this, \
SLOT(slotMsgInfo(QString))); +		connect(m_atlantikNetwork, SIGNAL(msgError(QString)), \
this, SLOT(slotMsgError(QString))); +		connect(m_atlantikNetwork, \
SIGNAL(msgChat(QString, QString)), this, SLOT(slotMsgChat(QString, QString)));  
-	m_atlantikNetwork = new AtlantikNetwork(m_atlanticCore, this, "atlantikNetwork");
-	connect(m_atlantikNetwork, SIGNAL(msgInfo(QString)), this, \
                SLOT(slotMsgInfo(QString)));
-	connect(m_atlantikNetwork, SIGNAL(msgError(QString)), this, \
                SLOT(slotMsgError(QString)));
-	connect(m_atlantikNetwork, SIGNAL(msgChat(QString, QString)), this, \
SLOT(slotMsgChat(QString, QString))); +		connect(m_atlantikNetwork, \
SIGNAL(connectionSuccess()), this, SLOT(slotNetworkConnected())); \
+		connect(m_atlantikNetwork, SIGNAL(connectionFailed(int)), this, \
SLOT(slotNetworkError(int)));  
-	connect(m_atlantikNetwork, SIGNAL(connectionSuccess()), this, \
                SLOT(slotNetworkConnected()));
-	connect(m_atlantikNetwork, SIGNAL(connectionFailed(int)), this, \
SLOT(slotNetworkError(int))); +		connect(m_atlantikNetwork, SIGNAL(joinedGame()), \
this, SLOT(showSelectConfiguration())); +		connect(m_atlantikNetwork, \
SIGNAL(initGame()), this, SLOT(initGame())); +		connect(m_atlantikNetwork, \
SIGNAL(gameStarted()), this, SLOT(gameStarted()));  
-	connect(m_atlantikNetwork, SIGNAL(joinedGame()), this, \
                SLOT(showSelectConfiguration()));
-	connect(m_atlantikNetwork, SIGNAL(initGame()), this, SLOT(initGame()));
-	connect(m_atlantikNetwork, SIGNAL(gameStarted()), this, SLOT(gameStarted()));
+		connect(m_atlantikNetwork, SIGNAL(newPlayer(Player *)), this, \
SLOT(newPlayer(Player *))); +		connect(m_atlantikNetwork, SIGNAL(newEstate(Estate \
*)), this, SLOT(newEstate(Estate *))); +		connect(m_atlantikNetwork, \
SIGNAL(newTrade(Trade *)), this, SLOT(newTrade(Trade *))); \
+		connect(m_atlantikNetwork, SIGNAL(newAuction(Auction *)), this, \
SLOT(newAuction(Auction *)));  
-	connect(m_atlantikNetwork, SIGNAL(newPlayer(Player *)), this, SLOT(newPlayer(Player \
                *)));
-	connect(m_atlantikNetwork, SIGNAL(newEstate(Estate *)), this, SLOT(newEstate(Estate \
                *)));
-	connect(m_atlantikNetwork, SIGNAL(newTrade(Trade *)), this, SLOT(newTrade(Trade \
                *)));
-	connect(m_atlantikNetwork, SIGNAL(newAuction(Auction *)), this, \
                SLOT(newAuction(Auction *)));
-
-	connect(this, SIGNAL(rollDice()), m_atlantikNetwork, SLOT(rollDice()));
-	connect(this, SIGNAL(buyEstate()), m_atlantikNetwork, SLOT(buyEstate()));
-	connect(this, SIGNAL(auctionEstate()), m_atlantikNetwork, SLOT(auctionEstate()));
-	connect(this, SIGNAL(endTurn()), m_atlantikNetwork, SLOT(endTurn()));
-	connect(this, SIGNAL(jailCard()), m_atlantikNetwork, SLOT(jailCard()));
-	connect(this, SIGNAL(jailPay()), m_atlantikNetwork, SLOT(jailPay()));
-	connect(this, SIGNAL(jailRoll()), m_atlantikNetwork, SLOT(jailRoll()));
+		connect(this, SIGNAL(rollDice()), m_atlantikNetwork, SLOT(rollDice()));
+		connect(this, SIGNAL(buyEstate()), m_atlantikNetwork, SLOT(buyEstate()));
+		connect(this, SIGNAL(auctionEstate()), m_atlantikNetwork, SLOT(auctionEstate()));
+		connect(this, SIGNAL(endTurn()), m_atlantikNetwork, SLOT(endTurn()));
+		connect(this, SIGNAL(jailCard()), m_atlantikNetwork, SLOT(jailCard()));
+		connect(this, SIGNAL(jailPay()), m_atlantikNetwork, SLOT(jailPay()));
+		connect(this, SIGNAL(jailRoll()), m_atlantikNetwork, SLOT(jailRoll()));
+	}
 	
 	if (m_selectServer)
 	{



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic