~ubuntu-branches/ubuntu/precise/networkmanagement/precise

« back to all changes in this revision

Viewing changes to .pc/fix-and-workaround-graphical-artifacts.diff/applet/interfaceitem.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2012-02-11 20:44:55 UTC
  • Revision ID: package-import@ubuntu.com-20120211204455-se2bx8iwlyhnp89u
Tags: 0.9.0~rc4-0ubuntu2
Cherry pick upstream commit 6a5e30e94ee539b7765eb5ad054bf9e1a6785703
as fix-and-workaround-graphical-artifacts.diff
to fix graphical artifacts in buttons with the default plasma theme.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2008,2009 Will Stephenson <wstephenson@kde.org>
 
3
Copyright 2008, 2009 Sebastian Kügler <sebas@kde.org>
 
4
 
 
5
This program is free software; you can redistribute it and/or
 
6
modify it under the terms of the GNU General Public License as
 
7
published by the Free Software Foundation; either version 2 of
 
8
the License or (at your option) version 3 or any later version
 
9
accepted by the membership of KDE e.V. (or its successor approved
 
10
by the membership of KDE e.V.), which shall act as a proxy
 
11
defined in Section 14 of version 3 of the license.
 
12
 
 
13
This program is distributed in the hope that it will be useful,
 
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
GNU General Public License for more details.
 
17
 
 
18
You should have received a copy of the GNU General Public License
 
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
*/
 
21
 
 
22
#include "interfaceitem.h"
 
23
#include "uiutils.h"
 
24
#include "remoteinterfaceconnection.h"
 
25
#include "remoteactivatablelist.h"
 
26
#include "remoteinterfaceconnection.h"
 
27
 
 
28
#include <arpa/inet.h>
 
29
 
 
30
#include <QGraphicsGridLayout>
 
31
#include <QLabel>
 
32
#include <QPainter>
 
33
 
 
34
#include <KDebug>
 
35
#include <KGlobalSettings>
 
36
#include <KIconLoader>
 
37
#include <KIcon>
 
38
#include <kdeversion.h>
 
39
 
 
40
#include <Plasma/Animation>
 
41
#include <Plasma/Animator>
 
42
 
 
43
#include <Plasma/IconWidget>
 
44
#include <Plasma/Label>
 
45
#include <Plasma/Meter>
 
46
 
 
47
#include <Solid/Device>
 
48
#include <Solid/NetworkInterface>
 
49
#include <solid/control/networkinterface.h>
 
50
#include <solid/control/wirednetworkinterface.h>
 
51
#include <solid/control/networkipv4confignm09.h>
 
52
#include <solid/control/networkmanager.h>
 
53
 
 
54
#include "knmserviceprefs.h"
 
55
#include "nm-device-interface.cpp"
 
56
#include "nm-ip4-config-interface.cpp"
 
57
 
 
58
 
 
59
InterfaceItem::InterfaceItem(Solid::Control::NetworkInterfaceNm09 * iface, RemoteActivatableList* activatables,  NameDisplayMode mode, QGraphicsWidget * parent) : Plasma::IconWidget(parent),
 
60
    m_currentConnection(0),
 
61
    m_iface(iface),
 
62
    m_activatables(activatables),
 
63
    m_icon(0),
 
64
    m_connectionNameLabel(0),
 
65
    m_nameMode(mode),
 
66
    m_enabled(false),
 
67
    m_hasDefaultRoute(false),
 
68
    m_starting(true)
 
69
{
 
70
    connect(m_activatables, SIGNAL(disappeared()), this, SLOT(serviceDisappeared()));
 
71
    connect(m_activatables, SIGNAL(activatableAdded(RemoteActivatable*, int)), SLOT(activatableAdded(RemoteActivatable*)));
 
72
    connect(m_activatables, SIGNAL(activatableRemoved(RemoteActivatable*)), SLOT(activatableRemoved(RemoteActivatable*)));
 
73
    setDrawBackground(true);
 
74
    setTextBackgroundColor(QColor(Qt::transparent));
 
75
    QString tt = i18nc("tooltip on the LHS widgets", "Click here for interface details");
 
76
 
 
77
    m_pixmapSize = QSize(48, 48);
 
78
    setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
 
79
 
 
80
    m_layout = new QGraphicsGridLayout(this);
 
81
    m_layout->setVerticalSpacing(0);
 
82
    m_layout->setColumnSpacing(0, 8);
 
83
    m_layout->setColumnSpacing(1, 4);
 
84
    m_layout->setColumnSpacing(2, 6);
 
85
    m_layout->setRowSpacing(0, 6);
 
86
    m_layout->setRowSpacing(1, 6);
 
87
    m_layout->setPreferredWidth(240);
 
88
    m_layout->setColumnFixedWidth(0, m_pixmapSize.width());
 
89
    m_layout->setColumnFixedWidth(2, 16); // FIXME: spacing?
 
90
 
 
91
    m_icon = new Plasma::Label(this);
 
92
    m_icon->setToolTip(tt);
 
93
    m_icon->setMinimumHeight(m_pixmapSize.height());
 
94
    m_icon->setMaximumHeight(m_pixmapSize.height());
 
95
 
 
96
    setMinimumHeight(m_pixmapSize.height()+6);
 
97
    m_layout->addItem(m_icon, 0, 0, 2, 1);
 
98
    m_icon->nativeWidget()->setPixmap(interfacePixmap());
 
99
 
 
100
    //     interface layout
 
101
    m_ifaceNameLabel = new Plasma::Label(this);
 
102
    m_ifaceNameLabel->setToolTip(tt);
 
103
    m_ifaceNameLabel->nativeWidget()->setWordWrap(true);
 
104
    m_ifaceNameLabel->setMaximumHeight(QFontMetrics(KGlobalSettings::generalFont()).height());
 
105
    m_ifaceNameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
 
106
    m_layout->addItem(m_ifaceNameLabel, 0, 1, 1, 1);
 
107
 
 
108
    m_disconnectButton = new Plasma::PushButton(this);
 
109
    m_disconnectButton->setMaximumHeight(16);
 
110
    m_disconnectButton->setMaximumWidth(16);
 
111
    m_disconnectButton->setIcon(KIcon("dialog-close"));
 
112
    m_disconnectButton->setToolTip(i18nc("tooltip on disconnect icon", "Disconnect"));
 
113
    m_disconnectButton->hide();
 
114
    m_disconnect = false;
 
115
    // forward disconnect signal
 
116
    connect(m_disconnectButton, SIGNAL(clicked()), this, SLOT(emitDisconnectInterfaceRequest()));
 
117
 
 
118
    m_layout->addItem(m_disconnectButton, 0, 2, 1, 1, Qt::AlignRight);
 
119
 
 
120
    //     active connection name
 
121
    m_connectionNameLabel = new Plasma::Label(this);
 
122
    m_connectionNameLabel->setToolTip(tt);
 
123
    m_connectionNameLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
 
124
    m_connectionNameLabel->nativeWidget()->setFont(KGlobalSettings::smallestReadableFont());
 
125
    m_connectionNameLabel->nativeWidget()->setWordWrap(false);
 
126
    m_connectionNameLabel->nativeWidget()->setMaximumWidth(210);
 
127
    m_layout->addItem(m_connectionNameLabel, 1, 1, 1, 1);
 
128
 
 
129
    //       security
 
130
    m_connectionInfoIcon = new Plasma::Label(this);
 
131
    m_connectionInfoIcon->setMinimumHeight(16);
 
132
    m_connectionInfoIcon->setMinimumWidth(16);
 
133
    m_connectionInfoIcon->setMaximumHeight(16);
 
134
    m_connectionInfoIcon->nativeWidget()->setPixmap(KIcon("security-low").pixmap(16, 16));
 
135
    m_connectionInfoIcon->hide(); // hide by default, we'll enable it later
 
136
 
 
137
    m_layout->addItem(m_connectionInfoIcon, 1, 2, 1, 1, Qt::AlignRight); // check...
 
138
 
 
139
    if (m_iface) {
 
140
        connect(m_iface.data(), SIGNAL(connectionStateChanged(int,int,int)),
 
141
                this, SLOT(handleConnectionStateChange(int,int,int)));
 
142
        connect(m_iface.data(), SIGNAL(linkUpChanged(bool)), this, SLOT(setActive(bool)));
 
143
    }
 
144
    setNameDisplayMode(mode);
 
145
 
 
146
    if (m_iface) {
 
147
        if (m_iface.data()->type() == Solid::Control::NetworkInterfaceNm09::Ethernet) {
 
148
            Solid::Control::WiredNetworkInterfaceNm09* wirediface =
 
149
                            static_cast<Solid::Control::WiredNetworkInterfaceNm09*>(m_iface.data());
 
150
            connect(wirediface, SIGNAL(carrierChanged(bool)), this, SLOT(setActive(bool)));
 
151
        }
 
152
        m_state = Solid::Control::NetworkInterfaceNm09::UnknownState;
 
153
        connectionStateChanged(static_cast<Solid::Control::NetworkInterfaceNm09::ConnectionState>(m_iface.data()->connectionState()));
 
154
    }
 
155
 
 
156
    m_layout->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
 
157
    setLayout(m_layout);
 
158
 
 
159
    connect(this, SIGNAL(clicked()), this, SLOT(slotClicked()));
 
160
 
 
161
    qreal targetOpacity = m_enabled ? 1.0 : 0.7;
 
162
    // Fade in when this widget appears
 
163
    Plasma::Animation* fadeAnimation = Plasma::Animator::create(Plasma::Animator::FadeAnimation);
 
164
    fadeAnimation->setTargetWidget(this);
 
165
    fadeAnimation->setProperty("startOpacity", 0.0);
 
166
    fadeAnimation->setProperty("targetOpacity", targetOpacity);
 
167
    fadeAnimation->start();
 
168
    m_starting = false;
 
169
}
 
170
 
 
171
InterfaceItem::~InterfaceItem()
 
172
{
 
173
}
 
174
 
 
175
void InterfaceItem::disappear()
 
176
{
 
177
    Plasma::Animation* fadeAnimation = Plasma::Animator::create(Plasma::Animator::FadeAnimation);
 
178
    fadeAnimation->setTargetWidget(this);
 
179
    fadeAnimation->setProperty("startOpacity", 1.0);
 
180
    fadeAnimation->setProperty("targetOpacity", 0.0);
 
181
    fadeAnimation->start();
 
182
    connect(fadeAnimation, SIGNAL(finished()), this, SIGNAL(disappearAnimationFinished()));
 
183
}
 
184
 
 
185
void InterfaceItem::showItem(QGraphicsWidget* widget, bool show)
 
186
{
 
187
    Plasma::Animation* fadeAnimation = Plasma::Animator::create(Plasma::Animator::FadeAnimation);
 
188
    fadeAnimation->setTargetWidget(widget);
 
189
    widget->show();
 
190
    if (show) {
 
191
        fadeAnimation->setProperty("startOpacity", 0.0);
 
192
        fadeAnimation->setProperty("targetOpacity", 1.0);
 
193
    } else {
 
194
        fadeAnimation->setProperty("startOpacity", 1.0);
 
195
        fadeAnimation->setProperty("targetOpacity", 0.0);
 
196
    }
 
197
    fadeAnimation->start();
 
198
}
 
199
 
 
200
QString InterfaceItem::label()
 
201
{
 
202
    return m_ifaceNameLabel->text();
 
203
}
 
204
 
 
205
Solid::Control::NetworkInterfaceNm09* InterfaceItem::interface()
 
206
{
 
207
    return m_iface.data();
 
208
}
 
209
 
 
210
void InterfaceItem::setActive(bool active)
 
211
{
 
212
    Q_UNUSED(active);
 
213
    if (m_iface) {
 
214
        connectionStateChanged(static_cast<Solid::Control::NetworkInterfaceNm09::ConnectionState>(m_iface.data()->connectionState()));
 
215
    }
 
216
}
 
217
 
 
218
void InterfaceItem::setEnabled(bool enable)
 
