mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
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:
parent
2f8d21ab76
commit
0c46da0dd2
52 changed files with 310 additions and 428 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "rsiface/rsdisc.h"
|
||||
#include "rsiface/rsiface.h"
|
||||
#include "settings/rsharesettings.h"
|
||||
|
||||
#include <QtGui/QHBoxLayout>
|
||||
#include <QtGui/QPainter>
|
||||
|
@ -355,9 +356,6 @@ void AWidget::drawWater(QRgb* srcImage,QRgb* dstImage) {
|
|||
TBoard::TBoard(QWidget *parent) {
|
||||
Q_UNUSED(parent);
|
||||
|
||||
/* Create RshareSettings object */
|
||||
_settings = new RshareSettings();
|
||||
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
isStarted = false;
|
||||
isPaused = false;
|
||||
|
@ -365,13 +363,16 @@ TBoard::TBoard(QWidget *parent) {
|
|||
nextPiece.setRandomShape();
|
||||
score = 0;
|
||||
level = 0;
|
||||
maxScore = _settings->value("/about/maxsc").toInt();
|
||||
|
||||
RshareSettings settings;
|
||||
maxScore = settings.value("/about/maxsc").toInt();
|
||||
}
|
||||
TBoard::~TBoard() {
|
||||
int oldMax = _settings->value("/about/maxsc").toInt();
|
||||
RshareSettings settings;
|
||||
int oldMax = settings.value("/about/maxsc").toInt();
|
||||
int newMax = qMax(maxScore, score);
|
||||
if (oldMax < newMax) {
|
||||
_settings->setValue("/about/maxsc", newMax);
|
||||
settings.setValue("/about/maxsc", newMax);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue