|
|
@ -158,7 +158,7 @@ Storage::restoreConnection(const TQString& grpname)
|
|
|
|
kdDebug() << k_funcinfo << " " << grpname << endl;
|
|
|
|
kdDebug() << k_funcinfo << " " << grpname << endl;
|
|
|
|
|
|
|
|
|
|
|
|
// we have a connection to restore
|
|
|
|
// we have a connection to restore
|
|
|
|
KConfigGroup grp( TDEGlobal::config(), grpname);
|
|
|
|
TDEConfigGroup grp( TDEGlobal::config(), grpname);
|
|
|
|
TQString id = grp.readEntry("Id");
|
|
|
|
TQString id = grp.readEntry("Id");
|
|
|
|
TQString cType = grp.readEntry("Type");
|
|
|
|
TQString cType = grp.readEntry("Type");
|
|
|
|
|
|
|
|
|
|
|
@ -217,7 +217,7 @@ Storage::restoreSetting(Connection* conn, const TQString& setting_grp_name)
|
|
|
|
kdDebug() << k_funcinfo << " " << setting_grp_name << endl;
|
|
|
|
kdDebug() << k_funcinfo << " " << setting_grp_name << endl;
|
|
|
|
kdDebug() << "restore setting: " << setting_grp_name.ascii() << endl;
|
|
|
|
kdDebug() << "restore setting: " << setting_grp_name.ascii() << endl;
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup setting_grp(TDEGlobal::config(), setting_grp_name);
|
|
|
|
TDEConfigGroup setting_grp(TDEGlobal::config(), setting_grp_name);
|
|
|
|
TQMap<TQString, TQString> config_map = TDEGlobal::config()->entryMap(setting_grp_name);
|
|
|
|
TQMap<TQString, TQString> config_map = TDEGlobal::config()->entryMap(setting_grp_name);
|
|
|
|
TQString type = setting_grp.readEntry("Type");
|
|
|
|
TQString type = setting_grp.readEntry("Type");
|
|
|
|
|
|
|
|
|
|
|
@ -257,7 +257,7 @@ Storage::restoreSecrets(Connection* conn, const TQString& secrets_grp_name)
|
|
|
|
kdDebug() << k_funcinfo << " " << secrets_grp_name << endl;
|
|
|
|
kdDebug() << k_funcinfo << " " << secrets_grp_name << endl;
|
|
|
|
kdDebug() << "restore secret: " << secrets_grp_name.ascii() << endl;
|
|
|
|
kdDebug() << "restore secret: " << secrets_grp_name.ascii() << endl;
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup secrets_grp(TDEGlobal::config(), secrets_grp_name);
|
|
|
|
TDEConfigGroup secrets_grp(TDEGlobal::config(), secrets_grp_name);
|
|
|
|
TQMap<TQString, TQString> config_map = TDEGlobal::config()->entryMap(secrets_grp_name);
|
|
|
|
TQMap<TQString, TQString> config_map = TDEGlobal::config()->entryMap(secrets_grp_name);
|
|
|
|
TQString type = secrets_grp.readEntry("Type");
|
|
|
|
TQString type = secrets_grp.readEntry("Type");
|
|
|
|
|
|
|
|
|
|
|
@ -297,7 +297,7 @@ Storage::restoreVPNSecrets(Connection* conn, const TQString& secrets_grp_name)
|
|
|
|
kdDebug() << k_funcinfo << " " << secrets_grp_name << endl;
|
|
|
|
kdDebug() << k_funcinfo << " " << secrets_grp_name << endl;
|
|
|
|
kdDebug() << "restore secret: " << secrets_grp_name.ascii() << endl;
|
|
|
|
kdDebug() << "restore secret: " << secrets_grp_name.ascii() << endl;
|
|
|
|
|
|
|
|
|
|
|
|
KConfigGroup secrets_grp(TDEGlobal::config(), secrets_grp_name);
|
|
|
|
TDEConfigGroup secrets_grp(TDEGlobal::config(), secrets_grp_name);
|
|
|
|
TQMap<TQString, TQString> config_map = TDEGlobal::config()->entryMap(secrets_grp_name);
|
|
|
|
TQMap<TQString, TQString> config_map = TDEGlobal::config()->entryMap(secrets_grp_name);
|
|
|
|
TQString type = secrets_grp.readEntry("Type");
|
|
|
|
TQString type = secrets_grp.readEntry("Type");
|
|
|
|
|
|
|
|
|
|
|
@ -352,7 +352,7 @@ Storage::saveConnections()
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Storage::saveConnection(Connection* conn)
|
|
|
|
Storage::saveConnection(Connection* conn)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString cType = conn->getType();
|
|
|
|
TQString cType = conn->getType();
|
|
|
|
|
|
|
|
|
|
|
@ -364,7 +364,7 @@ Storage::saveConnection(Connection* conn)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
// let's get the config group for this connection
|
|
|
|
// let's get the config group for this connection
|
|
|
|
KConfigGroup grp(config, TQString("Connection_%1").arg(id));
|
|
|
|
TDEConfigGroup grp(config, TQString("Connection_%1").arg(id));
|
|
|
|
TQStringList settings_grps;
|
|
|
|
TQStringList settings_grps;
|
|
|
|
TQStringList secrets_grps;
|
|
|
|
TQStringList secrets_grps;
|
|
|
|
|
|
|
|
|
|
|
@ -416,7 +416,7 @@ Storage::saveConnectionSettings(Connection* conn, TQStringList& settings_grps, T
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Storage::saveConnectionSetting(Connection* conn, ConnectionSetting* setting, TQString& setting_grp)
|
|
|
|
Storage::saveConnectionSetting(Connection* conn, ConnectionSetting* setting, TQString& setting_grp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString type = setting->getType();
|
|
|
|
TQString type = setting->getType();
|
|
|
|
|
|
|
|
|
|
|
@ -428,7 +428,7 @@ Storage::saveConnectionSetting(Connection* conn, ConnectionSetting* setting, TQS
|
|
|
|
|
|
|
|
|
|
|
|
// get a group for this setting
|
|
|
|
// get a group for this setting
|
|
|
|
setting_grp = TQString("ConnectionSetting_%1_%2").arg(id).arg(type);
|
|
|
|
setting_grp = TQString("ConnectionSetting_%1_%2").arg(id).arg(type);
|
|
|
|
KConfigGroup grp(config, setting_grp);
|
|
|
|
TDEConfigGroup grp(config, setting_grp);
|
|
|
|
|
|
|
|
|
|
|
|
// write the type
|
|
|
|
// write the type
|
|
|
|
grp.writeEntry("Type", type);
|
|
|
|
grp.writeEntry("Type", type);
|
|
|
@ -446,7 +446,7 @@ Storage::saveConnectionSetting(Connection* conn, ConnectionSetting* setting, TQS
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Storage::saveConnectionSecrets(Connection* conn, ConnectionSetting* setting, TQString& setting_grp)
|
|
|
|
Storage::saveConnectionSecrets(Connection* conn, ConnectionSetting* setting, TQString& setting_grp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString type = setting->getType();
|
|
|
|
TQString type = setting->getType();
|
|
|
|
bool storage_requested;
|
|
|
|
bool storage_requested;
|
|
|
@ -475,7 +475,7 @@ Storage::saveConnectionSecrets(Connection* conn, ConnectionSetting* setting, TQS
|
|
|
|
|
|
|
|
|
|
|
|
// get a group for this setting
|
|
|
|
// get a group for this setting
|
|
|
|
setting_grp = TQString("ConnectionSecrets_%1_%2").arg(id).arg(type);
|
|
|
|
setting_grp = TQString("ConnectionSecrets_%1_%2").arg(id).arg(type);
|
|
|
|
KConfigGroup grp(config, setting_grp);
|
|
|
|
TDEConfigGroup grp(config, setting_grp);
|
|
|
|
|
|
|
|
|
|
|
|
// write the type
|
|
|
|
// write the type
|
|
|
|
grp.writeEntry("Type", type);
|
|
|
|
grp.writeEntry("Type", type);
|
|
|
@ -593,7 +593,7 @@ Storage::restoreVPNSecrets(Connection* connection, ConnectionSetting* setting)
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Storage::deleteConnection(Connection* conn)
|
|
|
|
Storage::deleteConnection(Connection* conn)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfig* config = TDEGlobal::config();
|
|
|
|
TDEConfig* config = TDEGlobal::config();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString id = conn->getID();
|
|
|
|
TQString cType = conn->getType();
|
|
|
|
TQString cType = conn->getType();
|
|
|
|
|
|
|
|
|
|
|
@ -605,7 +605,7 @@ Storage::deleteConnection(Connection* conn)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
// let's get the config group for this connection
|
|
|
|
// let's get the config group for this connection
|
|
|
|
KConfigGroup grp(config, TQString("Connection_%1").arg(id));
|
|
|
|
TDEConfigGroup grp(config, TQString("Connection_%1").arg(id));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// delete all associated settings
|
|
|
|
// delete all associated settings
|
|
|
@ -613,7 +613,7 @@ Storage::deleteConnection(Connection* conn)
|
|
|
|
|
|
|
|
|
|
|
|
for (TQStringList::ConstIterator it = settings.begin(); it != settings.end(); ++it)
|
|
|
|
for (TQStringList::ConstIterator it = settings.begin(); it != settings.end(); ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfigGroup setting(config, *it);
|
|
|
|
TDEConfigGroup setting(config, *it);
|
|
|
|
setting.deleteGroup();
|
|
|
|
setting.deleteGroup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -622,7 +622,7 @@ Storage::deleteConnection(Connection* conn)
|
|
|
|
|
|
|
|
|
|
|
|
for (TQStringList::ConstIterator it = secrets.begin(); it != secrets.end(); ++it)
|
|
|
|
for (TQStringList::ConstIterator it = secrets.begin(); it != secrets.end(); ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KConfigGroup setting(config, *it);
|
|
|
|
TDEConfigGroup setting(config, *it);
|
|
|
|
setting.deleteGroup();
|
|
|
|
setting.deleteGroup();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|