aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/recent_files.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/recent_files.cpp b/src/recent_files.cpp
index 2382f1a..57ecb6c 100644
--- a/src/recent_files.cpp
+++ b/src/recent_files.cpp
@@ -1,5 +1,6 @@
#include "recent_files.h"
#include <QFileInfo>
+#include <QDir>
RecentFiles::RecentFiles(unsigned int size, bool force_empty) : size(size) {
if (not force_empty)
@@ -28,7 +29,13 @@ void RecentFiles::generate_menu_actions() {
if (not list.isEmpty()) {
int i = 1;
for (const QString& path : list) {
- Action* action = new Action(QStringLiteral("&%1. %2").arg(i++).arg(QFileInfo(path).fileName()));
+ QFileInfo file(path);
+
+ // Showing the parent directory's name allows knowing from which archive the file comes from
+ Action* action = new Action(QStringLiteral("&%1. %2").arg(i++).arg(
+ file.dir().dirName() + QStringLiteral("/") + file.fileName()
+ ));
+
action->file_path = path;
menu->addAction(action);
}