219
{
 
220
    m_enabled = enable;
 
221
    Plasma::Animation* fadeAnimation = Plasma::Animator::create(Plasma::Animator::FadeAnimation);
 
222
    fadeAnimation->setTargetWidget(this);
 
223
    if (enable) {
 
224
        showItem(m_connectionInfoIcon, false);
 
225
        fadeAnimation->setProperty("startOpacity", 0.7);
 
226
        fadeAnimation->setProperty("targetOpacity", 1.0);
 
227
    } else {
 
228
        fadeAnimation->setProperty("startOpacity", 1.0);
 
229
        fadeAnimation->setProperty("targetOpacity", 0.7);
 
230
    }
 
231
    if (!m_starting) {
 
232
        // we only animate when setEnabled is not called during initialization,
 
233
        // as that would conflict with the appear animation
 
234
        fadeAnimation->start();
 
235
    }
 
236
}
 
237
 
 
238
void InterfaceItem::setNameDisplayMode(NameDisplayMode mode)
 
239
{
 
240
    m_nameMode = mode;
 
241
    if (m_iface) {
 
242
        m_interfaceName = UiUtils::interfaceNameLabel(m_iface.data()->uni());
 
243
    }
 
244
    if (m_nameMode == InterfaceName) {
 
245
        m_ifaceNameLabel->setText(QString("<b>%1</b>").arg(m_interfaceName));
 
246
    } else if (m_nameMode == HardwareName) {
 
247
        if (m_iface) {
 
248
            m_ifaceNameLabel->setText(QString("<b>%1</b>").arg(m_iface.data()->interfaceName()));
 
249
        } else {
 
250
            m_ifaceNameLabel->setText(i18nc("generic label for an interface", "<b>Network Interface</b>"));
 
251
        }
 
252
 
 
253
    } else {
 
254
        m_ifaceNameLabel->setText(i18nc("network interface name unknown", "<b>Unknown Network Interface</b>"));
 
255
    }
 
256
}
 
257
 
 
258
InterfaceItem::NameDisplayMode InterfaceItem::nameDisplayMode() const
 
259
{
 
260
    return m_nameMode;
 
261
}
 
262
 
 
263
QString InterfaceItem::connectionName()
 
264
{
 
265
    // Default active connection's name is empty, room for improvement?
 
266
    if (m_currentConnection) {
 
267
        return m_currentConnection->connectionName();
 
268
    }
 
269
    return QString();
 
270
}
 
271
 
 
272
void InterfaceItem::setConnectionInfo()
 
273
{
 
274
    if (m_iface) {
 
275
        currentConnectionChanged();
 
276
        connectionStateChanged(static_cast<Solid::Control::NetworkInterfaceNm09::ConnectionState>(m_iface.data()->connectionState()));
 
277
    }
 
278
}
 
279
 
 
280
QString InterfaceItem::currentIpAddress()
 
281
{
 
282
    if (!m_iface)
 
283
        return QString();
 
284
 
 
285
    if (static_cast<Solid::Control::NetworkInterfaceNm09::ConnectionState>(m_iface.data()->connectionState()) != Solid::Control::NetworkInterfaceNm09::Activated) {
 
286
        return i18nc("label of the network interface", "No IP address.");
 
287
    }
 
288
 
 
289
    QHostAddress addr;
 
290
 
 
291
    OrgFreedesktopNetworkManagerDeviceInterface devIface(NM_DBUS_SERVICE, m_iface.data()->uni(), QDBusConnection::systemBus());
 
292
    if (devIface.isValid()) {
 
293
        addr.setAddress(ntohl(devIface.ip4Address()));
 
294
    }
 
295
 
 
296
    if (addr.isNull()) {
 
297
        return i18nc("label of the network interface", "IP display error.");
 
298
    }
 
299
    return addr.toString();
 
300
}
 
301
 
 
302
 
 
303
RemoteInterfaceConnection* InterfaceItem::currentConnection()
 
304
{
 
305
    return m_currentConnection;
 
306
}
 
307
 
 
308
void InterfaceItem::setActivatableList(RemoteActivatableList* activatables)
 
309
{
 
310
    m_activatables = activatables;
 
311
}
 
312
 
 
313
void InterfaceItem::currentConnectionChanged()
 
314
{
 
315
    updateCurrentConnection(m_activatables->connectionForInterface(m_iface.data()));
 
316
}
 
317
 
 
318
void InterfaceItem::updateCurrentConnection(RemoteInterfaceConnection * ic)
 
