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
KDE PIM Add-ons
Commits
cbf6e468
Commit
cbf6e468
authored
Aug 05, 2020
by
Laurent Montel
😁
Browse files
Continue to implement import windows contact
parent
cc642462
Pipeline
#29798
failed with stage
in 60 minutes
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
kaddressbook/importexportplugins/windows-contacts/importwindowcontact.cpp
View file @
cbf6e468
...
...
@@ -24,6 +24,8 @@
#include <QDomDocument>
#include <QFile>
//https://docs.microsoft.com/en-us/previous-versions//ms735869(v=vs.85)
ImportWindowContact
::
ImportWindowContact
()
{
...
...
@@ -94,16 +96,50 @@ KContacts::Addressee::List ImportWindowContact::importFile(const QString &fileNa
contact
.
setFamilyName
(
nameInfo
.
text
());
}
else
if
(
nameInfoTag
==
QLatin1String
(
"c:FormattedName"
))
{
contact
.
setFormattedName
(
nameInfo
.
text
());
}
else
if
(
nameInfoTag
==
QLatin1String
(
"c:Title"
))
{
contact
.
setTitle
(
nameInfo
.
text
());
}
else
if
(
nameInfoTag
==
QLatin1String
(
"c:NickName"
))
{
contact
.
setNickName
(
nameInfo
.
text
());
}
else
if
(
nameInfoTag
==
QLatin1String
(
"c:Prefix"
))
{
contact
.
setPrefix
(
nameInfo
.
text
());
}
else
if
(
nameInfoTag
==
QLatin1String
(
"c:Suffix"
))
{
contact
.
setSuffix
(
nameInfo
.
text
());
}
else
{
qDebug
()
<<
" name tag not supported yet "
<<
nameInfoTag
;
}
}
}
else
{
qDebug
()
<<
" name tag unknow:"
<<
nameTag
;
qDebug
()
<<
" name tag unknow
n
:"
<<
nameTag
;
}
}
}
else
if
(
tag
==
QLatin1String
(
"c:PhoneNumberCollection"
))
{
}
else
if
(
tag
==
QLatin1String
(
"c:PhotoCollection"
))
{
}
else
if
(
tag
==
QLatin1String
(
"c:PositionCollection"
))
{
for
(
QDomElement
position
=
e
.
firstChildElement
();
!
position
.
isNull
();
position
=
position
.
nextSiblingElement
())
{
const
QString
positionTag
=
position
.
tagName
();
if
(
positionTag
==
QLatin1String
(
"c:Position"
))
{
for
(
QDomElement
positionInfo
=
position
.
firstChildElement
();
!
positionInfo
.
isNull
();
positionInfo
=
positionInfo
.
nextSiblingElement
())
{
const
QString
positionInfoTag
=
positionInfo
.
tagName
();
if
(
positionInfoTag
==
QLatin1String
(
"c:Organization"
))
{
contact
.
setOrganization
(
positionInfo
.
text
());
}
else
if
(
positionInfoTag
==
QLatin1String
(
"c:Department"
))
{
contact
.
setDepartment
(
positionInfo
.
text
());
}
else
if
(
positionInfoTag
==
QLatin1String
(
"c:Office"
))
{
contact
.
setOffice
(
positionInfo
.
text
());
}
else
if
(
positionInfoTag
==
QLatin1String
(
"c:Profession"
))
{
contact
.
setProfession
(
positionInfo
.
text
());
}
else
if
(
positionInfoTag
==
QLatin1String
(
"c:Role"
))
{
contact
.
setRole
(
positionInfo
.
text
());
}
else
{
qDebug
()
<<
" position info tag not supported yet "
<<
positionInfoTag
;
}
}
}
else
{
qDebug
()
<<
" position tag unknown:"
<<
positionTag
;
}
}
}
else
{
qDebug
()
<<
"unknown tag "
<<
tag
;
}
...
...
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