Fixed calculation of the right QModelIndex for context menu. Indroduced with QSortFilterProxyModel.

Removed unnecessary calls to the librs in RemoveDirModel.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3708 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-10-28 17:26:00 +00:00
parent 741948acff
commit 162a949092
2 changed files with 48 additions and 97 deletions

View file

@ -693,10 +693,12 @@ void SharedFilesDialog::postModDirectories(bool update_local)
void SharedFilesDialog::sharedDirTreeWidgetContextMenu( QPoint point )
{
//=== at this moment we'll show menu only for files, not for folders
QModelIndex midx = ui.localDirTreeView->indexAt(point);
//if (localModel->isDir( midx ) )
// return;
QModelIndex idx = ui.localDirTreeView->indexAt(point);
if (!idx.isValid())
return;
QModelIndex midx = localProxyModel->mapToSource(idx);
if (!midx.isValid())
return;
currentFile = localModel->data(midx, RemoteDirModel::FileNameRole).toString();
QMenu contextMnu2( this );