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 @@
#include "accounts/accounts-aware-object.h"
#include "buddies/buddy-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 "contacts/contact-manager.h"
#include "core/core.h"
......
......@@ -24,7 +24,7 @@
#include "accounts/account-details.h"
#include "accounts/account-manager.h"
#include "accounts/account-status-container.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-manager.h"
#include "icons/kadu-icon.h"
#include "identities/identity-manager.h"
......
......@@ -19,7 +19,7 @@
* 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 "protocols/protocol-factory.h"
#include "protocols/protocol.h"
......
......@@ -27,7 +27,7 @@
#include "accounts/account-details.h"
#include "accounts/account-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/xml-configuration-file.h"
#include "contacts/contact-details.h"
......
......@@ -8,7 +8,7 @@
#include <QtX11Extras/QX11Info>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "os/x11/x11tools.h"
#undef KeyPress
#undef Status
......
......@@ -20,7 +20,7 @@
*/
#include "buddies/group-manager.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "misc/change-notifier.h"
#include "kadu-application.h"
......
......@@ -19,7 +19,7 @@
* 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 "storage/storage-point.h"
......
......@@ -29,7 +29,7 @@
#include "chat-style/engine/configured-chat-style-renderer-factory-provider.h"
#include "chat-style/engine/kadu/kadu-style-engine.h"
#include "configuration/chat-configuration-holder.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "core/core.h"
#include "formatted-string/formatted-string-factory.h"
#include "gui/widgets/chat-style-preview.h"
......
......@@ -31,7 +31,7 @@
#include "chat/chat-manager.h"
#include "chat/type/chat-type-manager.h"
#include "chat/type/chat-type.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h"
#include "misc/change-notifier.h"
#include "parser/parser.h"
......
......@@ -23,7 +23,7 @@
#include <QtCore/QVector>
#include "chat/chat-manager.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "message/message-manager.h"
#include "message/message.h"
#include "kadu-application.h"
......
......@@ -3,9 +3,9 @@ set (configuration_SRCS
config-file-data-manager.cpp
config-file-variant-wrapper.cpp
configuration-aware-object.cpp
configuration-file.cpp
configuration-holder.cpp
configuration-manager.cpp
deprecated-configuration-api.cpp
main-configuration-holder.cpp
notifier-configuration-data-manager.cpp
toolbar-configuration-manager.cpp
......
......@@ -20,7 +20,7 @@
* 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 "chat-configuration-holder.h"
......
......@@ -21,7 +21,7 @@
* 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 "config-file-data-manager.h"
......
......@@ -21,7 +21,7 @@
#include <QtCore/QVariant>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "kadu-application.h"
#include "config-file-variant-wrapper.h"
......
......@@ -41,17 +41,17 @@
#include "debug.h"
#include "configuration-file.h"
#include "deprecated-configuration-api.h"
static QMutex GlobalMutex;
ConfigFile::ConfigFile(XmlConfigFile *xmlConfigFile, const QString &fileName) :
DeprecatedConfigurationApi::DeprecatedConfigurationApi(XmlConfigFile *xmlConfigFile, const QString &fileName) :
m_xmlConfigFile{xmlConfigFile},
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);
......@@ -69,7 +69,7 @@ bool ConfigFile::changeEntry(const QString &group, const QString &name, const QS
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);
......@@ -98,42 +98,42 @@ QString ConfigFile::getEntry(const QString &group, const QString &name) const
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);
}
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));
}
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));
}
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");
}
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));
}
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());
}
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());
}
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);
if (string.isNull())
......@@ -141,7 +141,7 @@ QString ConfigFile::readEntry(const QString &group,const QString &name, const QS
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;
QString string = getEntry(group, name);
......@@ -153,7 +153,7 @@ unsigned int ConfigFile::readUnsignedNumEntry(const QString &group,const QString
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;
QString string = getEntry(group, name);
......@@ -165,7 +165,7 @@ int ConfigFile::readNumEntry(const QString &group,const QString &name, int def)
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);
if (string.isNull())
......@@ -173,12 +173,12 @@ bool ConfigFile::readBoolEntry(const QString &group,const QString &name, bool de
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);
}
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);
if (str.isNull())
......@@ -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);
if (string.isNull())
......@@ -199,7 +199,7 @@ QFont ConfigFile::readFontEntry(const QString &group,const QString &name, const
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);
......@@ -214,32 +214,32 @@ void ConfigFile::removeVariable(const QString &group, const QString &name)
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())
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())
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())
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())
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())
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())
writeEntry(group,name,defvalue);
......
......@@ -26,8 +26,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_FILE_H
#define CONFIG_FILE_H
#pragma once
#include <QtCore/QMap>
#include <QtCore/QRect>
......@@ -42,7 +41,7 @@
class XmlConfigFile;
class KADUAPI ConfigFile final
class KADUAPI DeprecatedConfigurationApi final
{
bool changeEntry(const QString &group, const QString &name, const QString &value);
QString getEntry(const QString &group, const QString &name) const;
......@@ -51,7 +50,7 @@ class KADUAPI ConfigFile final
QString m_fileName;
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 char *value);
......@@ -79,5 +78,3 @@ public:
void addVariable(const QString &group, const QString &name, const QFont &value);
};
#endif
......@@ -24,7 +24,7 @@
* 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 "kadu-application.h"
......
......@@ -19,7 +19,7 @@
* 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 "kadu-application.h"
......
......@@ -25,7 +25,7 @@
#include "buddies/buddy-manager.h"
#include "buddies/buddy.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "configuration/configuration-manager.h"
#include "contacts/contact-parser-tags.h"
#include "core/core.h"
......
......@@ -25,7 +25,7 @@
#include "avatars/avatar-manager.h"
#include "avatars/avatar.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-manager.h"
#include "core/core.h"
......
......@@ -43,7 +43,7 @@
#include "chat-style/chat-style-manager.h"
#include "chat-style/engine/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/main-configuration-holder.h"
#include "contacts/contact-manager.h"
......
......@@ -23,7 +23,7 @@
#include <QtWidgets/QFileDialog>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h"
#include "core/core.h"
#include "file-transfer/file-transfer-handler.h"
......
......@@ -31,7 +31,7 @@
#include "chat/chat-manager.h"
#include "chat/chat.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 "core/core.h"
#include "file-transfer/file-transfer-actions.h"
......
......@@ -22,7 +22,7 @@
#include <QtGui/QKeyEvent>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "kadu-application.h"
#include "hot-key.h"
......
......@@ -27,7 +27,7 @@
#include "avatars/avatar.h"
#include "buddies/buddy-preferred-manager.h"
#include "buddies/buddy.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-manager.h"
#include "core/core.h"
#include "dom/dom-processor-service.h"
......
......@@ -31,7 +31,7 @@
#include <QtWidgets/QMessageBox>
#include <QtWidgets/QVBoxLayout>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "notify/notification-manager.h"
#include "protocols/protocol.h"
......
......@@ -20,7 +20,7 @@
* 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 "chat-edit-box-size-manager.h"
......
......@@ -33,7 +33,7 @@
#include "buddies/buddy-set.h"
#include "chat/chat.h"
#include "configuration/chat-configuration-holder.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "configuration/main-configuration-holder.h"
#include "configuration/xml-configuration-file.h"
#include "contacts/contact-set.h"
......
......@@ -29,7 +29,7 @@
#include "accounts/account-manager.h"
#include "accounts/account.h"
#include "chat/chat-manager.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h"
#include "contacts/contact.h"
#include "core/core.h"
......
......@@ -19,7 +19,7 @@
#include "chat-widget-message-handler-configurator.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "gui/widgets/chat-widget/chat-widget-message-handler.h"
#include "gui/widgets/chat-widget/chat-widget-message-handler-configuration.h"
#include "kadu-application.h"
......
......@@ -53,7 +53,7 @@
#include "chat-style/engine/chat-style-renderer-factory-provider.h"
#include "chat/type/chat-type-manager.h"
#include "configuration/chat-configuration-holder.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h"
#include "contacts/contact.h"
#include "contacts/model/chat-adapter.h"
......
......@@ -26,7 +26,7 @@
#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QListWidget>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "gui/widgets/configuration/config-group-box.h"
#include "gui/widgets/configuration/config-section.h"
#include "gui/widgets/configuration/config-tab.h"
......
......@@ -34,7 +34,7 @@
#include <QtWidgets/QWidget>
#include <QtXml/QDomElement>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "gui/widgets/configuration/config-action-button.h"
#include "gui/widgets/configuration/config-check-box.h"
#include "gui/widgets/configuration/config-color-button.h"
......
......@@ -20,7 +20,7 @@
#include <QtWidgets/QApplication>
#include "buddies/group-manager.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "configuration/xml-configuration-file.h"
#include "gui/widgets/group-tab-bar/group-tab-bar.h"
#include "gui/widgets/group-tab-bar/group-tab-bar-configuration.h"
......
......@@ -26,7 +26,7 @@
#include <QtGui/QDrag>
#include <QtGui/QKeyEvent>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "gui/widgets/filtered-tree-view.h"
#include "icons/kadu-icon.h"
#include "kadu-application.h"
......
......@@ -58,7 +58,7 @@
# include <QtWebKitWidgets/QWebInspector>
#endif
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "core/core.h"
#include "gui/services/clipboard-html-transformer-service.h"
#include "gui/windows/message-dialog.h"
......
......@@ -25,7 +25,7 @@
#include <QtWidgets/QScrollBar>
#include <QtWidgets/QStackedWidget>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "gui/widgets/filter-widget.h"
#include "gui/widgets/filtered-tree-view.h"
#include "gui/widgets/group-tab-bar/group-tab-bar.h"
......
......@@ -19,7 +19,7 @@
* 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/widgets/talkable-tree-view.h"
#include "icons/kadu-icon.h"
#include "kadu-application.h"
......
......@@ -44,7 +44,7 @@
#include "buddies/buddy-set.h"
#include "buddies/buddy.h"
#include "chat/chat-manager.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "configuration/main-configuration-holder.h"
#include "core/core.h"
#include "gui/actions/action-description.h"
......
......@@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "talkable/talkable.h"
#include "kadu-application.h"
......
......@@ -36,7 +36,7 @@
#include <QtWidgets/QToolButton>
#include <QtXml/QDomElement>
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "configuration/xml-configuration-file.h"
#include "gui/actions/actions.h"
#include "gui/windows/main-window.h"
......
......@@ -53,7 +53,7 @@
#include "buddies/group-manager.h"
#include "buddies/group.h"
#include "configuration/config-file-variant-wrapper.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "configuration/xml-configuration-file.h"
#include "contacts/contact.h"
#include "core/core.h"
......
......@@ -19,7 +19,7 @@
#include "chat-window-storage-configurator.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "gui/windows/chat-window/chat-window-storage.h"
#include "gui/windows/chat-window/chat-window-storage-configuration.h"
#include "kadu-application.h"
......
......@@ -36,7 +36,7 @@
#include "chat/chat-details.h"
#include "chat/type/chat-type.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact-set.h"
#include "gui/widgets/chat-widget/chat-widget-manager.h"
#include "gui/widgets/chat-widget/chat-widget.h"
......
......@@ -34,7 +34,7 @@
#include <QtWidgets/QVBoxLayout>
#include "buddies/group.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "icons/kadu-icon.h"
#include "misc/change-notifier.h"
#include "misc/change-notifier-lock.h"
......
......@@ -35,7 +35,7 @@
#include "accounts/account.h"
#include "buddies/buddy-manager.h"
#include "buddies/group-manager.h"
#include "configuration/configuration-file.h"
#include "configuration/deprecated-configuration-api.h"
#include "contacts/contact.h"
#include "core/core.h"
#include "gui/actions/action.h"
......
......@@ -43,7 +43,7 @@
#include "chat/recent-chat-manager.h"
#include "chat/type/chat-type-manager.h"