|
|
|
@ -28,7 +28,7 @@
|
|
|
|
|
#include <klocale.h>
|
|
|
|
|
#include <tqdir.h>
|
|
|
|
|
#include <kdebug.h>
|
|
|
|
|
#include <kconfig.h>
|
|
|
|
|
#include <tdeconfig.h>
|
|
|
|
|
|
|
|
|
|
#include "knetworkmanager-vpnmanager.h"
|
|
|
|
|
#include "knetworkmanager-vpnservice.h"
|
|
|
|
@ -53,18 +53,18 @@ VPNManager::getVPNServices ()
|
|
|
|
|
// read in all available Services
|
|
|
|
|
for (TQStringList::Iterator i = services.begin (); i != services.end (); ++i) {
|
|
|
|
|
TQString service = SERVICE_DIR + TQString ("/") + *i;
|
|
|
|
|
TDEConfig* kconfig = new TDEConfig (service, true, true, "config");
|
|
|
|
|
kconfig->setGroup ("VPN Connection");
|
|
|
|
|
TDEConfig* tdeconfig = new TDEConfig (service, true, true, "config");
|
|
|
|
|
tdeconfig->setGroup ("VPN Connection");
|
|
|
|
|
|
|
|
|
|
kdDebug() << "VPN Service " << kconfig->readEntry ("name", TQString()).ascii() << endl;
|
|
|
|
|
kdDebug() << "VPN Service " << tdeconfig->readEntry ("name", TQString()).ascii() << endl;
|
|
|
|
|
|
|
|
|
|
// create new VPNService Object
|
|
|
|
|
VPNService* vpnservice = new VPNService(kconfig->readEntry ("name", TQString()), kconfig->readEntry ("service", TQString()), TQT_TQOBJECT(KNetworkManager::getInstance()));
|
|
|
|
|
VPNService* vpnservice = new VPNService(tdeconfig->readEntry ("name", TQString()), tdeconfig->readEntry ("service", TQString()), TQT_TQOBJECT(KNetworkManager::getInstance()));
|
|
|
|
|
if (!vpnservice->getVPNPlugin())
|
|
|
|
|
delete vpnservice;
|
|
|
|
|
else
|
|
|
|
|
list.push_back(vpnservice);
|
|
|
|
|
delete kconfig;
|
|
|
|
|
delete tdeconfig;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -86,13 +86,13 @@ VPNManager::getVPNService(TQString service_type)
|
|
|
|
|
// read in all available Services
|
|
|
|
|
for (TQStringList::Iterator i = services.begin (); i != services.end (); ++i) {
|
|
|
|
|
TQString service = SERVICE_DIR + TQString ("/") + *i;
|
|
|
|
|
TDEConfig* kconfig = new TDEConfig (service, true, true, "config");
|
|
|
|
|
kconfig->setGroup ("VPN Connection");
|
|
|
|
|
TDEConfig* tdeconfig = new TDEConfig (service, true, true, "config");
|
|
|
|
|
tdeconfig->setGroup ("VPN Connection");
|
|
|
|
|
|
|
|
|
|
if (kconfig->readEntry ("service", TQString()) == service_type)
|
|
|
|
|
if (tdeconfig->readEntry ("service", TQString()) == service_type)
|
|
|
|
|
{
|
|
|
|
|
// create new VPNService Object
|
|
|
|
|
VPNService* vpnservice = new VPNService(kconfig->readEntry ("name", TQString()), kconfig->readEntry ("service", TQString()), TQT_TQOBJECT(KNetworkManager::getInstance()));
|
|
|
|
|
VPNService* vpnservice = new VPNService(tdeconfig->readEntry ("name", TQString()), tdeconfig->readEntry ("service", TQString()), TQT_TQOBJECT(KNetworkManager::getInstance()));
|
|
|
|
|
if (!vpnservice->getVPNPlugin())
|
|
|
|
|
delete vpnservice;
|
|
|
|
|
else
|
|
|
|
|