Optimized some small things in TransferDialog and SearchDialog.

Changed the parameter of the constructor of ftFileCreator and ftFileProvider and some methods of ftTransferModule from "std::string" to "const std::string&"

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4045 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-02-20 00:59:47 +00:00
parent 61b57ede65
commit db19db7e60
8 changed files with 40 additions and 33 deletions

View file

@ -923,13 +923,15 @@ void TransfersDialog::insertTransfers()
//first clean the model in case some files are not download anymore
//remove items that are not fiends anymore
int removeIndex = 0;
while (removeIndex < DLListModel->rowCount())
int rowCount = DLListModel->rowCount();
while (removeIndex < rowCount)
{
std::string hash = DLListModel->item(removeIndex, ID)->data(Qt::DisplayRole).toString().toStdString();
if(used_hashes.find(hash) == used_hashes.end())
if(used_hashes.find(hash) == used_hashes.end()) {
QListDelete (DLListModel->takeRow(removeIndex));
else
rowCount = DLListModel->rowCount();
} else
removeIndex++;
}
@ -1017,14 +1019,16 @@ void TransfersDialog::insertTransfers()
//first clean the model in case some files are not download anymore
//remove items that are not fiends anymore
removeIndex = 0;
while (removeIndex < ULListModel->rowCount())
rowCount = ULListModel->rowCount();
while (removeIndex < rowCount)
{
std::string hash = ULListModel->item(removeIndex, UHASH)->data(Qt::EditRole).toString().toStdString();
std::string peer = ULListModel->item(removeIndex, UUSERID)->data(Qt::EditRole).toString().toStdString();
if(used_hashes.find(hash + peer) == used_hashes.end())
if(used_hashes.find(hash + peer) == used_hashes.end()) {
QListDelete (ULListModel->takeRow(removeIndex));
else
rowCount = ULListModel->rowCount();
} else
removeIndex++;
}