319
{
 
320
    if (ic) {
 
321
        if (m_currentConnection) {
 
322
            QObject::disconnect(m_currentConnection, 0, this, 0);
 
323
        }
 
324
        m_currentConnection = ic;
 
325
 
 
326
        connect(m_currentConnection, SIGNAL(hasDefaultRouteChanged(bool)),
 
327
                                     SLOT(handleHasDefaultRouteChanged(bool)));
 
328
        handleHasDefaultRouteChanged(m_currentConnection->hasDefaultRoute());
 
329
        return;
 
330
    }
 
331
    handleHasDefaultRouteChanged(false);
 
332
    m_currentConnection = 0;
 
333
    return;
 
334
}
 
335
 
 
336
void InterfaceItem::handleHasDefaultRouteChanged(bool changed)
 
337
{
 
338
    m_hasDefaultRoute = changed;
 
339
    //kDebug() << "Default Route changed!!" << changed;
 
340
    m_icon->nativeWidget()->setPixmap(interfacePixmap());
 
341
    update();
 
342
}
 
343
 
 
344
void InterfaceItem::pppStats(uint in, uint out)
 
345
{
 
346
    kDebug() << "PPP Stats. in:" << in << "out:" << out;
 
347
}
 
348
 
 
349
void InterfaceItem::activeConnectionsChanged()
 
350
{
 
351
    setConnectionInfo();
 
352
}
 
353
 
 
354
void InterfaceItem::slotClicked()
 
355
{
 
356
    emit clicked(m_iface.data());
 
357
}
 
358
 
 
359
void InterfaceItem::handleConnectionStateChange(int new_state, int old_state, int reason)
 
360
{
 
361
    Q_UNUSED(old_state);
 
362
    Q_UNUSED(reason);
 
363
    connectionStateChanged((Solid::Control::NetworkInterfaceNm09::ConnectionState)new_state);
 
364
}
 
365
 
 
366
void InterfaceItem::handleConnectionStateChange(int new_state)
 
367
{
 
368
    connectionStateChanged((Solid::Control::NetworkInterfaceNm09::ConnectionState)new_state);
 
369
}
 
370
 
 
371
void InterfaceItem::connectionStateChanged(Solid::Control::NetworkInterfaceNm09::ConnectionState state, bool updateConnection)
 
372
{
 
373
    if (m_state == state) {
 
374
        return;
 
375
    }
 
376
    m_state = state;
 
377
    // TODO:
 
378
    // get the active connections
 
379
    // check if any of them affect our interface
 
380
    // setActiveConnection on ourself
 
381
    // button to connect, disconnect
 
382
    bool old_disco = m_disconnect;
 
383
 
 
384
    m_disconnect = false;
 
385
    // Name and info labels
 
386
    QString lname;
 
387
    if (updateConnection) {
 
388
        currentConnectionChanged();
 
389
    }
 
390
    if (m_currentConnection) {
 
391
        lname = UiUtils::connectionStateToString(state, m_currentConnection->connectionName());
 
392
    } else {
 
393
        lname = UiUtils::connectionStateToString(state, QString());
 
394
        // to allow updating connection's name in the next call of connectionStateChanged()
 
395
        // even if the state has not changed.
 
396
        m_state = Solid::Control::NetworkInterfaceNm09::UnknownState;
 
397
    }
 
398
 
 
399
    switch (state) {
 
400
        case Solid::Control::NetworkInterfaceNm09::Unavailable:
 
401
            if (m_iface.data()->type() == Solid::Control::NetworkInterfaceNm09::Ethernet) {
 
402
                lname = i18nc("wired interface network cable unplugged", "Cable Unplugged");
 
403
            }
 
404
            setEnabled(false); // FIXME: tone down colors using an animation
 
405
            break;
 
406
        case Solid::Control::NetworkInterfaceNm09::Disconnected:
 
407
        case Solid::Control::NetworkInterfaceNm09::Deactivating:
 
408
            setEnabled(true);
 
409
            break;
 
410
        case Solid::Control::NetworkInterfaceNm09::Preparing:
 
411
        case Solid::Control::NetworkInterfaceNm09::Configuring:
 
412
        case Solid::Control::NetworkInterfaceNm09::NeedAuth:
 
413
        case Solid::Control::NetworkInterfaceNm09::IPConfig:
 
414
        case Solid::Control::NetworkInterfaceNm09::IPCheck:
 
415
        case Solid::Control::NetworkInterfaceNm09::Secondaries:
 
416
        case Solid::Control::NetworkInterfaceNm09::Activated:
 
417
            setEnabled(true);
 
418
            m_disconnect = true;
 
419
            break;
 
420
        case Solid::Control::NetworkInterfaceNm09::Unmanaged:
 
421
        case Solid::Control::NetworkInterfaceNm09::Failed:
 
422
        case Solid::Control::NetworkInterfaceNm09::UnknownState:
 
423
            setEnabled(false);
 
424
            break;
 
425
    }
 
426
 
 
427
    // Update connect button
 
428
    if (old_disco != m_disconnect) {
 
429
        showItem(m_disconnectButton, m_disconnect);
 
430
    }
 
431
    m_connectionNameLabel->setText(lname);
 
432
    m_icon->nativeWidget()->setPixmap(interfacePixmap());
 
433
 
 
434
    //kDebug() << "State changed" << lname;
 
435
    emit stateChanged();
 
436
}
 
