Commit 0479937b authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Store the full path if path references a directory

GnuPG-bug-id: 6121
parent 47e4f93d
......@@ -32,6 +32,7 @@ QString ApplicationState::lastUsedExportDirectory()
void ApplicationState::setLastUsedExportDirectory(const QString &path)
{
const QFileInfo fi{path};
KConfigGroup stateConfig{KSharedConfig::openStateConfig(), "Export"};
stateConfig.writeEntry("LastDirectory", QFileInfo{path}.absolutePath());
stateConfig.writeEntry("LastDirectory", fi.isDir() ? fi.absoluteFilePath() : fi.absolutePath());
}
......@@ -14,8 +14,16 @@ class QString;
namespace ApplicationState
{
/**
* Reads the last used export directory from the application state config file.
*/
QString lastUsedExportDirectory();
/**
* Writes the last used export directory to the application state config file.
* If \p path references a file, then the file name is stripped. The path is
* written as absolute path.
*/
void setLastUsedExportDirectory(const QString &path);
};
Supports Markdown
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