Commit dfd8e443 authored by Rafał Malinowski's avatar Rafał Malinowski

core: #2885 done: remove support for configuration files of Kadu 0.6.5

Signed-off-by: Rafał Malinowski's avatarRafał Przemysław Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent f851800d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* gui: #2818 implemented: add option to open chat windows minimized on incoming message (Vogel) * gui: #2818 implemented: add option to open chat windows minimized on incoming message (Vogel)
* gui: #1510 implemented: hide description option also affects notifications (Vogel) * gui: #1510 implemented: hide description option also affects notifications (Vogel)
* plugins: #2825 implemented: plugin categories are now translated (Vogel) * plugins: #2825 implemented: plugin categories are now translated (Vogel)
* core: #2885 done: remove support for configuration files of Kadu 0.6.5 (Vogel)
+++ version 1.2 +++ version 1.2
* gui: #2881 fixed: after some imported configuration no contacts are displayed at all (Vogel) * gui: #2881 fixed: after some imported configuration no contacts are displayed at all (Vogel)
......
...@@ -49,7 +49,6 @@ QStringList ConfigurationPathProvider::possibleConfigurationFilePaths() const ...@@ -49,7 +49,6 @@ QStringList ConfigurationPathProvider::possibleConfigurationFilePaths() const
auto profilePath = m_pathsProvider->profilePath(); auto profilePath = m_pathsProvider->profilePath();
auto backups_0_12 = QDir{profilePath, "kadu-0.12.conf.xml.backup.*", QDir::Name, QDir::Files}; auto backups_0_12 = QDir{profilePath, "kadu-0.12.conf.xml.backup.*", QDir::Name, QDir::Files};
auto backups_0_6_6 = QDir{profilePath, "kadu-0.6.6.conf.xml.backup.*", QDir::Name, QDir::Files}; auto backups_0_6_6 = QDir{profilePath, "kadu-0.6.6.conf.xml.backup.*", QDir::Name, QDir::Files};
auto backups_0_6_5 = QDir{profilePath, "kadu.conf.xml.backup.*", QDir::Name, QDir::Files};
auto files = QStringList{}; auto files = QStringList{};
...@@ -57,8 +56,6 @@ QStringList ConfigurationPathProvider::possibleConfigurationFilePaths() const ...@@ -57,8 +56,6 @@ QStringList ConfigurationPathProvider::possibleConfigurationFilePaths() const
files += backups_0_12.entryList(); files += backups_0_12.entryList();
files += "kadu-0.6.6.conf.xml"; files += "kadu-0.6.6.conf.xml";
files += backups_0_6_6.entryList(); files += backups_0_6_6.entryList();
files += "kadu.conf.xml";
files += backups_0_6_5.entryList();
return files; return files;
} }
......
...@@ -223,7 +223,6 @@ Core::Core(injeqt::injector &injector) : ...@@ -223,7 +223,6 @@ Core::Core(injeqt::injector &injector) :
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit())); connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(quit()));
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
configurationUpdated(); configurationUpdated();
...@@ -274,11 +273,6 @@ Core::~Core() ...@@ -274,11 +273,6 @@ Core::~Core()
triggerAllAccountsUnregistered(); triggerAllAccountsUnregistered();
} }
void Core::import_0_6_5_configuration()
{
Application::instance()->configuration()->deprecatedApi()->addVariable("Look", "UserboxAlternateBgColor", Application::instance()->configuration()->deprecatedApi()->readEntry("Look", "UserboxBgColor"));
}
void Core::importPre10Configuration() void Core::importPre10Configuration()
{ {
if (Application::instance()->configuration()->deprecatedApi()->readBoolEntry("General", "ImportedPre10")) if (Application::instance()->configuration()->deprecatedApi()->readBoolEntry("General", "ImportedPre10"))
......
...@@ -166,7 +166,6 @@ class KADUAPI Core : public QObject, private AccountsAwareObject, public Configu ...@@ -166,7 +166,6 @@ class KADUAPI Core : public QObject, private AccountsAwareObject, public Configu
Core(injeqt::v1::injector &injector); Core(injeqt::v1::injector &injector);
virtual ~Core(); virtual ~Core();
void import_0_6_5_configuration();
void importPre10Configuration(); void importPre10Configuration();
void createDefaultConfiguration(); void createDefaultConfiguration();
void createAllDefaultToolbars(); void createAllDefaultToolbars();
......
...@@ -45,7 +45,6 @@ WindowNotifier::WindowNotifier(QObject *parent) : ...@@ -45,7 +45,6 @@ WindowNotifier::WindowNotifier(QObject *parent) :
{ {
kdebugf(); kdebugf();
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
NotificationManager::instance()->registerNotifier(this); NotificationManager::instance()->registerNotifier(this);
...@@ -78,11 +77,6 @@ void WindowNotifier::notificationClosed(Notification *notification) ...@@ -78,11 +77,6 @@ void WindowNotifier::notificationClosed(Notification *notification)
notification->release(this); notification->release(this);
} }
void WindowNotifier::import_0_6_5_configuration()
{
Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "StatusChanged/ToAway_Window", Application::instance()->configuration()->deprecatedApi()->readEntry("Notify", "StatusChanged/ToBusy_Window"));
}
void WindowNotifier::createDefaultConfiguration() void WindowNotifier::createDefaultConfiguration()
{ {
Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "FileTransfer/IncomingFile_Window", true); Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "FileTransfer/IncomingFile_Window", true);
......
...@@ -35,7 +35,6 @@ class WindowNotifier : public Notifier ...@@ -35,7 +35,6 @@ class WindowNotifier : public Notifier
{ {
Q_OBJECT Q_OBJECT
void import_0_6_5_configuration();
void createDefaultConfiguration(); void createDefaultConfiguration();
private slots: private slots:
......
...@@ -98,7 +98,6 @@ ExecNotify::ExecNotify(QObject *parent) : ...@@ -98,7 +98,6 @@ ExecNotify::ExecNotify(QObject *parent) :
{ {
kdebugf(); kdebugf();
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
NotificationManager::instance()->registerNotifier(this); NotificationManager::instance()->registerNotifier(this);
...@@ -114,11 +113,6 @@ ExecNotify::~ExecNotify() ...@@ -114,11 +113,6 @@ ExecNotify::~ExecNotify()
kdebugf2(); kdebugf2();
} }
void ExecNotify::import_0_6_5_configuration()
{
Application::instance()->configuration()->deprecatedApi()->addVariable("Exec Notify", "StatusChanged/ToAwayCmd", Application::instance()->configuration()->deprecatedApi()->readEntry("Exec Notify", "StatusChanged/ToBusyCmd"));
}
void ExecNotify::createDefaultConfiguration() void ExecNotify::createDefaultConfiguration()
{ {
Application::instance()->configuration()->deprecatedApi()->addVariable("Exec Notify", "NewChatCmd", "Xdialog --msgbox \"#{protocol} %u %ids #{event}\" 10 100"); Application::instance()->configuration()->deprecatedApi()->addVariable("Exec Notify", "NewChatCmd", "Xdialog --msgbox \"#{protocol} %u %ids #{event}\" 10 100");
......
...@@ -58,7 +58,6 @@ class ExecNotify : public Notifier ...@@ -58,7 +58,6 @@ class ExecNotify : public Notifier
{ {
Q_OBJECT Q_OBJECT
void import_0_6_5_configuration();
void createDefaultConfiguration(); void createDefaultConfiguration();
void run(const QStringList &args); void run(const QStringList &args);
......
...@@ -93,8 +93,6 @@ Firewall::Firewall() : ...@@ -93,8 +93,6 @@ Firewall::Firewall() :
pattern.setCaseSensitivity(Qt::CaseSensitive); pattern.setCaseSensitivity(Qt::CaseSensitive);
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
configurationUpdated(); configurationUpdated();
...@@ -500,27 +498,6 @@ void Firewall::writeLog(const Contact &contact, const QString &message) ...@@ -500,27 +498,6 @@ void Firewall::writeLog(const Contact &contact, const QString &message)
kdebugf2(); kdebugf2();
} }
void Firewall::import_0_6_5_configuration()
{
kdebugf();
QString loadedStr = Application::instance()->configuration()->deprecatedApi()->readEntry("Firewall", "Secured_list");
QStringList secured = loadedStr.split(',', QString::SkipEmptyParts);
foreach (const QString &contact, secured)
{
Buddy buddy = BuddyManager::instance()->byDisplay(contact, ActionReturnNull);
if (buddy.isNull() || buddy.isAnonymous())
continue;
buddy.addProperty("firewall-secured-sending:FirewallSecuredSending", true, CustomProperties::Storable);
}
Application::instance()->configuration()->deprecatedApi()->removeVariable("Firewall", "Secured_list");
kdebugf2();
}
void Firewall::configurationUpdated() void Firewall::configurationUpdated()
{ {
CheckFloodingEmoticons = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Firewall", "dos_emoticons", true); CheckFloodingEmoticons = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Firewall", "dos_emoticons", true);
......
...@@ -82,8 +82,6 @@ class Firewall : public MessageFilter, ConfigurationAwareObject, AccountsAwareOb ...@@ -82,8 +82,6 @@ class Firewall : public MessageFilter, ConfigurationAwareObject, AccountsAwareOb
QString ConfirmationQuestion; QString ConfirmationQuestion;
QString LogFilePath; QString LogFilePath;
void import_0_6_5_configuration();
bool checkChat(const Chat &chat, const Contact &sender, const QString &message, bool &stop); bool checkChat(const Chat &chat, const Contact &sender, const QString &message, bool &stop);
bool checkConference(const Chat &chat); bool checkConference(const Chat &chat);
bool checkEmoticons(const QString &message); bool checkEmoticons(const QString &message);
......
...@@ -86,26 +86,6 @@ void GaduAccountDetails::store() ...@@ -86,26 +86,6 @@ void GaduAccountDetails::store()
storeValue("ReceiveSpam", ReceiveSpam); storeValue("ReceiveSpam", ReceiveSpam);
} }
void GaduAccountDetails::import_0_6_5_LastStatus()
{
if (!isValidStorage())
return;
QString name;
int typeIndex = Application::instance()->configuration()->deprecatedApi()->readNumEntry("General", "LastStatusType", -1);
switch (typeIndex)
{
case 0: name = "Online"; break;
case 1: name = "Away"; break;
case 2: name = "Invisible"; break;
default: name = "Offline"; break;
}
storeValue("LastStatusName", name);
storeValue("LastStatusDescription", Application::instance()->configuration()->deprecatedApi()->readEntry("General", "LastStatusDescription"));
}
UinType GaduAccountDetails::uin() UinType GaduAccountDetails::uin()
{ {
return mainData()->id().toULong(); return mainData()->id().toULong();
......
...@@ -66,8 +66,6 @@ public: ...@@ -66,8 +66,6 @@ public:
PROPERTY_DEF(int, userlistVersion, setUserlistVersion, UserlistVersion) PROPERTY_DEF(int, userlistVersion, setUserlistVersion, UserlistVersion)
PROPERTY_DEF(bool, receiveSpam, setReceiveSpam, ReceiveSpam) PROPERTY_DEF(bool, receiveSpam, setReceiveSpam, ReceiveSpam)
void import_0_6_5_LastStatus();
}; };
#endif // GADU_ACCOUNT_DETAILS_H #endif // GADU_ACCOUNT_DETAILS_H
...@@ -196,9 +196,6 @@ void GaduImporter::importAccounts() ...@@ -196,9 +196,6 @@ void GaduImporter::importAccounts()
defaultGaduGadu.setProxy(networkProxy); defaultGaduGadu.setProxy(networkProxy);
} }
if (accountDetails)
accountDetails->import_0_6_5_LastStatus();
AccountManager::instance()->addItem(defaultGaduGadu); AccountManager::instance()->addItem(defaultGaduGadu);
defaultGaduGadu.accountContact().setOwnerBuddy(Core::instance()->myself()); defaultGaduGadu.accountContact().setOwnerBuddy(Core::instance()->myself());
......
...@@ -75,7 +75,6 @@ HintManager::HintManager(QObject *parent) : ...@@ -75,7 +75,6 @@ HintManager::HintManager(QObject *parent) :
{ {
kdebugf(); kdebugf();
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
...@@ -590,83 +589,6 @@ void HintManager::notificationClosed(Notification *notification) ...@@ -590,83 +589,6 @@ void HintManager::notificationClosed(Notification *notification)
Q_UNUSED(notification) Q_UNUSED(notification)
} }
void HintManager::realCopyConfiguration(const QString &fromCategory, const QString &fromHint, const QString &toHint)
{
QFont font(qApp->font());
QPalette palette(qApp->palette());
Application::instance()->configuration()->deprecatedApi()->writeEntry("Hints", toHint + "_font", Application::instance()->configuration()->deprecatedApi()->readFontEntry(fromCategory, fromHint + "_font", &font));
Application::instance()->configuration()->deprecatedApi()->writeEntry("Hints", toHint + "_fgcolor", Application::instance()->configuration()->deprecatedApi()->readColorEntry(fromCategory, fromHint + "_fgcolor", &palette.windowText().color()));
Application::instance()->configuration()->deprecatedApi()->writeEntry("Hints", toHint + "_bgcolor", Application::instance()->configuration()->deprecatedApi()->readColorEntry(fromCategory, fromHint + "_bgcolor", &palette.window().color()));
Application::instance()->configuration()->deprecatedApi()->writeEntry("Hints", toHint + "_timeout", (int) Application::instance()->configuration()->deprecatedApi()->readUnsignedNumEntry(fromCategory, fromHint + "_timeout", 10));
}
void HintManager::import_0_6_5_configuration()
{
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "AllEvents_transparency", 1 - Application::instance()->configuration()->deprecatedApi()->readNumEntry("OSDHints", "Opacity", 100)/100);
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "AllEvents_iconSize", Application::instance()->configuration()->deprecatedApi()->readNumEntry("OSDHints", "IconSize", 32));
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "AllEvents_borderWidth",Application::instance()->configuration()->deprecatedApi()->readNumEntry("OSDHints", "SetAll_borderWidth", FRAME_WIDTH));
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "AllEvents_bdcolor", Application::instance()->configuration()->deprecatedApi()->readColorEntry("OSDHints", "SetAll_bdcolor", &qApp->palette().window().color()).name());
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_transparency", 1 - Application::instance()->configuration()->deprecatedApi()->readNumEntry("OSDHints", "Opacity", 100)/100);
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_iconSize", Application::instance()->configuration()->deprecatedApi()->readNumEntry("OSDHints", "IconSize", 32));
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_borderWidth",Application::instance()->configuration()->deprecatedApi()->readNumEntry("OSDHints", "SetAll_borderWidth", FRAME_WIDTH));
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_bdcolor", Application::instance()->configuration()->deprecatedApi()->readColorEntry("OSDHints", "SetAll_bdcolor", &qApp->palette().window().color()).name());
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_bgcolor", Application::instance()->configuration()->deprecatedApi()->readColorEntry("OSDHints", "SetAll_bgcolor", &qApp->palette().window().color()).name());
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_fgcolor", Application::instance()->configuration()->deprecatedApi()->readColorEntry("OSDHints", "SetAll_fgcolor", &qApp->palette().windowText().color()).name());
Application::instance()->configuration()->deprecatedApi()->addVariable("Hints", "HintOverUser_font", Application::instance()->configuration()->deprecatedApi()->readFontEntry("OSDHints", "SetAll_font"));
if (Application::instance()->configuration()->deprecatedApi()->readEntry("Look", "UserboxToolTipStyle") == "OSDHints")
Application::instance()->configuration()->deprecatedApi()->writeEntry("Hints", "MouseOverUserSyntax", Application::instance()->configuration()->deprecatedApi()->readEntry("OSDHints", "MouseOverUserSyntax"));
QStringList events;
events << "ConnectionError" << "NewChat" << "NewMessage" << "StatusChanged"
<<"StatusChanged/ToFreeForChat" << "StatusChanged/ToOnline" << "StatusChanged/ToNotAvailable"
<< "StatusChanged/ToDoNotDisturb" << "StatusChanged/ToOffline"
<< "FileTransfer" << "FileTransfer/IncomingFile" << "FileTransfer/Finished";
bool osdHintsSetAll = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("OSDHints", "SetAll", false);
bool hintsSetAll = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Hints", "SetAll", false);
foreach (const QString &event, events)
{
if (Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Notify", event + "_OSDHints", false))
{
if (osdHintsSetAll)
realCopyConfiguration("OSDHints", "SetAll", event);
else
realCopyConfiguration("OSDHints", event, event);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Notify", event + "_Hints", true);
Application::instance()->configuration()->deprecatedApi()->removeVariable("Notify", event + "_OSDHints");
}
else if (hintsSetAll)
realCopyConfiguration("Hints", "SetAll", event);
}
if (Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Notify", "StatusChanged/ToBusy_OSDHints", false))
{
if (osdHintsSetAll)
realCopyConfiguration("OSDHints", "SetAll", "ToAway");
else
realCopyConfiguration("OSDHints", "StatusChanged/ToBusy", "StatusChanged/ToAway");
Application::instance()->configuration()->deprecatedApi()->writeEntry("Notify", "StatusChanged/ToAway_Hints", true);
Application::instance()->configuration()->deprecatedApi()->removeVariable("Notify", "StatusChanged/ToBusy_OSDHints");
}
else
{
if (osdHintsSetAll)
realCopyConfiguration("Hints", "SetAll", "ToAway");
else
realCopyConfiguration("Hints", "StatusChanged/ToBusy", "StatusChanged/ToAway");
}
Application::instance()->configuration()->deprecatedApi()->removeVariable("OSDHints", "SetAll");
Application::instance()->configuration()->deprecatedApi()->removeVariable("Hints", "SetAll");
}
void HintManager::createDefaultConfiguration() void HintManager::createDefaultConfiguration()
{ {
// TODO: this should be more like: if (plugins.loaded(freedesktop_notify) && this_is_first_time_we_are_loaded_or_whatever) // TODO: this should be more like: if (plugins.loaded(freedesktop_notify) && this_is_first_time_we_are_loaded_or_whatever)
......
...@@ -67,12 +67,8 @@ class HintManager : public Notifier, public AbstractToolTip, public Configuratio ...@@ -67,12 +67,8 @@ class HintManager : public Notifier, public AbstractToolTip, public Configuratio
**/ **/
void setLayoutDirection(); void setLayoutDirection();
// TODO: usun�� w 0.6
void realCopyConfiguration(const QString &fromCategory, const QString &fromHint, const QString &toHint);
void createDefaultConfiguration(); void createDefaultConfiguration();
void import_0_6_5_configuration();
private slots: private slots:
/** /**
min��a sekunda: aktualizuje czasy wszystkich dymk�w min��a sekunda: aktualizuje czasy wszystkich dymk�w
......
...@@ -55,7 +55,6 @@ Qt4Notify::Qt4Notify(QObject *parent) : ...@@ -55,7 +55,6 @@ Qt4Notify::Qt4Notify(QObject *parent) :
{ {
kdebugf(); kdebugf();
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
NotificationManager::instance()->registerNotifier(this); NotificationManager::instance()->registerNotifier(this);
...@@ -146,18 +145,6 @@ NotifierConfigurationWidget *Qt4Notify::createConfigurationWidget(QWidget *paren ...@@ -146,18 +145,6 @@ NotifierConfigurationWidget *Qt4Notify::createConfigurationWidget(QWidget *paren
return configurationWidget; return configurationWidget;
} }
void Qt4Notify::import_0_6_5_configuration()
{
Application::instance()->configuration()->deprecatedApi()->addVariable("Qt4DockingNotify", "Event_StatusChanged/ToAway_timeout",
Application::instance()->configuration()->deprecatedApi()->readEntry("Qt4DockingNotify", "Event_StatusChanged/ToBusy_timeout"));
Application::instance()->configuration()->deprecatedApi()->addVariable("Qt4DockingNotify", "Event_StatusChanged/ToAway_syntax",
Application::instance()->configuration()->deprecatedApi()->readEntry("Qt4DockingNotify", "Event_StatusChanged/ToBusy_timeout"));
Application::instance()->configuration()->deprecatedApi()->addVariable("Qt4DockingNotify", "Event_StatusChanged/ToAway_timeout",
Application::instance()->configuration()->deprecatedApi()->readEntry("Qt4DockingNotify", "Event_StatusChanged/ToBusy_title"));
Application::instance()->configuration()->deprecatedApi()->addVariable("Qt4DockingNotify", "Event_StatusChanged/ToAway_icon",
Application::instance()->configuration()->deprecatedApi()->readEntry("Qt4DockingNotify", "Event_StatusChanged/ToBusy_icon"));
}
void Qt4Notify::createDefaultConfiguration() void Qt4Notify::createDefaultConfiguration()
{ {
Application::instance()->configuration()->deprecatedApi()->addVariable("Qt4DockingNotify", "Event_ConnectionError_timeout", 10); Application::instance()->configuration()->deprecatedApi()->addVariable("Qt4DockingNotify", "Event_ConnectionError_timeout", 10);
......
...@@ -15,7 +15,6 @@ class Qt4Notify : public Notifier ...@@ -15,7 +15,6 @@ class Qt4Notify : public Notifier
{ {
Q_OBJECT Q_OBJECT
void import_0_6_5_configuration();
void createDefaultConfiguration(); void createDefaultConfiguration();
QString toPlainText(const QString &text); QString toPlainText(const QString &text);
QString parseText(const QString &text, Notification *notification, const QString &def); QString parseText(const QString &text, Notification *notification, const QString &def);
......
...@@ -64,7 +64,6 @@ SoundManager::SoundManager() : ...@@ -64,7 +64,6 @@ SoundManager::SoundManager() :
{ {
kdebugf(); kdebugf();
import_0_6_5_configuration();
createDefaultConfiguration(); createDefaultConfiguration();
setMute(!Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Sounds", "PlaySound")); setMute(!Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Sounds", "PlaySound"));
...@@ -100,12 +99,6 @@ SoundManager::~SoundManager() ...@@ -100,12 +99,6 @@ SoundManager::~SoundManager()
kdebugf2(); kdebugf2();
} }
void SoundManager::import_0_6_5_configuration()
{
Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "StatusChanged/ToAway_Sound",
Application::instance()->configuration()->deprecatedApi()->readEntry("Notify", "StatusChanged/ToAway_Sound"));
}
void SoundManager::createDefaultConfiguration() void SoundManager::createDefaultConfiguration()
{ {
Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "ConnectionError_Sound", false); Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "ConnectionError_Sound", false);
......
...@@ -59,7 +59,6 @@ class SOUNDAPI SoundManager : public QObject ...@@ -59,7 +59,6 @@ class SOUNDAPI SoundManager : public QObject
SoundManager(); SoundManager();
virtual ~SoundManager(); virtual ~SoundManager();
void import_0_6_5_configuration();
void createDefaultConfiguration(); void createDefaultConfiguration();
public slots: public slots:
......
...@@ -69,9 +69,6 @@ Speech::Speech() : ...@@ -69,9 +69,6 @@ Speech::Speech() :
{ {
kdebugf(); kdebugf();
import_0_5_0_Configuration();
import_0_6_5_configuration();
NotificationManager::instance()->registerNotifier(this); NotificationManager::instance()->registerNotifier(this);
Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "NewChat_Speech", true); Application::instance()->configuration()->deprecatedApi()->addVariable("Notify", "NewChat_Speech", true);
...@@ -87,76 +84,6 @@ Speech::~Speech() ...@@ -87,76 +84,6 @@ Speech::~Speech()
kdebugf2(); kdebugf2();
} }
void Speech::import_0_5_0_ConfigurationFromTo(const QString &from, const QString &to)
{
QString entry = Application::instance()->configuration()->deprecatedApi()->readEntry("Speech", from + "Female", QString());
if (!entry.isEmpty())
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", from + "_Syntax/Female", entry);
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", from + "Female");
entry = Application::instance()->configuration()->deprecatedApi()->readEntry("Speech", to + "Male", QString());
if (!entry.isEmpty())
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", to + "_Syntax/Male", entry);
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", to + "Male");
}
void Speech::import_0_5_0_Configuration()
{
QString entry;
entry = Application::instance()->configuration()->deprecatedApi()->readEntry("Speech", "ConnectionError", QString());
if (!entry.isEmpty())
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "ConnectionError_Syntax", entry.replace("%1", "(#{errorServer}) #{error}"));
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", "ConnectionError");
entry = Application::instance()->configuration()->deprecatedApi()->readEntry("Speech", "NotifyFormatFemale", QString());
if (!entry.isEmpty())
{
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToOnline_Syntax/Female", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToBusy_Syntax/Female", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToInvisible_Syntax/Female", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToOffline_Syntax/Female", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToTalkWithMe_Syntax/Female", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToDoNotDisturb_Syntax/Female", entry);
}
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", "NotifyFormatFemale");
entry = Application::instance()->configuration()->deprecatedApi()->readEntry("Speech", "NotifyFormatMale", QString());
if (!entry.isEmpty())
{
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToOnline_Syntax/Male", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToBusy_Syntax/Male", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToInvisible_Syntax/Male", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToOffline_Syntax/Male", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToTalkWithMe_Syntax/Male", entry);
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "StatusChanged/ToDoNotDisturb_Syntax/Male", entry);
}
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", "NotifyFormatMale");
import_0_5_0_ConfigurationFromTo("NewChat", "NewChat");
import_0_5_0_ConfigurationFromTo("NewMessage", "NewMessage");
bool arts = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Speech", "UseArts", false);
bool esd = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Speech", "UseEsd", false);
bool dsp = Application::instance()->configuration()->deprecatedApi()->readBoolEntry("Speech", "UseDsp", false);
if (arts)
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "SoundSystem", "aRts");
else if (esd)
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "SoundSystem", "Eds");
else if (dsp)
Application::instance()->configuration()->deprecatedApi()->writeEntry("Speech", "SoundSystem", "Dsp");
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", "UseArts");
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", "UseEsd");
Application::instance()->configuration()->deprecatedApi()->removeVariable("Speech", "UseDsp");
}
void Speech::import_0_6_5_configuration()
{
}
void Speech::say(const QString &s, const QString &path, void Speech::say(const QString &s, const QString &path,
bool klatt, bool melody, bool klatt, bool melody,
const QString &sound_system, const QString &device, const QString &sound_system, const QString &device,
......
...@@ -42,10 +42,6 @@ class Speech : public Notifier ...@@ -42,10 +42,6 @@ class Speech : public Notifier
QTime lastSpeech; QTime lastSpeech;
void import_0_5_0_Configuration();
void import_0_5_0_ConfigurationFromTo(const QString &from, const QString &to);
void import_0_6_5_configuration();
public: public:
Speech(); Speech();
virtual ~Speech(); virtual ~Speech();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment