Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34113576
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
View Options
diff --git a/src/utils/applicationstate.cpp b/src/utils/applicationstate.cpp
index fed0f4005..631ce5622 100644
--- a/src/utils/applicationstate.cpp
+++ b/src/utils/applicationstate.cpp
@@ -1,37 +1,40 @@
/*
This file is part of Kleopatra, the KDE keymanager
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config-kleopatra.h>
#include "applicationstate.h"
#include <KConfigGroup>
#include <KSharedConfig>
#include <QFileInfo>
#include <QStandardPaths>
QString ApplicationState::lastUsedExportDirectory()
{
QString ret;
const KConfigGroup stateConfig{KSharedConfig::openStateConfig(), QLatin1StringView("Export")};
ret = stateConfig.readEntry("LastDirectory");
if (ret.isEmpty()) {
// try the normal config for backward compatibility
const KConfigGroup config{KSharedConfig::openConfig(), QLatin1StringView("ExportDialog")};
ret = config.readEntry("LastDirectory");
}
return ret.isEmpty() ? QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) : ret;
}
void ApplicationState::setLastUsedExportDirectory(const QString &path)
{
+ if (path.isEmpty()) {
+ return;
+ }
const QFileInfo fi{path};
KConfigGroup stateConfig{KSharedConfig::openStateConfig(), QLatin1StringView("Export")};
stateConfig.writeEntry("LastDirectory", fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath());
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Dec 5, 6:21 PM (1 d, 20 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b7/1d/c743d696ffe24b1037bd45483cfd
Attached To
rKLEOPATRA Kleopatra
Event Timeline
Log In to Comment