437
 
 
438
QPixmap InterfaceItem::interfacePixmap(const QString &icon) {
 
439
    // Which pixmap should we display with the notification?
 
440
    QString overlayIcon = icon;
 
441
    if (overlayIcon.isEmpty()) {
 
442
        overlayIcon = "network-defaultroute";
 
443
    }
 
444
    //kDebug() << "painting icon" << overlayIcon;
 
445
    QPixmap pmap = KIcon(UiUtils::iconName(m_iface.data())).pixmap(m_pixmapSize);
 
446
    //QPixmap pmap = KIcon(icon).pixmap(QSize(KIconLoader::SizeMedium, KIconLoader::SizeMedium));
 
447
    if (m_hasDefaultRoute && !pmap.isNull()) {
 
448
        QPainter p(&pmap);
 
449
        p.drawPixmap(QRect(2,2,18,18), KIcon(overlayIcon).pixmap(QSize(18,18)));
 
450
    }
 
451
    return pmap;
 
452
}
 
453
 
 
454
void InterfaceItem::emitDisconnectInterfaceRequest()
 
455
{
 
456
    if (m_iface) {
 
457
        //kDebug() << m_iface->uni();
 
458
        emit disconnectInterfaceRequested(m_iface.data()->uni());
 
459
    }
 
460
}
 
461
 
 
462
void InterfaceItem::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
 
463
{
 
464
    if (m_iface) {
 
465
        emit hoverEnter(m_iface.data()->uni());
 
466
    }
 
467
    IconWidget::hoverEnterEvent(event);
 
468
}
 
469
 
 
470
void InterfaceItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
 
471
{
 
472
    if (m_iface) {
 
473
        emit hoverLeave(m_iface.data()->uni());
 
474
    }
 
475
    IconWidget::hoverLeaveEvent(event);
 
476
}
 
477
 
 
478
void InterfaceItem::serviceDisappeared()
 
479
{
 
480
    m_currentConnection = 0;
 
481
}
 
482
 
 
483
void InterfaceItem::activatableAdded(RemoteActivatable * activatable)
 
484
{
 
485
    if (m_iface && RemoteActivatableList::isConnectionForInterface(activatable, m_iface.data())) {
 
486
        updateCurrentConnection(qobject_cast<RemoteInterfaceConnection*>(activatable));
 
487
 
 
488
        /* Sometimes the activatableAdded signal arrives after the connectionStateChanged
 
489
           signal, so update the interface state here but do not search for current connection
 
490
           since it is already known. */
 
491
        connectionStateChanged(m_iface.data()->connectionState(), false);
 
492
    }
 
493
}
 
494
 
 
495
void InterfaceItem::activatableRemoved(RemoteActivatable * activatable)
 
496
{
 
497
    if (activatable == m_currentConnection) {
 
498
        m_currentConnection = 0;
 
499
    }
 
500
}
 
501
// vim: sw=4 sts=4 et tw=100