fix: new text file visible
This commit is contained in:
parent
3ba1d05073
commit
9315be222a
1 changed files with 8 additions and 4 deletions
|
@ -1249,6 +1249,7 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
|
|||
updateActions();
|
||||
|
||||
const QModelIndexList indexes = m_selectionModel->selectedIndexes();
|
||||
const bool isTrash = (resolvedUrl().scheme() == QLatin1String("trash"));
|
||||
QMenu *menu = new QMenu;
|
||||
|
||||
// Open folder menu.
|
||||
|
@ -1256,11 +1257,14 @@ void FolderModel::openContextMenu(QQuickItem *visualParent, Qt::KeyboardModifier
|
|||
QAction *selectAll = new QAction(tr("Select All"), this);
|
||||
connect(selectAll, &QAction::triggered, this, &FolderModel::selectAll);
|
||||
|
||||
menu->addAction(m_actionCollection.action("newFolder"));
|
||||
|
||||
if (!isTrash) {
|
||||
QMenu *newMenu = new QMenu(tr("New Documents"));
|
||||
newMenu->addAction(m_actionCollection.action("newTextFile"));
|
||||
|
||||
menu->addAction(m_actionCollection.action("newFolder"));
|
||||
menu->addMenu(newMenu);
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction(m_actionCollection.action("paste"));
|
||||
menu->addAction(selectAll);
|
||||
|
|
Loading…
Reference in a new issue