mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
if file in friends file list is available locally or is being downloaded, then show it in red like in search.
The color is hardcoded, because it is not possible to style arbitrary QObjects with stylesheets. closes #195
This commit is contained in:
parent
9f4256cd00
commit
a118870db9
@ -533,6 +533,20 @@ QVariant RetroshareDirModel::data(const QModelIndex &index, int role) const
|
||||
{
|
||||
if(details->min_age > ageIndicator)
|
||||
return QVariant(QColor(Qt::gray)) ;
|
||||
else if(RemoteMode)
|
||||
{
|
||||
FileInfo info;
|
||||
QVariant local_file_color = QVariant(QColor(Qt::red));
|
||||
if(rsFiles->alreadyHaveFile(details->hash, info))
|
||||
return local_file_color;
|
||||
|
||||
std::list<RsFileHash> downloads;
|
||||
rsFiles->FileDownloads(downloads);
|
||||
if(std::find(downloads.begin(), downloads.end(), details->hash) != downloads.end())
|
||||
return local_file_color;
|
||||
else
|
||||
return QVariant();
|
||||
}
|
||||
else
|
||||
return QVariant() ; // standard
|
||||
} /* end of TextColorRole */
|
||||
|
Loading…
x
Reference in New Issue
Block a user