~ken-vandine/content-hub/noclick

« back to all changes in this revision

Viewing changes to src/com/ubuntu/content/hub.cpp

  • Committer: Ken VanDine
  • Date: 2017-03-15 12:54:42 UTC
  • mfrom: (321.1.7 content-hub)
  • Revision ID: ken.vandine@canonical.com-20170315125442-jultuh0alb8kjknp
merged trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
    QObject::connect(d->service, SIGNAL(PeerSelectionCancelled(const QString&)),
96
96
            this,
97
97
            SLOT(onPeerSelectionCancelled(const QString&)));
 
98
    QObject::connect(d->service, SIGNAL(PasteSelected(const QString&, QByteArray, bool)),
 
99
            this,
 
100
            SLOT(onPasteSelected(const QString&, QByteArray, bool)));
 
101
    QObject::connect(d->service, SIGNAL(PasteSelectionCancelled(const QString&)),
 
102
            this,
 
103
            SLOT(onPasteSelectionCancelled(const QString&)));
98
104
}
99
105
 
100
106
cuc::Hub::~Hub()
113
119
    d->service->RequestPeerForTypeByAppId(type.id(), handler_id, app_id());
114
120
}
115
121
 
 
122
void cuc::Hub::requestPaste()
 
123
{
 
124
    TRACE() << Q_FUNC_INFO;
 
125
    d->service->RequestPasteByAppId(app_id());
 
126
}
 
127
 
 
128
void cuc::Hub::selectPasteForAppId(QString app_id, QString surface_id, QString paste_id, bool pasteAsRichText)
 
129
{
 
130
    TRACE() << Q_FUNC_INFO << app_id << surface_id << paste_id << pasteAsRichText;
 
131
    d->service->SelectPasteForAppId(app_id, surface_id, paste_id, pasteAsRichText);
 
132
}
 
133
 
 
134
void cuc::Hub::selectPasteForAppIdCancelled(QString app_id)
 
135
{
 
136
    TRACE() << Q_FUNC_INFO << app_id;
 
137
    d->service->SelectPasteForAppIdCancelled(app_id);
 
138
}
 
139
 
116
140
void cuc::Hub::selectPeerForAppId(QString app_id, QString peer_id)
117
141
{
118
142
    TRACE() << Q_FUNC_INFO << app_id << peer_id;
165
189
        Q_EMIT(peerSelectionCancelled());
166
190
}
167
191
 
 
192
void cuc::Hub::onPasteSelected(const QString &id, QByteArray paste, bool pasteAsRichText)
 
193
{
 
194
    TRACE() << Q_FUNC_INFO << id << paste << pasteAsRichText;
 
195
    if (id == app_id())
 
196
        Q_EMIT(pasteSelected(paste, pasteAsRichText));
 
197
}
 
198
 
 
199
void cuc::Hub::onPasteSelectionCancelled(const QString &id)
 
200
{
 
201
    TRACE() << Q_FUNC_INFO << id;
 
202
    if (id == app_id())
 
203
        Q_EMIT(pasteSelectionCancelled());
 
204
}
 
205
 
168
206
bool cuc::Hub::eventFilter(QObject *obj, QEvent *event)
169
207
{
170
208
   if (event->type() == QEvent::ApplicationActivate)