linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #05159
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 2793: "Get file list" now defaults to partial file lists
------------------------------------------------------------
revno: 2793
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Sat 2012-01-07 19:16:19 +0100
message:
"Get file list" now defaults to partial file lists
modified:
changelog.txt
help/commands_user_general.inc
win32/QueueFrame.cpp
win32/QueueFrame.h
win32/UserInfoBase.cpp
win32/UserInfoBase.h
win32/WinUtil.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 'changelog.txt'
--- changelog.txt 2012-01-07 18:05:09 +0000
+++ changelog.txt 2012-01-07 18:16:19 +0000
@@ -1,7 +1,8 @@
* Save and restore partial file lists (poy)
* Apply ADL searches in partial file lists (poy)
-* [ADC] Heuristics to send additional levels of info in partial file lists (poy)
+* Heuristics to send additional levels of info in partial file lists (poy)
* Add a "Download full list" button in the file list toolbar (poy)
+* "Get file list" now defaults to partial file lists (poy)
-- 0.790 2011-12-29 --
* Fav users frame becomes users frame and shows all users
=== modified file 'help/commands_user_general.inc'
--- help/commands_user_general.inc 2011-12-11 14:45:53 +0000
+++ help/commands_user_general.inc 2012-01-07 18:16:19 +0000
@@ -1,9 +1,6 @@
<dl style="margin-left: 40px;">
<dt>Get file list</dt>
<dd>Download the file list of the selected users.</dd>
- <dt>Browse file list</dt>
- <dd>Download only the required pieces of the file lists of the selected users.
- Only available in ADC hubs.</dd>
<dt>Match queue</dt>
<dd>Matches the files in your download queue to the file lists of the selected
users. 2 files are considered to be the same if their TTH is the same. If matches are found in one user's file list,
=== modified file 'win32/QueueFrame.cpp'
--- win32/QueueFrame.cpp 2011-12-27 14:29:30 +0000
+++ win32/QueueFrame.cpp 2012-01-07 18:16:19 +0000
@@ -658,8 +658,7 @@
}
}
-void QueueFrame::handleBrowseList(const HintedUser& user) {
-
+void QueueFrame::handleGetList(const HintedUser& user) {
if(files->countSelected() == 1) {
try {
QueueManager::getInstance()->addList(user, QueueItem::FLAG_CLIENT_VIEW);
@@ -886,7 +885,7 @@
void QueueFrame::addBrowseMenu(const MenuPtr& parent, QueueItemInfo* qii) {
unsigned int pos = parent->getCount();
MenuPtr menu = parent->appendPopup(T_("&Get file list"));
- if(!addUsers(menu, &QueueFrame::handleBrowseList, qii->getSources(), false))
+ if(!addUsers(menu, &QueueFrame::handleGetList, qii->getSources(), false))
parent->setItemEnabled(pos, false);
}
=== modified file 'win32/QueueFrame.h'
--- win32/QueueFrame.h 2011-12-26 16:12:50 +0000
+++ win32/QueueFrame.h 2012-01-07 18:16:19 +0000
@@ -269,7 +269,7 @@
void handlePM(const HintedUser& user);
void handleRemoveSource(const HintedUser& user);
void handleRemoveSources(const HintedUser& user);
- void handleBrowseList(const HintedUser& user);
+ void handleGetList(const HintedUser& user);
void handleReadd(const HintedUser& user);
bool handleKeyDownFiles(int c);
bool handleKeyDownDirs(int c);
=== modified file 'win32/UserInfoBase.cpp'
--- win32/UserInfoBase.cpp 2011-12-14 19:07:55 +0000
+++ win32/UserInfoBase.cpp 2012-01-07 18:16:19 +0000
@@ -42,16 +42,11 @@
}
void UserInfoBase::getList() {
try {
- QueueManager::getInstance()->addList(user, QueueItem::FLAG_CLIENT_VIEW);
- } catch(const Exception& e) {
- LogManager::getInstance()->message(e.getError());
- }
-}
-void UserInfoBase::browseList() {
- if(user.user->getCID().isZero())
- return;
- try {
- QueueManager::getInstance()->addList(user, QueueItem::FLAG_CLIENT_VIEW | QueueItem::FLAG_PARTIAL_LIST);
+ int flags = QueueItem::FLAG_CLIENT_VIEW;
+ if(!user.user->isSet(User::NMDC)) {
+ flags |= QueueItem::FLAG_PARTIAL_LIST;
+ }
+ QueueManager::getInstance()->addList(user, flags);
} catch(const Exception& e) {
LogManager::getInstance()->message(e.getError());
}
=== modified file 'win32/UserInfoBase.h'
--- win32/UserInfoBase.h 2011-12-14 18:25:45 +0000
+++ win32/UserInfoBase.h 2012-01-07 18:16:19 +0000
@@ -38,7 +38,6 @@
UserInfoBase(const HintedUser& u, bool hubSet = false) : user(u), hubSet(hubSet) { }
virtual void getList();
- virtual void browseList();
virtual void matchQueue();
virtual void pm(TabViewPtr);
virtual void grant();
@@ -110,9 +109,6 @@
void handleGetList() {
handleUserFunction([](UserInfoBase* u) { u->getList(); });
}
- void handleBrowseList() {
- handleUserFunction([](UserInfoBase* u) { u->browseList(); });
- }
void handleAddFavorite() {
handleUserFunction([](UserInfoBase* u) { u->addFav(); });
}
@@ -141,8 +137,6 @@
for_each(users, [&](const UserInfoBase* u) { traits.parse(u); });
menu->appendItem(T_("&Get file list"), [this] { this->t().handleGetList(); }, dwt::IconPtr(), true, defaultIsGetList);
- if(traits.isSet(UserTraits::adcOnly))
- menu->appendItem(T_("&Browse file list"), [this] { this->t().handleBrowseList(); });
menu->appendItem(T_("&Match queue"), [this] { this->t().handleMatchQueue(); });
if(includeSendPM)
menu->appendItem(T_("&Send private message"), [this, parent] { this->t().handlePrivateMessage(parent); }, dwt::IconPtr(), true, !defaultIsGetList);
=== modified file 'win32/WinUtil.cpp'
--- win32/WinUtil.cpp 2011-12-23 16:21:08 +0000
+++ win32/WinUtil.cpp 2012-01-07 18:16:19 +0000
@@ -1418,9 +1418,6 @@
return ret;
}
-static bool isAdc(const UserPtr& u) {
- return !u->isSet(User::NMDC);
-}
static bool isFav(const UserPtr& u) {
return !FavoriteManager::getInstance()->isFavoriteUser(u);
}
@@ -1429,10 +1426,11 @@
QueueManager* qm = QueueManager::getInstance();
addUsers(menu, T_("&Get file list"), users, [=](const HintedUser &u, const string& s) {
- qm->addList(u, QueueItem::FLAG_CLIENT_VIEW, s); }, dwt::IconPtr(), dirs);
-
- addUsers(menu, T_("&Browse file list"), filter(users, &isAdc), [=](const HintedUser &u, const string& s) {
- qm->addList(u, QueueItem::FLAG_CLIENT_VIEW | QueueItem::FLAG_PARTIAL_LIST, s); }, dwt::IconPtr(), dirs);
+ int flags = QueueItem::FLAG_CLIENT_VIEW;
+ if(!u.user->isSet(User::NMDC)) {
+ flags |= QueueItem::FLAG_PARTIAL_LIST;
+ }
+ qm->addList(u, flags, s); }, dwt::IconPtr(), dirs);
addUsers(menu, T_("&Match queue"), users, [=](const HintedUser &u, const string& s) {
qm->addList(u, QueueItem::FLAG_MATCH_QUEUE, Util::emptyString); });