mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
commit
4d7997b2ce
@ -139,7 +139,7 @@ public:
|
|||||||
if(!convertRefPointerToTabEntry(ref,entry,source_id) || entry >= mDownloads.size() || source_id > -1)
|
if(!convertRefPointerToTabEntry(ref,entry,source_id) || entry >= mDownloads.size() || source_id > -1)
|
||||||
return false ;
|
return false ;
|
||||||
|
|
||||||
return !mDownloads[entry].peers.empty(); // costly
|
return !mDownloads[entry].peers.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const
|
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const
|
||||||
@ -242,12 +242,12 @@ public:
|
|||||||
int source_id=0 ;
|
int source_id=0 ;
|
||||||
|
|
||||||
if(!ref)
|
if(!ref)
|
||||||
return false ;
|
return QVariant() ;
|
||||||
|
|
||||||
if(!convertRefPointerToTabEntry(ref,entry,source_id) || entry >= mDownloads.size())
|
if(!convertRefPointerToTabEntry(ref,entry,source_id) || entry >= mDownloads.size())
|
||||||
{
|
{
|
||||||
std::cerr << "Bad pointer: " << (void*)ref << std::endl;
|
std::cerr << "Bad pointer: " << (void*)ref << std::endl;
|
||||||
return false ;
|
return QVariant() ;
|
||||||
}
|
}
|
||||||
|
|
||||||
const FileInfo& finfo(mDownloads[entry]) ;
|
const FileInfo& finfo(mDownloads[entry]) ;
|
||||||
@ -549,13 +549,13 @@ public:
|
|||||||
|
|
||||||
if(old_size < mDownloads.size())
|
if(old_size < mDownloads.size())
|
||||||
{
|
{
|
||||||
beginInsertRows(QModelIndex(), old_size, mDownloads.size());
|
beginInsertRows(QModelIndex(), old_size, mDownloads.size()-1);
|
||||||
insertRows(old_size, mDownloads.size() - old_size);
|
insertRows(old_size, mDownloads.size() - old_size);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
}
|
}
|
||||||
else if(mDownloads.size() < old_size)
|
else if(mDownloads.size() < old_size)
|
||||||
{
|
{
|
||||||
beginRemoveRows(QModelIndex(), mDownloads.size(), old_size);
|
beginRemoveRows(QModelIndex(), mDownloads.size(), old_size-1);
|
||||||
removeRows(old_size, old_size - mDownloads.size());
|
removeRows(old_size, old_size - mDownloads.size());
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
@ -572,7 +572,7 @@ public:
|
|||||||
|
|
||||||
// endResetModel();
|
// endResetModel();
|
||||||
|
|
||||||
QModelIndex topLeft = createIndex(0,0), bottomRight = createIndex(mDownloads.size(), COLUMN_COUNT-1);
|
QModelIndex topLeft = createIndex(0,0), bottomRight = createIndex(mDownloads.size()-1, COLUMN_COUNT-1);
|
||||||
emit dataChanged(topLeft, bottomRight);
|
emit dataChanged(topLeft, bottomRight);
|
||||||
|
|
||||||
//shit code follow (rewrite this please)
|
//shit code follow (rewrite this please)
|
||||||
|
Loading…
Reference in New Issue
Block a user