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
47e4f93d
Commit
47e4f93d
authored
Aug 05, 2022
by
Ingo Klöcker
Browse files
Store last used export directory in state config
and change its config group to the more general "Export". GnuPG-bug-id: 6121
parent
9994a362
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/utils/applicationstate.cpp
View file @
47e4f93d
...
...
@@ -19,12 +19,19 @@
QString
ApplicationState
::
lastUsedExportDirectory
()
{
const
KConfigGroup
config
{
KSharedConfig
::
openConfig
(),
"ExportDialog"
};
return
config
.
readEntry
(
"LastDirectory"
,
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
));
QString
ret
;
const
KConfigGroup
stateConfig
{
KSharedConfig
::
openStateConfig
(),
"Export"
};
ret
=
stateConfig
.
readEntry
(
"LastDirectory"
);
if
(
ret
.
isEmpty
())
{
// try the normal config for backward compatibility
const
KConfigGroup
config
{
KSharedConfig
::
openConfig
(),
"ExportDialog"
};
ret
=
config
.
readEntry
(
"LastDirectory"
);
}
return
ret
.
isEmpty
()
?
QStandardPaths
::
writableLocation
(
QStandardPaths
::
DocumentsLocation
)
:
ret
;
}
void
ApplicationState
::
setLastUsedExportDirectory
(
const
QString
&
path
)
{
KConfigGroup
c
onfig
{
KSharedConfig
::
openConfig
(),
"Export
Dialog
"
};
c
onfig
.
writeEntry
(
"LastDirectory"
,
QFileInfo
{
path
}.
absolutePath
());
KConfigGroup
stateC
onfig
{
KSharedConfig
::
open
State
Config
(),
"Export"
};
stateC
onfig
.
writeEntry
(
"LastDirectory"
,
QFileInfo
{
path
}.
absolutePath
());
}
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