Skip to content

Commit

Permalink
Debug|libdeng2|RuleRectangle: Debug name for RuleRectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 20, 2013
1 parent ab79fb6 commit c4a712b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doomsday/libdeng2/include/de/widgets/rulerectangle.h
Expand Up @@ -100,6 +100,8 @@ class DENG2_PUBLIC RuleRectangle
*/
Rectanglei recti() const;

void setDebugName(String const &name);

String description() const;

private:
Expand Down
11 changes: 10 additions & 1 deletion doomsday/libdeng2/src/widgets/rulerectangle.cpp
Expand Up @@ -28,6 +28,8 @@ DENG2_PIMPL(RuleRectangle),
DENG2_OBSERVES(Clock, TimeChange),
public DelegateRule::ISource
{
String debugName;

// Internal identifiers for the output rules.
enum OutputIds
{
Expand Down Expand Up @@ -63,6 +65,8 @@ public DelegateRule::ISource
{
outputRules[i] = new DelegateRule(*this, i);
}

debugName = QString("0x%1").arg(dintptr(thisPublic), 0, 16);
}

~Instance()
Expand Down Expand Up @@ -461,9 +465,14 @@ Rectanglei RuleRectangle::recti() const
Vector2i(de::floor(r.bottomRight.x), de::floor(r.bottomRight.y)));
}

void RuleRectangle::setDebugName(String const &name)
{
d->debugName = name;
}

String RuleRectangle::description() const
{
String desc = String("RuleRectangle 0x%1:").arg(dintptr(this), 0, 16);
String desc = QString("RuleRectangle '%1'").arg(d->debugName);

for(int i = 0; i < int(Rule::MAX_SEMANTICS); ++i)
{
Expand Down

0 comments on commit c4a712b

Please sign in to comment.