Bug 12339 - Miniature logs to FICS already in MainPage
: Miniature logs to FICS already in MainPage
Status: CLOSED FIXED
Product: Miniature
Engine
: master
: other other
: High major (vote)
: 0.4
Assigned To: Michael Hasselmann
: general
:
: easyfix
:
:
  Show dependency tree
 
Reported: 2011-08-24 22:23 UTC by Quim Gil
Modified: 2011-09-18 07:53 UTC (History)
1 user (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Quim Gil (reporter) 2011-08-24 22:23:43 UTC
SOFTWARE VERSION: 
0.3 in N9

EXACT STEPS LEADING TO PROBLEM: 
1. Boot Miniature


EXPECTED OUTCOME: 
Just boots up, nothing else.

ACTUAL OUTCOME: 
The logs show that already in MainPage there is a FICS conenction and activity
going on. Before logging in as guest or registered user.

REPRODUCIBILITY: 
always
Comment 1 Michael Hasselmann 2011-08-27 02:43:45 UTC
Would consider this an easyfix, still. One can quickly debug where the
connection to FICS gets activated, in
https://gitorious.org/miniature/miniature/blobs/master/game/fics/backend.cc
Comment 2 Quim Gil (reporter) 2011-08-29 01:55:35 UTC
(In reply to comment #1)
> https://gitorious.org/miniature/miniature/blobs/master/game/fics/backend.cc

"Sorry, page not found", and I couldn't find backend.cc.
Comment 3 Michael Hasselmann 2011-08-29 11:09:06 UTC
I had chosen to rename it:
https://gitorious.org/miniature/miniature/blobs/master/game/fics/engine.cc
Comment 4 Quim Gil (reporter) 2011-08-29 19:42:31 UTC
fwiw this is my attempt of finding a solution. Seems to work now, I have tested
both just waiting without logging in and introducing a wrong userid:


diff --git a/game/fics/engine.cc b/game/fics/engine.cc
index 2a58bd7..2cf6f94 100644
--- a/game/fics/engine.cc
+++ b/game/fics/engine.cc
@@ -356,7 +356,7 @@ void Engine::setEnabled(bool enable)
             m_state = StateIdle;
             emit stateChanged(m_state);
         }
-    } else if (not m_channel.isOpen()) {
+      } else if ((m_state == StateLoginPending || StateLoginFailed) && not
m_channel.isOpen()) {
         m_channel.connectToHost("freechess.org", 5000, QIODevice::ReadWrite);
         m_channel.waitForConnected();
Comment 5 Michael Hasselmann 2011-09-04 01:09:51 UTC
Fixed with commit 1514dd9e4badb01fd3d5765f1f54de6c7bd8ee96.
Comment 6 Quim Gil (reporter) 2011-09-04 08:42:48 UTC
Verified, thanks!

PS: looking at the patch there is nothing that I would consider "easyfix" for
myself.  ;)
Comment 7 Michael Hasselmann 2011-09-05 23:58:08 UTC
Well, I doubt a newcomer would have fixed it in the same way as I did (because
I merged login and connection handling into one step), but the original bug fix
was easy.