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