Fix in context menu
This commit is contained in:
@@ -76,22 +76,25 @@ void Filetree::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
if(info.isDir())
|
if(info.isDir())
|
||||||
{
|
{
|
||||||
open = menu.addAction(tr("Open"));
|
open = menu.addAction(tr("Open"));
|
||||||
setRoot = menu.addAction("Set as root");
|
setRoot = menu.addAction(tr("Set as root"));
|
||||||
copy = menu.addAction(tr("Copy marked files"));
|
copy = menu.addAction(tr("Copy marked files"));
|
||||||
move = menu.addAction(tr("Move marked files"));
|
move = menu.addAction(tr("Move marked files"));
|
||||||
indexDir = menu.addAction(tr("Index directory"));
|
indexDir = menu.addAction(tr("Index directory"));
|
||||||
}
|
}
|
||||||
menu.addSeparator();
|
menu.addSeparator();
|
||||||
|
|
||||||
QAction *resetRoot = menu.addAction("Reset root");
|
QAction *resetRoot = menu.addAction(tr("Reset root"));
|
||||||
QAction *goUp = menu.addAction("Go up");
|
QAction *goUp = menu.addAction(tr("Go up"));
|
||||||
|
|
||||||
QAction *a = menu.exec(event->globalPos());
|
QAction *a = menu.exec(event->globalPos());
|
||||||
|
if(a == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
if(a == open)
|
if(a == open)
|
||||||
{
|
{
|
||||||
emit fileSelected(m_fileSystemModel->filePath(index));
|
emit fileSelected(m_fileSystemModel->filePath(index));
|
||||||
}
|
}
|
||||||
if(a == setRoot && index.isValid())
|
else if(a == setRoot && index.isValid())
|
||||||
{
|
{
|
||||||
setRootIndex(index);
|
setRootIndex(index);
|
||||||
m_rootDir = m_fileSystemModel->filePath(index);
|
m_rootDir = m_fileSystemModel->filePath(index);
|
||||||
|
|||||||
Reference in New Issue
Block a user