summaryrefslogtreecommitdiffstats
path: root/knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-08-30 12:57:49 -0500
committerTimothy Pearson <[email protected]>2012-08-30 12:57:49 -0500
commit1d86a2adb82a0c0c1b98e5196a3e6bbda0e46287 (patch)
tree51bb543c0b9195690652ec15f95d9a8227891cc0 /knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp
parentbf231a0d0362758f167da389222e271acb2ebd90 (diff)
downloadtdenetworkmanager-1d86a2adb82a0c0c1b98e5196a3e6bbda0e46287.tar.gz
tdenetworkmanager-1d86a2adb82a0c0c1b98e5196a3e6bbda0e46287.zip
Move directory to new location
Diffstat (limited to 'knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp')
-rw-r--r--knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp200
1 files changed, 0 insertions, 200 deletions
diff --git a/knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp b/knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp
deleted file mode 100644
index ecca0f5..0000000
--- a/knetworkmanager-0.9/src/knetworkmanager-connection_dbus.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore_dbus.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa <[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
- *
- **************************************************************************/
-
-/* qt headers */
-#include <tqvaluelist.h>
-
-/* kde headers */
-#include <kdebug.h>
-#include <klocale.h>
-
-/* TQDbus headers */
-#include <tqdbusconnection.h>
-#include <tqdbusobjectpath.h>
-#include <tqdbusdata.h>
-#include <tqdbusdatamap.h>
-#include <tqdbusvariant.h>
-#include <tqdbuserror.h>
-
-/* NM headers */
-#include <NetworkManager.h>
-
-/* knetworkmanager headers */
-#include "knetworkmanager.h"
-#include "knetworkmanager-connection.h"
-#include "knetworkmanager-connection_dbus.h"
-#include "knetworkmanager-connection_setting.h"
-#include "knetworkmanager-nmsettings.h"
-#include "xmlmarshaller.h"
-
-using namespace ConnectionSettings;
-
-namespace ConnectionSettings
-{
-
-class ConnectionDBusPrivate
-{
- public:
- ConnectionDBusPrivate() {}
- ~ConnectionDBusPrivate() {}
-
- ConnectionSettings::Connection* parent;
-};
-}
-
-/*
- class Connection
-*/
-ConnectionDBus::ConnectionDBus(ConnectionSettings::Connection* parent)
- : TQObject(parent)
-{
- d = new ConnectionDBusPrivate();
- d->parent = parent;
-}
-
-ConnectionDBus::~ConnectionDBus()
-{
- delete d;
-}
-
-bool
-ConnectionDBus::GetID(TQString& id, TQT_DBusError& /*error*/)
-{
- kdDebug() << "Connection::GetID" << endl;
- id = d->parent->getID();
-
- return true;
-}
-
-bool
-ConnectionDBus::GetSettings(TQT_DBusDataMap<TQString>& settings, TQT_DBusError& /*error*/)
-{
- kdDebug() << "Connection::GetSettings, obj: " << objectPath().ascii() << endl;
-
- TQValueList<ConnectionSetting*> all_settings = d->parent->getSettings();
-
- // FIXME: ugly conversions, ask Kevin on how to make it better
- for (TQValueList<ConnectionSetting*>::Iterator it = all_settings.begin(); it != all_settings.end(); ++it)
- {
- kdDebug() << " Processing Setting '" << (*it)->getType().ascii() << "'" << endl;
- // only append this setting if it is really used
- if (!(*it)->getEnabled())
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is not enabled, discarding" << endl;
- continue;
- }
-
- if (!(*it)->isValid())
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is not valid, discarding" << endl;
- continue;
- }
-
- // copy the settingsmap over to a variantmap
- TQMap<TQString, TQT_DBusData> map = (*it)->toMap();
-
- // only take used settings
- if (map.size() == 0)
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is empty, discarding" << endl;
- continue;
- }
-
- kdDebug() << " Attach setting '" << (*it)->getType().ascii() << "'" << endl;
-
- TQMap<TQString, TQT_DBusVariant> variant_map;
-
- for (TQMap<TQString, TQT_DBusData>::Iterator it2 = map.begin(); it2 != map.end(); ++it2)
- {
- TQString dataxml = XMLMarshaller::fromTQT_DBusData(it2.data());
- kdDebug() << " " << it2.key().ascii() << ": " << dataxml.replace('\n', ' ').ascii() << endl;
- TQT_DBusVariant var;
- var.value = it2.data();
- var.signature = var.value.buildDBusSignature();
- variant_map.insert(it2.key(), var);
- }
-
- // convert the variantma
- TQT_DBusDataMap<TQString> map2 = TQT_DBusDataMap<TQString>(variant_map);
- TQT_DBusData data = TQT_DBusData::fromStringKeyMap(map2);
-
- // insert this setting
- settings.insert((*it)->getType(), data);
- }
-
- return true;
-}
-
-bool
-ConnectionDBus::Update(const TQT_DBusDataMap<TQString>& properties, TQT_DBusError& error)
-{
- // FIXME
- return true;
-}
-
-bool
-ConnectionDBus::Delete(TQT_DBusError& error)
-{
- // FIXME
- return true;
-}
-
-
-void
-ConnectionDBus::handleMethodReply(const TQT_DBusMessage& reply)
-{
- TQT_DBusConnection::systemBus().send(reply);
-}
-
-bool
-ConnectionDBus::handleSignalSend(const TQT_DBusMessage& reply)
-{
- TQT_DBusConnection::systemBus().send(reply);
- return true;
-}
-
-
-TQString
-ConnectionDBus::objectPath() const
-{
- return TQString(d->parent->getObjectPath());
-}
-
-void
-ConnectionDBus::slotAboutToBeRemoved()
-{
- // tell NM about us being removed
- emitRemoved();
-}
-
-void
-ConnectionDBus::slotUpdated()
-{
- TQT_DBusDataMap<TQString> settings;
- TQT_DBusError error;
- if (GetSettings(settings, error))
- emitUpdated(settings);
-}
-
-#include "knetworkmanager-connection_dbus.moc"