DisposeWatch: Make private and constify members
This commit is contained in:
parent
194f70c48c
commit
d128375d62
|
@ -42,15 +42,7 @@ struct DisposeWatch
|
|||
{
|
||||
typedef void (C::*NotifyFun)();
|
||||
|
||||
/* The object owning the prop (and this helper) */
|
||||
C *owner;
|
||||
/* Optional notify method */
|
||||
const NotifyFun notify;
|
||||
/* Location of the prop pointer inside the owner */
|
||||
P *&propLocation;
|
||||
sigc::connection dispCon;
|
||||
|
||||
DisposeWatch(C *owner, P *&propLocation, NotifyFun notify = 0)
|
||||
DisposeWatch(C &owner, P *&propLocation, NotifyFun notify = 0)
|
||||
: owner(owner),
|
||||
notify(notify),
|
||||
propLocation(propLocation)
|
||||
|
@ -74,13 +66,21 @@ struct DisposeWatch
|
|||
}
|
||||
|
||||
private:
|
||||
/* The object owning the prop (and this helper) */
|
||||
C &owner;
|
||||
/* Optional notify method */
|
||||
const NotifyFun notify;
|
||||
/* Location of the prop pointer inside the owner */
|
||||
P * &propLocation;
|
||||
sigc::connection dispCon;
|
||||
|
||||
void onDisposed()
|
||||
{
|
||||
dispCon.disconnect();
|
||||
propLocation = 0;
|
||||
|
||||
if (notify)
|
||||
(owner->*notify)();
|
||||
(owner.*notify)();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ struct PlanePrivate
|
|||
|
||||
PlanePrivate()
|
||||
: bitmap(0),
|
||||
bitmapWatch(this, bitmap),
|
||||
bitmapWatch(*this, bitmap),
|
||||
opacity(255),
|
||||
blendType(BlendNormal),
|
||||
color(&tmp.color),
|
||||
|
|
|
@ -89,7 +89,7 @@ struct SpritePrivate
|
|||
|
||||
SpritePrivate()
|
||||
: bitmap(0),
|
||||
bitmapWatch(this, bitmap),
|
||||
bitmapWatch(*this, bitmap),
|
||||
srcRect(&tmp.rect),
|
||||
mirrored(false),
|
||||
bushDepth(0),
|
||||
|
|
|
@ -355,7 +355,7 @@ struct TilemapPrivate
|
|||
TilemapPrivate(Viewport *viewport)
|
||||
: viewport(viewport),
|
||||
tileset(0),
|
||||
tilesetWatch(this, tileset),
|
||||
tilesetWatch(*this, tileset),
|
||||
mapData(0),
|
||||
flashData(0),
|
||||
priorities(0),
|
||||
|
|
|
@ -250,9 +250,9 @@ struct WindowPrivate
|
|||
|
||||
WindowPrivate(Viewport *viewport = 0)
|
||||
: windowskin(0),
|
||||
windowskinWatch(this, windowskin),
|
||||
windowskinWatch(*this, windowskin),
|
||||
contents(0),
|
||||
contentsWatch(this, contents, &WindowPrivate::markControlVertDirty),
|
||||
contentsWatch(*this, contents, &WindowPrivate::markControlVertDirty),
|
||||
bgStretch(true),
|
||||
cursorRect(&tmp.rect),
|
||||
active(true),
|
||||
|
|
Loading…
Reference in New Issue