Changed settings to local variable, no more as pointer on all classes.

RshareSettings settings;
settings.value(...);

It should lower memory usage and removes memory leaks.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2886 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-05-11 20:02:52 +00:00
parent 2f8d21ab76
commit 0c46da0dd2
52 changed files with 310 additions and 428 deletions

View file

@ -21,6 +21,7 @@
#include "rsiface/rspeers.h" //for rsPeers variable
#include "rsiface/rsiface.h"
#include "rsharesettings.h"
#include <QtGui>
#include <QClipboard>
@ -39,9 +40,6 @@ ChatPage::ChatPage(QWidget * parent, Qt::WFlags flags)
/* Invoke the Qt Designer generated object setup routine */
ui.setupUi(this);
/* Create RshareSettings object */
_settings = new RshareSettings();
//connect(ui.copykeyButton, SIGNAL(clicked()), this, SLOT(copyPublicKey()));
//connect(ui.saveButton, SIGNAL(clicked()), this, SLOT(fileSaveAs()));
@ -66,11 +64,12 @@ ChatPage::closeEvent (QCloseEvent * event)
bool
ChatPage::save(QString &errmsg)
{
_settings->setValue(QString::fromUtf8("Emoteicons_PrivatChat"), emotePrivatChat());
RshareSettings settings;
settings.setValue(QString::fromUtf8("Emoteicons_PrivatChat"), emotePrivatChat());
_settings->setValue(QString::fromUtf8("Emoteicons_GroupChat"), emoteGroupChat());
settings.setValue(QString::fromUtf8("Emoteicons_GroupChat"), emoteGroupChat());
_settings->setValue(QString::fromUtf8("GroupChat_History"), groupchatHistory());
settings.setValue(QString::fromUtf8("GroupChat_History"), groupchatHistory());
return true;
}
@ -79,12 +78,13 @@ ChatPage::save(QString &errmsg)
void
ChatPage::load()
{
RshareSettings settings;
ui.checkBox_emoteprivchat->setChecked(_settings->value(QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool());
ui.checkBox_emoteprivchat->setChecked(settings.value(QString::fromUtf8("Emoteicons_PrivatChat"), true).toBool());
ui.checkBox_emotegroupchat->setChecked(_settings->value(QString::fromUtf8("Emoteicons_GroupChat"), true).toBool());
ui.checkBox_emotegroupchat->setChecked(settings.value(QString::fromUtf8("Emoteicons_GroupChat"), true).toBool());
ui.checkBox_groupchathistory->setChecked(_settings->value(QString::fromUtf8("GroupChat_History"), true).toBool());
ui.checkBox_groupchathistory->setChecked(settings.value(QString::fromUtf8("GroupChat_History"), true).toBool());
}