Commit 236cbb4b authored by Alexandre Savard's avatar Alexandre Savard
parents 401ce9a1 5df6c398
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
add_subdirectory(dataengine)
add_subdirectory(plasmoid)
......@@ -13,7 +13,7 @@ SFLPhonePlasmoid::SFLPhonePlasmoid(QObject* parent, const QVariantList& args)
//m_svg.setImagePath("widgets/background");
setBackgroundHints(DefaultBackground);
CallModelConvenience::init();
CallModel<>::init();
setMinimumSize(24,24);
}
......
ADD_DEFINITIONS(
${KDE4_DEFINITIONS}
${QT_DEFINITIONS}
-fexceptions
-DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\""
-DSHARE_INSTALL_PREFIX="\\\"${SHARE_INSTALL_PREFIX}\\\""
${KDE4_DEFINITIONS}
${QT_DEFINITIONS}
-fexceptions
-DDATA_INSTALL_DIR="\\\"${DATA_INSTALL_DIR}\\\""
-DSHARE_INSTALL_PREFIX="\\\"${SHARE_INSTALL_PREFIX}\\\""
)
ADD_DEFINITIONS("-std=c++0x")
add_subdirectory(lib)
add_subdirectory( lib )
add_subdirectory( klib )
find_package(Phonon)
MESSAGE("CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
IF(${CMAKE_BUILD_TYPE} MATCHES Release)
MESSAGE("NO DEBUG OUTPUT")
ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT)
MESSAGE("NO DEBUG OUTPUT")
ADD_DEFINITIONS( -DQT_NO_DEBUG_OUTPUT)
ENDIF(${CMAKE_BUILD_TYPE} MATCHES Release)
SET ( KDE4_KABC_LIBS -lkabc )
SET( sflphone_client_kde_SRCS
SET(
sflphone_client_kde_SRCS
SFLPhoneView.cpp
SFLPhone.cpp
SFLPhoneapplication.cpp
......@@ -40,7 +42,6 @@ SET( sflphone_client_kde_SRCS
conf/dlgaudio.cpp
conf/dlgaddressbook.cpp
conf/dlghooks.cpp
conf/ConfigurationSkeleton.cpp
conf/ConfigAccountList.cpp
widgets/Dialpad.cpp
widgets/ContactItemWidget.cpp
......@@ -50,10 +51,8 @@ SET( sflphone_client_kde_SRCS
widgets/TranslucentButtons.cpp
widgets/CategoryDrawer.cpp
widgets/CategorizedTreeWidget.cpp
widgets/SortableDockCommon.cpp
Codec.cpp
AccountListModel.cpp
AkonadiBackend.cpp
CallView.cpp
AccountView.cpp
)
......@@ -66,27 +65,26 @@ QT4_ADD_RESOURCES(QtApp_RCC_SRCS ${QtApp_RCCS})
# kde4_automoc(${sflphone_client_kde_SRCS})
SET( config_ui_files
conf/dlggeneralbase.ui
conf/dlgdisplaybase.ui
conf/dlgaccountsbase.ui
conf/dlgaudiobase.ui
conf/dlgaddressbookbase.ui
conf/dlghooksbase.ui
SET(
config_ui_files
conf/dlggeneralbase.ui
conf/dlgdisplaybase.ui
conf/dlgaccountsbase.ui
conf/dlgaudiobase.ui
conf/dlgaddressbookbase.ui
conf/dlghooksbase.ui
)
KDE4_ADD_UI_FILES(sflphone_client_kde_SRCS ui/SFLPhoneView_base.ui ${config_ui_files} )
KDE4_ADD_KCFG_FILES(sflphone_client_kde_SRCS conf/kcfg_settings.kcfgc)
INSTALL(FILES conf/sflphone-client-kde.kcfg DESTINATION ${KCFG_INSTALL_DIR})
KDE4_ADD_EXECUTABLE(sflphone-client-kde ${sflphone_client_kde_SRCS} ${QtApp_RCC_SRCS})
TARGET_LINK_LIBRARIES(sflphone-client-kde qtsflphone ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDEPIMLIBS_AKONADI_KMIME_LIBS} ${KDEPIMLIBS_AKONADI_LIBS} ${KDEPIMLIBS_AKONADI_CONTACT_LIBS} ${KDE4_PHONON_LIBS} )
TARGET_LINK_LIBRARIES(sflphone-client-kde ksflphone qtsflphone ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDEPIMLIBS_AKONADI_KMIME_LIBS} ${KDEPIMLIBS_AKONADI_LIBS} ${KDEPIMLIBS_AKONADI_CONTACT_LIBS} ${KDE4_PHONON_LIBS} )
########### install files ###############
INSTALL(TARGETS sflphone-client-kde DESTINATION ${BIN_INSTALL_DIR})
INSTALL(TARGETS sflphone-client-kde DESTINATION ${BIN_INSTALL_DIR} )
INSTALL( FILES icons/transferarraw.png DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
INSTALL( FILES icons/transfertarrow.svg DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
INSTALL( FILES icons/confBlackWhite.svg DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
......
......@@ -44,7 +44,7 @@
#include "widgets/CallTreeItem.h"
#include "SFLPhone.h"
#include "SFLPhoneView.h"
#include "AkonadiBackend.h"
#include "klib/AkonadiBackend.h"
///Retrieve current and older calls from the daemon, fill history and the calls TreeView and enable drag n' drop
......
......@@ -47,14 +47,14 @@
#include "lib/Contact.h"
//SFLPhone
#include "AkonadiBackend.h"
#include "klib/AkonadiBackend.h"
#include "AccountWizard.h"
#include "SFLPhoneView.h"
#include "widgets/SFLPhoneTray.h"
#include "widgets/ContactDock.h"
#include "widgets/HistoryDock.h"
#include "widgets/BookmarkDock.h"
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
SFLPhone* SFLPhone::m_sApp = NULL;
TreeWidgetCallModel* SFLPhone::m_pModel = NULL;
......
......@@ -38,7 +38,7 @@
//SFLPhone
#include "conf/ConfigurationDialog.h"
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
#include "AccountWizard.h"
#include "ActionSetAccountFirst.h"
#include "SFLPhone.h"
......
......@@ -24,7 +24,7 @@
#include <KDebug>
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
#include "dlggeneral.h"
#include "dlgdisplay.h"
......
......@@ -24,7 +24,7 @@
#include <kconfigdialog.h>
#include "kcfg_settings.h"
#include "klib/kcfg_settings.h"
#include "SFLPhoneView.h"
......
......@@ -20,7 +20,7 @@
***************************************************************************/
#include "dlgaddressbook.h"
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
DlgAddressBook::DlgAddressBook(QWidget *parent)
: QWidget(parent)
......
......@@ -22,7 +22,7 @@
#include <KLineEdit>
#include "lib/configurationmanager_interface_singleton.h"
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
#include "conf/ConfigurationDialog.h"
#include <QtGui/QHeaderView>
#include <KStandardDirs>
......
......@@ -25,7 +25,7 @@
#include <kconfigdialog.h>
#include "ui_dlgaudiobase.h"
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
/**
@author Jérémy Quentin <jeremy.quentin@gmail.com>
......
......@@ -22,7 +22,7 @@
#include <QToolButton>
#include <QAction>
#include "conf/ConfigurationSkeleton.h"
#include "klib/ConfigurationSkeleton.h"
#include "conf/ConfigurationDialog.h"
DlgGeneral::DlgGeneral(QWidget *parent)
......
......@@ -43,16 +43,17 @@
#include <kabc/phonenumber.h>
//SFLPhone library
#include "lib/Contact.h"
#include "lib/AccountList.h"
#include "lib/Account.h"
#include "../lib/Contact.h"
#include "../lib/AccountList.h"
#include "../lib/Account.h"
//SFLPhone
#include "SFLPhone.h"
#include "SFLPhoneView.h"
//#include "SFLPhone.h"
//#include "SFLPhoneView.h"
///Init static attributes
AkonadiBackend* AkonadiBackend::m_pInstance = 0;
CallModel<>* AkonadiBackend::m_pModel = 0;
///Constructor
AkonadiBackend::AkonadiBackend(QObject* parent) : ContactBackend(parent)
......@@ -60,6 +61,12 @@ AkonadiBackend::AkonadiBackend(QObject* parent) : ContactBackend(parent)
//QTimer::singleShot( 0, this, SLOT( delayedInit() ) );
m_pSession = new Akonadi::Session( "SFLPhone::instance" );
if ( not m_pModel ) {
m_pModel = new CallModel<>(CallModel<>::ActiveCall);
m_pModel->initCall();
m_pModel->initHistory();
}
// fetching all collections containing emails recursively, starting at the root collection
Akonadi::CollectionFetchJob *job = new Akonadi::CollectionFetchJob( Akonadi::Collection::root(), Akonadi::CollectionFetchJob::Recursive, this );
job->fetchScope().setContentMimeTypes( QStringList() << "text/directory" );
......@@ -95,7 +102,7 @@ Contact* AkonadiBackend::getContactByPhone(const QString& phoneNumber,bool resol
if (!resolveDNS || phoneNumber.indexOf("@") == -1)
return m_ContactByPhone[phoneNumber];
else if (!getHostNameFromPhone(phoneNumber).isEmpty() && m_ContactByPhone[getUserFromPhone(phoneNumber)]) {
foreach (Account* a, SFLPhone::model()->getAccountList()->getAccounts()) {
foreach (Account* a, m_pModel->getAccountList()->getAccounts()) {
if (a->getAccountDetail(ACCOUNT_HOSTNAME) == getHostNameFromPhone(phoneNumber))
return m_ContactByPhone[getUserFromPhone(phoneNumber)];
}
......@@ -120,10 +127,9 @@ Contact* AkonadiBackend::getContactByUid(const QString& uid)
ContactList AkonadiBackend::update(Akonadi::Collection collection)
{
m_Collection = collection;
ContactList contacts;
if ( !collection.isValid() ) {
kDebug() << "The current collection is not valid";
return contacts;
return ContactList();
}
Akonadi::RecursiveItemFetchJob *job = new Akonadi::RecursiveItemFetchJob( collection, QStringList() << KABC::Addressee::mimeType() << KABC::ContactGroup::mimeType());
......@@ -164,33 +170,32 @@ ContactList AkonadiBackend::update(Akonadi::Collection collection)
aContact->setPhoto(new QPixmap(QPixmap::fromImage( tmp.photo().data()).scaled(QSize(48,48))));
else
aContact->setPhoto(0);
contacts << aContact;
}
}
m_pContacts = m_ContactByUid.values();
}
return contacts;
return m_ContactByUid.values();
}
///Edit backend value using an updated frontend contact
void AkonadiBackend::editContact(Contact* contact)
void AkonadiBackend::editContact(Contact* contact,QWidget* parent)
{
KABC::Addressee ct = m_AddrHash[contact->getUid()];
if (ct.uid() != contact->getUid()) {
kDebug() << "Contact not found";
return;
}
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::EditMode, SFLPhone::app()->view() );
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::EditMode, parent );
Akonadi::Item item;
item.setPayload<KABC::Addressee>(ct);
editor->loadContact(item);
KDialog* dlg = new KDialog(SFLPhone::app()->view());
KDialog* dlg = new KDialog(parent);
dlg->setMainWidget(editor);
dlg->exec();
}
///Add a new contact
void AkonadiBackend::addNewContact(Contact* contact)
void AkonadiBackend::addNewContact(Contact* contact,QWidget* parent)
{
KABC::Addressee newContact;
newContact.setNickName ( contact->getNickName() );
......@@ -222,14 +227,13 @@ void AkonadiBackend::addNewContact(Contact* contact)
newContact.insertPhoneNumber(pn);
}
//aContact->setPhoneNumbers (newNumbers );//TODO
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::CreateMode, SFLPhone::app()->view() );
Akonadi::ContactEditor *editor = new Akonadi::ContactEditor( Akonadi::ContactEditor::CreateMode, parent );
editor->setContactTemplate(newContact);
KDialog* dlg = new KDialog(SFLPhone::app()->view());
KDialog* dlg = new KDialog(parent);
dlg->setMainWidget(editor);
dlg->exec();
......@@ -239,6 +243,18 @@ void AkonadiBackend::addNewContact(Contact* contact)
}
}
///Implement virtual pure method
void AkonadiBackend::editContact(Contact* contact)
{
editContact(contact,0);
}
///Implement virtual pure method
void AkonadiBackend::addNewContact(Contact* contact)
{
addNewContact(contact,0);
}
/*****************************************************************************
* *
......
......@@ -20,7 +20,9 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
**************************************************************************/
#include <lib/ContactBackend.h>
#include "../lib/ContactBackend.h"
#include "../lib/CallModel.h"
#include "../lib/typedefs.h"
#include <akonadi/collectionmodel.h>
//Qt
......@@ -41,17 +43,18 @@ namespace Akonadi {
//SFLPhone
class Contact;
typedef QList<Contact*> ContactList;
///@class AkonadiBackend Implement a backend for Akonadi
class AkonadiBackend : public ContactBackend {
class LIB_EXPORT AkonadiBackend : public ContactBackend {
Q_OBJECT
public:
static ContactBackend* getInstance();
Contact* getContactByPhone ( const QString& phoneNumber ,bool resolveDNS = false );
Contact* getContactByUid ( const QString& uid );
void editContact ( Contact* contact );
void addNewContact ( Contact* contact );
void editContact ( Contact* contact , QWidget* parent = 0 );
void addNewContact ( Contact* contact , QWidget* parent = 0 );
virtual void editContact ( Contact* contact );
virtual void addNewContact ( Contact* contact );
private:
AkonadiBackend(QObject* parent);
......@@ -63,6 +66,7 @@ private:
//Attributes
static AkonadiBackend* m_pInstance ;
static CallModel<>* m_pModel ;
Akonadi::Session* m_pSession ;
Akonadi::Collection m_Collection ;
QHash<QString,KABC::Addressee> m_AddrHash ;
......
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
ADD_DEFINITIONS("-std=c++0x")
ADD_DEFINITIONS(
${QT_DEFINITIONS}
-fexceptions
)
PROJECT(ksflphone)
SET ( KDE4_KABC_LIBS -lkabc )
add_subdirectory(dataengine)
SET(LOCAL_CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")
SET(CMAKE_MODULE_PATH "${LOCAL_CMAKE_MODULE_PATH}")
FIND_PACKAGE ( KDE4 REQUIRED )
FIND_PACKAGE ( Qt4 REQUIRED )
INCLUDE ( KDE4Defaults )
set(GENERIC_LIB_VERSION "1.1.0")
INCLUDE_DIRECTORIES ( ${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})
#File to compile
set( ksflphone_LIB_SRCS
HelperFunctions.cpp
AkonadiBackend.cpp
SortableDockCommon.cpp
ConfigurationSkeleton.cpp
)
KDE4_ADD_KCFG_FILES(ksflphone_LIB_SRCS kcfg_settings.kcfgc)
kde4_add_library( ksflphone SHARED ${ksflphone_LIB_SRCS} )
target_link_libraries( ksflphone
qtsflphone
${QT_QTCORE_LIBRARY}
${KDEPIMLIBS_AKONADI_KMIME_LIBS}
${KDEPIMLIBS_AKONADI_LIBS}
${KDEPIMLIBS_AKONADI_CONTACT_LIBS}
${KDE4_KDEUI_LIBS}
)
set_target_properties( ksflphone
PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}
)
set( ksflphone_LIB_HDRS
AkonadiBackend.h
HelperFunctions.h
SortableDockCommon.h
)
INSTALL(FILES sflphone-client-kde.kcfg DESTINATION ${KCFG_INSTALL_DIR})
install( FILES ${ksflphone_LIB_HDRS}
DESTINATION ${INCLUDE_INSTALL_DIR}/ksflphone
COMPONENT Devel
)
install( TARGETS ksflphone ${INSTALL_TARGETS_DEFAULT_ARGS} )
......@@ -20,8 +20,8 @@
***************************************************************************/
#include "ConfigurationSkeleton.h"
#include "lib/configurationmanager_interface_singleton.h"
#include "lib/sflphone_const.h"
#include "../lib/configurationmanager_interface_singleton.h"
#include "../lib/sflphone_const.h"
//KDE
#include <KDebug>
......
......@@ -22,10 +22,10 @@
#define CONFIGURATIONSKELETON_H
#include <QWidget>
#include "../lib/typedefs.h"
#include "kcfg_settings.h"
#include "src/klib/kcfg_settings.h"
//#include "CodecListModel.h"
#include "AccountListModel.h"
/**
@author Jérémy Quentin <jeremy.quentin@gmail.com>
......@@ -38,7 +38,7 @@
This class reimplements the writeConfig and readConfig functions to ask the
daemon instead of the normal behavior (read and write in a kconfig file).
*/
class ConfigurationSkeleton : public ConfigurationSkeletonBase
class LIB_EXPORT ConfigurationSkeleton : public ConfigurationSkeletonBase
{
Q_OBJECT
......
#include "HelperFunctions.h"
//Qt
#include <QtCore/QString>
#include <QtCore/QVariant>
//SFLPhone
#include "../lib/Contact.h"
ContactHash HelperFunctions::toHash(QList<Contact*> contacts) {
QHash<QString,QHash<QString,QVariant> > hash;
for (int i=0;i<contacts.size();i++) {
hash[contacts[i]->getUid()] = contacts[i]->toHash();
}
return hash;
}
\ No newline at end of file
#ifndef HELPER_FUNCTIONS
#define HELPER_FUNCTIONS
//Qt
#include <QtCore/QString>
#include <QtCore/QVariant>
#include <QtCore/QHash>
#include <QtCore/QList>
//SFLPhone
#include "../lib/Contact.h"
//Typedef
typedef QHash<QString,QHash<QString,QVariant> > ContactHash;
///@class HelperFunctions little visitor not belonging to libqtsflphone
///Ramdom mix of dynamic property and transtypping
class LIB_EXPORT HelperFunctions {
public:
static ContactHash toHash(QList<Contact*> contacts);
};
#endif
\ No newline at end of file
......@@ -6,14 +6,13 @@
#include <QtCore/QTimer>
//SFLPhone
#include "lib/Call.h"
#include "lib/Contact.h"
#include "lib/CallModel.h"
#include "SFLPhone.h"
#include "../lib/Call.h"
#include "../lib/Contact.h"
#include "../lib/CallModel.h"
#include "AkonadiBackend.h"
///StaticEventHandler constructor
StaticEventHandler::StaticEventHandler(QObject* parent) : QObject(parent)
StaticEventHandler::StaticEventHandler(QObject* parent, QStringList* list) : QObject(parent),m_pList(list)
{
QTimer* timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
......@@ -24,7 +23,7 @@ StaticEventHandler::StaticEventHandler(QObject* parent) : QObject(parent)
///Update the days constant, necessary to cycle after midnight
void StaticEventHandler::update()
{
SortableDockCommon::m_slHistoryConst = {
(*m_pList)= {
"Today" ,//0
"Yesterday" ,//1
QDate::currentDate().addDays(-2).toString("dddd"),//2
......@@ -52,64 +51,3 @@ void StaticEventHandler::update()
"Never" //24
};
}
QStringList SortableDockCommon::m_slHistoryConst;
StaticEventHandler* SortableDockCommon::m_spEvHandler = new StaticEventHandler(0);
/*****************************************************************************
* *
* Helpers *
* *
****************************************************************************/
QString SortableDockCommon::timeToHistoryCategory(QDate date)
{
if (QDate::currentDate() == date || QDate::currentDate() < date) //The future case would be a bug, but it have to be handled anyway or it will appear in "very long time ago"
return m_slHistoryConst[HistoryConst::Today];
//Check for last week
for (int i=1;i<7;i++) {
if (QDate::currentDate().addDays(-i) == date)
return m_slHistoryConst[i]; //Yesterday to Six_days_ago
}
//Check for last month
for (int i=1;i<4;i++) {
if (QDate::currentDate().addDays(-(i*7)) >= date && QDate::currentDate().addDays(-(i*7) -7) < date)
return m_slHistoryConst[i+Last_week-1]; //Last_week to Three_weeks_ago
}
//Check for last year
for (int i=1;i<12;i++) {
if (QDate::currentDate().addMonths(-i) >= date && QDate::currentDate().addMonths((-i) - 1) < date)
return m_slHistoryConst[i+Last_month-1]; //Last_month to Twelve_months ago
}
if (QDate::currentDate().addYears(-1) >= date && QDate::currentDate().addYears(-2) < date)
return m_slHistoryConst[Last_year];
//Every other senario
return m_slHistoryConst[Very_long_time_ago];
}
///Return the list of contact from history (in order, most recently used first)
QHash<Contact*, QDateTime> SortableDockCommon::getContactListByTime(/*ContactList list*/)
{
const CallMap& history= SFLPhone::model()->getHistory();
QHash<Contact*, QDateTime> toReturn;
QSet<QString> alreadyUsed;
QMapIterator<QString, Call*> i(history);
i.toBack();
while (i.hasPrevious()) { //Iterate from the end up
i.previous();
(alreadyUsed.find(i.value()->getPeerPhoneNumber()) == alreadyUsed.constEnd()); //Don't ask, leave it there Elv13(2012)
if (alreadyUsed.find(i.value()->getPeerPhoneNumber()) == alreadyUsed.constEnd()) {
Contact* contact = AkonadiBackend::getInstance()->getContactByPhone(i.value()->getPeerPhoneNumber(),true);
if (contact && toReturn.find(contact) == toReturn.end()) {
toReturn[contact] = QDateTime::fromTime_t(i.value()->getStartTimeStamp().toUInt());
}
alreadyUsed << i.value()->getPeerPhoneNumber();
}
}
return toReturn;
}
\ No newline at end of file
#ifndef SORTABLE_DOCK_COMMON
#define SORTABLE_DOCK_COMMON
#include <QObject>
#include <QHash>
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtCore/QModelIndex>
#include <QtGui/QWidget>
#include "HelperFunctions.h"
//Qt
class QString;
......@@ -13,16 +17,41 @@ class QDateTime;
//SFLPhone
class StaticEventHandler;
class Contact;
class Call;
///@enum ContactSortingMode Available sorting mode
enum ContactSortingMode {
Name ,
Organisation ,
Recently_used ,
Group ,
Department
};
///@enum HistorySortingMode
enum HistorySortingMode {
Date = 0,
Name2 = 1,
Popularity = 2,
Length = 3
};
class SortableDockCommon {
template <typename CallWidget = QWidget*, typename Index = QModelIndex*>
class LIB_EXPORT SortableDockCommon {
public:
friend class StaticEventHandler;
//Helpers
static QString getIdentity(Call* item);
static int usableNumberCount(Contact* cont);
static void setHistoryCategory ( QList<Call*>& calls , HistorySortingMode mode );
static void setContactCategory ( QList<Contact*> contacts , ContactSortingMode mode );
protected:
SortableDockCommon(){};
SortableDockCommon();
//Helpers
static QString timeToHistoryCategory(QDate date);
static QHash<Contact*, QDateTime> getContactListByTime(/*ContactList list*/);
static QString timeToHistoryCategory ( QDate date );
static QHash<Contact*, QDateTime> getContactListByTime ( /*ContactList list*/ );
//Attributes
static QStringList m_slHistoryConst;
......@@ -62,14 +91,18 @@ class SortableDockCommon {
///@class StaticEventHandler "cron jobs" for static member;
class StaticEventHandler : public QObject
class LIB_EXPORT StaticEventHandler : public QObject
{
Q_OBJECT
public:
StaticEventHandler(QObject* parent);
StaticEventHandler(QObject* parent, QStringList* list);
private slots:
public slots:
void update();
private:
QStringList* m_pList;
};
#include "SortableDockCommon.hpp"
#endif
\ No newline at end of file
//Qt
#include <QtCore/QDateTime>
#include <QtCore/QStringList>
#include <QtCore/QTimer>
//SFLPhone
#include "../lib/Call.h"
#include "../lib/Contact.h"
#include "../lib/CallModel.h"
#include "AkonadiBackend.h"
#include "HelperFunctions.h"
#include "ConfigurationSkeleton.h"
//Define
#define CALLMODEL_TEMPLATE template<typename CallWidget, typename Index>
#define SORTABLE_T SortableDockCommon<CallWidget,Index>
CALLMODEL_TEMPLATE QStringList SORTABLE_T::m_slHistoryConst = QStringList();
CALLMODEL_TEMPLATE StaticEventHandler* SORTABLE_T::m_spEvHandler = new StaticEventHandler(0,&(SORTABLE_T::m_slHistoryConst));
CALLMODEL_TEMPLATE SORTABLE_T::SortableDockCommon()
{
/*if (not m_spEvHandler) {
m_spEvHandler = new StaticEventHandler(0,&(SORTABLE_T::m_slHistoryConst));
}*/