This change is necessary to allow chatwindows/chatsessions with no other members. For example, meanwhile conferences can start with no members, as other participants can be added later.
However, IANAKCWH (I am not a kopete chat window hacker) - are there any other problems associated with having an empty chatwindow or Kopete::ChatSession? Signed-off-by: Jeremy Kerr <[EMAIL PROTECTED]> --- kopete/kopete/chatwindow/chatview.cpp | 4 ++-- kopete/kopete/chatwindow/kopetechatwindow.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) Index: kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp =================================================================== --- kdenetwork.orig/kopete/kopete/chatwindow/kopetechatwindow.cpp +++ kdenetwork/kopete/kopete/chatwindow/kopetechatwindow.cpp @@ -87,9 +87,9 @@ KopeteChatWindow *KopeteChatWindow::wind //Take the first and the first? What else? Kopete::Group *group = 0L; Kopete::ContactPtrList members = manager->members(); - Kopete::MetaContact *metaContact = members.first()->metaContact(); + Kopete::MetaContact *metaContact = 0L; - if ( metaContact ) + if ( !members.isEmpty() && (metaContact = members.first()->metaContact())) { Kopete::GroupList gList = metaContact->groups(); group = gList.first(); Index: kdenetwork/kopete/kopete/chatwindow/chatview.cpp =================================================================== --- kdenetwork.orig/kopete/kopete/chatwindow/chatview.cpp +++ kdenetwork/kopete/kopete/chatwindow/chatview.cpp @@ -456,7 +456,7 @@ void ChatView::toggleMembersVisibility() membersStatus = d->visibleMembers ? Visible : Hidden; placeMembersList( membersDockPosition ); Kopete::ContactPtrList members = m_manager->members(); - if ( members.first()->metaContact() ) + if ( !members.isempty() && members.first()->metaContact() ) { members.first()->metaContact()->setPluginData( m_manager->protocol(), QString::fromLatin1( "MembersListPolicy" ), QString::number(membersStatus) ); @@ -871,7 +871,7 @@ void ChatView::saveChatSettings() void ChatView::loadChatSettings() { Kopete::ContactPtrList contacts = msgManager()->members(); - if ( contacts.count() > 1 ) + if ( contacts.count() != 1 ) return; //can't load with more than one other person in the chat //read settings for metacontact _______________________________________________ kopete-devel mailing list kopete-devel@kde.org https://mail.kde.org/mailman/listinfo/kopete-devel