mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-24 02:42:52 +00:00
kuassel: remove code for migration from very old releases
This commit is contained in:
parent
263da31635
commit
2d5840585c
4 changed files with 0 additions and 81 deletions
|
@ -121,9 +121,6 @@ void CoreAccountSettings::storeAccountData(AccountId id, const QVariantMap &data
|
|||
foreach(const QString &key, data.keys()) {
|
||||
setLocalValue(base + "/" + key, data.value(key));
|
||||
}
|
||||
|
||||
// FIXME Migration from 0.5 -> 0.6
|
||||
removeLocalKey(QString("%1/Connection").arg(base));
|
||||
}
|
||||
|
||||
|
||||
|
@ -135,28 +132,6 @@ QVariantMap CoreAccountSettings::retrieveAccountData(AccountId id)
|
|||
map[key] = localValue(base + "/" + key);
|
||||
}
|
||||
|
||||
// FIXME Migration from 0.5 -> 0.6
|
||||
if (!map.contains("Uuid") && map.contains("Connection")) {
|
||||
QVariantMap oldmap = map.value("Connection").toMap();
|
||||
map["AccountName"] = oldmap.value("AccountName");
|
||||
map["HostName"] = oldmap.value("Host");
|
||||
map["Port"] = oldmap.value("Port");
|
||||
map["User"] = oldmap.value("User");
|
||||
map["Password"] = oldmap.value("Password");
|
||||
map["StorePassword"] = oldmap.value("RememberPasswd");
|
||||
map["UseSSL"] = oldmap.value("useSsl");
|
||||
map["UseProxy"] = oldmap.value("useProxy");
|
||||
map["ProxyHostName"] = oldmap.value("proxyHost");
|
||||
map["ProxyPort"] = oldmap.value("proxyPort");
|
||||
map["ProxyUser"] = oldmap.value("proxyUser");
|
||||
map["ProxyPassword"] = oldmap.value("proxyPassword");
|
||||
map["ProxyType"] = oldmap.value("proxyType");
|
||||
map["Internal"] = oldmap.value("InternalAccount");
|
||||
|
||||
map["AccountId"] = id.toInt();
|
||||
map["Uuid"] = QUuid::createUuid().toString();
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
|
|
@ -91,53 +91,6 @@ Core::Core()
|
|||
|
||||
KGlobal::locale()->insertCatalog("kuassel");
|
||||
|
||||
// FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
|
||||
// Move settings, note this does not delete the old files
|
||||
|
||||
QSettings::Format format = QSettings::NativeFormat;
|
||||
QString newFilePath = Quassel::configDirPath() + "quasselcore"
|
||||
+ ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
|
||||
QSettings newSettings(newFilePath, format);
|
||||
|
||||
if (newSettings.value("Config/Version").toUInt() == 0) {
|
||||
QString org = "Quassel Project";
|
||||
QSettings oldSettings(org, "Quassel Core");
|
||||
if (oldSettings.allKeys().count()) {
|
||||
qWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your core settings...";
|
||||
foreach(QString key, oldSettings.allKeys())
|
||||
newSettings.setValue(key, oldSettings.value(key));
|
||||
newSettings.setValue("Config/Version", 1);
|
||||
qWarning() << "* Your core settings have been migrated to" << newSettings.fileName();
|
||||
|
||||
QString quasselDir = QDir::homePath() + "/.quassel/";
|
||||
|
||||
QFileInfo info(Quassel::configDirPath() + "quassel-storage.sqlite");
|
||||
if (!info.exists()) {
|
||||
// move database, if we found it
|
||||
QFile oldDb(quasselDir + "quassel-storage.sqlite");
|
||||
if (oldDb.exists()) {
|
||||
bool success = oldDb.rename(Quassel::configDirPath() + "quassel-storage.sqlite");
|
||||
if (success)
|
||||
qWarning() << "* Your database has been moved to" << Quassel::configDirPath() + "quassel-storage.sqlite";
|
||||
else
|
||||
qWarning() << "!!! Moving your database has failed. Please move it manually into" << Quassel::configDirPath();
|
||||
}
|
||||
}
|
||||
// move certificate
|
||||
QFileInfo certInfo(quasselDir + "quasselCert.pem");
|
||||
if (certInfo.exists()) {
|
||||
QFile cert(quasselDir + "quasselCert.pem");
|
||||
bool success = cert.rename(Quassel::configDirPath() + "quasselCert.pem");
|
||||
if (success)
|
||||
qWarning() << "* Your certificate has been moved to" << Quassel::configDirPath() + "quasselCert.pem";
|
||||
else
|
||||
qWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath();
|
||||
}
|
||||
qWarning() << "*** Migration completed.\n\n";
|
||||
}
|
||||
}
|
||||
// MIGRATION end
|
||||
|
||||
// check settings version
|
||||
// so far, we only have 1
|
||||
CoreSettings s;
|
||||
|
|
|
@ -44,13 +44,6 @@ QVariant CoreSettings::storageSettings(const QVariant &def)
|
|||
}
|
||||
|
||||
|
||||
// FIXME remove
|
||||
QVariant CoreSettings::oldDbSettings()
|
||||
{
|
||||
return localValue("DatabaseSettings");
|
||||
}
|
||||
|
||||
|
||||
void CoreSettings::setCoreState(const QVariant &data)
|
||||
{
|
||||
setLocalValue("CoreState", data);
|
||||
|
|
|
@ -32,8 +32,6 @@ public:
|
|||
void setStorageSettings(const QVariant &data);
|
||||
QVariant storageSettings(const QVariant &def = QVariant());
|
||||
|
||||
QVariant oldDbSettings(); // FIXME remove
|
||||
|
||||
void setCoreState(const QVariant &data);
|
||||
QVariant coreState(const QVariant &def = QVariant());
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue