diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-05-01 14:47:53 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-05-10 11:00:45 (GMT) |
commit | 4b47675441b76620519b0204497686b09113daaa (patch) | |
tree | c3494c61a82b84418761000d5fc7fc5d12188204 /src/Remember.cc | |
parent | fa15400cc24ddcfd6e361bd068ae1986b9f9e561 (diff) | |
download | fluxbox_pavel-4b47675441b76620519b0204497686b09113daaa.zip fluxbox_pavel-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/Remember.cc')
-rw-r--r-- | src/Remember.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Remember.cc b/src/Remember.cc index 6dd636f..10aa52c 100644 --- a/src/Remember.cc +++ b/src/Remember.cc | |||
@@ -584,8 +584,8 @@ Application* findMatchingPatterns(ClientPattern *pat, Remember::Patterns *patlis | |||
584 | for (; it != it_end; ++it) { | 584 | for (; it != it_end; ++it) { |
585 | if (*it->first == *pat && is_group == it->second->is_grouped && | 585 | if (*it->first == *pat && is_group == it->second->is_grouped && |
586 | transient == it->second->is_transient && | 586 | transient == it->second->is_transient && |
587 | ((match_pat == 0 && *it->second->group_pattern == 0) || | 587 | ((match_pat == 0 && it->second->group_pattern == 0) || |
588 | (match_pat && *match_pat == **it->second->group_pattern))) { | 588 | (match_pat && *match_pat == *it->second->group_pattern))) { |
589 | 589 | ||
590 | Application *ret = it->second; | 590 | Application *ret = it->second; |
591 | 591 | ||
@@ -887,7 +887,7 @@ void Remember::save() { | |||
887 | grouped_apps.insert(&a); | 887 | grouped_apps.insert(&a); |
888 | // otherwise output this whole group | 888 | // otherwise output this whole group |
889 | apps_file << "[group]"; | 889 | apps_file << "[group]"; |
890 | if (*a.group_pattern) | 890 | if (a.group_pattern) |
891 | apps_file << " " << a.group_pattern->toString(); | 891 | apps_file << " " << a.group_pattern->toString(); |
892 | apps_file << endl; | 892 | apps_file << endl; |
893 | 893 | ||
@@ -1366,7 +1366,7 @@ FluxboxWindow *Remember::findGroup(Application *app, BScreen &screen) { | |||
1366 | for (; it != it_end; ++it) { | 1366 | for (; it != it_end; ++it) { |
1367 | if (it->second == app && it->first->fbwindow() && | 1367 | if (it->second == app && it->first->fbwindow() && |
1368 | &screen == &it->first->screen() && | 1368 | &screen == &it->first->screen() && |
1369 | (!*app->group_pattern || app->group_pattern->match(*it->first))) | 1369 | (!app->group_pattern || app->group_pattern->match(*it->first))) |
1370 | return it->first->fbwindow(); | 1370 | return it->first->fbwindow(); |
1371 | } | 1371 | } |
1372 | 1372 | ||