~diegosarmentero/ubuntu-system-settings/update-battery

« back to all changes in this revision

Viewing changes to plugins/bluetooth/device.h

  • Committer: CI bot
  • Author(s): Mathieu Trudel-Lapierre
  • Date: 2014-06-23 13:52:09 UTC
  • mfrom: (742.1.8 ubuntu-system-settings)
  • Revision ID: ps-jenkins@lists.canonical.com-20140623135209-c4a7hhxmy9fcey9o
Implement discoverability and some bluetooth fixes:
  - Discoverability: make the system visible to other bluetooth devices
  - Trusted: when successfully paired and connected, mark device as Trusted so it can automatically connect again.
  - Connect the Audio interface for all audio devices, including Headsets. Some bluetooth audio devices that don't contain a microphone still show up as Headsets, and won't connect successfully otherwise. This will still work for standard headsets, since Audio connects all audio interfaces.
  - Stop discovery when a device is selected for connection, and it sometimes causes connection attempts to fail. Fixes: 1268047, 1331642

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
               READ isPaired
50
50
               NOTIFY pairedChanged)
51
51
 
 
52
    Q_PROPERTY(bool trusted
 
53
               READ isTrusted
 
54
               NOTIFY trustedChanged)
 
55
 
52
56
    Q_PROPERTY(Connection connection
53
57
               READ getConnection
54
58
               NOTIFY connectionChanged)
81
85
    void addressChanged();
82
86
    void typeChanged();
83
87
    void pairedChanged();
 
88
    void trustedChanged();
84
89
    void connectionChanged();
85
90
    void strengthChanged();
86
91
    void deviceChanged(); // catchall for any change
91
96
    const QString& getIconName() const { return m_iconName; }
92
97
    Type getType() const { return m_type; }
93
98
    bool isPaired() const { return m_paired; }
 
99
    bool isTrusted() const { return m_trusted; }
94
100
    Connection getConnection() const { return m_connection; }
95
101
    Strength getStrength() const { return m_strength; }
96
102
    QString getPath() const { return m_deviceInterface->path(); }
103
109
    QString m_fallbackIconName;
104
110
    Type m_type = Type::Other;
105
111
    bool m_paired = false;
 
112
    bool m_trusted = false;
106
113
    Connection m_connection = Connection::Disconnected;
107
114
    Strength m_strength = Strength::Fair;
108
115
    bool m_isConnected = false;
118
125
    void setAddress(const QString &address);
119
126
    void setType(Type type);
120
127
    void setPaired(bool paired);
 
128
    void setTrusted(bool trusted);
121
129
    void setConnection(Connection connection);
122
130
    void setStrength(Strength strength);
123
131
    void updateIcon();
129
137
    Device(const QString &path, QDBusConnection &bus);
130
138
    bool isValid() const { return getType() != Type::Other; }
131
139
    void connect(ConnectionMode);
 
140
    void makeTrusted();
132
141
    void disconnect(ConnectionMode);
133
142
    void setProperties(const QMap<QString,QVariant> &properties);
134
143