Commit 7530330a authored by Rafał Malinowski's avatar Rafał Malinowski

configuration: replace config_file_ptr with config_file

Signed-off-by: Rafał Malinowski's avatarRafał Malinowski <rafal.przemyslaw.malinowski@gmail.com>
parent 53a95b3a
......@@ -313,8 +313,8 @@ void AccountShared::setDisconnectStatus()
if (!ProtocolHandler->isConnected() && !ProtocolHandler->isDisconnecting())
return;
bool disconnectWithCurrentDescription = config_file.readBoolEntry("General", "DisconnectWithCurrentDescription");
QString disconnectDescription = config_file.readEntry("General", "DisconnectDescription");
bool disconnectWithCurrentDescription = config_file->readBoolEntry("General", "DisconnectWithCurrentDescription");
QString disconnectDescription = config_file->readEntry("General", "DisconnectDescription");
Status disconnectStatus;
disconnectStatus.setType(StatusTypeOffline);
......
......@@ -35,7 +35,7 @@
if( X11_isWindowShaded( QX11Info::display(), window->winId() ) )
X11_shadeWindow( QX11Info::display(), window->winId(), false );
// read user settings
int action = config_file.readNumEntry( "General", "WindowActivationMethod" );
int action = config_file->readNumEntry( "General", "WindowActivationMethod" );
// window & desktop
if( X11_getDesktopsCount( QX11Info::display() ) > 1 )
{
......
......@@ -68,7 +68,7 @@ QString GroupShared::storageNodeName()
void GroupShared::importConfiguration(const QString &name)
{
Name = name;
Icon = config_file.readEntry("GroupIcon", name);
Icon = config_file->readEntry("GroupIcon", name);
NotifyAboutStatusChanges = true;
ShowInAllGroup= true;
OfflineToGroup= false;
......
......@@ -117,18 +117,18 @@ void ChatStyleManager::unregisterChatStyleEngine(const QString &name)
void ChatStyleManager::configurationUpdated()
{
if (config_file.readBoolEntry("Chat", "ChatPrune", true))
Prune = config_file.readNumEntry("Chat", "ChatPruneLen");
if (config_file->readBoolEntry("Chat", "ChatPrune", true))
Prune = config_file->readNumEntry("Chat", "ChatPruneLen");
else
{
config_file.writeEntry("Chat", "ChatPrune", true);
config_file.writeEntry("Chat", "ChatPruneLen", 0);
config_file->writeEntry("Chat", "ChatPrune", true);
config_file->writeEntry("Chat", "ChatPruneLen", 0);
Prune = 0;
}
ParagraphSeparator = config_file.readNumEntry("Look", "ParagraphSeparator");
ParagraphSeparator = config_file->readNumEntry("Look", "ParagraphSeparator");
QFont font = config_file.readFontEntry("Look","ChatFont");
QFont font = config_file->readFontEntry("Look","ChatFont");
QString fontFamily = font.family();
QString fontSize;
......@@ -170,13 +170,13 @@ void ChatStyleManager::configurationUpdated()
" padding: 3px;"
"}").arg(fontStyle, fontWeight, fontSize, fontFamily, textDecoration, QString::number(ParagraphSeparator), backgroundColor);
CfgNoHeaderRepeat = config_file.readBoolEntry("Look", "NoHeaderRepeat", true);
CfgNoHeaderRepeat = config_file->readBoolEntry("Look", "NoHeaderRepeat", true);
// headers removal stuff
if (CfgNoHeaderRepeat)
{
CfgHeaderSeparatorHeight = config_file.readNumEntry("Look", "HeaderSeparatorHeight");
CfgNoHeaderInterval = config_file.readNumEntry("Look", "NoHeaderInterval");
CfgHeaderSeparatorHeight = config_file->readNumEntry("Look", "HeaderSeparatorHeight");
CfgNoHeaderInterval = config_file->readNumEntry("Look", "NoHeaderInterval");
}
else
{
......@@ -184,10 +184,10 @@ void ChatStyleManager::configurationUpdated()
CfgNoHeaderInterval = 0;
}
NoServerTime = config_file.readBoolEntry("Look", "NoServerTime");
NoServerTimeDiff = config_file.readNumEntry("Look", "NoServerTimeDiff");
NoServerTime = config_file->readBoolEntry("Look", "NoServerTime");
NoServerTimeDiff = config_file->readNumEntry("Look", "NoServerTimeDiff");
auto newChatStyle = ChatStyle{config_file.readEntry("Look", "Style"), config_file.readEntry("Look", "ChatStyleVariant")};
auto newChatStyle = ChatStyle{config_file->readEntry("Look", "Style"), config_file->readEntry("Look", "ChatStyleVariant")};
// if Style was changed, load new Style
if (!CurrentEngine || newChatStyle != m_currentChatStyle)
......@@ -355,8 +355,8 @@ void ChatStyleManager::mainConfigurationWindowCreated(MainConfigurationWindow *w
void ChatStyleManager::configurationApplied()
{
config_file.writeEntry("Look", "Style", SyntaxListCombo->currentText());
config_file.writeEntry("Look", "ChatStyleVariant", VariantListCombo->currentText());
config_file->writeEntry("Look", "Style", SyntaxListCombo->currentText());
config_file->writeEntry("Look", "ChatStyleVariant", VariantListCombo->currentText());
}
void ChatStyleManager::styleChangedSlot(const QString &styleName)
......
......@@ -231,7 +231,7 @@ bool ChatShared::shouldStore()
return false;
// we dont need data for non-roster contacts only from 4 version of sql schema
if (config_file.readNumEntry("History", "Schema", 0) < 4)
if (config_file->readNumEntry("History", "Schema", 0) < 4)
return true;
if (customProperties()->shouldStore())
......
......@@ -140,7 +140,7 @@ void RecentChatManager::store()
for (int i = 0; i < count; i++)
mainElement.removeChild(chatElements.at(i));
if (!config_file.readBoolEntry("Chat", "RecentChatsClear", false))
if (!config_file->readBoolEntry("Chat", "RecentChatsClear", false))
foreach (const Chat &chat, RecentChats)
if (chat && !chat.uuid().isNull())
{
......@@ -234,7 +234,7 @@ void RecentChatManager::removeRecentChat(Chat chat)
void RecentChatManager::configurationUpdated()
{
CleanUpTimer.stop();
RecentChatsTimeout = config_file.readNumEntry("Chat", "RecentChatsTimeout") * 60;
RecentChatsTimeout = config_file->readNumEntry("Chat", "RecentChatsTimeout") * 60;
if (RecentChatsTimeout > 0)
CleanUpTimer.start();
......
......@@ -57,35 +57,35 @@ void ChatConfigurationHolder::init()
void ChatConfigurationHolder::configurationUpdated()
{
AutoSend = config_file.readBoolEntry("Chat", "AutoSend");
NiceDateFormat = config_file.readBoolEntry("Look", "NiceDateFormat");
ChatTextCustomColors = config_file.readBoolEntry("Look", "ChatTextCustomColors");
ChatTextBgColor = config_file.readColorEntry("Look", "ChatTextBgColor");
ChatTextFontColor = config_file.readColorEntry("Look", "ChatTextFontColor");
ForceCustomChatFont = config_file.readBoolEntry("Look", "ForceCustomChatFont");
ChatFont = config_file.readFontEntry("Look", "ChatFont");
ChatContents = config_file.readEntry("Look", "ChatContents");
ConferenceContents = config_file.readEntry("Look", "ConferenceContents");
ConferencePrefix = config_file.readEntry("Look", "ConferencePrefix");
MyBackgroundColor = config_file.readEntry("Look", "ChatMyBgColor");
MyFontColor = config_file.readEntry("Look", "ChatMyFontColor");
MyNickColor = config_file.readEntry("Look", "ChatMyNickColor");
UsrBackgroundColor = config_file.readEntry("Look", "ChatUsrBgColor");
UsrFontColor = config_file.readEntry("Look", "ChatUsrFontColor");
UsrNickColor = config_file.readEntry("Look", "ChatUsrNickColor");
ContactStateChats = config_file.readBoolEntry("Chat", "ContactStateChats");
ContactStateWindowTitle = config_file.readBoolEntry("Chat", "ContactStateWindowTitle");
ContactStateWindowTitlePosition = config_file.readNumEntry("Chat", "ContactStateWindowTitlePosition");
ContactStateWindowTitleComposingSyntax = config_file.readEntry("Chat", "ContactStateWindowTitleComposingSyntax");
ChatBgFilled = config_file.readBoolEntry("Look", "ChatBgFilled");
ChatBgColor = config_file.readColorEntry("Look", "ChatBgColor");
UseTransparency = config_file.readBoolEntry("Chat", "UseTransparency");
AutoSend = config_file->readBoolEntry("Chat", "AutoSend");
NiceDateFormat = config_file->readBoolEntry("Look", "NiceDateFormat");
ChatTextCustomColors = config_file->readBoolEntry("Look", "ChatTextCustomColors");
ChatTextBgColor = config_file->readColorEntry("Look", "ChatTextBgColor");
ChatTextFontColor = config_file->readColorEntry("Look", "ChatTextFontColor");
ForceCustomChatFont = config_file->readBoolEntry("Look", "ForceCustomChatFont");
ChatFont = config_file->readFontEntry("Look", "ChatFont");
ChatContents = config_file->readEntry("Look", "ChatContents");
ConferenceContents = config_file->readEntry("Look", "ConferenceContents");
ConferencePrefix = config_file->readEntry("Look", "ConferencePrefix");
MyBackgroundColor = config_file->readEntry("Look", "ChatMyBgColor");
MyFontColor = config_file->readEntry("Look", "ChatMyFontColor");
MyNickColor = config_file->readEntry("Look", "ChatMyNickColor");
UsrBackgroundColor = config_file->readEntry("Look", "ChatUsrBgColor");
UsrFontColor = config_file->readEntry("Look", "ChatUsrFontColor");
UsrNickColor = config_file->readEntry("Look", "ChatUsrNickColor");
ContactStateChats = config_file->readBoolEntry("Chat", "ContactStateChats");
ContactStateWindowTitle = config_file->readBoolEntry("Chat", "ContactStateWindowTitle");
ContactStateWindowTitlePosition = config_file->readNumEntry("Chat", "ContactStateWindowTitlePosition");
ContactStateWindowTitleComposingSyntax = config_file->readEntry("Chat", "ContactStateWindowTitleComposingSyntax");
ChatBgFilled = config_file->readBoolEntry("Look", "ChatBgFilled");
ChatBgColor = config_file->readColorEntry("Look", "ChatBgColor");
UseTransparency = config_file->readBoolEntry("Chat", "UseTransparency");
emit chatConfigurationUpdated();
......
......@@ -30,7 +30,7 @@ void ConfigFileDataManager::writeEntry(const QString &section, const QString &na
if (section.isEmpty() || name.isEmpty())
return;
config_file.writeEntry(section, name, value.toString());
config_file->writeEntry(section, name, value.toString());
}
QVariant ConfigFileDataManager::readEntry(const QString &section, const QString &name)
......@@ -38,7 +38,7 @@ QVariant ConfigFileDataManager::readEntry(const QString &section, const QString
if (section.isEmpty() || name.isEmpty())
return QVariant(QString());
return QVariant(config_file.readEntry(section, name));
return QVariant(config_file->readEntry(section, name));
}
......
......@@ -36,10 +36,10 @@ ConfigFileVariantWrapper::~ConfigFileVariantWrapper()
QVariant ConfigFileVariantWrapper::get(const QVariant &defaultValue) const
{
return config_file.readEntry(Group, Name, defaultValue.toString());
return config_file->readEntry(Group, Name, defaultValue.toString());
}
void ConfigFileVariantWrapper::set(const QVariant &value)
{
config_file.writeEntry(Group, Name, value.toString());
config_file->writeEntry(Group, Name, value.toString());
}
......@@ -766,4 +766,4 @@ void ConfigFile::addVariable(const QString &group, const QString &name, const QP
writeEntry(group,name,defvalue);
}
ConfigFile *config_file_ptr;
ConfigFile *config_file;
......@@ -686,7 +686,6 @@ public:
//TODO: mamy juz 0.6 ;)
//TODO pozdrowienia z prawie-1.0
extern KADUAPI ConfigFile *config_file_ptr;
#define config_file (*config_file_ptr)
extern KADUAPI ConfigFile *config_file;
#endif
......@@ -56,7 +56,7 @@ MainConfigurationHolder::MainConfigurationHolder() :
void MainConfigurationHolder::configurationUpdated()
{
QString statusContainerType = config_file.readEntry("General", "StatusContainerType", "Identity");
QString statusContainerType = config_file->readEntry("General", "StatusContainerType", "Identity");
SetStatusMode newStatus = SetStatusPerIdentity;
if (statusContainerType == "Account")
......
......@@ -36,7 +36,7 @@ void NotifierConfigurationDataManager::writeEntry(const QString &section, const
if (section.isEmpty() || name.isEmpty())
return;
config_file.writeEntry(section, QString("Event_") + EventName + name, value.toString());
config_file->writeEntry(section, QString("Event_") + EventName + name, value.toString());
}
QVariant NotifierConfigurationDataManager::readEntry(const QString &section, const QString &name)
......@@ -44,7 +44,7 @@ QVariant NotifierConfigurationDataManager::readEntry(const QString &section, con
if (section.isEmpty() || name.isEmpty())
return QVariant(QString());
return config_file.readEntry(section, QString("Event_") + EventName + name);
return config_file->readEntry(section, QString("Event_") + EventName + name);
}
NotifierConfigurationDataManager * NotifierConfigurationDataManager::dataManagerForEvent(const QString &eventName)
......
......@@ -271,14 +271,14 @@ void ContactManager::removeDuplicateContacts()
uniqueContacts.insert(qMakePair(contact.contactAccount(), contact.id()), contact);
}
config_file.writeEntry("General", "ContactsImportedFrom0_9", true);
config_file->writeEntry("General", "ContactsImportedFrom0_9", true);
}
void ContactManager::loaded()
{
Manager<Contact>::loaded();
if (!config_file.readBoolEntry("General", "ContactsImportedFrom0_9", false))
if (!config_file->readBoolEntry("General", "ContactsImportedFrom0_9", false))
// delay it so that everything needed will be loaded when we call this method
QTimer::singleShot(0, this, SLOT(removeDuplicateContacts()));
}
......
......@@ -184,7 +184,7 @@ bool ContactShared::shouldStore()
return false;
// we dont need data for non-roster contacts only from 4 version of sql schema
if (config_file.readNumEntry("History", "Schema", 0) < 4)
if (config_file->readNumEntry("History", "Schema", 0) < 4)
return true;
return !isAnonymous() || rosterEntry()->requiresSynchronization() || customProperties()->shouldStore();
......
This diff is collapsed.
......@@ -141,7 +141,7 @@ QStringList FileTransferActions::selectFilesToSend()
{
return QFileDialog::getOpenFileNames(
0, tr("Select file location"),
config_file.readEntry("Network", "LastUploadDirectory"));
config_file->readEntry("Network", "LastUploadDirectory"));
}
void FileTransferActions::selectFilesAndSend(const ContactSet &contacts)
......
......@@ -168,7 +168,7 @@ void FileTransferManager::acceptFileTransfer(FileTransfer transfer)
{
if (fileName.isEmpty())
fileName = QFileDialog::getSaveFileName(Core::instance()->kaduWindow(), tr("Select file location"),
config_file.readEntry("Network", "LastDownloadDirectory") + transfer.remoteFileName(),
config_file->readEntry("Network", "LastDownloadDirectory") + transfer.remoteFileName(),
QString(), 0, QFileDialog::DontConfirmOverwrite);
if (fileName.isEmpty())
......@@ -179,7 +179,7 @@ void FileTransferManager::acceptFileTransfer(FileTransfer transfer)
return;
}
config_file.writeEntry("Network", "LastDownloadDirectory", QFileInfo(fileName).absolutePath() + '/');
config_file->writeEntry("Network", "LastDownloadDirectory", QFileInfo(fileName).absolutePath() + '/');
fi.setFile(fileName);
if (!haveFileName && fi.exists())
......
......@@ -28,12 +28,12 @@
QKeySequence HotKey::shortCutFromFile(const QString &groupname, const QString &name)
{
return QKeySequence::fromString(config_file.readEntry(groupname, name), QKeySequence::PortableText);
return QKeySequence::fromString(config_file->readEntry(groupname, name), QKeySequence::PortableText);
}
bool HotKey::shortCut(QKeyEvent *e, const QString &groupname, const QString &name)
{
QString config = config_file.readEntry(groupname, name);
QString config = config_file->readEntry(groupname, name);
return !config.isEmpty() && config == keyEventToString(e);
}
......
......@@ -63,7 +63,7 @@ BuddyInfoPanel::~BuddyInfoPanel()
void BuddyInfoPanel::configurationUpdated()
{
setUserFont(config_file.readFontEntry("Look", "PanelFont").toString(), true);
setUserFont(config_file->readFontEntry("Look", "PanelFont").toString(), true);
update();
}
......@@ -79,7 +79,7 @@ void BuddyInfoPanel::update()
if (Core::instance()->isClosing())
return;
QFont font = config_file.readFontEntry("Look", "PanelFont");
QFont font = config_file->readFontEntry("Look", "PanelFont");
QString fontFamily = font.family();
QString fontSize;
if (font.pointSize() > 0)
......@@ -90,10 +90,10 @@ void BuddyInfoPanel::update()
QString fontStyle = font.italic() ? "italic" : "normal";
QString fontWeight = font.bold() ? "bold" : "normal";
QString textDecoration = font.underline() ? "underline" : "none";
QString fontColor = config_file.readColorEntry("Look", "InfoPanelFgColor").name();
bool backgroundFilled = config_file.readBoolEntry("Look", "InfoPanelBgFilled");
QString fontColor = config_file->readColorEntry("Look", "InfoPanelFgColor").name();
bool backgroundFilled = config_file->readBoolEntry("Look", "InfoPanelBgFilled");
if (backgroundFilled)
BackgroundColor = config_file.readColorEntry("Look", "InfoPanelBgColor").name();
BackgroundColor = config_file->readColorEntry("Look", "InfoPanelBgColor").name();
else
BackgroundColor = "transparent";
......@@ -130,11 +130,11 @@ void BuddyInfoPanel::update()
"</html>"
).arg(fontColor, fontStyle, fontWeight, fontSize, fontFamily, textDecoration, BackgroundColor, "%1");
QString syntaxFile = config_file.readEntry("Look", "InfoPanelSyntaxFile", "ultr");
QString syntaxFile = config_file->readEntry("Look", "InfoPanelSyntaxFile", "ultr");
if (syntaxFile == "default")
{
syntaxFile = "Old Default";
config_file.writeEntry("Look", "InfoPanelSyntaxFile", syntaxFile);
config_file->writeEntry("Look", "InfoPanelSyntaxFile", syntaxFile);
}
Syntax = SyntaxList::readSyntax("infopanel", syntaxFile,
......@@ -142,7 +142,7 @@ void BuddyInfoPanel::update()
"<div align=\"left\"> [<b>%a</b>][ (%u)] [<br>tel.: %m][<br>IP: %i]</div></td></tr></table> <hr> <b>%s</b> [<br>%d]");
displayItem(Item);
if (config_file.readBoolEntry("Look", "PanelVerticalScrollbar"))
if (config_file->readBoolEntry("Look", "PanelVerticalScrollbar"))
page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAsNeeded);
else
page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
......
......@@ -46,7 +46,7 @@ ChatEditBoxSizeManager::~ChatEditBoxSizeManager()
void ChatEditBoxSizeManager::configurationUpdated()
{
setCommonHeight(config_file.readNumEntry("Chat", "ChatEditBoxHeight", 0));
setCommonHeight(config_file->readNumEntry("Chat", "ChatEditBoxHeight", 0));
}
void ChatEditBoxSizeManager::setCommonHeight(int height)
......@@ -54,7 +54,7 @@ void ChatEditBoxSizeManager::setCommonHeight(int height)
if (height != CommonHeight)
{
CommonHeight = height;
config_file.writeEntry("Chat", "ChatEditBoxHeight", CommonHeight);
config_file->writeEntry("Chat", "ChatEditBoxHeight", CommonHeight);
emit commonHeightChanged(CommonHeight);
}
}
......
......@@ -227,13 +227,13 @@ void ChatEditBox::openInsertImageDialog()
return;
// QTBUG-849
QString selectedFile = QFileDialog::getOpenFileName(this, tr("Insert image"), config_file.readEntry("Chat", "LastImagePath"),
QString selectedFile = QFileDialog::getOpenFileName(this, tr("Insert image"), config_file->readEntry("Chat", "LastImagePath"),
tr("Images (*.png *.PNG *.jpg *.JPG *.jpeg *.JPEG *.gif *.GIF *.bmp *.BMP);;All Files (*)"));
if (!selectedFile.isEmpty())
{
QFileInfo f(selectedFile);
config_file.writeEntry("Chat", "LastImagePath", f.absolutePath());
config_file->writeEntry("Chat", "LastImagePath", f.absolutePath());
if (!f.isReadable())
{
......
......@@ -246,7 +246,7 @@ void ChatWidgetActions::configurationUpdated()
void ChatWidgetActions::autoSendActionCreated(Action *action)
{
action->setChecked(config_file.readBoolEntry("Chat", "AutoSend"));
action->setChecked(config_file->readBoolEntry("Chat", "AutoSend"));
}
void ChatWidgetActions::clearChatActionCreated(Action *action)
......@@ -275,7 +275,7 @@ void ChatWidgetActions::sendActionCreated(Action *action)
void ChatWidgetActions::autoSendActionCheck()
{
bool check = config_file.readBoolEntry("Chat", "AutoSend");
bool check = config_file->readBoolEntry("Chat", "AutoSend");
foreach (Action *action, AutoSend->actions())
action->setChecked(check);
}
......@@ -288,7 +288,7 @@ void ChatWidgetActions::autoSendActionActivated(QAction *sender, bool toggled)
if (!chatEditBox)
return;
config_file.writeEntry("Chat", "AutoSend", toggled);
config_file->writeEntry("Chat", "AutoSend", toggled);
chatEditBox->setAutoSend(toggled);
autoSendActionCheck();
}
......
......@@ -42,14 +42,14 @@ void ChatWidgetMessageHandlerConfigurator::configurationUpdated()
void ChatWidgetMessageHandlerConfigurator::createDefaultConfiguration() const
{
config_file.addVariable("Chat", "OpenChatOnMessage", false);
config_file.addVariable("Chat", "OpenChatOnMessageWhenOnline", true);
config_file->addVariable("Chat", "OpenChatOnMessage", false);
config_file->addVariable("Chat", "OpenChatOnMessageWhenOnline", true);
}
ChatWidgetMessageHandlerConfiguration ChatWidgetMessageHandlerConfigurator::loadConfiguration() const
{
auto configuration = ChatWidgetMessageHandlerConfiguration();
configuration.setOpenChatOnMessage(config_file.readBoolEntry("Chat", "OpenChatOnMessage", false));
configuration.setOpenChatOnMessageOnlyWhenOnline(config_file.readBoolEntry("Chat", "OpenChatOnMessageWhenOnline", true));
configuration.setOpenChatOnMessage(config_file->readBoolEntry("Chat", "OpenChatOnMessage", false));
configuration.setOpenChatOnMessageOnlyWhenOnline(config_file->readBoolEntry("Chat", "OpenChatOnMessageWhenOnline", true));
return configuration;
}
......@@ -533,7 +533,7 @@ void ChatWidget::clearChatWindow()
dialog->addButton(QMessageBox::Yes, tr("Clear chat window"));
dialog->addButton(QMessageBox::No, tr("Cancel"));
if (!config_file.readBoolEntry("Chat", "ConfirmChatClear") || dialog->ask())
if (!config_file->readBoolEntry("Chat", "ConfirmChatClear") || dialog->ask())
{
MessagesView->clearMessages();
MessagesView->setForcePruneDisabled(false);
......
......@@ -54,7 +54,7 @@ ConfigSection::~ConfigSection()
blockSignals(false);
emit destroyed(this);
config_file.writeEntry("General", "ConfigurationWindow_" + MyConfigurationWidget->name() + '_' + Name,
config_file->writeEntry("General", "ConfigurationWindow_" + MyConfigurationWidget->name() + '_' + Name,
TabWidget->tabText(TabWidget->currentIndex()));
// delete them here, since they manually delete child widgets of our TabWidget
......@@ -88,7 +88,7 @@ void ConfigSection::activate()
if (Activated)
return;
QString tab = config_file.readEntry("General", "ConfigurationWindow_" + MyConfigurationWidget->name() + '_' + Name);
QString tab = config_file->readEntry("General", "ConfigurationWindow_" + MyConfigurationWidget->name() + '_' + Name);
if (ConfigTabs.contains(tab))
TabWidget->setCurrentWidget(ConfigTabs.value(tab)->widget());
Activated = true;
......
......@@ -95,7 +95,7 @@ ConfigurationWidget::ConfigurationWidget(ConfigurationWindowDataManager *dataMan
ConfigurationWidget::~ConfigurationWidget()
{
if (SectionsListWidget->currentItem())
config_file.writeEntry("General", "ConfigurationWindow_" + Name, SectionsListWidget->currentItem()->text());
config_file->writeEntry("General", "ConfigurationWindow_" + Name, SectionsListWidget->currentItem()->text());
disconnect(SectionsListWidget, 0, this, 0);
......@@ -109,7 +109,7 @@ ConfigurationWidget::~ConfigurationWidget()
void ConfigurationWidget::init()
{
QString lastSection = config_file.readEntry("General", "ConfigurationWindow_" + Name);
QString lastSection = config_file->readEntry("General", "ConfigurationWindow_" + Name);
if (ConfigSections.contains(lastSection))
ConfigSections.value(lastSection)->activate();
else if (SectionsListWidget->count() > 0)
......
......@@ -41,9 +41,9 @@ void GroupTabBarConfigurator::setGroupTabBar(GroupTabBar *groupTabBar)
void GroupTabBarConfigurator::createDefaultConfiguration()
{
config_file.addVariable("Look", "ShowGroupAll", true);
config_file.addVariable("Look", "ShowGroupTabUngroupped", false);
config_file.addVariable("Look", "DisplayGroupTabs", true);
config_file->addVariable("Look", "ShowGroupAll", true);
config_file->addVariable("Look", "ShowGroupTabUngroupped", false);
config_file->addVariable("Look", "DisplayGroupTabs", true);
}
void GroupTabBarConfigurator::configurationUpdated()
......@@ -58,10 +58,10 @@ GroupTabBarConfiguration GroupTabBarConfigurator::loadConfiguration() const
{
auto configuration = GroupTabBarConfiguration();
configuration.setDisplayGroupTabs(config_file.readBoolEntry("Look", "DisplayGroupTabs", true));
configuration.setShowGroupTabEverybody(config_file.readBoolEntry("Look", "ShowGroupAll", true));
configuration.setAlwaysShowGroupTabUngroupped(config_file.readBoolEntry("Look", "AlwaysShowGroupTabUngroupped", true));
configuration.setCurrentGroupTab(config_file.readNumEntry("Look", "CurrentGroupTab", 0));
configuration.setDisplayGroupTabs(config_file->readBoolEntry("Look", "DisplayGroupTabs", true));
configuration.setShowGroupTabEverybody(config_file->readBoolEntry("Look", "ShowGroupAll", true));
configuration.setAlwaysShowGroupTabUngroupped(config_file->readBoolEntry("Look", "AlwaysShowGroupTabUngroupped", true));
configuration.setCurrentGroupTab(config_file->readNumEntry("Look", "CurrentGroupTab", 0));
configuration.setGroupFilters(loadGroupFilters(configuration.showGroupTabEverybody()));
return configuration;
......@@ -73,11 +73,11 @@ void GroupTabBarConfigurator::storeConfiguration()
return;
auto configuration = ConfigurableGroupTabBar.data()->configuration();
config_file.writeEntry("Look", "CurrentGroupTab", configuration.currentGroupTab());
config_file->writeEntry("Look", "CurrentGroupTab", configuration.currentGroupTab());
storeGroupFilters(configuration.groupFilters());
config_file.sync(); // TODO: fix whole configuration system
config_file->sync(); // TODO: fix whole configuration system
}
QVector<GroupFilter> GroupTabBarConfigurator::loadGroupFilters(bool showGroupTabEverybody) const
......@@ -116,8 +116,8 @@ QVector<GroupFilter> GroupTabBarConfigurator::import_0_12_groupFilters(bool show
{
auto result = QVector<GroupFilter>();
auto position = showGroupTabEverybody
? config_file.readNumEntry("Look", "AllGroupTabPosition", 0)
: config_file.readNumEntry("Look", "UngroupedGroupTabPosition", 0);
? config_file->readNumEntry("Look", "AllGroupTabPosition", 0)
: config_file->readNumEntry("Look", "UngroupedGroupTabPosition", 0);
auto groups = GroupManager::instance()->items().toList();
qStableSort(groups.begin(), groups.end(), [](const Group &a, const Group &b){ return a.tabPosition() < b.tabPosition(); });
......
......@@ -56,7 +56,7 @@ KaduTreeView::~KaduTreeView()
void KaduTreeView::configurationUpdated()
{
bool showExpandingControl = config_file.readBoolEntry("Look", "ShowExpandingControl", false);
bool showExpandingControl = config_file->readBoolEntry("Look", "ShowExpandingControl", false);
if (rootIsDecorated() && !showExpandingControl)
collapseAll();
......@@ -80,7 +80,7 @@ void KaduTreeView::updateBackground()
style.append("QTreeView::branch:has-siblings:!adjoins-item { border-image: none; image: none }");
style.append("QTreeView::branch:has-siblings:adjoins-item { border-image: none; image: none }");
style.append("QTreeView::branch:has-childres:!has-siblings:adjoins-item { border-image: none; image: none }");
if (config_file.readBoolEntry("Look", "AlignUserboxIconsTop"))
if (config_file->readBoolEntry("Look", "AlignUserboxIconsTop"))
{
style.append("QTreeView::branch:has-children:!has-siblings:closed, QTreeView::branch:closed:has-children:has-siblings "
"{ border-image: none; image: url(" + KaduIcon("kadu_icons/stylesheet-branch-closed", "16x16").fullPath() + "); margin-top: 4px; image-position: top }");
......
......@@ -280,7 +280,7 @@ void KaduWebView::saveImage()
QPointer<QFileDialog> fd = new QFileDialog(this);
fd->setFileMode(QFileDialog::AnyFile);
fd->setAcceptMode(QFileDialog::AcceptSave);
fd->setDirectory(config_file.readEntry("Chat", "LastImagePath"));
fd->setDirectory(config_file->readEntry("Chat", "LastImagePath"));
fd->setNameFilter(QString("%1 (*%2)").arg(QCoreApplication::translate("ImageDialog", "Images"), fileExt));
fd->setLabelText(QFileDialog::FileName, imageFullPath.section('/', -1));
fd->setWindowTitle(tr("Save image"));
......@@ -334,7 +334,7 @@ void KaduWebView::saveImage()
}
}
config_file.writeEntry("Chat", "LastImagePath", fd->directory().absolutePath());
config_file->writeEntry("Chat", "LastImagePath", fd->directory().absolutePath());
} while (false);
delete fd.data();
......
......@@ -87,12 +87,12 @@ void RosterWidget::createGui()
void RosterWidget::configurationUpdated()
{
QString bgColor = config_file.readColorEntry("Look","UserboxBgColor").name();
QString alternateBgColor = config_file.readColorEntry("Look","UserboxAlternateBgColor").name();
QString bgColor = config_file->readColorEntry("Look","UserboxBgColor").name();
QString alternateBgColor = config_file->readColorEntry("Look","UserboxAlternateBgColor").name();
if (CompositingEnabled && config_file.readBoolEntry("Look", "UserboxTransparency"))
if (CompositingEnabled && config_file->readBoolEntry("Look", "UserboxTransparency"))
{