--Boundary-00=_67fyEHPuiQnjpTP Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Ack... everybody, please disregard the previous patch. I forgot to exclude my work on the SMS protocol porting. If you use that old patch I sent out kopete probably won't compile ;) Please see the attached patch. The patch is from SVN r567030. -- ~ Michael D. Stemle, Jr. <>< (A)bort, (R)etry, (I)nfluence with large hammer --Boundary-00=_67fyEHPuiQnjpTP Content-Type: text/x-diff; charset="iso-8859-15"; name="20060728-metacontact.svn-diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="20060728-metacontact.svn-diff" Index: kopete/contactlist/kopetecontactlistview.h =================================================================== --- kopete/contactlist/kopetecontactlistview.h (revision 567121) +++ kopete/contactlist/kopetecontactlistview.h (working copy) @@ -180,6 +180,8 @@ void slotTimeout(); + void slotMakeMetaContact(); + private: bool mShowAsTree; @@ -206,6 +208,7 @@ KAction *actionProperties; KAction *actionUndo; KAction *actionRedo; + KAction *actionMakeMetaContact; KopeteContactListViewPrivate *d; Index: kopete/contactlist/kopetecontactlistview.cpp =================================================================== --- kopete/contactlist/kopetecontactlistview.cpp (revision 567121) +++ kopete/contactlist/kopetecontactlistview.cpp (working copy) @@ -495,6 +495,9 @@ actionCopy = new KopeteGroupListAction( i18n( "&Copy To" ), QLatin1String( "editcopy" ), 0, this, SLOT( slotCopyToGroup() ), ac, "contactCopy" ); + actionMakeMetaContact = new KAction(KIcon("move"), i18n("Make Meta Contact"), ac, "makeMetaContact"); + connect (actionMakeMetaContact, SIGNAL(triggered(bool)), this, SLOT(slotMakeMetaContact())); + actionRemove = KopeteStdAction::deleteContact( this, SLOT( slotRemove() ), ac, "contactRemove" ); actionSendEmail = new KAction( KIcon("mail_generic"), i18n( "Send Email..." ), ac, "contactSendEmail" ); @@ -1449,6 +1452,9 @@ actionRename->setEnabled(false); actionRemove->setEnabled(contacts.count()+groups.count()); actionAddContact->setEnabled(false); + + actionMakeMetaContact->setText(i18n("Make Meta Contact")); + actionMakeMetaContact->setEnabled(contacts.count()); // Specifically for multiple contacts, not groups. } actionMove->setCurrentItem( -1 ); @@ -1878,7 +1884,6 @@ undoTimer.start(10*60*1000); } - void KopeteContactListView::slotUndo() { bool step = false; @@ -2187,6 +2192,33 @@ actionRedo->setEnabled(false); } +void KopeteContactListView::slotMakeMetaContact() +{ + QList contacts = Kopete::ContactList::self()->selectedMetaContacts(); + QList::iterator cit, citEnd = contacts.end(); + Kopete::MetaContact * first = (Kopete::MetaContact *) NULL; + + // Iterate through the selected contacts. + for( cit = contacts.begin(); cit != citEnd; ++cit ) { + Kopete::MetaContact* mc = static_cast(*cit); + + if (!first) { + // Grab the first one. + first = mc; + } else { + QList foreignList = mc->contacts(); + QList::iterator theContact, stopit = foreignList.end(); + // Have the first of all in the selected contacts steal the contacts from all the others. + for (theContact = foreignList.begin(); theContact != stopit; ++theContact) { + Kopete::Contact *one = static_cast(*theContact); + one->setMetaContact(first); + } + } + } + + return; +} + #include "kopetecontactlistview.moc" // vim: set noet ts=4 sts=4 sw=4: Index: kopete/kopeteui.rc =================================================================== --- kopete/kopeteui.rc (revision 567121) +++ kopete/kopeteui.rc (working copy) @@ -94,6 +94,8 @@ + + Index: libkopete/ui/addcontactpage.h =================================================================== --- libkopete/ui/addcontactpage.h (revision 567121) +++ libkopete/ui/addcontactpage.h (working copy) @@ -37,6 +37,7 @@ public: AddContactPage(QWidget *parent=0); + AddContactPage(QWidget *parent, const char *name); virtual ~AddContactPage(); //Kopete::Protocol *protocol; Index: libkopete/ui/addcontactpage.cpp =================================================================== --- libkopete/ui/addcontactpage.cpp (revision 567121) +++ libkopete/ui/addcontactpage.cpp (working copy) @@ -21,6 +21,10 @@ { } +AddContactPage::AddContactPage(QWidget *parent, const char *name) : QWidget(parent, name) +{ +} + AddContactPage::~AddContactPage() { } --Boundary-00=_67fyEHPuiQnjpTP Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kopete-devel mailing list kopete-devel@kde.org https://mail.kde.org/mailman/listinfo/kopete-devel --Boundary-00=_67fyEHPuiQnjpTP--