aboutsummaryrefslogtreecommitdiff
path: root/src/ToolFactory.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-05-01 14:47:53 (GMT)
committerPavel Labath <pavelo@centrum.sk>2011-05-10 11:00:45 (GMT)
commit4b47675441b76620519b0204497686b09113daaa (patch)
treec3494c61a82b84418761000d5fc7fc5d12188204 /src/ToolFactory.cc
parentfa15400cc24ddcfd6e361bd068ae1986b9f9e561 (diff)
downloadfluxbox-4b47675441b76620519b0204497686b09113daaa.zip
fluxbox-4b47675441b76620519b0204497686b09113daaa.tar.bz2
Make RefCount<> more sensible
the previous version of operator*() made no sense. E.g., it violated the invariant (*ptr).foo <=> ptr->foo. The dereferencing operator now returns a reference to the pointed-to object, rather than a pointer to it. I also added a bool conversion operator, which can be used in testing the NULL-ness of the pointer. Anyone wondering if that could be done in a simpler way is encouraged to read <http://www.artima.com/cppsource/safebool.html>. And, finally, I removed the mutable flag from the m_data member, since it does not need it.
Diffstat (limited to 'src/ToolFactory.cc')
-rw-r--r--src/ToolFactory.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc
index 2645956..d94105d 100644
--- a/src/ToolFactory.cc
+++ b/src/ToolFactory.cc
@@ -92,7 +92,7 @@ ToolbarItem *ToolFactory::create(const std::string &name, const FbTk::FbWindow &
92 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu()); 92 item = new ClockTool(parent, m_clock_theme, screen(), tbar.menu());
93 } else { 93 } else {
94 FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name)); 94 FbTk::RefCount<FbTk::Command<void> > cmd(FbTk::CommandParser<void>::instance().parse(name));
95 if (*cmd == 0) // we need a command 95 if (cmd == 0) // we need a command
96 return 0; 96 return 0;
97 97
98 // TODO maybe direction of arrows should depend on toolbar layout ? 98 // TODO maybe direction of arrows should depend on toolbar layout ?