Show
Ignore:
Timestamp:
01/06/07 23:36:07 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
f9e7e83d1603744ec991482a6817091f55697ba2
Children:
6339f85f35eb76692e0d2cad2682fd9a8c92187e
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:36:07Z+0000
Message:

[project @ Use of local_buffer instead of dynamic casts [ref #9]]

Original author: Armin Burgmeier <armin@…>
Date: 2005-05-29 19:39:23+00:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/window.cpp

    rf9e7e83 reaf8ea6  
    441441void Gobby::Window::on_obby_user_join(obby::user& user) 
    442442{ 
    443         // TODO: Something like is_client to prevent dynamic_cast? 
    444         // TODO: local_buffer should fix this issue because the host does not 
    445         // send a user_join for the local user (well, it does, but it does 
    446         // it in its constructor - no signal handler could have been 
    447         // connected at this time). 
    448         obby::client_buffer* buf = dynamic_cast<obby::client_buffer*>(m_buffer); 
    449         if(buf) 
    450         { 
    451                 if(&buf->get_self() == &user) 
    452                 { 
    453                         // Login was sucessful, let the fun begin                
    454                         m_header.obby_start(); 
    455                         m_folder.obby_start(); 
    456                         m_userlist.obby_start(); 
    457                         m_chat.obby_start(); 
    458                         m_statusbar.obby_start(); 
    459  
    460                         m_running = true; 
    461                 } 
     443        // Send obby start to GUI components if this is a join command for the 
     444        // local user. The host does not emit such a signal (well it does, but 
     445        // in its constructor - no signal handler could have been connected), 
     446        // so it is only done for the client upon successful login 
     447        if(&m_buffer->get_self() == &user) 
     448        { 
     449                m_header.obby_start(); 
     450                m_folder.obby_start(); 
     451                m_userlist.obby_start(); 
     452                m_chat.obby_start(); 
     453                m_statusbar.obby_start(); 
     454 
     455                m_running = true; 
    462456        } 
    463457