2
* Copyright (C) 2013 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authors: Tiago Salem Herrmann <tiago.herrmann@canonical.com>
22
#include "mmsdmessage.h"
24
MMSDMessage::MMSDMessage(QString objectPath, QVariantMap properties, QObject *parent)
26
m_messagePath(objectPath),
27
m_properties(properties)
29
QDBusConnection::sessionBus().connect("org.ofono.mms", m_messagePath, "org.ofono.mms.Message",
30
"PropertyChanged", this,
31
SLOT(onPropertyChanged(const QString&, const QVariant&)));
34
MMSDMessage::~MMSDMessage()
38
QString MMSDMessage::path() const
43
QVariantMap MMSDMessage::properties() const
48
void MMSDMessage::onPropertyChanged(const QString &property, const QVariant &value)
50
qDebug() << "property changed" << property << value;
51
m_properties[property] = value;
52
Q_EMIT propertyChanged(property, value);
55
void MMSDMessage::markRead() const
58
request = QDBusMessage::createMethodCall("org.ofono.mms",
59
m_messagePath, "org.ofono.mms.Message",
61
QDBusConnection::sessionBus().call(request);
64
void MMSDMessage::remove() const
67
request = QDBusMessage::createMethodCall("org.ofono.mms",
68
m_messagePath, "org.ofono.mms.Message",
70
QDBusConnection::sessionBus().call(request);