Treat the "open parent" link click more like the right-click menu entry for open parent. The latter is still different because it opens the enclosing document, not necessarily a folder if the doc result is embedded. But they now behave the same if the parent is a folder

This commit is contained in:
Jean-Francois Dockes 2014-07-19 15:31:03 +02:00
parent 73f15d134b
commit c11453fc27
4 changed files with 12 additions and 9 deletions

View File

@ -885,10 +885,8 @@ void ResList::linkWasClicked(const QUrl &url)
LOGERR(("ResList::linkWasClicked: can't get doc for %d\n", i));
return;
}
Rcl::Doc pdoc;
pdoc.url = url_parentfolder(doc.url);
pdoc.mimetype = "inode/directory";
emit editRequested(pdoc);
emit editRequested(ResultPopup::getParent(RefCntr<DocSequence>(),
doc));
}
break;

View File

@ -120,7 +120,7 @@ Rcl::Doc getParent(RefCntr<DocSequence> source, Rcl::Doc& doc)
if (source.isNull() || !source->getEnclosing(doc, pdoc)) {
// No parent doc: show enclosing folder with app configured for
// directories
pdoc.url = path_getfather(doc.url);
pdoc.url = url_parentfolder(doc.url);
pdoc.meta[Rcl::Doc::keychildurl] = doc.url;
pdoc.meta[Rcl::Doc::keyapptg] = "parentopen";
pdoc.mimetype = "inode/directory";

View File

@ -767,10 +767,8 @@ void ResTable::linkWasClicked(const QUrl &url)
// Open parent folder
case 'F':
{
Rcl::Doc pdoc;
pdoc.url = url_parentfolder(m_detaildoc.url);
pdoc.mimetype = "inode/directory";
emit editRequested(pdoc);
emit editRequested(ResultPopup::getParent(RefCntr<DocSequence>(),
m_detaildoc));
}
break;

View File

@ -179,7 +179,14 @@ void ResListPager::displayDoc(RclConfig *config, int i, Rcl::Doc& doc,
titleOrFilename = utf8fn;
}
// Url for the parent directory. We strip the file:// part for local
// paths
string parenturl = url_parentfolder(url);
{
string localpath = fileurltolocalpath(parenturl);
if (!localpath.empty())
parenturl = localpath;
}
// Result number
char numbuf[20];