From f8ccf6916359dbd45a0adfbe677377df3e191cd5 Mon Sep 17 00:00:00 2001 From: Joona Petrell Date: Thu, 4 Feb 2016 10:17:36 +0200 Subject: [PATCH] [voicecall] Revert the new commhistory logging in voicecall. Contributes to JB#34082 Reverts "Merge pull request #71 from tswindell/commhistory" This reverts commit b2c2b0abeeac5513e5226b97c1f7b4339eb54a3c, reversing changes made to 73ef2eed939d0f4ef3c36e4427d3e0eb3ad9ac71. --- plugins/commhistory/commhistory.pro | 4 - plugins/commhistory/src/calleventhandler.cpp | 139 ------------------ plugins/commhistory/src/calleventhandler.h | 55 ------- plugins/commhistory/src/commhistoryplugin.cpp | 116 --------------- plugins/commhistory/src/commhistoryplugin.h | 62 -------- plugins/commhistory/src/src.pro | 17 --- plugins/plugins.pro | 2 +- .../telepathy/src/telepathyprovider.cpp | 2 +- rpm/voicecall-qt5.spec | 2 - 9 files changed, 2 insertions(+), 397 deletions(-) delete mode 100644 plugins/commhistory/commhistory.pro delete mode 100644 plugins/commhistory/src/calleventhandler.cpp delete mode 100644 plugins/commhistory/src/calleventhandler.h delete mode 100644 plugins/commhistory/src/commhistoryplugin.cpp delete mode 100644 plugins/commhistory/src/commhistoryplugin.h delete mode 100644 plugins/commhistory/src/src.pro diff --git a/plugins/commhistory/commhistory.pro b/plugins/commhistory/commhistory.pro deleted file mode 100644 index c29cdd8..0000000 --- a/plugins/commhistory/commhistory.pro +++ /dev/null @@ -1,4 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = src - -OTHER_FILES += LICENSE diff --git a/plugins/commhistory/src/calleventhandler.cpp b/plugins/commhistory/src/calleventhandler.cpp deleted file mode 100644 index 69dbfdd..0000000 --- a/plugins/commhistory/src/calleventhandler.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * This file is a part of the Voice Call Manager Plugin project. - * - * Copyright (C) 2011-2015 Jolla Ltd - * Contact: Tom Swindell - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ -#include "common.h" -#include "calleventhandler.h" - -#include - -#include -#include - -struct CallEventHandlerPrivate -{ - CallEventHandlerPrivate(AbstractVoiceCallHandler *pTarget, CommHistoryPlugin *pParent) - : target(pTarget), - parent(pParent), - started(false), - created(false) - {/*...*/} - - AbstractVoiceCallHandler *target; - CommHistoryPlugin *parent; - CommHistory::Event event; - - bool started; - bool created; -}; - -CallEventHandler::CallEventHandler(AbstractVoiceCallHandler *target, CommHistoryPlugin *parent) - : QObject(parent), d_ptr(new CallEventHandlerPrivate(target, parent)) -{ - TRACE - Q_D(CallEventHandler); - - QObject::connect(parent->eventModel(), SIGNAL(eventsCommitted(QList, bool)), - this, SLOT(onEventsCommitted(QList, bool))); - - d->event.setType(CommHistory::Event::CallEvent); - d->event.setStartTime(QDateTime::currentDateTime()); - d->event.setEndTime(d->event.startTime()); - d->event.setLocalUid(target->provider()->providerId()); - d->event.setRecipients(CommHistory::Recipient(d->event.localUid(), target->lineId().replace(QRegExp("^sip:"), ""))); - d->event.setDirection(target->isIncoming() ? CommHistory::Event::Inbound : CommHistory::Event::Outbound); - d->event.setIsVideoCall(false); - d->event.setIsEmergencyCall(target->isEmergency()); - - pushEvent(); - - QObject::connect(target, &AbstractVoiceCallHandler::statusChanged, this, &CallEventHandler::onCallStatusChanged); - QObject::connect(target, SIGNAL(destroyed()), this, SLOT(deleteLater())); -} - -CallEventHandler::~CallEventHandler() -{ - TRACE -} - -void CallEventHandler::pushEvent() -{ - TRACE - Q_D(CallEventHandler); - - if(d->created) { - d->parent->eventModel()->modifyEvent(d->event); - } else { - d->created = d->parent->eventModel()->addEvent(d->event); - } - - if(!d->created) WARNING_T("Failed to push event!"); -} - -void CallEventHandler::onEventsCommitted(const QList &events, bool success) -{ - TRACE - Q_UNUSED(events) - - if(!success) - { - DEBUG_T("Failed to commit events!"); - } -} - -void CallEventHandler::onCallStatusChanged(AbstractVoiceCallHandler::VoiceCallStatus status) -{ - TRACE - Q_D(CallEventHandler); - bool modified = false; - - switch(status) { - case AbstractVoiceCallHandler::STATUS_ACTIVE: - d->started = true; - - d->event.setStartTime(d->target->startedAt()); - d->event.setEndTime(d->event.startTime()); - - modified = true; - break; - - case AbstractVoiceCallHandler::STATUS_INCOMING: - d->event.setDirection(CommHistory::Event::Inbound); - modified = true; - break; - - case AbstractVoiceCallHandler::STATUS_NULL: - case AbstractVoiceCallHandler::STATUS_DISCONNECTED: - d->event.setEndTime(d->target->startedAt().addSecs(d->target->duration())); - - //TODO: We really need a "rejected()" signal so we can not display notifications - // for rejected calls? - if(!d->started) d->event.setIsMissedCall(true); - - modified = true; - break; - - default: - break; - } - - if(modified) pushEvent(); -} - diff --git a/plugins/commhistory/src/calleventhandler.h b/plugins/commhistory/src/calleventhandler.h deleted file mode 100644 index ee3b6f4..0000000 --- a/plugins/commhistory/src/calleventhandler.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * This file is a part of the Voice Call Manager Plugin project. - * - * Copyright (C) 2011-2015 Jolla Ltd - * Contact: Tom Swindell - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ -#ifndef CALLEVENTHANDLER_H -#define CALLEVENTHANDLER_H - -#include - -#include -#include "commhistoryplugin.h" - -namespace CommHistory { - class Event; -} - -class CallEventHandler : public QObject -{ - Q_OBJECT - -public: - explicit CallEventHandler(AbstractVoiceCallHandler *target, CommHistoryPlugin *parent); - ~CallEventHandler(); - -protected Q_SLOTS: - void onCallStatusChanged(AbstractVoiceCallHandler::VoiceCallStatus status); - void onEventsCommitted(const QList &events, bool success); - -protected: - void pushEvent(); - -private: - class CallEventHandlerPrivate *d_ptr; - - Q_DECLARE_PRIVATE(CallEventHandler) -}; - -#endif // CALLEVENTHANDLER_H diff --git a/plugins/commhistory/src/commhistoryplugin.cpp b/plugins/commhistory/src/commhistoryplugin.cpp deleted file mode 100644 index bcbacb8..0000000 --- a/plugins/commhistory/src/commhistoryplugin.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* -* This file is a part of the Voice Call Manager Plugin project. -* -* Copyright (C) 2011-2015 Jolla Ltd -* Contact: Tom Swindell -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -*/ -#include "common.h" -#include "commhistoryplugin.h" - -#include "calleventhandler.h" - -#include - -class CommHistoryPluginPrivate -{ - Q_DECLARE_PUBLIC(CommHistoryPlugin) - -public: - CommHistoryPluginPrivate(CommHistoryPlugin *q) - : q_ptr(q), manager(NULL), model(NULL) - { /* ... */ } - - CommHistoryPlugin *q_ptr; - VoiceCallManagerInterface *manager; - - CommHistory::EventModel *model; -}; - -CommHistoryPlugin::CommHistoryPlugin(QObject *parent) - : AbstractVoiceCallManagerPlugin(parent), d_ptr(new CommHistoryPluginPrivate(this)) -{ - TRACE - Q_D(CommHistoryPlugin); - d->model = new CommHistory::EventModel(this); -} - -CommHistoryPlugin::~CommHistoryPlugin() -{ - TRACE - delete this->d_ptr; -} - -QString CommHistoryPlugin::pluginId() const -{ - TRACE - return PLUGIN_NAME; -} - -bool CommHistoryPlugin::initialize() -{ - TRACE - return true; -} - -bool CommHistoryPlugin::configure(VoiceCallManagerInterface *manager) -{ - TRACE - Q_D(CommHistoryPlugin); - d->manager = manager; - return true; -} - -bool CommHistoryPlugin::start() -{ - TRACE - Q_D(const CommHistoryPlugin); - return QObject::connect(d->manager, - SIGNAL(voiceCallAdded(AbstractVoiceCallHandler*)), - this, - SLOT(onVoiceCallAdded(AbstractVoiceCallHandler*))); -} - -bool CommHistoryPlugin::suspend() -{ - TRACE - return true; -} - -bool CommHistoryPlugin::resume() -{ - TRACE - return true; -} - -void CommHistoryPlugin::finalize() -{ - TRACE -} - -CommHistory::EventModel* CommHistoryPlugin::eventModel() -{ - TRACE - Q_D(CommHistoryPlugin); - return d->model; -} - -void CommHistoryPlugin::onVoiceCallAdded(AbstractVoiceCallHandler *handler) -{ - TRACE - new CallEventHandler(handler, this); -} diff --git a/plugins/commhistory/src/commhistoryplugin.h b/plugins/commhistory/src/commhistoryplugin.h deleted file mode 100644 index 1f6314b..0000000 --- a/plugins/commhistory/src/commhistoryplugin.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is a part of the Voice Call Manager Plugin project. - * - * Copyright (C) 2011-2015 Jolla Ltd - * Contact: Tom Swindell - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ -#ifndef COMMHISTORYPLUGIN_H -#define COMMHISTORYPLUGIN_H - -#include - -#include -#include - -class CommHistoryPlugin : public AbstractVoiceCallManagerPlugin -{ - Q_OBJECT - - Q_PLUGIN_METADATA(IID "org.nemomobile.voicecall.commhistory") - Q_INTERFACES(AbstractVoiceCallManagerPlugin) - -public: - explicit CommHistoryPlugin(QObject *parent = 0); - ~CommHistoryPlugin(); - - QString pluginId() const; - - CommHistory::EventModel* eventModel(); - -public Q_SLOTS: - bool initialize(); - bool configure(VoiceCallManagerInterface *manager); - bool start(); - bool suspend(); - bool resume(); - void finalize(); - -protected Q_SLOTS: - void onVoiceCallAdded(AbstractVoiceCallHandler *handler); - -private: - class CommHistoryPluginPrivate *d_ptr; - - Q_DECLARE_PRIVATE(CommHistoryPlugin) -}; - -#endif // COMMHISTORYPLUGIN_H diff --git a/plugins/commhistory/src/src.pro b/plugins/commhistory/src/src.pro deleted file mode 100644 index 1df4f7f..0000000 --- a/plugins/commhistory/src/src.pro +++ /dev/null @@ -1,17 +0,0 @@ -include(../../plugin.pri) -QT += contacts dbus -TARGET = voicecall-commhistory-plugin - -PKGCONFIG += qtcontacts-sqlite-qt5-extensions contactcache-qt5 commhistory-qt5 nemonotifications-qt5 - -DEFINES += PLUGIN_NAME=\\\"commhistory-plugin\\\" - -#DEFINES += WANT_TRACE - -HEADERS += \ - commhistoryplugin.h \ - calleventhandler.h - -SOURCES += \ - commhistoryplugin.cpp \ - calleventhandler.cpp diff --git a/plugins/plugins.pro b/plugins/plugins.pro index 5f299fb..07bbfbe 100644 --- a/plugins/plugins.pro +++ b/plugins/plugins.pro @@ -1,2 +1,2 @@ TEMPLATE = subdirs -SUBDIRS = declarative providers ngf playback-manager mce commhistory +SUBDIRS = declarative providers ngf playback-manager mce diff --git a/plugins/providers/telepathy/src/telepathyprovider.cpp b/plugins/providers/telepathy/src/telepathyprovider.cpp index 59f0f7e..408251f 100644 --- a/plugins/providers/telepathy/src/telepathyprovider.cpp +++ b/plugins/providers/telepathy/src/telepathyprovider.cpp @@ -80,7 +80,7 @@ QString TelepathyProvider::providerId() const { TRACE Q_D(const TelepathyProvider); - return d->account->objectPath(); + return QString("telepathy-") + d->account->uniqueIdentifier(); } QString TelepathyProvider::providerType() const diff --git a/rpm/voicecall-qt5.spec b/rpm/voicecall-qt5.spec index 4952e37..c4d9cb2 100644 --- a/rpm/voicecall-qt5.spec +++ b/rpm/voicecall-qt5.spec @@ -14,7 +14,6 @@ Requires(postun): /sbin/ldconfig BuildRequires: pkgconfig(Qt5Qml) BuildRequires: pkgconfig(Qt5Multimedia) BuildRequires: pkgconfig(libresourceqt5) -BuildRequires: pkgconfig(commhistory-qt5) BuildRequires: pkgconfig(libpulse-mainloop-glib) BuildRequires: pkgconfig(ngf-qt5) BuildRequires: pkgconfig(qt5-boostable) @@ -112,7 +111,6 @@ fi %{_libdir}/voicecall/plugins/libvoicecall-playback-manager-plugin.so %{_libdir}/voicecall/plugins/libvoicecall-ngf-plugin.so %{_libdir}/voicecall/plugins/libvoicecall-mce-plugin.so -%{_libdir}/voicecall/plugins/libvoicecall-commhistory-plugin.so %{_libdir}/systemd/user/voicecall-manager.service %{_libdir}/systemd/user/user-session.target.wants/voicecall-manager.service