diff options
author | Timothy Pearson <[email protected]> | 2012-08-30 12:57:49 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-08-30 12:57:49 -0500 |
commit | 1d86a2adb82a0c0c1b98e5196a3e6bbda0e46287 (patch) | |
tree | 51bb543c0b9195690652ec15f95d9a8227891cc0 /knetworkmanager-0.9/src/knetworkmanager-device.cpp | |
parent | bf231a0d0362758f167da389222e271acb2ebd90 (diff) | |
download | tdenetworkmanager-1d86a2adb82a0c0c1b98e5196a3e6bbda0e46287.tar.gz tdenetworkmanager-1d86a2adb82a0c0c1b98e5196a3e6bbda0e46287.zip |
Move directory to new location
Diffstat (limited to 'knetworkmanager-0.9/src/knetworkmanager-device.cpp')
-rw-r--r-- | knetworkmanager-0.9/src/knetworkmanager-device.cpp | 166 |
1 files changed, 0 insertions, 166 deletions
diff --git a/knetworkmanager-0.9/src/knetworkmanager-device.cpp b/knetworkmanager-0.9/src/knetworkmanager-device.cpp deleted file mode 100644 index 585ce8d..0000000 --- a/knetworkmanager-0.9/src/knetworkmanager-device.cpp +++ /dev/null @@ -1,166 +0,0 @@ -/*************************************************************************** - * - * knetworkmanager-device.cpp - A NetworkManager frontend for KDE - * - * Copyright (C) 2005, 2006 Novell, Inc. - * - * Author: Timo Hoenig <[email protected]>, <[email protected]> - * Will Stephenson <[email protected]>, <[email protected]> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - **************************************************************************/ - -#include <NetworkManager.h> - -#include "knetworkmanager.h" -#include "knetworkmanager-nm_proxy.h" -#include "knetworkmanager-device.h" -#include "dbus/deviceproxy.h" -#include "knetworkmanager-hal_device_proxy.h" - - -#include <kdebug.h> -#include <tqhostaddress.h> - -#include <tqdbuserror.h> -#include <tqdbusconnection.h> -#include <tqdbusproxy.h> - - -class NMDeviceProxy : public DBus::DeviceProxy -{ - public: - NMDeviceProxy(const TQString& service, const TQString& path, TQObject* parent = 0, const char* name = 0) - : DeviceProxy(service, path, parent, name) - { - - } - - TQString getObjectPath() const - { - return m_baseProxy->path(); - } -}; - -class DevicePrivate -{ -public: - DevicePrivate(TQString service, TQString obj_path) - : nmDevice(service, obj_path) - , halDevice(NULL) - {} - ~DevicePrivate() {} - - NMDeviceProxy nmDevice; - HalDeviceProxy* halDevice; -}; - -TQ_UINT32 Device::getDeviceType() const -{ - TQT_DBusError err; - TQ_UINT32 type = d->nmDevice.getDeviceType(err); - kdWarning() << k_funcinfo << err.name() << err.message() << endl; - return type; -} - -TQString Device::getInterface() const -{ - TQT_DBusError err; - return d->nmDevice.getInterface(err); -} - -TQString Device::getUdi() const -{ - TQT_DBusError err; - return d->nmDevice.getUdi(err); -} - -TQString Device::getDriver() const -{ - TQT_DBusError err; - return d->nmDevice.getDriver(err); -} - -TQ_UINT32 Device::getCapabilities() const -{ - TQT_DBusError err; - return d->nmDevice.getCapabilities(err); -} - -TQ_INT32 Device::getIp4Address() const -{ - TQT_DBusError err; - return d->nmDevice.getIp4Address(err); -} - -NMDeviceState Device::getState() const -{ - TQT_DBusError err; - return (NMDeviceState)d->nmDevice.getState(err); -} - -TQString Device::getVendor() const -{ - // FIXME: ask hal - return ""; -} - -TQString Device::getProduct() const -{ - // FIXME: ask hal - return ""; -} - -TQString Device::getObjectPath() const -{ - return d->nmDevice.getObjectPath(); -} - -void Device::slotStateChanged(TQ_UINT32 state) -{ - emit StateChanged((NMDeviceState)state); -} - -void Device::slotDeactivate() -{ - // FIXME: the method was removed from NM API, use nm_proxy instead - NMProxy* nm = NMProxy::getInstance(); - - nm->deactivateDevice(this); - -// TQT_DBusError err; -// d->nmDevice.Deactivate(err); -} - -Device::Device (const TQString & obj_path) -{ - d = new DevicePrivate(NM_DBUS_SERVICE, obj_path); - - // create the NM Device Proxy - d->nmDevice.setConnection(TQT_DBusConnection::systemBus()); - - connect(&(d->nmDevice), TQT_SIGNAL(StateChanged(TQ_UINT32)), this, TQT_SLOT(slotStateChanged(TQ_UINT32))); -// d->halDevice = new HalDeviceProxy(); -} - -Device::~Device () -{ -// delete d->halDevice; - delete d; -} - - -#include "knetworkmanager-device.moc" |