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

@ -26,6 +26,7 @@
#include <sstream>
#include "rsiface/rsnotify.h"
#include "rsharesettings.h"
#include <QTimer>
@ -39,9 +40,6 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WFlags flags)
setAttribute(Qt::WA_QuitOnClose, false);
setWindowTitle(windowTitle() + QLatin1String(" - Notify"));
/* Create RshareSettings object */
_settings = new RshareSettings();
//load();
//QTimer *timer = new QTimer(this);
@ -57,7 +55,6 @@ NotifyPage::NotifyPage(QWidget * parent, Qt::WFlags flags)
NotifyPage::~NotifyPage()
{
delete _settings;
}
void
@ -111,9 +108,10 @@ NotifyPage::save(QString &errmsg)
if (ui.chat_Focus->isChecked())
chatflags |= RS_CHAT_FOCUS;
_settings->setNotifyFlags(notifyflags);
_settings->setNewsFeedFlags(newsflags);
_settings->setChatFlags(chatflags);
RshareSettings settings;
settings.setNotifyFlags(notifyflags);
settings.setNewsFeedFlags(newsflags);
settings.setChatFlags(chatflags);
load();
return true;
@ -124,10 +122,11 @@ NotifyPage::save(QString &errmsg)
void NotifyPage::load()
{
/* extract from rsNotify the flags */
RshareSettings settings;
uint notifyflags = _settings->getNotifyFlags();
uint newsflags = _settings->getNewsFeedFlags();
uint chatflags = _settings->getChatFlags();
uint notifyflags = settings.getNotifyFlags();
uint newsflags = settings.getNewsFeedFlags();
uint chatflags = settings.getChatFlags();
ui.popup_Connect->setChecked(notifyflags & RS_POPUP_CONNECT);
ui.popup_NewMsg->setChecked(notifyflags & RS_POPUP_MSG);