Added to sort by Age when one day, one week or one month is selected

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4215 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2011-05-21 18:34:34 +00:00
parent a748f88686
commit 0429baf807
2 changed files with 16 additions and 3 deletions

View File

@ -325,6 +325,8 @@ QVariant TreeStyle_RDM::displayRole(const DirDetails& details,int coln) const
return QString::fromUtf8(details.name.c_str());
case 1:
return QString() ;
case 2:
return misc::userFriendlyDuration(details.min_age);
default:
return QString() ;
}
@ -433,6 +435,8 @@ QVariant TreeStyle_RDM::sortRole(const QModelIndex& index,const DirDetails& deta
return QString::fromUtf8(details.name.c_str());
case 1:
return QString();
case 2:
return details.min_age;
default:
return QString();
}

View File

@ -907,10 +907,19 @@ void SharedFilesDialog::indicatorChanged(int index)
model->changeAgeIndicator(correct_indicator[index]);
localModel->changeAgeIndicator(correct_indicator[index]);
ui.remoteDirTreeView->update(ui.remoteDirTreeView->rootIndex());
ui.localDirTreeView->update(ui.localDirTreeView->rootIndex()) ;
ui.remoteDirTreeView->update(ui.remoteDirTreeView->rootIndex());
ui.localDirTreeView->update(ui.localDirTreeView->rootIndex()) ;
if (correct_indicator[index] != IND_ALWAYS)
{
ui.remoteDirTreeView->sortByColumn(2, Qt::AscendingOrder);
}
else
{
ui.remoteDirTreeView->sortByColumn(0, Qt::AscendingOrder);
}
updateDisplay() ;
updateDisplay() ;
}
void SharedFilesDialog::filterRegExpChanged()