Thanks GargoyleMT and Farcry for the advice. I've created this patch, which seems to work fine.
Code: Select all
diff -urdN dcpp orig/windows/HubFrame.cpp dcpp new/windows/HubFrame.cpp
--- dcpp orig/windows/HubFrame.cpp Tue Nov 29 15:08:21 2005
+++ dcpp new/windows/HubFrame.cpp Fri Dec 2 17:40:39 2005
@@ -351,12 +351,12 @@
if(i == userMap.end()) {
UserInfo* ui = new UserInfo(u);
userMap.insert(make_pair(u.user, ui));
- if(!ui->getHidden() && showUsers)
+ if(!ui->getIdentity().isHidden() && showUsers)
ctrlUsers.insertItem(ui, getImage(u.identity));
return true;
} else {
UserInfo* ui = i->second;
- if(!ui->getHidden() && u.identity.isHidden() && showUsers) {
+ if(!ui->getIdentity().isHidden() && u.identity.isHidden() && showUsers) {
ctrlUsers.deleteItem(ui);
}
@@ -377,7 +377,7 @@
dcassert(i != userMap.end());
UserInfo* ui = i->second;
- if(!ui->getHidden() && showUsers)
+ if(!ui->getIdentity().isHidden() && showUsers)
ctrlUsers.deleteItem(ui);
userMap.erase(i);
@@ -385,7 +385,7 @@
}
bool HubFrame::UserInfo::update(const Identity& identity, int sortCol) {
- bool needsSort = (op != identity.isOp());
+ bool needsSort = (getIdentity().isOp() != identity.isOp());
tstring old;
if(sortCol != -1)
old = columns[sortCol];
@@ -397,9 +397,6 @@
/// @todo columns[COLUMN_CONNECTION] = Text::toT(i->getConnection());
columns[COLUMN_EMAIL] = Text::toT(identity.getEmail());
- op = identity.isOp();
- hidden = identity.isHidden();
-
if(sortCol != -1) {
needsSort = needsSort || (old != columns[sortCol]);
}
@@ -996,7 +993,7 @@
for(UserMapIter i = userMap.begin(); i != userMap.end(); ++i) {
UserInfo* ui = i->second;
- if(!ui->getHidden())
+ if(!ui->getIdentity().isHidden())
ctrlUsers.insertItem(ui, getImage(ui->getIdentity()));
}
diff -urdN dcpp orig/windows/HubFrame.h dcpp new/windows/HubFrame.h
--- dcpp orig/windows/HubFrame.h Tue Nov 29 15:08:22 2005
+++ dcpp new/windows/HubFrame.h Fri Dec 2 17:01:30 2005
@@ -193,7 +193,7 @@
friend struct CompareItems;
class UserInfo : public UserInfoBase, public FastAlloc<UserInfo> {
public:
- UserInfo(const UpdateInfo& u) : UserInfoBase(u.user), op(false), hidden(false) {
+ UserInfo(const UpdateInfo& u) : UserInfoBase(u.user) {
update(u.identity, -1);
};
@@ -203,9 +203,9 @@
static int compareItems(const UserInfo* a, const UserInfo* b, int col) {
if(col == COLUMN_NICK) {
- if(a->getOp() && !b->getOp()) {
+ if(a->getIdentity().isOp() && !b->getIdentity().isOp()) {
return -1;
- } else if(!a->getOp() && b->getOp()) {
+ } else if(!a->getIdentity().isOp() && b->getIdentity().isOp()) {
return 1;
}
}
@@ -219,8 +219,6 @@
tstring columns[COLUMN_LAST];
GETSET(Identity, identity, Identity);
- GETSET(bool, op, Op);
- GETSET(bool, hidden, Hidden);
};
class PMInfo {
If this looks right i'll enter into Bugzilla.
I am also assuming that
Code: Select all
op = identity.isOp();
hidden = identity.isHidden();
is no longer needed, as this should be done a few lines lower, with existing