~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to libs/solid/control/wirednetworkinterface.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  This file is part of the KDE project
 
2
    Copyright (C) 2006 Will Stephenson <wstephenson@kde.org>
 
3
    Copyright (C) 2007 Kevin Ottens <ervin@kde.org>
 
4
 
 
5
    This library is free software; you can redistribute it and/or
 
6
    modify it under the terms of the GNU Library General Public
 
7
    License version 2 as published by the Free Software Foundation.
 
8
 
 
9
    This library is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
    Library General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU Library General Public License
 
15
    along with this library; see the file COPYING.LIB.  If not, write to
 
16
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 
17
    Boston, MA 02110-1301, USA.
 
18
 
 
19
*/
 
20
 
 
21
#include "wirednetworkinterface.h"
 
22
#include "wirednetworkinterface_p.h"
 
23
 
 
24
#include "soliddefs_p.h"
 
25
#include "ifaces/wirednetworkinterface.h"
 
26
 
 
27
Solid::Control::WiredNetworkInterface::WiredNetworkInterface(QObject *backendObject)
 
28
    : NetworkInterface(*new WiredNetworkInterfacePrivate(this), backendObject)
 
29
{
 
30
    Q_D(WiredNetworkInterface);
 
31
    d->setBackendObject(backendObject);
 
32
}
 
33
 
 
34
Solid::Control::WiredNetworkInterface::WiredNetworkInterface(const WiredNetworkInterface &networkinterface)
 
35
    : NetworkInterface(*new WiredNetworkInterfacePrivate(this), networkinterface)
 
36
{
 
37
    Q_D(WiredNetworkInterface);
 
38
    d->setBackendObject(networkinterface.d_ptr->backendObject());
 
39
}
 
40
 
 
41
Solid::Control::WiredNetworkInterface::WiredNetworkInterface(WiredNetworkInterfacePrivate &dd, QObject *backendObject)
 
42
    : NetworkInterface(dd, backendObject)
 
43
{
 
44
}
 
45
 
 
46
Solid::Control::WiredNetworkInterface::WiredNetworkInterface(WiredNetworkInterfacePrivate &dd, const WiredNetworkInterface &network)
 
47
    : NetworkInterface(dd, network.d_ptr->backendObject())
 
48
{
 
49
}
 
50
 
 
51
Solid::Control::WiredNetworkInterface::~WiredNetworkInterface()
 
52
{
 
53
 
 
54
}
 
55
 
 
56
Solid::Control::NetworkInterface::Type Solid::Control::WiredNetworkInterface::type() const
 
57
{
 
58
    return Ieee8023;
 
59
}
 
60
 
 
61
QString Solid::Control::WiredNetworkInterface::hardwareAddress() const
 
62
{
 
63
    Q_D(const WiredNetworkInterface);
 
64
    return_SOLID_CALL(Ifaces::WiredNetworkInterface *, d->backendObject(), QString(), hardwareAddress());
 
65
}
 
66
 
 
67
int Solid::Control::WiredNetworkInterface::bitRate() const
 
68
{
 
69
    Q_D(const WiredNetworkInterface);
 
70
    return_SOLID_CALL(Ifaces::WiredNetworkInterface *, d->backendObject(), 0, bitRate());
 
71
}
 
72
 
 
73
bool Solid::Control::WiredNetworkInterface::carrier() const
 
74
{
 
75
    Q_D(const WiredNetworkInterface);
 
76
    return_SOLID_CALL(Ifaces::WiredNetworkInterface *, d->backendObject(), false, carrier());
 
77
}
 
78
 
 
79
void Solid::Control::WiredNetworkInterfacePrivate::setBackendObject(QObject *object)
 
80
{
 
81
    NetworkInterfacePrivate::setBackendObject(object);
 
82
 
 
83
    if (object) {
 
84
        QObject::connect(object, SIGNAL(bitRateChanged(int)),
 
85
                         parent(), SIGNAL(bitRateChanged(int)));
 
86
        QObject::connect(object, SIGNAL(carrierChanged(bool)),
 
87
                         parent(), SIGNAL(carrierChanged(bool)));
 
88
    }
 
89
}
 
90
 
 
91
void Solid::Control::WiredNetworkInterface::_k_destroyed(QObject *object)
 
92
{
 
93
    Q_UNUSED(object);
 
94
    // nothing to do yet
 
95
}
 
96
#include "wirednetworkinterface.moc"