From: <it_...@us...> - 2007-05-19 18:20:45
|
Revision: 1849 http://kmess.svn.sourceforge.net/kmess/?rev=1849&view=rev Author: it_amroth Date: 2007-05-19 11:20:46 -0700 (Sat, 19 May 2007) Log Message: ----------- Removed some stale old code. Modified Paths: -------------- trunk/kmess/ChangeLog trunk/kmess/kmess/chat/chatmaster.cpp trunk/kmess/kmess/chat/chatmaster.h Modified: trunk/kmess/ChangeLog =================================================================== --- trunk/kmess/ChangeLog 2007-05-19 18:09:41 UTC (rev 1848) +++ trunk/kmess/ChangeLog 2007-05-19 18:20:46 UTC (rev 1849) @@ -1,6 +1,7 @@ 2007-05-19 (Valerio) * Fixed a problem in ChatMessageStyle which caused a freeze; also reformatted the code around that method. + * Removed some stale old code in ChatMaster. 2007-05-18 (Valerio) * Fixed sending nudges to currently disconnected chats, it didn't display the contact name. Modified: trunk/kmess/kmess/chat/chatmaster.cpp =================================================================== --- trunk/kmess/kmess/chat/chatmaster.cpp 2007-05-19 18:09:41 UTC (rev 1848) +++ trunk/kmess/kmess/chat/chatmaster.cpp 2007-05-19 18:20:46 UTC (rev 1849) @@ -36,18 +36,16 @@ #include "../network/applications/filetransferp2p.h" #include "../network/applications/gnomemeeting.h" +#include <qfile.h> #include <klocale.h> -#include <qfile.h> - // The constructor ChatMaster::ChatMaster(QObject *parent) : QObject(parent, "ChatMaster"), initialized_(false) { - pendingChatMessages_.setAutoDelete(true); pendingMimeMessages_.setAutoDelete(true); } @@ -410,38 +408,6 @@ /** - * @brief Send all pending chat messages for the contact. - * @param handle The contact to send messages for. - * @param chatWindow The chat window to deliver the messages to. - */ -void ChatMaster::sendPendingChatMessages( const QString &handle, ChatWindow *chatWindow ) -{ - QPair<QString,ChatMessage> *pendingChatMessage; - - pendingChatMessage = pendingChatMessages_.first(); - while( pendingChatMessage != 0 ) - { - // Ignore messages for other contacts - if( pendingChatMessage->first != handle ) - { - // Get next message - pendingChatMessage = pendingChatMessages_.next(); - continue; - } - - // Send the message - chatWindow->receivedMessage( pendingChatMessage->second ); - - // Remove from queue - pendingChatMessages_.remove( pendingChatMessage ); // updates current() - kdDebug() << "sent message, old=" << pendingChatMessage << " new=" << pendingChatMessages_.current() << endl; - pendingChatMessage = pendingChatMessages_.current(); - } -} - - - -/** * @brief Send all pending mime messages for the contact. * @param handle The contact to send messages for. * @param connection The switchboard connection that can be used to send the messages. @@ -666,7 +632,7 @@ if(KMESS_NULL(connection)) return; // Send any pending messages, if any - if( pendingChatMessages_.count() > 0 || pendingMimeMessages_.count() > 0 ) + if( pendingMimeMessages_.count() > 0 ) { // Find the chat window where the contact is the only participant. if( connection->getContactsInChat().size() > 1 ) @@ -687,13 +653,6 @@ { sendPendingMimeMessages( handle, connection ); } - - // Display all pending chat messages for the contact. - ChatWindow *chatWindow = getChatWindowBySwitchboard( connection ); - if( pendingChatMessages_.count() > 0 && chatWindow != 0 ) - { - sendPendingChatMessages( handle, chatWindow ); - } } } @@ -969,7 +928,7 @@ void ChatMaster::slotSwitchboardReady() { // No need to send pending messages or resume an application (a message is always queued before the app is paused). - if( pendingChatMessages_.count() == 0 && pendingMimeMessages_.count() == 0 ) + if( pendingMimeMessages_.count() == 0 ) { #ifdef KMESSDEBUG_CHATMASTER kdDebug() << "ChatMaster::slotSwitchboardReady() - A switchboard is ready to send more messages, no messages pending." << endl; Modified: trunk/kmess/kmess/chat/chatmaster.h =================================================================== --- trunk/kmess/kmess/chat/chatmaster.h 2007-05-19 18:09:41 UTC (rev 1848) +++ trunk/kmess/kmess/chat/chatmaster.h 2007-05-19 18:20:46 UTC (rev 1849) @@ -137,8 +137,6 @@ MsnSwitchboardConnection * getContactSwitchboardConnection(const QString &handle, bool privateChat); // Append the message to the queue, waiting to be delivered void queueMessage( const MimeMessage &message, const QString &handle, bool privateChatRequired ); - // Send all pending chat messages for the contact. - void sendPendingChatMessages( const QString &handle, ChatWindow *chatWindow ); // Send all pending mime messages for the contact. void sendPendingMimeMessages( const QString &handle, MsnSwitchboardConnection *connection ); @@ -156,8 +154,6 @@ QPtrList<ChatWindow> closingChatWindows_; // Whether or not the object was initialized bool initialized_; - // A list of chat messages that should be displayed in the chat window when connection is reestablished - QPtrList< QPair<QString,ChatMessage> > pendingChatMessages_; // A list of mime messages that should be sent to the contact when connection is reestablished QPtrList< PendingMimeMessage > pendingMimeMessages_; // The pointers to the switchboard server connections This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |