Commit 2cbbadb4 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Fix defaulting to last used directory when importing certificates

Use QFileDialog::getOpenFileNames() instead of
Kleo::FileDialog::getOpenFileNames(). The Kleo::FileDialog helpers
expects the ID of a directory and not the path of a directory.
Moreover, those helpers only cache the last used directory transiently
in memory which is of no use for us because we want to store this
information persistently.

GnuPG-bug-id: 5638
parent 1875d6d3
Pipeline #96384 passed with stage
in 14 minutes and 10 seconds
......@@ -12,8 +12,6 @@
#include "importcertificatefromfilecommand.h"
#include "importcertificatescommand_p.h"
#include "utils/filedialog.h"
#include <QGpgME/Protocol>
#include <QGpgME/ImportJob>
......@@ -26,6 +24,7 @@
#include <KConfigGroup>
#include <QFile>
#include <QFileDialog>
#include <QString>
#include <QWidget>
#include <QFileInfo>
......@@ -148,7 +147,7 @@ static QStringList get_file_name(QWidget *parent)
const KConfigGroup group(config, "Import Certificate");
previousDir = group.readPathEntry("last-open-file-directory", QDir::homePath());
}
const QStringList files = Kleo::FileDialog::getOpenFileNames(parent, i18n("Select Certificate File"), previousDir, certificateFilter + QLatin1String(";;") + anyFilesFilter);
const QStringList files = QFileDialog::getOpenFileNames(parent, i18n("Select Certificate File"), previousDir, certificateFilter + QLatin1String(";;") + anyFilesFilter);
if (!files.empty())
if (const KSharedConfig::Ptr config = KSharedConfig::openConfig()) {
KConfigGroup group(config, "Import Certificate");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment