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