~phablet-team/telephony-service/trunk

« back to all changes in this revision

Viewing changes to libtelephonyservice/protocol.cpp

  • Committer: Bileto Bot
  • Author(s): Roberto Mier Escandon, Tiago Salem Herrmann
  • Date: 2016-12-13 12:46:07 UTC
  • mfrom: (1212.2.12 protocols-through-dbus)
  • Revision ID: ci-train-bot@canonical.com-20161213124607-74zrir0pa80kkaor
Requesting protocols from qml plugin using DBus in case protocols dir folder does not exits.
This is needed in snappy to access available protocols from applications.

Approved by: Tiago Salem Herrmann

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 */
22
22
 
23
23
#include "protocol.h"
 
24
#include "dbustypes.h"
24
25
#include <QFileInfo>
25
26
#include <QSettings>
26
27
 
27
 
Protocol::Protocol(const QString &name, Features features,
 
28
Protocol::Protocol(const ProtocolStruct & protocol)
 
29
    : mName(protocol.name)
 
30
    , mFeatures(protocol.features)
 
31
    , mFallbackProtocol(protocol.fallbackProtocol)
 
32
    , mFallbackMatchRule((MatchRule)protocol.fallbackMatchRule)
 
33
    , mFallbackSourceProperty(protocol.fallbackSourceProperty)
 
34
    , mFallbackDestinationProperty(protocol.fallbackDestinationProperty)
 
35
    , mShowOnSelector(protocol.showOnSelector)
 
36
    , mShowOnlineStatus(protocol.showOnlineStatus)
 
37
    , mBackgroundImage(protocol.backgroundImage)
 
38
    , mIcon(protocol.icon)
 
39
    , mServiceName(protocol.serviceName)
 
40
    , mServiceDisplayName(protocol.serviceDisplayName)
 
41
{
 
42
}
 
43
 
 
44
Protocol::Protocol(const QString &name,
 
45
                   Features features,
28
46
                   const QString &fallbackProtocol,
29
47
                   MatchRule fallbackMatchRule,
30
48
                   const QString &fallbackSourceProperty,
36
54
                   const QString &serviceName,
37
55
                   const QString &serviceDisplayName,
38
56
                   QObject *parent)
39
 
: QObject(parent), mName(name), mFeatures(features), mFallbackProtocol(fallbackProtocol), mFallbackMatchRule(fallbackMatchRule),
40
 
  mFallbackSourceProperty(fallbackSourceProperty), mFallbackDestinationProperty(fallbackDestinationProperty),
41
 
  mShowOnSelector(showOnSelector), mShowOnlineStatus(showOnlineStatus), mBackgroundImage(backgroundImage), mIcon(icon),
42
 
  mServiceName(serviceName), mServiceDisplayName(serviceDisplayName)
43
 
{
 
57
 : QObject(parent)
 
58
 , mName(name)
 
59
 , mFeatures(features)
 
60
 , mFallbackProtocol(fallbackProtocol)
 
61
 , mFallbackMatchRule(fallbackMatchRule)
 
62
 , mFallbackSourceProperty(fallbackSourceProperty)
 
63
 , mFallbackDestinationProperty(fallbackDestinationProperty)
 
64
 , mShowOnSelector(showOnSelector)
 
65
 , mShowOnlineStatus(showOnlineStatus)
 
66
 , mBackgroundImage(backgroundImage)
 
67
 , mIcon(icon)
 
68
 , mServiceName(serviceName)
 
69
 , mServiceDisplayName(serviceDisplayName)
 
70
{
 
71
}
 
72
 
 
73
ProtocolStruct Protocol::dbusType()
 
74
{
 
75
    return ProtocolStruct{mName, static_cast<uint>(mFeatures), mFallbackProtocol, static_cast<uint>(mFallbackMatchRule), mFallbackSourceProperty, mFallbackDestinationProperty, mShowOnSelector, mShowOnlineStatus, mBackgroundImage, mIcon, mServiceName, mServiceDisplayName};
44
76
}
45
77
 
46
78
QString Protocol::name() const