Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit a5a30e48 authored by R. Harish Navnit's avatar R. Harish Navnit Committed by Pali Rohár

Remove K3/Q3 classes from kopete main app

REVIEW: 124305
parent ef6ebc20
......@@ -49,7 +49,7 @@
#include <QTimer>
#include <QSplitter>
#include <Q3UriDrag>
#include <QMimeData>
#include <QScrollBar>
K_PLUGIN_FACTORY( ChatWindowPluginFactory, registerPlugin<ChatWindowPlugin>(); )
......@@ -992,7 +992,7 @@ void ChatView::dropEvent ( QDropEvent * event )
Kopete::ContactPtrList members = m_manager->members();
Kopete::Contact *contact = members.first();
if ( !contact || !contact->canAcceptFiles() || !Q3UriDrag::canDecode( event ) )
if ( !contact || !contact->canAcceptFiles() || event->mimeData()->hasText() || event->mimeData()->hasURls() )
{
event->ignore();
return;
......
......@@ -27,7 +27,6 @@
#include <kdialog.h>
#include <kiconloader.h>
#include <k3listbox.h>
#include <klocale.h>
#include "kopeteaccount.h"
......@@ -41,6 +40,11 @@ KopeteAddressBookExport::KopeteAddressBookExport( QWidget *parent, Kopete::MetaC
mParent = parent;
mAddressBook = KABC::StdAddressBook::self();
mMetaContact = mc;
mWorkPhones->setSelectionMode(QAbstractItemView::ExtendedSelection);
mMobilePhones->setSelectionMode(QAbstractItemView::ExtendedSelection);
mHomePhones->setSelectionMode(QAbstractItemView::ExtendedSelection);
mEmails->setSelectionMode(QAbstractItemView::ExtendedSelection);
}
KopeteAddressBookExport::~KopeteAddressBookExport()
......@@ -91,12 +95,17 @@ void KopeteAddressBookExport::fetchKABCData()
// emails
QStringList emails = mAddressee.emails();
unsigned int rowCount = 0;
numEmails = emails.count();
for ( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it )
mEmails->insertItem( mAddrBookIcon, *it );
for ( QStringList::Iterator it = emails.begin(); it != emails.end(); ++it ) {
mEmails->insertItem(rowCount, *it);
mEmails->item(rowCount)->setIcon(QIcon(mAddrBookIcon));
++rowCount;
}
if ( numEmails == 0 )
{
mEmails->insertItem( mAddrBookIcon, i18n("<Not Set>") );
QListWidgetItem *newItem = new QListWidgetItem(mAddrBookIcon, i18n("<Not Set>"));
mEmails->addItem(newItem);
numEmails = 1;
}
......@@ -107,16 +116,20 @@ void KopeteAddressBookExport::fetchKABCData()
}
}
void KopeteAddressBookExport::fetchPhoneNumbers( K3ListBox * listBox, KABC::PhoneNumber::Type type, uint& counter )
void KopeteAddressBookExport::fetchPhoneNumbers( QListWidget * listBox, KABC::PhoneNumber::Type type, uint& counter )
{
KABC::PhoneNumber::List phones = mAddressee.phoneNumbers( type );
counter = phones.count();
KABC::PhoneNumber::List::Iterator it;
for ( it = phones.begin(); it != phones.end(); ++it )
listBox->insertItem( mAddrBookIcon, (*it).number() );
unsigned int rowCount = 0;
for ( it = phones.begin(); it != phones.end(); ++it ) {
listBox->item(rowCount)->setIcon(QIcon(mAddrBookIcon));
listBox->insertItem(rowCount, (*it).number());
}
if ( counter == 0 )
{
listBox->insertItem( mAddrBookIcon, i18n("<Not Set>") );
QListWidgetItem *newItem = new QListWidgetItem(mAddrBookIcon, i18n("<Not Set>"));
listBox->addItem(newItem);
counter = 1;
}
}
......@@ -156,12 +169,14 @@ void KopeteAddressBookExport::populateIM( const Kopete::Contact *contact, const
}
}
void KopeteAddressBookExport::populateIM( const Kopete::Contact *contact, const QPixmap &icon, K3ListBox *listBox, const Kopete::PropertyTmpl &property )
void KopeteAddressBookExport::populateIM( const Kopete::Contact *contact, const QPixmap &icon, QListWidget *listBox, const Kopete::PropertyTmpl &property )
{
Kopete::Property prop = contact->property( property );
if ( !prop.isNull() )
{
listBox->insertItem( icon, prop.value().toString() );
QListWidgetItem *newItem = new QListWidgetItem(QIcon(icon), prop.value().toString());
listBox->addItem(newItem);
delete newItem;
}
}
......@@ -278,24 +293,24 @@ bool KopeteAddressBookExport::newValue( QComboBox *combo )
( combo->itemText( combo->currentIndex() ) == combo->itemText( 0 ) ) );
}
QStringList KopeteAddressBookExport::newValues( K3ListBox *listBox, uint counter )
QStringList KopeteAddressBookExport::newValues( QListWidget *listBox, int counter )
{
QStringList newValues;
// need to iterate all items except those from KABC and check if selected and not same as the first
// counter is the number of KABC items, and hence the index of the first non KABC item
for ( uint i = counter; i < listBox->count(); ++i )
for ( int i = counter; i < listBox->count(); ++i )
{
if ( listBox->isSelected( i ) )
if ( listBox->item(i)->isSelected() )
{
// check whether it matches any KABC item
bool duplicate = false;
for ( uint j = 0; j < counter; ++j )
for ( int j = 0; j < counter; ++j )
{
if ( listBox->text( i ) == listBox->text( j ) )
if ( listBox->item(i)->text() == listBox->item(j)->text() )
duplicate = true;
}
if ( !duplicate )
newValues.append( listBox->text( i ) );
newValues.append( listBox->item(i)->text() );
}
}
return newValues;
......
......@@ -27,9 +27,9 @@
#include "kopeteproperty.h"
#include "ui_kopeteaddrbookexportui.h"
#include <QPixmap>
#include <QListWidget>
class KDialog;
class K3ListBox;
namespace Kopete
{
......@@ -67,7 +67,7 @@ protected:
/**
* Populate a listbox with a given type of phone number
*/
void fetchPhoneNumbers( K3ListBox * listBox, KABC::PhoneNumber::Type type, uint& counter );
void fetchPhoneNumbers( QListWidget * listBox, KABC::PhoneNumber::Type type, uint& counter );
/**
* Populate the GUI with data from IM systems
*/
......@@ -81,11 +81,11 @@ protected:
* Populate a listbox with a contact's IM data
*/
void populateIM( const Kopete::Contact *contact, const QPixmap &icon,
K3ListBox *combo, const Kopete::PropertyTmpl &property );
QListWidget *combo, const Kopete::PropertyTmpl &property );
/** Check the selected item is not the first (existing KABC) item, or the same as it */
bool newValue( QComboBox *combo );
QStringList newValues( K3ListBox *listBox, uint counter );
QStringList newValues( QListWidget *listBox, int counter );
// the GUI
QWidget *mParent;
......
......@@ -52,25 +52,13 @@
</widget>
</item>
<item row="5" column="1" >
<widget class="K3ListBox" name="mWorkPhones" >
<property name="selectionMode" >
<enum>Q3ListBox::Extended</enum>
</property>
</widget>
<widget class="QListWidget" name="mWorkPhones" > </widget>
</item>
<item row="6" column="1" >
<widget class="K3ListBox" name="mMobilePhones" >
<property name="selectionMode" >
<enum>Q3ListBox::Extended</enum>
</property>
</widget>
<widget class="QListWidget" name="mMobilePhones" > </widget>
</item>
<item row="4" column="1" >
<widget class="K3ListBox" name="mHomePhones" >
<property name="selectionMode" >
<enum>Q3ListBox::Extended</enum>
</property>
</widget>
<widget class="QListWidget" name="mHomePhones" > </widget>
</item>
<item row="5" column="0" >
<widget class="QLabel" name="mLblWorkPhone" >
......@@ -122,11 +110,7 @@
</widget>
</item>
<item row="2" column="1" >
<widget class="K3ListBox" name="mEmails" >
<property name="selectionMode" >
<enum>Q3ListBox::Extended</enum>
</property>
</widget>
<widget class="QListWidget" name="mEmails" > </widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="mLblEmail" >
......@@ -140,13 +124,6 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>K3ListBox</class>
<extends>Q3ListBox</extends>
<header>k3listbox.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>mFirstName</tabstop>
<tabstop>mLastName</tabstop>
......
......@@ -20,8 +20,8 @@
#include "kopetestatusgroupviewitem.h"
#include <kdebug.h>
KopeteStatusGroupViewItem::KopeteStatusGroupViewItem( Kopete::OnlineStatus::StatusType status_ , Q3ListView *parent)
: Q3ListViewItem(parent)
KopeteStatusGroupViewItem::KopeteStatusGroupViewItem( Kopete::OnlineStatus::StatusType status_ , QTreeWidget *parent)
: QTreeWidgetItem(parent)
{
m_status = status_;
}
......
......@@ -26,10 +26,10 @@
*@author Duncan Mac-Vicar Prett <duncan@kde.org>
*/
class KopeteStatusGroupViewItem : public Q3ListViewItem
class KopeteStatusGroupViewItem : public QTreeWidgetItem
{
public:
KopeteStatusGroupViewItem( Kopete::OnlineStatus::StatusType status_ , Q3ListView *parent);
KopeteStatusGroupViewItem( Kopete::OnlineStatus::StatusType status_ , QTreeWidget *parent);
~KopeteStatusGroupViewItem();
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment