From 49e8f08f11d8a3245dc2e15b2aa99b973a4719ce Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage <emmanuel.lepage@savoirfairelinux.com> Date: Thu, 31 May 2012 16:40:43 -0400 Subject: [PATCH] [ #11850 ] Reimplement most destructor --- kde/src/CallView.cpp | 14 ++++++ kde/src/CallView.h | 2 + kde/src/SFLPhone.cpp | 31 +++++++++++-- kde/src/klib/AkonadiBackend.cpp | 1 + kde/src/klib/SortableDockCommon.h | 1 + kde/src/lib/Account.cpp | 1 + kde/src/lib/Call.cpp | 61 +++++++++++++++++--------- kde/src/lib/Call.h | 3 ++ kde/src/lib/CallModel.h | 1 + kde/src/lib/CallModel.hpp | 19 +++++++- kde/src/lib/ContactBackend.cpp | 7 +++ kde/src/lib/ContactBackend.h | 1 + kde/src/lib/Item.h | 1 - kde/src/widgets/AccountItemWidget.cpp | 8 ++-- kde/src/widgets/BookmarkDock.cpp | 9 +++- kde/src/widgets/CallTreeItem.cpp | 14 +++++- kde/src/widgets/ContactDock.cpp | 11 ++++- kde/src/widgets/ContactItemWidget.cpp | 15 ++++++- kde/src/widgets/HistoryDock.cpp | 18 +++++++- kde/src/widgets/HistoryDock.h | 29 ++++++------ kde/src/widgets/HistoryTreeItem.cpp | 28 +++++++++++- kde/src/widgets/HistoryTreeItem.h | 2 +- kde/src/widgets/SFLPhoneTray.cpp | 1 + kde/src/widgets/TranslucentButtons.cpp | 2 +- 24 files changed, 226 insertions(+), 54 deletions(-) diff --git a/kde/src/CallView.cpp b/kde/src/CallView.cpp index 92e2b03733..0fa58df149 100644 --- a/kde/src/CallView.cpp +++ b/kde/src/CallView.cpp @@ -105,6 +105,15 @@ CallView::CallView(QWidget* parent) : QTreeWidget(parent),m_pActiveOverlay(0),m_ } //CallView +///Destructor +CallView::~CallView() +{ + delete m_pTransferB; + delete m_pTransferLE; + if (m_pTransferOverlay) delete m_pTransferOverlay; + if (m_pActiveOverlay) delete m_pActiveOverlay; +} + /***************************************************************************** * * @@ -732,6 +741,11 @@ CallViewOverlay::CallViewOverlay(QWidget* parent) : QWidget(parent),m_pIcon(0),m m_black.setAlpha(75); } +CallViewOverlay::~CallViewOverlay() +{ + +} + ///Add a widget (usually an icon) in the corner void CallViewOverlay::setCornerWidget(QWidget* wdg) { wdg->setParent ( this ); diff --git a/kde/src/CallView.h b/kde/src/CallView.h index 1274665f9e..78bbb78a5a 100644 --- a/kde/src/CallView.h +++ b/kde/src/CallView.h @@ -58,6 +58,7 @@ class CallViewOverlay : public QWidget { public: //Constructor CallViewOverlay(QWidget* parent); + ~CallViewOverlay(); //Setters void setCornerWidget(QWidget* wdg); @@ -85,6 +86,7 @@ class CallView : public QTreeWidget { Q_OBJECT public: CallView ( QWidget* parent = 0 ); + ~CallView ( ); //Getters Call* getCurrentItem ( ); diff --git a/kde/src/SFLPhone.cpp b/kde/src/SFLPhone.cpp index 5a75a30c09..b2add8a22f 100755 --- a/kde/src/SFLPhone.cpp +++ b/kde/src/SFLPhone.cpp @@ -74,14 +74,39 @@ SFLPhone::~SFLPhone() ConfigurationSkeleton::setDisplayContactDock ( m_pContactCD->isVisible() ); ConfigurationSkeleton::setDisplayHistoryDock ( m_pHistoryDW->isVisible() ); ConfigurationSkeleton::setDisplayBookmarkDock( m_pBookmarkDW->isVisible() ); - delete m_pContactCD; - delete m_pHistoryDW; - delete m_pBookmarkDW; + + delete action_accept ; + delete action_refuse ; + delete action_hold ; + delete action_transfer ; + delete action_record ; + delete action_mailBox ; + delete action_close ; + delete action_quit ; + delete action_displayVolumeControls ; + delete action_displayDialpad ; + delete action_displayMessageBox ; + delete action_configureSflPhone ; + delete action_configureShortcut ; + delete action_accountCreationWizard ; + delete action_pastenumber ; + delete action_showContactDock ; + delete action_showHistoryDock ; + delete action_showBookmarkDock ; + + delete m_pView ; + delete m_pTrayIcon ; + delete m_pStatusBarWidget ; + delete m_pContactCD ; + delete m_pCentralDW ; + delete m_pHistoryDW ; + delete m_pBookmarkDW ; if (m_pModel) { delete m_pModel; } delete AkonadiBackend::getInstance(); + TreeWidgetCallModel::destroy(); } ///Init everything diff --git a/kde/src/klib/AkonadiBackend.cpp b/kde/src/klib/AkonadiBackend.cpp index a4946b3dc1..87c0a1293e 100644 --- a/kde/src/klib/AkonadiBackend.cpp +++ b/kde/src/klib/AkonadiBackend.cpp @@ -76,6 +76,7 @@ AkonadiBackend::AkonadiBackend(QObject* parent) : ContactBackend(parent) AkonadiBackend::~AkonadiBackend() { delete m_pModel; + CallModel<>::destroy(); } diff --git a/kde/src/klib/SortableDockCommon.h b/kde/src/klib/SortableDockCommon.h index 789fe935a4..32e2e75bf7 100644 --- a/kde/src/klib/SortableDockCommon.h +++ b/kde/src/klib/SortableDockCommon.h @@ -56,6 +56,7 @@ enum HistorySortingMode { Length = 3, }; +///@class SortableDockCommon Common code for filtering template <typename CallWidget = QWidget*, typename Index = QModelIndex*> class LIB_EXPORT SortableDockCommon { public: diff --git a/kde/src/lib/Account.cpp b/kde/src/lib/Account.cpp index b58b14e5e2..301810123d 100644 --- a/kde/src/lib/Account.cpp +++ b/kde/src/lib/Account.cpp @@ -108,6 +108,7 @@ Account* Account::buildNewAccountFromAlias(const QString& alias) Account::~Account() { delete m_pAccountId; + delete m_pAccountDetails; } diff --git a/kde/src/lib/Call.cpp b/kde/src/lib/Call.cpp index 3a446295d1..e48d79e93e 100644 --- a/kde/src/lib/Call.cpp +++ b/kde/src/lib/Call.cpp @@ -115,7 +115,7 @@ void Call::setContactBackend(ContactBackend* be) ///Constructor Call::Call(call_state startState, QString callId, QString peerName, QString peerNumber, QString account) - : m_isConference(false) + : m_isConference(false),m_pStopTime(nullptr),m_pStartTime(nullptr) { this->m_CallId = callId ; this->m_PeerPhoneNumber = peerNumber ; @@ -131,8 +131,8 @@ Call::Call(call_state startState, QString callId, QString peerName, QString peer ///Destructor Call::~Call() { - delete m_pStartTime ; - delete m_pStopTime ; + //if (m_pStartTime) delete m_pStartTime ; + //if (m_pStopTime) delete m_pStopTime ; } ///Constructor @@ -225,9 +225,16 @@ Call* Call::buildHistoryCall(const QString & callId, uint startTimeStamp, uint s { if(name == "empty") name = ""; Call* call = new Call(CALL_STATE_OVER, callId, name, number, account ); - call->m_pStartTime = new QDateTime(QDateTime::fromTime_t(startTimeStamp) ); - call->m_pStopTime = new QDateTime(QDateTime::fromTime_t(stopTimeStamp) ); - call->m_HistoryState = getHistoryStateFromType(type ); + + QDateTime* start = new QDateTime(QDateTime::fromTime_t(startTimeStamp)); + QDateTime* stop = new QDateTime(QDateTime::fromTime_t(startTimeStamp)); + + if (start){ + call->m_pStartTime = start; + call->m_pStopTime = stop; + } + + call->m_HistoryState = getHistoryStateFromType(type); return call; } @@ -603,8 +610,7 @@ call_state Call::actionPerformed(call_action action) return m_CurrentState; } //actionPerformed -/* -void Call::putRecording() +/*void Call::putRecording() { CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); bool daemonRecording = callManager.getIsRecording(this -> m_CallId); @@ -612,8 +618,8 @@ void Call::putRecording() { callManager.setRecording(this->m_CallId); } -} -*/ +}*/ + ///Change the state void Call::changeCurrentState(call_state newState) { @@ -631,6 +637,21 @@ void Call::sendTextMessage(QString message) callManager.sendTextMessage(m_CallId,message); } +QDateTime* Call::setStartTime_private(QDateTime* time) +{ + //if (m_pStartTime && time) + // delete m_pStartTime; + + return m_pStartTime = time; +} + +QDateTime* Call::setStopTime_private(QDateTime* time) +{ + //if (m_pStopTime && time) + // delete m_pStopTime; + return m_pStopTime = time; +} + /***************************************************************************** * * * Automate function * @@ -650,7 +671,7 @@ void Call::accept() CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); qDebug() << "Accepting call. callId : " << m_CallId << "ConfId:" << m_ConfId; callManager.accept(m_CallId); - this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); + setStartTime_private(new QDateTime(QDateTime::currentDateTime())); this->m_HistoryState = INCOMING; } @@ -660,7 +681,7 @@ void Call::refuse() CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); qDebug() << "Refusing call. callId : " << m_CallId << "ConfId:" << m_ConfId; callManager.refuse(m_CallId); - this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); + setStartTime_private(new QDateTime(QDateTime::currentDateTime())); this->m_HistoryState = MISSED; } @@ -688,7 +709,7 @@ void Call::acceptHold() void Call::hangUp() { CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - this->m_pStopTime = new QDateTime(QDateTime::currentDateTime()); + setStopTime_private(new QDateTime(QDateTime::currentDateTime())); qDebug() << "Hanging up call. callId : " << m_CallId << "ConfId:" << m_ConfId; if (!isConference()) callManager.hangUp(m_CallId); @@ -734,7 +755,7 @@ void Call::call() if (contact) m_PeerName = contact->getFormattedName(); } - this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); + setStartTime_private(new QDateTime(QDateTime::currentDateTime())); this->m_HistoryState = OUTGOING; } else { @@ -750,7 +771,7 @@ void Call::transfer() CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); qDebug() << "\n\n\nTransferring call to number : " << m_TransferNumber << ". callId : " << m_CallId << "\n\n\n"; callManager.transfer(m_CallId, m_TransferNumber); - this->m_pStopTime = new QDateTime(QDateTime::currentDateTime()); + setStopTime_private(new QDateTime(QDateTime::currentDateTime())); } void Call::unhold() @@ -784,29 +805,29 @@ void Call::setRecord() void Call::start() { qDebug() << "Starting call. callId : " << m_CallId << "ConfId:" << m_ConfId; - this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); + setStartTime_private(new QDateTime(QDateTime::currentDateTime())); } ///Toggle the timer void Call::startStop() { qDebug() << "Starting and stoping call. callId : " << m_CallId << "ConfId:" << m_ConfId; - this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); - this->m_pStopTime = new QDateTime(QDateTime::currentDateTime()); + setStartTime_private(new QDateTime(QDateTime::currentDateTime())); + setStopTime_private(new QDateTime(QDateTime::currentDateTime())); } ///Stop the timer void Call::stop() { qDebug() << "Stoping call. callId : " << m_CallId << "ConfId:" << m_ConfId; - this->m_pStopTime = new QDateTime(QDateTime::currentDateTime()); + setStopTime_private(new QDateTime(QDateTime::currentDateTime())); } ///Handle error instead of crashing void Call::startWeird() { qDebug() << "Starting call. callId : " << m_CallId << "ConfId:" << m_ConfId; - this->m_pStartTime = new QDateTime(QDateTime::currentDateTime()); + setStartTime_private(new QDateTime(QDateTime::currentDateTime())); qDebug() << "Warning : call " << m_CallId << " had an unexpected transition of state at its start."; } diff --git a/kde/src/lib/Call.h b/kde/src/lib/Call.h index 5f63067f2e..db09d1f8d3 100644 --- a/kde/src/lib/Call.h +++ b/kde/src/lib/Call.h @@ -255,6 +255,9 @@ private: void startWeird (); void warning (); + QDateTime* setStartTime_private(QDateTime* time); + QDateTime* setStopTime_private(QDateTime* time); + signals: void changed(); void isOver(Call*); diff --git a/kde/src/lib/CallModel.h b/kde/src/lib/CallModel.h index 9f632765b2..f337cbaf85 100644 --- a/kde/src/lib/CallModel.h +++ b/kde/src/lib/CallModel.h @@ -109,6 +109,7 @@ class LIB_EXPORT CallModel : public CallModelBase { virtual bool initCall ( ); virtual void initContact ( ContactBackend* be ); static bool initHistory ( ); + static void destroy ( ); //Call related virtual Call* addCall ( Call* call , Call* parent =0 ); diff --git a/kde/src/lib/CallModel.hpp b/kde/src/lib/CallModel.hpp index ed55456e06..ffb925bf43 100644 --- a/kde/src/lib/CallModel.hpp +++ b/kde/src/lib/CallModel.hpp @@ -90,10 +90,26 @@ CALLMODEL_TEMPLATE CALLMODEL_T::CallModel(ModelType type) : CallModelBase(0) init(); } +///Static destructor +CALLMODEL_TEMPLATE void CALLMODEL_T::destroy() +{ + /*foreach (InternalStruct* s, m_sPrivateCallList_call.values()) { + delete s; + } + foreach (Call* call, m_sPrivateCallList_call.keys()) { + delete call; + }*/ + m_sPrivateCallList_call.clear(); + m_sPrivateCallList_callId.clear(); + m_sPrivateCallList_widget.clear(); + m_sPrivateCallList_index.clear(); + m_sHistoryCalls.clear(); +} + ///Destructor CALLMODEL_TEMPLATE CALLMODEL_T::~CallModel() { - + if (m_spAccountList) delete m_spAccountList; } ///Open the connection to the daemon and register this client @@ -101,7 +117,6 @@ CALLMODEL_TEMPLATE bool CALLMODEL_T::init() { if (!m_sInstanceInit) { registerCommTypes(); - InstanceInterface& instance = InstanceInterfaceSingleton::getInstance(); //Setup accounts if (m_spAccountList == NULL) diff --git a/kde/src/lib/ContactBackend.cpp b/kde/src/lib/ContactBackend.cpp index e9af33886c..8b5fb60f46 100644 --- a/kde/src/lib/ContactBackend.cpp +++ b/kde/src/lib/ContactBackend.cpp @@ -33,6 +33,13 @@ ContactBackend::ContactBackend(QObject* parent) : QObject(parent) } +ContactBackend::~ContactBackend() +{ + foreach (Contact* c,m_ContactByUid) { + delete c; + } +} + ///Update slot ContactList ContactBackend::update() { diff --git a/kde/src/lib/ContactBackend.h b/kde/src/lib/ContactBackend.h index cea4318555..635cae26a9 100644 --- a/kde/src/lib/ContactBackend.h +++ b/kde/src/lib/ContactBackend.h @@ -40,6 +40,7 @@ class LIB_EXPORT ContactBackend : public QObject { Q_OBJECT public: ContactBackend(QObject* parent); + ~ContactBackend(); virtual Contact* getContactByPhone ( const QString& phoneNumber , bool resolveDNS = false) = 0; virtual Contact* getContactByUid ( const QString& uid ) = 0; virtual void editContact ( Contact* contact ) = 0; diff --git a/kde/src/lib/Item.h b/kde/src/lib/Item.h index ecb301dd59..5086ddffa1 100644 --- a/kde/src/lib/Item.h +++ b/kde/src/lib/Item.h @@ -1,7 +1,6 @@ /************************************************************************************ * Copyright (C) 2009 by Savoir-Faire Linux * * Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> * - * Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com> * * * * This library is free software; you can redistribute it and/or * * modify it under the terms of the GNU Lesser General Public * diff --git a/kde/src/widgets/AccountItemWidget.cpp b/kde/src/widgets/AccountItemWidget.cpp index c4c550a2d9..139bf7a782 100755 --- a/kde/src/widgets/AccountItemWidget.cpp +++ b/kde/src/widgets/AccountItemWidget.cpp @@ -37,7 +37,7 @@ ///Constructor AccountItemWidget::AccountItemWidget(QWidget *parent) - : QWidget(parent) + : QWidget(parent),m_pLed(nullptr),m_pCheckBox(nullptr),m_pTextLabel(nullptr) { m_pCheckBox = new QCheckBox(this); m_pCheckBox->setObjectName("m_pCheckBox"); @@ -65,9 +65,9 @@ AccountItemWidget::AccountItemWidget(QWidget *parent) ///Destructor AccountItemWidget::~AccountItemWidget() { - delete m_pLed; - delete m_pCheckBox; - delete m_pTextLabel; + if (m_pLed) delete m_pLed ; + if (m_pCheckBox) delete m_pCheckBox ; + if (m_pTextLabel) delete m_pTextLabel; } diff --git a/kde/src/widgets/BookmarkDock.cpp b/kde/src/widgets/BookmarkDock.cpp index 62e61650b0..4e811f3f85 100644 --- a/kde/src/widgets/BookmarkDock.cpp +++ b/kde/src/widgets/BookmarkDock.cpp @@ -106,7 +106,14 @@ BookmarkDock::BookmarkDock(QWidget* parent) : QDockWidget(parent) ///Destructor BookmarkDock::~BookmarkDock() { - + foreach (HistoryTreeItem* hti,m_pBookmark) { + delete hti; + } + delete m_pItemView ; + delete m_pFilterLE ; + delete m_pSplitter ; + delete m_pMostUsedCK; + delete m_pTest ; } diff --git a/kde/src/widgets/CallTreeItem.cpp b/kde/src/widgets/CallTreeItem.cpp index c76787ffaa..c7b23f23d7 100644 --- a/kde/src/widgets/CallTreeItem.cpp +++ b/kde/src/widgets/CallTreeItem.cpp @@ -58,7 +58,8 @@ const char * CallTreeItem::callStateIcons[12] = {ICON_INCOMING, ICON_RINGING, IC ///Constructor CallTreeItem::CallTreeItem(QWidget *parent) - : QWidget(parent), m_pItemCall(0), m_Init(false),m_pBtnConf(0), m_pBtnTrans(0),m_pTimer(0),m_pPeerL(0),m_pIconL(0),m_pCallNumberL(0),m_pSecureL(0),m_pCodecL(0) + : QWidget(parent), m_pItemCall(0), m_Init(false),m_pBtnConf(0), m_pBtnTrans(0),m_pTimer(0),m_pPeerL(0),m_pIconL(0),m_pCallNumberL(0),m_pSecureL(0),m_pCodecL(0),m_pHistoryPeerL(0) + , m_pTransferPrefixL(0),m_pTransferNumberL(0),m_pElapsedL(0) { setMaximumSize(99999,50); } @@ -66,7 +67,16 @@ CallTreeItem::CallTreeItem(QWidget *parent) ///Destructor CallTreeItem::~CallTreeItem() { - + if (m_pIconL) delete m_pIconL ; + if (m_pPeerL) delete m_pPeerL ; + if (m_pCallNumberL) delete m_pCallNumberL ; + if (m_pTransferPrefixL) delete m_pTransferPrefixL ; + if (m_pTransferNumberL) delete m_pTransferNumberL ; + if (m_pCodecL) delete m_pCodecL ; + if (m_pSecureL) delete m_pSecureL ; + if (m_pHistoryPeerL) delete m_pHistoryPeerL ; + if (m_pElapsedL) delete m_pElapsedL ; + if (m_pTimer) delete m_pTimer ; } diff --git a/kde/src/widgets/ContactDock.cpp b/kde/src/widgets/ContactDock.cpp index 07eb464f44..65a2b39b71 100644 --- a/kde/src/widgets/ContactDock.cpp +++ b/kde/src/widgets/ContactDock.cpp @@ -150,7 +150,16 @@ ContactDock::ContactDock(QWidget* parent) : QDockWidget(parent) ///Destructor ContactDock::~ContactDock() { - + /*foreach (ContactItemWidget* w, m_Contacts) { + delete w; + } + + delete m_pFilterLE ; + delete m_pSplitter ; + delete m_pContactView; + delete m_pCallView ; + delete m_pSortByCBB ; + delete m_pShowHistoCK;*/ } diff --git a/kde/src/widgets/ContactItemWidget.cpp b/kde/src/widgets/ContactItemWidget.cpp index 617d3baf4b..1694040960 100644 --- a/kde/src/widgets/ContactItemWidget.cpp +++ b/kde/src/widgets/ContactItemWidget.cpp @@ -95,7 +95,20 @@ ContactItemWidget::ContactItemWidget(QWidget *parent) ///Destructor ContactItemWidget::~ContactItemWidget() { - + /*delete m_pIconL ; + delete m_pContactNameL ; + delete m_pCallNumberL ; + delete m_pOrganizationL; + delete m_pEmailL ; + delete m_pItem ; + + delete m_pCallAgain ; + delete m_pEditContact ; + delete m_pCopy ; + delete m_pEmail ; + delete m_pAddPhone ; + delete m_pBookmark ; + delete m_pMenu ;*/ } diff --git a/kde/src/widgets/HistoryDock.cpp b/kde/src/widgets/HistoryDock.cpp index 15022433b6..9c4f92c47e 100644 --- a/kde/src/widgets/HistoryDock.cpp +++ b/kde/src/widgets/HistoryDock.cpp @@ -115,8 +115,8 @@ HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent) //m_pItemView->setAlternatingRowColors(true ); m_pItemView->setAcceptDrops( true ); m_pItemView->setDragEnabled( true ); - KeyPressEater *keyPressEater = new KeyPressEater(this); - m_pItemView->installEventFilter(keyPressEater); + m_pKeyPressEater = new KeyPressEater(this); + m_pItemView->installEventFilter(m_pKeyPressEater); m_pFilterLE->setPlaceholderText(i18n("Filter")); m_pFilterLE->setClearButtonShown(true); @@ -165,6 +165,20 @@ HistoryDock::HistoryDock(QWidget* parent) : QDockWidget(parent) ///Destructor HistoryDock::~HistoryDock() { + /*foreach (HistoryTreeItem* w, m_History) { + delete w; + } + delete m_pItemView ; + delete m_pFilterLE ; + delete m_pSortByCBB ; + delete m_pSortByL ; + delete m_pFromL ; + delete m_pToL ; + delete m_pFromDW ; + delete m_pToDW ; + delete m_pAllTimeCB ; + delete m_pLinkPB ; + delete m_pKeyPressEater;*/ } diff --git a/kde/src/widgets/HistoryDock.h b/kde/src/widgets/HistoryDock.h index 8286087601..9268ef44bf 100644 --- a/kde/src/widgets/HistoryDock.h +++ b/kde/src/widgets/HistoryDock.h @@ -45,6 +45,7 @@ class KDateWidget; //SFLPhone class HistoryTreeItem; class HistoryTree; +class KeyPressEater; //Typedef typedef QList<HistoryTreeItem*> HistoryList; @@ -63,19 +64,20 @@ public: private: //Attributes - HistoryTree* m_pItemView ; - KLineEdit* m_pFilterLE ; - QComboBox* m_pSortByCBB ; - QLabel* m_pSortByL ; - QLabel* m_pFromL ; - QLabel* m_pToL ; - KDateWidget* m_pFromDW ; - KDateWidget* m_pToDW ; - QCheckBox* m_pAllTimeCB ; - QPushButton* m_pLinkPB ; - HistoryList m_History ; - QDate m_CurrentFromDate ; - QDate m_CurrentToDate ; + HistoryTree* m_pItemView ; + KLineEdit* m_pFilterLE ; + QComboBox* m_pSortByCBB ; + QLabel* m_pSortByL ; + QLabel* m_pFromL ; + QLabel* m_pToL ; + KDateWidget* m_pFromDW ; + KDateWidget* m_pToDW ; + QCheckBox* m_pAllTimeCB ; + QPushButton* m_pLinkPB ; + HistoryList m_History ; + QDate m_CurrentFromDate ; + QDate m_CurrentToDate ; + KeyPressEater* m_pKeyPressEater ; //Mutator void updateLinkedDate(KDateWidget* item, QDate& prevDate, QDate& newDate); @@ -102,6 +104,7 @@ public: bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action); }; +///@class KeyPressEater Intercept each keypress to manage it globally class KeyPressEater : public QObject { Q_OBJECT diff --git a/kde/src/widgets/HistoryTreeItem.cpp b/kde/src/widgets/HistoryTreeItem.cpp index 7f0fb67b3e..766a1b8e62 100644 --- a/kde/src/widgets/HistoryTreeItem.cpp +++ b/kde/src/widgets/HistoryTreeItem.cpp @@ -75,7 +75,8 @@ protected: ///Constructor HistoryTreeItem::HistoryTreeItem(QWidget *parent ,QString phone) - : QWidget(parent), m_pItemCall(0),m_pMenu(0),m_pAudioSlider(0),m_pTimeLeftL(0),m_pTimePlayedL(0),m_pPlayer(0),m_pContact(0) + : QWidget(parent), m_pItemCall(0),m_pMenu(0),m_pAudioSlider(0),m_pTimeLeftL(0),m_pTimePlayedL(0),m_pPlayer(0),m_pContact(0), + m_pPause(0), m_pStop(0), m_pNote(0) { setContextMenuPolicy(Qt::CustomContextMenu); @@ -172,7 +173,30 @@ HistoryTreeItem::HistoryTreeItem(QWidget *parent ,QString phone) ///Destructor HistoryTreeItem::~HistoryTreeItem() { - + delete m_pIconL ; + delete m_pPeerNameL ; + delete m_pCallNumberL ; + delete m_pTimeL ; + delete m_pLengthL ; + + delete m_pCallAgain ; + delete m_pAddContact ; + delete m_pAddToContact ; + delete m_pCopy ; + delete m_pEmail ; + delete m_pBookmark ; + delete m_pMenu ; + + delete m_pPlay ; + delete m_pRemove ; + delete m_pAudioSlider ; + delete m_pTimeLeftL ; + delete m_pTimePlayedL ; + delete m_pPlayer ; + + delete m_pPause ; + delete m_pStop ; + delete m_pNote ; } diff --git a/kde/src/widgets/HistoryTreeItem.h b/kde/src/widgets/HistoryTreeItem.h index bb57dad739..aafa80d994 100644 --- a/kde/src/widgets/HistoryTreeItem.h +++ b/kde/src/widgets/HistoryTreeItem.h @@ -87,7 +87,7 @@ class HistoryTreeItem : public QWidget QLabel* m_pPeerNameL ; QLabel* m_pCallNumberL ; QLabel* m_pTimeL ; - QLabel* m_pLengthL ; + QLabel* m_pLengthL ; KAction* m_pCallAgain ; KAction* m_pAddContact ; diff --git a/kde/src/widgets/SFLPhoneTray.cpp b/kde/src/widgets/SFLPhoneTray.cpp index 01e72c3ee6..8ee116e03f 100755 --- a/kde/src/widgets/SFLPhoneTray.cpp +++ b/kde/src/widgets/SFLPhoneTray.cpp @@ -41,6 +41,7 @@ SFLPhoneTray::SFLPhoneTray(QIcon icon, QWidget *parent) ///Destructor SFLPhoneTray::~SFLPhoneTray() { + if (m_pTrayIconMenu) delete m_pTrayIconMenu; } ///Initializer diff --git a/kde/src/widgets/TranslucentButtons.cpp b/kde/src/widgets/TranslucentButtons.cpp index facf8a1f92..0aed7374e7 100644 --- a/kde/src/widgets/TranslucentButtons.cpp +++ b/kde/src/widgets/TranslucentButtons.cpp @@ -20,7 +20,7 @@ TranslucentButtons::TranslucentButtons(QWidget* parent):QPushButton(parent),m_en ///Destructor TranslucentButtons::~TranslucentButtons() { - + if (m_pTimer) delete m_pTimer; } ///How to paint -- GitLab