← Back to team overview

linuxdcpp-team team mailing list archive

[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2601: Ditch CO field from ADC users' identity; Fix Users frame filtering

 

------------------------------------------------------------
revno: 2601
committer: eMTee <emtee11@xxxxxxxxx>
branch nick: dcplusplus
timestamp: Mon 2011-08-22 22:33:02 +0200
message:
  Ditch CO field from ADC users' identity; Fix Users frame filtering
modified:
  dcpp/AdcHub.cpp
  dcpp/NmdcHub.cpp
  dcpp/OnlineUser.h
  dcpp/User.cpp
  win32/UsersFrame.cpp


--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk

Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'dcpp/AdcHub.cpp'
--- dcpp/AdcHub.cpp	2011-08-11 13:02:19 +0000
+++ dcpp/AdcHub.cpp	2011-08-22 20:33:02 +0000
@@ -187,10 +187,6 @@
 		u->getUser()->setFlag(User::TLS);
 	}
 
-	if(!u->getIdentity().get("US").empty()) {
-		u->getIdentity().setConnection(str(F_("%1%/s") % Util::formatBytes(u->getIdentity().get("US"))));
-	}
-
 	if(u->getUser() == getMyIdentity().getUser()) {
 		state = STATE_NORMAL;
 		setAutoReconnect(true);

=== modified file 'dcpp/NmdcHub.cpp'
--- dcpp/NmdcHub.cpp	2011-08-11 13:02:19 +0000
+++ dcpp/NmdcHub.cpp	2011-08-22 20:33:02 +0000
@@ -382,7 +382,7 @@
 
 		u.getIdentity().setHub(false);
 
-		u.getIdentity().setConnection(connection);
+		u.getIdentity().set("CO", connection); 
 		i = j + 1;
 		j = param.find('$', i);
 

=== modified file 'dcpp/OnlineUser.h'
--- dcpp/OnlineUser.h	2011-08-11 13:02:19 +0000
+++ dcpp/OnlineUser.h	2011-08-22 20:33:02 +0000
@@ -70,7 +70,6 @@
 	GS(Udp4Port, "U4")
 	GS(Udp6Port, "U6")
 	GS(Email, "EM")
-	GS(Connection, "CO")
 
 	void setBytesShared(const string& bs) { set("SS", bs); }
 	int64_t getBytesShared() const { return Util::toInt64(get("SS")); }
@@ -81,6 +80,7 @@
 	void setHidden(bool hidden) { set("HI", hidden ? "1" : Util::emptyString); }
 	string getTag() const;
 	string getApplication() const;
+	string getConnection() const;
 	const string& getCountry() const;
 	bool supports(const string& name) const;
 	bool isHub() const { return isClientType(CT_HUB) || isSet("HU"); }

=== modified file 'dcpp/User.cpp'
--- dcpp/User.cpp	2011-08-11 13:02:19 +0000
+++ dcpp/User.cpp	2011-08-22 20:33:02 +0000
@@ -22,6 +22,7 @@
 #include "AdcHub.h"
 #include "FavoriteUser.h"
 #include "StringTokenizer.h"
+#include "format.h"
 
 namespace dcpp {
 
@@ -140,6 +141,13 @@
 	return application + ' ' + version;
 }
 
+string Identity::getConnection() const {
+	if(!get("US").empty())
+		return str(F_("%1%/s") % Util::formatBytes(get("US")));
+
+	return get("CO");
+}
+
 const string& Identity::getCountry() const {
 	return Util::getIpCountry(getIp());
 }

=== modified file 'win32/UsersFrame.cpp'
--- win32/UsersFrame.cpp	2011-08-20 17:56:47 +0000
+++ win32/UsersFrame.cpp	2011-08-22 20:33:02 +0000
@@ -70,7 +70,7 @@
 }
 
 static tstring formatSpeed(const string& val) {
-	return Text::toT(Util::formatBytes(val) + "/s");
+	return Text::toT(str(F_("%1%/s") % Util::formatBytes(val)));
 }
 
 static const FieldName fields[] =
@@ -514,11 +514,11 @@
 		return false;
 	}
 
-	if(showWaiting->getChecked() && isWaiting(u)) {
+	if(showWaiting->getChecked() && !isWaiting(u)) {
 		return false;
 	}
 
-	if(showQueue->getChecked() && hasDownload(u)) {
+	if(showQueue->getChecked() && !hasDownload(u)) {
 		return false;
 	}