diff --git a/src/Account.cpp b/src/Account.cpp index c9c415866817db2ce11a0738498344cf147d7e6a..bf978941af455c5527e6d822b7c2af868e17cc09 100644 --- a/src/Account.cpp +++ b/src/Account.cpp @@ -23,6 +23,8 @@ #include <QtGui/QApplication> #include <QDebug> +#include <QtCore/QString> +#include <QtGui/QColor> #include "sflphone_const.h" #include "configurationmanager_interface_singleton.h" diff --git a/src/Account.h b/src/Account.h index b4c235ac25045fe774f776bb6619cbdea0e88ee5..f393a13fde8b92d6b0e912c57cb4466f45db8c77 100644 --- a/src/Account.h +++ b/src/Account.h @@ -22,8 +22,8 @@ #ifndef ACCOUNT_H #define ACCOUNT_H -#include <QtCore/QString> -#include <QtGui/QColor> +//Qt +class QString; #include "typedefs.h" diff --git a/src/AccountList.cpp b/src/AccountList.cpp index 14212427c1146938857da1eed45c30c2f88adec6..be54288e7e3948e8209b2a5416f04acef6b7da52 100644 --- a/src/AccountList.cpp +++ b/src/AccountList.cpp @@ -166,7 +166,7 @@ Account* AccountList::firstRegisteredAccount() const Account* current; for (int i = 0; i < m_pAccounts->count(); ++i) { current = (*m_pAccounts)[i]; - if(current->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) { + if(current && current->getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) { return current; } else { diff --git a/src/Call.cpp b/src/Call.cpp index 30313bfdf476c939c73fc2b12cfed6c5f32ad60e..54533d8b97cf22eb9fb5f70e7b9a46ac6f65c6d0 100644 --- a/src/Call.cpp +++ b/src/Call.cpp @@ -610,7 +610,8 @@ void Call::call() this->m_pPeerPhoneNumber = m_pCallNumber; if (m_pContactBackend) { Contact* contact = m_pContactBackend->getContactByPhone(m_pPeerPhoneNumber); - m_pPeerName = contact->getFormattedName(); + if (contact) + m_pPeerName = contact->getFormattedName(); } this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); this->m_pHistoryState = OUTGOING; diff --git a/src/Call.h b/src/Call.h index 0ad0ee8bb2bb169b724ba80f1010e65e11a09bba..e8769151504d672e72d84e72e787b0b5e5d9a9b7 100644 --- a/src/Call.h +++ b/src/Call.h @@ -17,16 +17,17 @@ * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ + **************************************************************************/ #ifndef CALL_H #define CALL_H -#include <QtCore/QString> -#include <QtCore/QDateTime> -#include <QtGui/QLabel> -#include <QtGui/QWidget> +//Qt +class QString; +class QDateTime; +class QLabel; +class QWidget; #include "sflphone_const.h" #include "typedefs.h" diff --git a/src/CallModel.cpp b/src/CallModel.cpp index e9541dd8365c3f09ae4824d7f4d851cbb458f4ad..e74ca594d8fd051967e6cbd5e12b05a302f63abd 100644 --- a/src/CallModel.cpp +++ b/src/CallModel.cpp @@ -62,6 +62,7 @@ void CallModelBase::on1_callStateChanged(const QString &callID, const QString &s void CallModelBase::on1_incomingCall(const QString & accountID, const QString & callID) { + Q_UNUSED(accountID) qDebug() << "Signal : Incoming Call ! ID = " << callID; Call* call = addIncomingCall(callID); diff --git a/src/CallModel.h b/src/CallModel.h index cdd9c681ae6cb3a641134ed48e1ac93eb282c8d2..6262751177a2e0c000388c645cd4aba7d2831e7a 100644 --- a/src/CallModel.h +++ b/src/CallModel.h @@ -22,25 +22,26 @@ #define CALL_MODEL_H #include <QObject> -#include <QHash> #include <QVector> -#include <QDragEnterEvent> -#include <QDebug> - -#include "Call.h" -#include "AccountList.h" -#include "dbus/metatypes.h" -#include "callmanager_interface_singleton.h" -#include "configurationmanager_interface_singleton.h" -#include "instance_interface_singleton.h" -#include "sflphone_const.h" -#include "unistd.h" +#include <QHash> #include "typedefs.h" -#include "ContactBackend.h" + +//Qt +class QDragEnterEvent; +class QDebug; +class QModelIndex; + +//SFLPhone +class Call; +class AccountList; +class Account; +class ContactBackend; typedef QHash<QString, Call*> CallHash; typedef QList<Call*> CallList; +///This class need to exist because template classes can't have signals ans +///slots because Qt MOC generator can't guess the type at precompilation class LIB_EXPORT CallModelBase : public QObject { Q_OBJECT diff --git a/src/CallModel.hpp b/src/CallModel.hpp index 54c74c2b21511f60d647d4ebfd05db2c74e2c271..371a4853982b495d9eed291fd91503f3c0763f80 100644 --- a/src/CallModel.hpp +++ b/src/CallModel.hpp @@ -1,3 +1,18 @@ +#include <QHash> +#include <QVector> +#include <QDragEnterEvent> +#include <QDebug> +#include "Call.h" +#include "AccountList.h" +#include "dbus/metatypes.h" +#include "callmanager_interface_singleton.h" +#include "configurationmanager_interface_singleton.h" +#include "instance_interface_singleton.h" +#include "sflphone_const.h" +#include "unistd.h" +#include "typedefs.h" +#include "ContactBackend.h" + //Static member template <typename CallWidget, typename Index> QString CallModel<CallWidget,Index>::m_pPriorAccountId = "" ; template <typename CallWidget, typename Index> AccountList* CallModel<CallWidget,Index>::m_pAccountList = 0 ; diff --git a/src/Contact.cpp b/src/Contact.cpp index 11551f750cdc0aa29e1bcf1c16ab500605e4d13d..84eee4a9203d960cc2bf9ff6d5d9e4befa1b794c 100644 --- a/src/Contact.cpp +++ b/src/Contact.cpp @@ -21,6 +21,12 @@ #include "Contact.h" #include <QtCore/QDebug> +#include <kabc/addressee.h> +#include <kabc/picture.h> +#include <kabc/phonenumber.h> +#include <QtGui/QListWidgetItem> +#include <QtGui/QWidget> +#include <QPixmap> #include "sflphone_const.h" diff --git a/src/Contact.h b/src/Contact.h index 68e133acf11c383e5a56c4eeb184c39e4a4088c6..5e03a500a70cc0c171e62f50f1e53be9d2747713 100644 --- a/src/Contact.h +++ b/src/Contact.h @@ -21,20 +21,25 @@ #ifndef CONTACT_H #define CONTACT_H -#include <QtGui/QListWidgetItem> -#include <QtGui/QWidget> +#include <QObject> -#include <QPixmap> +//Qt +class QListWidgetItem; +class QWidget; +class QPixmap; -#include <kabc/addressee.h> -#include <kabc/picture.h> -#include <kabc/phonenumber.h> +//KDE +namespace KABC { + class Addressee ; + class Picture ; + class PhoneNumber ; +} #include "typedefs.h" /** @author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> - @author Jérémy Quentin <emmanuel.lepage@savoirfairelinux.com> + @author Emmanuel Lepage <emmanuel.lepage@savoirfairelinux.com> */ class LIB_EXPORT Contact : public QObject{ Q_OBJECT @@ -85,6 +90,7 @@ public: virtual QString getType() const; virtual void initItem(); + //Setters virtual void setPhoneNumbers (PhoneNumbers ); virtual void setFormattedName (QString name ); virtual void setNickName (QString name ); diff --git a/src/ContactBackend.h b/src/ContactBackend.h index 72584f8c52f51b3294b6eae5261f428589534348..1a3cc57a0c92c5f950b4d929d1117262c779ddb4 100644 --- a/src/ContactBackend.h +++ b/src/ContactBackend.h @@ -6,6 +6,7 @@ #include "typedefs.h" +//SFLPhone class Contact; typedef QList<Contact*> ContactList;