Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Kleopatra
Commits
0479937b
Commit
0479937b
authored
Aug 05, 2022
by
Ingo Klöcker
Browse files
Store the full path if path references a directory
GnuPG-bug-id: 6121
parent
47e4f93d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/utils/applicationstate.cpp
View file @
0479937b
...
...
@@ -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
());
}
src/utils/applicationstate.h
View file @
0479937b
...
...
@@ -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
);
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment