Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Akonadi Data Import Wizard
Commits
cb65b23e
Commit
cb65b23e
authored
Nov 13, 2020
by
Laurent Montel
😁
Browse files
Prepare using qt5keychain
parent
25462a34
Pipeline
#40660
failed with stage
in 6 minutes and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/libimportwizard/importwizardutil.cpp
View file @
cb65b23e
...
...
@@ -62,7 +62,7 @@ void ImportWizardUtil::mergeLdap(const ldapStruct &ldap)
grp
.
writeEntry
(
QStringLiteral
(
"SelectedSizeLimit%1"
).
arg
(
numberOfLdapSelected
),
ldap
.
limit
);
}
if
(
!
ldap
.
password
.
isEmpty
())
{
store
InKWallet
(
QStringLiteral
(
"SelectedPwdBind%1"
).
arg
(
numberOfLdapSelected
),
ImportWizardUtil
::
Ldap
,
ldap
.
password
);
store
Password
(
QStringLiteral
(
"SelectedPwdBind%1"
).
arg
(
numberOfLdapSelected
),
ImportWizardUtil
::
Ldap
,
ldap
.
password
);
}
grp
.
sync
();
}
...
...
@@ -78,39 +78,32 @@ void ImportWizardUtil::addAkonadiTag(const QVector<tagStruct> &tagList)
}
}
void
ImportWizardUtil
::
store
InKWallet
(
const
QString
&
name
,
ImportWizardUtil
::
ResourceType
type
,
const
QString
&
password
)
void
ImportWizardUtil
::
store
Password
(
const
QString
&
name
,
ImportWizardUtil
::
ResourceType
type
,
const
QString
&
password
)
{
KWallet
::
Wallet
*
wallet
=
nullptr
;
switch
(
type
)
{
case
Imap
:
wallet
=
KWallet
::
Wallet
::
openWallet
(
KWallet
::
Wallet
::
NetworkWallet
(),
0
);
if
(
wallet
&&
wallet
->
isOpen
())
{
KWallet
::
Wallet
*
wallet
=
KWallet
::
Wallet
::
openWallet
(
KWallet
::
Wallet
::
NetworkWallet
(),
0
);
if
(
wallet
&&
wallet
->
isOpen
())
{
switch
(
type
)
{
case
Imap
:
if
(
!
wallet
->
hasFolder
(
QStringLiteral
(
"imap"
)))
{
wallet
->
createFolder
(
QStringLiteral
(
"imap"
));
}
wallet
->
setFolder
(
QStringLiteral
(
"imap"
));
wallet
->
writePassword
(
name
+
QLatin1String
(
"rc"
),
password
);
}
break
;
case
Pop3
:
wallet
=
KWallet
::
Wallet
::
openWallet
(
KWallet
::
Wallet
::
NetworkWallet
(),
0
);
if
(
wallet
&&
wallet
->
isOpen
())
{
break
;
case
Pop3
:
if
(
!
wallet
->
hasFolder
(
QStringLiteral
(
"pop3"
)))
{
wallet
->
createFolder
(
QStringLiteral
(
"pop3"
));
}
wallet
->
setFolder
(
QStringLiteral
(
"pop3"
));
wallet
->
writePassword
(
name
,
password
);
}
break
;
case
Ldap
:
wallet
=
KWallet
::
Wallet
::
openWallet
(
KWallet
::
Wallet
::
LocalWallet
(),
0
);
if
(
wallet
&&
wallet
->
isOpen
())
{
break
;
case
Ldap
:
if
(
!
wallet
->
hasFolder
(
QStringLiteral
(
"ldapclient"
)))
{
wallet
->
createFolder
(
QStringLiteral
(
"ldapclient"
));
}
wallet
->
setFolder
(
QStringLiteral
(
"ldapclient"
));
wallet
->
writePassword
(
name
,
password
);
}
delete
wallet
;
}
delete
wallet
;
}
src/libimportwizard/importwizardutil.h
View file @
cb65b23e
...
...
@@ -51,7 +51,7 @@ enum ResourceType {
LIBIMPORTWIZARD_EXPORT
void
mergeLdap
(
const
ldapStruct
&
ldap
);
LIBIMPORTWIZARD_EXPORT
void
addAkonadiTag
(
const
QVector
<
tagStruct
>
&
tagList
);
void
store
InKWallet
(
const
QString
&
name
,
ImportWizardUtil
::
ResourceType
type
,
const
QString
&
password
);
void
store
Password
(
const
QString
&
name
,
ImportWizardUtil
::
ResourceType
type
,
const
QString
&
password
);
}
#endif // IMPORTWIZARDUTIL_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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