Commit 3549d325 authored by Rafał Malinowski's avatar Rafał Malinowski

configuration: rename ConfigFile to DeprecatedConfigurationApi

Signed-off-by: Rafał Malinowski's avatarRafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent 03c9056b
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "accounts/accounts-aware-object.h" #include "accounts/accounts-aware-object.h"
#include "buddies/buddy-manager.h" #include "buddies/buddy-manager.h"
#include "chat/chat-manager.h" #include "chat/chat-manager.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "configuration/xml-configuration-file.h" #include "configuration/xml-configuration-file.h"
#include "contacts/contact-manager.h" #include "contacts/contact-manager.h"
#include "core/core.h" #include "core/core.h"
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "accounts/account-details.h" #include "accounts/account-details.h"
#include "accounts/account-manager.h" #include "accounts/account-manager.h"
#include "accounts/account-status-container.h" #include "accounts/account-status-container.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-manager.h" #include "contacts/contact-manager.h"
#include "icons/kadu-icon.h" #include "icons/kadu-icon.h"
#include "identities/identity-manager.h" #include "identities/identity-manager.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "icons/kadu-icon.h" #include "icons/kadu-icon.h"
#include "protocols/protocol-factory.h" #include "protocols/protocol-factory.h"
#include "protocols/protocol.h" #include "protocols/protocol.h"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "accounts/account-details.h" #include "accounts/account-details.h"
#include "accounts/account-manager.h" #include "accounts/account-manager.h"
#include "buddies/buddy-manager.h" #include "buddies/buddy-manager.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "configuration/main-configuration-holder.h" #include "configuration/main-configuration-holder.h"
#include "configuration/xml-configuration-file.h" #include "configuration/xml-configuration-file.h"
#include "contacts/contact-details.h" #include "contacts/contact-details.h"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include <QtX11Extras/QX11Info> #include <QtX11Extras/QX11Info>
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "os/x11/x11tools.h" #include "os/x11/x11tools.h"
#undef KeyPress #undef KeyPress
#undef Status #undef Status
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
*/ */
#include "buddies/group-manager.h" #include "buddies/group-manager.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "misc/change-notifier.h" #include "misc/change-notifier.h"
#include "kadu-application.h" #include "kadu-application.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "configuration/xml-configuration-file.h" #include "configuration/xml-configuration-file.h"
#include "storage/storage-point.h" #include "storage/storage-point.h"
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include "chat-style/engine/configured-chat-style-renderer-factory-provider.h" #include "chat-style/engine/configured-chat-style-renderer-factory-provider.h"
#include "chat-style/engine/kadu/kadu-style-engine.h" #include "chat-style/engine/kadu/kadu-style-engine.h"
#include "configuration/chat-configuration-holder.h" #include "configuration/chat-configuration-holder.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "core/core.h" #include "core/core.h"
#include "formatted-string/formatted-string-factory.h" #include "formatted-string/formatted-string-factory.h"
#include "gui/widgets/chat-style-preview.h" #include "gui/widgets/chat-style-preview.h"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "chat/chat-manager.h" #include "chat/chat-manager.h"
#include "chat/type/chat-type-manager.h" #include "chat/type/chat-type-manager.h"
#include "chat/type/chat-type.h" #include "chat/type/chat-type.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h" #include "contacts/contact-set.h"
#include "misc/change-notifier.h" #include "misc/change-notifier.h"
#include "parser/parser.h" #include "parser/parser.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <QtCore/QVector> #include <QtCore/QVector>
#include "chat/chat-manager.h" #include "chat/chat-manager.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "message/message-manager.h" #include "message/message-manager.h"
#include "message/message.h" #include "message/message.h"
#include "kadu-application.h" #include "kadu-application.h"
......
...@@ -3,9 +3,9 @@ set (configuration_SRCS ...@@ -3,9 +3,9 @@ set (configuration_SRCS
config-file-data-manager.cpp config-file-data-manager.cpp
config-file-variant-wrapper.cpp config-file-variant-wrapper.cpp
configuration-aware-object.cpp configuration-aware-object.cpp
configuration-file.cpp
configuration-holder.cpp configuration-holder.cpp
configuration-manager.cpp configuration-manager.cpp
deprecated-configuration-api.cpp
main-configuration-holder.cpp main-configuration-holder.cpp
notifier-configuration-data-manager.cpp notifier-configuration-data-manager.cpp
toolbar-configuration-manager.cpp toolbar-configuration-manager.cpp
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "kadu-application.h" #include "kadu-application.h"
#include "chat-configuration-holder.h" #include "chat-configuration-holder.h"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "kadu-application.h" #include "kadu-application.h"
#include "config-file-data-manager.h" #include "config-file-data-manager.h"
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include <QtCore/QVariant> #include <QtCore/QVariant>
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "kadu-application.h" #include "kadu-application.h"
#include "config-file-variant-wrapper.h" #include "config-file-variant-wrapper.h"
......
...@@ -41,17 +41,17 @@ ...@@ -41,17 +41,17 @@
#include "debug.h" #include "debug.h"
#include "configuration-file.h" #include "deprecated-configuration-api.h"
static QMutex GlobalMutex; static QMutex GlobalMutex;
ConfigFile::ConfigFile(XmlConfigFile *xmlConfigFile, const QString &fileName) : DeprecatedConfigurationApi::DeprecatedConfigurationApi(XmlConfigFile *xmlConfigFile, const QString &fileName) :
m_xmlConfigFile{xmlConfigFile}, m_xmlConfigFile{xmlConfigFile},
m_fileName{fileName} m_fileName{fileName}
{ {
} }
bool ConfigFile::changeEntry(const QString &group, const QString &name, const QString &value) bool DeprecatedConfigurationApi::changeEntry(const QString &group, const QString &name, const QString &value)
{ {
QMutexLocker locker(&GlobalMutex); QMutexLocker locker(&GlobalMutex);
...@@ -69,7 +69,7 @@ bool ConfigFile::changeEntry(const QString &group, const QString &name, const QS ...@@ -69,7 +69,7 @@ bool ConfigFile::changeEntry(const QString &group, const QString &name, const QS
return true; return true;
} }
QString ConfigFile::getEntry(const QString &group, const QString &name) const QString DeprecatedConfigurationApi::getEntry(const QString &group, const QString &name) const
{ {
QMutexLocker locker(&GlobalMutex); QMutexLocker locker(&GlobalMutex);
...@@ -98,42 +98,42 @@ QString ConfigFile::getEntry(const QString &group, const QString &name) const ...@@ -98,42 +98,42 @@ QString ConfigFile::getEntry(const QString &group, const QString &name) const
return QString(); return QString();
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const QString &value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const QString &value)
{ {
changeEntry(group, name, value); changeEntry(group, name, value);
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const char *value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const char *value)
{ {
changeEntry(group, name, QString::fromLocal8Bit(value)); changeEntry(group, name, QString::fromLocal8Bit(value));
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const int value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const int value)
{ {
changeEntry(group, name, QString::number(value)); changeEntry(group, name, QString::number(value));
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const bool value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const bool value)
{ {
changeEntry(group, name, value ? "true" : "false"); changeEntry(group, name, value ? "true" : "false");
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const QRect &value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const QRect &value)
{ {
changeEntry(group, name, rectToString(value)); changeEntry(group, name, rectToString(value));
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const QColor &value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const QColor &value)
{ {
changeEntry(group, name, value.name()); changeEntry(group, name, value.name());
} }
void ConfigFile::writeEntry(const QString &group,const QString &name, const QFont &value) void DeprecatedConfigurationApi::writeEntry(const QString &group,const QString &name, const QFont &value)
{ {
changeEntry(group, name, value.toString()); changeEntry(group, name, value.toString());
} }
QString ConfigFile::readEntry(const QString &group,const QString &name, const QString &def) const QString DeprecatedConfigurationApi::readEntry(const QString &group,const QString &name, const QString &def) const
{ {
QString string = getEntry(group, name); QString string = getEntry(group, name);
if (string.isNull()) if (string.isNull())
...@@ -141,7 +141,7 @@ QString ConfigFile::readEntry(const QString &group,const QString &name, const QS ...@@ -141,7 +141,7 @@ QString ConfigFile::readEntry(const QString &group,const QString &name, const QS
return string; return string;
} }
unsigned int ConfigFile::readUnsignedNumEntry(const QString &group,const QString &name, unsigned int def) const unsigned int DeprecatedConfigurationApi::readUnsignedNumEntry(const QString &group,const QString &name, unsigned int def) const
{ {
bool ok; bool ok;
QString string = getEntry(group, name); QString string = getEntry(group, name);
...@@ -153,7 +153,7 @@ unsigned int ConfigFile::readUnsignedNumEntry(const QString &group,const QString ...@@ -153,7 +153,7 @@ unsigned int ConfigFile::readUnsignedNumEntry(const QString &group,const QString
return num; return num;
} }
int ConfigFile::readNumEntry(const QString &group,const QString &name, int def) const int DeprecatedConfigurationApi::readNumEntry(const QString &group,const QString &name, int def) const
{ {
bool ok; bool ok;
QString string = getEntry(group, name); QString string = getEntry(group, name);
...@@ -165,7 +165,7 @@ int ConfigFile::readNumEntry(const QString &group,const QString &name, int def) ...@@ -165,7 +165,7 @@ int ConfigFile::readNumEntry(const QString &group,const QString &name, int def)
return num; return num;
} }
bool ConfigFile::readBoolEntry(const QString &group,const QString &name, bool def) const bool DeprecatedConfigurationApi::readBoolEntry(const QString &group,const QString &name, bool def) const
{ {
QString string = getEntry(group, name); QString string = getEntry(group, name);
if (string.isNull()) if (string.isNull())
...@@ -173,12 +173,12 @@ bool ConfigFile::readBoolEntry(const QString &group,const QString &name, bool de ...@@ -173,12 +173,12 @@ bool ConfigFile::readBoolEntry(const QString &group,const QString &name, bool de
return string=="true"; return string=="true";
} }
QRect ConfigFile::readRectEntry(const QString &group,const QString &name, const QRect *def) const QRect DeprecatedConfigurationApi::readRectEntry(const QString &group,const QString &name, const QRect *def) const
{ {
return stringToRect(getEntry(group, name), def); return stringToRect(getEntry(group, name), def);
} }
QColor ConfigFile::readColorEntry(const QString &group,const QString &name, const QColor *def) const QColor DeprecatedConfigurationApi::readColorEntry(const QString &group,const QString &name, const QColor *def) const
{ {
QString str = getEntry(group, name); QString str = getEntry(group, name);
if (str.isNull()) if (str.isNull())
...@@ -188,7 +188,7 @@ QColor ConfigFile::readColorEntry(const QString &group,const QString &name, cons ...@@ -188,7 +188,7 @@ QColor ConfigFile::readColorEntry(const QString &group,const QString &name, cons
} }
QFont ConfigFile::readFontEntry(const QString &group,const QString &name, const QFont *def) const QFont DeprecatedConfigurationApi::readFontEntry(const QString &group,const QString &name, const QFont *def) const
{ {
QString string = getEntry(group, name); QString string = getEntry(group, name);
if (string.isNull()) if (string.isNull())
...@@ -199,7 +199,7 @@ QFont ConfigFile::readFontEntry(const QString &group,const QString &name, const ...@@ -199,7 +199,7 @@ QFont ConfigFile::readFontEntry(const QString &group,const QString &name, const
return def ? *def : QApplication::font(); return def ? *def : QApplication::font();
} }
void ConfigFile::removeVariable(const QString &group, const QString &name) void DeprecatedConfigurationApi::removeVariable(const QString &group, const QString &name)
{ {
QMutexLocker locker(&GlobalMutex); QMutexLocker locker(&GlobalMutex);
...@@ -214,32 +214,32 @@ void ConfigFile::removeVariable(const QString &group, const QString &name) ...@@ -214,32 +214,32 @@ void ConfigFile::removeVariable(const QString &group, const QString &name)
group_elem.removeChild(entry_elem); group_elem.removeChild(entry_elem);
} }
void ConfigFile::addVariable(const QString &group, const QString &name, const QString &defvalue) void DeprecatedConfigurationApi::addVariable(const QString &group, const QString &name, const QString &defvalue)
{ {
if (getEntry(group, name).isEmpty()) if (getEntry(group, name).isEmpty())
writeEntry(group,name,defvalue); writeEntry(group,name,defvalue);
} }
void ConfigFile::addVariable(const QString &group, const QString &name, const char *defvalue) void DeprecatedConfigurationApi::addVariable(const QString &group, const QString &name, const char *defvalue)
{ {
if (getEntry(group, name).isEmpty()) if (getEntry(group, name).isEmpty())
writeEntry(group,name,defvalue); writeEntry(group,name,defvalue);
} }
void ConfigFile::addVariable(const QString &group, const QString &name, const int defvalue) void DeprecatedConfigurationApi::addVariable(const QString &group, const QString &name, const int defvalue)
{ {
if (getEntry(group, name).isEmpty()) if (getEntry(group, name).isEmpty())
writeEntry(group,name,defvalue); writeEntry(group,name,defvalue);
} }
void ConfigFile::addVariable(const QString &group, const QString &name, const bool defvalue) void DeprecatedConfigurationApi::addVariable(const QString &group, const QString &name, const bool defvalue)
{ {
if (getEntry(group, name).isEmpty()) if (getEntry(group, name).isEmpty())
writeEntry(group,name,defvalue); writeEntry(group,name,defvalue);
} }
void ConfigFile::addVariable(const QString &group, const QString &name, const QColor &defvalue) void DeprecatedConfigurationApi::addVariable(const QString &group, const QString &name, const QColor &defvalue)
{ {
if (getEntry(group, name).isEmpty()) if (getEntry(group, name).isEmpty())
writeEntry(group,name,defvalue); writeEntry(group,name,defvalue);
} }
void ConfigFile::addVariable(const QString &group, const QString &name, const QFont &defvalue) void DeprecatedConfigurationApi::addVariable(const QString &group, const QString &name, const QFont &defvalue)
{ {
if (getEntry(group, name).isEmpty()) if (getEntry(group, name).isEmpty())
writeEntry(group,name,defvalue); writeEntry(group,name,defvalue);
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef CONFIG_FILE_H #pragma once
#define CONFIG_FILE_H
#include <QtCore/QMap> #include <QtCore/QMap>
#include <QtCore/QRect> #include <QtCore/QRect>
...@@ -42,7 +41,7 @@ ...@@ -42,7 +41,7 @@
class XmlConfigFile; class XmlConfigFile;
class KADUAPI ConfigFile final class KADUAPI DeprecatedConfigurationApi final
{ {
bool changeEntry(const QString &group, const QString &name, const QString &value); bool changeEntry(const QString &group, const QString &name, const QString &value);
QString getEntry(const QString &group, const QString &name) const; QString getEntry(const QString &group, const QString &name) const;
...@@ -51,7 +50,7 @@ class KADUAPI ConfigFile final ...@@ -51,7 +50,7 @@ class KADUAPI ConfigFile final
QString m_fileName; QString m_fileName;
public: public:
ConfigFile(XmlConfigFile *xmlConfigFile, const QString &fileName); DeprecatedConfigurationApi(XmlConfigFile *xmlConfigFile, const QString &fileName);
void writeEntry(const QString &group, const QString &name, const QString &value); void writeEntry(const QString &group, const QString &name, const QString &value);
void writeEntry(const QString &group, const QString &name, const char *value); void writeEntry(const QString &group, const QString &name, const char *value);
...@@ -79,5 +78,3 @@ public: ...@@ -79,5 +78,3 @@ public:
void addVariable(const QString &group, const QString &name, const QFont &value); void addVariable(const QString &group, const QString &name, const QFont &value);
}; };
#endif
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "misc/kadu-paths.h" #include "misc/kadu-paths.h"
#include "kadu-application.h" #include "kadu-application.h"
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "gui/windows/configuration-window.h" #include "gui/windows/configuration-window.h"
#include "kadu-application.h" #include "kadu-application.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "buddies/buddy-manager.h" #include "buddies/buddy-manager.h"
#include "buddies/buddy.h" #include "buddies/buddy.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "configuration/configuration-manager.h" #include "configuration/configuration-manager.h"
#include "contacts/contact-parser-tags.h" #include "contacts/contact-parser-tags.h"
#include "core/core.h" #include "core/core.h"
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
#include "avatars/avatar-manager.h" #include "avatars/avatar-manager.h"
#include "avatars/avatar.h" #include "avatars/avatar.h"
#include "buddies/buddy-manager.h" #include "buddies/buddy-manager.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-details.h" #include "contacts/contact-details.h"
#include "contacts/contact-manager.h" #include "contacts/contact-manager.h"
#include "core/core.h" #include "core/core.h"
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
#include "chat-style/chat-style-manager.h" #include "chat-style/chat-style-manager.h"
#include "chat-style/engine/chat-style-renderer-factory-provider.h" #include "chat-style/engine/chat-style-renderer-factory-provider.h"
#include "chat-style/engine/configured-chat-style-renderer-factory-provider.h" #include "chat-style/engine/configured-chat-style-renderer-factory-provider.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "configuration/configuration-manager.h" #include "configuration/configuration-manager.h"
#include "configuration/main-configuration-holder.h" #include "configuration/main-configuration-holder.h"
#include "contacts/contact-manager.h" #include "contacts/contact-manager.h"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
#include <QtWidgets/QFileDialog> #include <QtWidgets/QFileDialog>
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h" #include "contacts/contact-set.h"
#include "core/core.h" #include "core/core.h"
#include "file-transfer/file-transfer-handler.h" #include "file-transfer/file-transfer-handler.h"
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "chat/chat-manager.h" #include "chat/chat-manager.h"
#include "chat/chat.h" #include "chat/chat.h"
#include "chat/type/chat-type-contact.h" #include "chat/type/chat-type-contact.h"
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h" #include "contacts/contact-set.h"
#include "core/core.h" #include "core/core.h"
#include "file-transfer/file-transfer-actions.h" #include "file-transfer/file-transfer-actions.h"
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <QtGui/QKeyEvent> #include <QtGui/QKeyEvent>
#include "configuration/configuration-file.h" #include "configuration/deprecated-configuration-api.h"
#include "kadu-application.h" #include "kadu-application.h"
#include "hot-key.h" #include "hot-key.h"
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#include "avatars/avatar.h"