diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-04 03:20:20 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-04 03:33:23 -0500 |
| commit | 2f3b9f9a9eaa876cac1c12fe6756dc24cd709a20 (patch) | |
| tree | a6979ad20925079273c1d9983043014008f74bc1 /src/filetree.cpp | |
| parent | d14488d2f750a52f85519ca15d087f35332a784f (diff) | |
skip files from archives for the shell menu
Diffstat (limited to 'src/filetree.cpp')
| -rw-r--r-- | src/filetree.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/filetree.cpp b/src/filetree.cpp index 41b10586..5831e75e 100644 --- a/src/filetree.cpp +++ b/src/filetree.cpp @@ -491,7 +491,7 @@ bool FileTree::showShellMenu(QPoint pos) // menus by origin std::map<int, env::ShellMenu> menus; int totalFiles = 0; - bool hasDirectory = false; + bool warnOnEmpty = true; for (auto&& index : m_tree->selectionModel()->selectedRows()) { auto* item = m_model->itemFromIndex(index); @@ -500,7 +500,7 @@ bool FileTree::showShellMenu(QPoint pos) } if (item->isDirectory()) { - hasDirectory = true; + warnOnEmpty = false; log::warn( "directories do not have shell menus; '{}' selected", @@ -509,6 +509,16 @@ bool FileTree::showShellMenu(QPoint pos) continue; } + if (item->isFromArchive()) { + warnOnEmpty = false; + + log::warn( + "files from archives do not have shell menus; '{}' selected", + item->filename()); + + continue; + } + auto itor = menus.find(item->originID()); if (itor == menus.end()) { itor = menus.emplace(item->originID(), mw).first; @@ -557,9 +567,9 @@ bool FileTree::showShellMenu(QPoint pos) } if (menus.empty()) { - // don't warn if a directory was selected, a warning has already been - // logged above - if (!hasDirectory) { + // don't warn if something that doesn't have a shell menu was selected, a + // warning has already been logged above + if (warnOnEmpty) { log::warn("no menus to show"); } |
