[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise
From: Will Stephenson <wstephenson () kde ! org>
Date: 2007-07-26 9:57:11
Message-ID: 1185443831.690883.23942.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 692802 by wstephens:
*) Better error reporting
*) Fix error in chatroom search so that all chatrooms are listed
*) Fetch user info for invitation declined event user if we joined after the \
invitation was made
*) Deactivate the Join Chatrooms action when offline, fix crash
M +9 -4 gwaccount.cpp
M +6 -6 libgroupwise/Makefile.am
M +2 -5 libgroupwise/chatroommanager.cpp
M +2 -3 libgroupwise/chatroommanager.h
A libgroupwise/gwerror.cpp [License: LGPL (v2+)]
M +4 -2 libgroupwise/gwerror.h
M +4 -1 libgroupwise/task.cpp
M +3 -0 libgroupwise/task.h
M +3 -2 libgroupwise/tasks/conferencetask.cpp
M +2 -2 libgroupwise/tasks/getchatsearchresultstask.h
M +2 -2 libgroupwise/tasks/modifycontactlisttask.cpp
M +7 -2 libgroupwise/tasks/searchchattask.cpp
M +5 -5 ui/gwchatsearchdialog.cpp
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/gwaccount.cpp \
#692801:692802 @@ -106,6 +106,7 @@
m_actionAutoReply->setEnabled( isConnected() );
m_actionManagePrivacy->setEnabled( isConnected() );
+ m_actionJoinChatRoom->setEnabled( isConnected() );
m_actionMenu->insert( m_actionManagePrivacy );
m_actionMenu->insert( m_actionAutoReply );
m_actionMenu->insert( m_actionJoinChatRoom );
@@ -1183,10 +1184,14 @@
Kopete::Contact * c = contacts()[ protocol()->dnToDotted( cct->userId() ) ];
if ( c )
{
- if ( c->metaContact()->contacts().count() == 1 )
- Kopete::ContactList::self()->removeMetaContact( c->metaContact() );
- else
- delete c;
+ // if the contact creation failed because it already exists on the server, don't \
delete it + if (!cct->statusCode() == NMERR_DUPLICATE_CONTACT )
+ {
+ if ( c->metaContact()->contacts().count() == 1 )
+ Kopete::ContactList::self()->removeMetaContact( c->metaContact() );
+ else
+ delete c;
+ }
}
KMessageBox::queuedMessageBox( Kopete::UI::Global::mainWidget (), \
KMessageBox::Error,
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/Makefile.am \
#692801:692802 @@ -19,12 +19,12 @@
noinst_LTLIBRARIES = libgroupwise.la libgwtest.la
libgroupwise_la_COMPILE_FIRST = securestream.moc
-libgroupwise_la_SOURCES = connector.cpp bytestream.cpp tlshandler.cpp \
- qcatlshandler.cpp gwclientstream.cpp securestream.cpp stream.cpp \
coreprotocol.cpp \
- gwfield.cpp transferbase.cpp usertransfer.cpp eventtransfer.cpp \
transfer.cpp \
- request.cpp requestfactory.cpp safedelete.cpp response.cpp client.cpp \
task.cpp \
- rtf.cc userdetailsmanager.cpp eventprotocol.cpp inputprotocolbase.cpp \
- responseprotocol.cpp privacymanager.cpp gwglobal.cpp chatroommanager.cpp
+libgroupwise_la_SOURCES = bytestream.cpp chatroommanager.cpp client.cpp \
+ connector.cpp coreprotocol.cpp eventprotocol.cpp eventtransfer.cpp \
gwclientstream.cpp \ + gwerror.cpp gwfield.cpp gwglobal.cpp inputprotocolbase.cpp \
privacymanager.cpp \ + qcatlshandler.cpp request.cpp requestfactory.cpp response.cpp \
responseprotocol.cpp rtf.cc \ + safedelete.cpp securestream.cpp stream.cpp task.cpp \
tlshandler.cpp transfer.cpp \ + transferbase.cpp userdetailsmanager.cpp \
usertransfer.cpp libgroupwise_la_LDFLAGS = -no-undefined $(all_libraries)
libgroupwise_la_LIBADD = tasks/libgroupwise_tasks.la -lqt-mt qca/src/libqca.la
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/chatroommanager.cpp \
#692801:692802 @@ -37,12 +37,9 @@
{
}
-void ChatroomManager::update()
+void ChatroomManager::updateRooms()
{
- if ( m_rooms.isEmpty() )
- getChatrooms( false );
- else
- updateCounts();
+ getChatrooms( !m_rooms.isEmpty() );
}
GroupWise::ChatroomMap ChatroomManager::rooms()
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/chatroommanager.h \
#692801:692802 @@ -37,13 +37,12 @@
~ChatroomManager();
GroupWise::ChatroomMap rooms();
void requestProperties( const QString & displayName );
- void update();
+ void updateRooms();
+ void updateCounts();
signals:
void gotProperties( const GroupWise::Chatroom & );
void updated();
- public slots:
protected:
- void updateCounts();
void getChatrooms( bool refresh );
protected slots:
/**
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/gwerror.h \
#692801:692802 @@ -1,9 +1,9 @@
/*
gwerror.h - Kopete Groupwise Protocol
- Copyright (c) 2004 SUSE Linux AG http://www.suse.com
+ Copyright (c) 2004-2007 Novell, Inc http://www.novell.com/linux
- Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
+ Kopete (c) 2002-2007 by the Kopete developers <kopete-devel@kde.org>
*************************************************************************
* *
@@ -94,6 +94,8 @@
Closed = 0x10000000
};
+ QString errorCodeToString( int errorCode );
+
// helpful structs used to pass data between the client library and the application \
using it class ConferenceGuid : public QString
{
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/task.cpp \
#692801:692802 @@ -197,7 +197,10 @@
if(!d->done) {
d->success = false;
d->statusCode = code;
- d->statusString = str;
+ if ( str.isEmpty() )
+ d->statusString = GroupWise::errorCodeToString( code );
+ else
+ d->statusString = str;
done();
}
}
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/task.h \
#692801:692802 @@ -64,6 +64,9 @@
virtual void onDisconnect();
void send( Request * request );
void setSuccess( int code=0, const QString &str="" );
+ /**
+ * If an empty string is passed, this sets the error string based on the error code \
using GroupWise::errorCodeToString + */
void setError( int code=0, const QString &str="" );
// void debug( const char *, ... );
void debug( const QString & );
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/tasks/conferencetask.cpp \
#692801:692802 @@ -130,7 +130,8 @@
break;
case GroupWise::ConferenceReject:
client()->debug( "ConferenceReject" );
- emit invitationDeclined( event );
+ if ( !queueWhileAwaitingData( event ) )
+ emit invitationDeclined( event );
break;
case GroupWise::ReceiveAutoReply:
Q_ASSERT( incomingEvent->hasFlags() );
@@ -180,7 +181,7 @@
// if the details relate to event, try again to handle it
if ( details.dn == (*current).user )
{
- client()->debug( QString( " - got details for event involving%1" ).arg( \
(*current).user ) ); + client()->debug( QString( " - got details for event \
involving %1" ).arg( (*current).user ) ); switch ( (*current).type )
{
case GroupWise::ConferenceJoined:
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/tasks/getchatsearchresultstask.h \
#692801:692802 @@ -28,7 +28,7 @@
#include "requesttask.h"
/**
-Search results are polled on the server, using the search handle returned by the \
server with the original query. This is a single poll request, which if successful, \
will retrieve the results. Otherwise, it will set a status code, so the \
SearchContactTask can decide whether to poll again. +Search results are polled on the \
server, using the search handle returned by the server with the original query. This \
is a single poll request, which if successful, will retrieve the results. Otherwise, \
it will set a status code, so the SearchChatTask can decide whether to poll again.
@author SUSE Linux Products GmbH
*/
@@ -36,7 +36,7 @@
{
Q_OBJECT
public:
- enum SearchResultCode { Cancelled=4, Error=5, GettingData=8, DataRetrieved=9 };
+ enum SearchResultCode { Completed=2, Cancelled=4, Error=5, GettingData=8, \
DataRetrieved=9 }; GetChatSearchResultsTask(Task* parent);
~GetChatSearchResultsTask();
void poll( int queryHandle);
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/tasks/modifycontactlisttask.cpp \
#692801:692802 @@ -20,7 +20,7 @@
#include "client.h"
#include "response.h"
-
+#include "gwerror.h"
#include "modifycontactlisttask.h"
ModifyContactListTask::ModifyContactListTask(Task* parent): RequestTask(parent)
@@ -74,7 +74,7 @@
// TODO: call virtual here to read any fields after the contact list...
if ( response->resultCode() == GroupWise::None )
setSuccess();
- else
+ else
setError( response->resultCode() );
return true;
}
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/libgroupwise/tasks/searchchattask.cpp \
#692801:692802 @@ -101,8 +101,13 @@
else
setSuccess( gcsrt->statusCode() );
break;
- case GetChatSearchResultsTask::DataRetrieved:
- m_results = gcsrt->results();
+ case GetChatSearchResultsTask::DataRetrieved:
+ // got some results, there may be more.
+ m_results += gcsrt->results();
+ QTimer::singleShot( 0, this, SLOT( slotPollForResults() ) );
+ break;
+ case GetChatSearchResultsTask::Completed:
+ m_results += gcsrt->results();
setSuccess();
break;
case GetChatSearchResultsTask::Cancelled:
--- branches/KDE/3.5/kdenetwork/kopete/protocols/groupwise/ui/gwchatsearchdialog.cpp \
#692801:692802 @@ -51,7 +51,7 @@
connect( m_widget->m_btnRefresh, SIGNAL( clicked() ), SLOT( slotUpdateClicked() ) \
); connect( m_widget->m_btnProperties, SIGNAL( clicked() ), SLOT( \
slotPropertiesClicked() ) );
- m_manager->update();
+ m_manager->updateRooms();
show();
}
@@ -62,19 +62,19 @@
void GroupWiseChatSearchDialog::slotUpdateClicked()
{
kdDebug ( GROUPWISE_DEBUG_GLOBAL ) << "updating chatroom list " << endl;
+ m_widget->m_chatrooms->clear();
QListViewItem * first = m_widget->m_chatrooms->firstChild();
QString updateMessage = i18n("Updating chatroom list..." );
- if ( first )
+/* if ( first )
new QListViewItem( first, updateMessage );
- else
+ else*/
new QListViewItem( m_widget->m_chatrooms, updateMessage );
- m_manager->update();
+ m_manager->updateRooms();
}
void GroupWiseChatSearchDialog::slotManagerUpdated()
{
- m_widget->m_chatrooms->clear();
ChatroomMap rooms = m_manager->rooms();
ChatroomMap::iterator it = rooms.begin();
const ChatroomMap::iterator end = rooms.end();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic