Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
PIM
KDE PIM Add-ons
Commits
5e3f3fc2
Commit
5e3f3fc2
authored
Aug 06, 2020
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Continue to implement import contact
parent
67dbba5e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
kaddressbook/importexportplugins/windows-contacts/importwindowcontact.cpp
...ortexportplugins/windows-contacts/importwindowcontact.cpp
+52
-0
No files found.
kaddressbook/importexportplugins/windows-contacts/importwindowcontact.cpp
View file @
5e3f3fc2
...
...
@@ -113,9 +113,61 @@ KContacts::Addressee::List ImportWindowContact::importFile(const QString &fileNa
}
}
}
else
if
(
tag
==
QLatin1String
(
"c:PhoneNumberCollection"
))
{
for
(
QDomElement
number
=
e
.
firstChildElement
();
!
number
.
isNull
();
number
=
number
.
nextSiblingElement
())
{
const
QString
numberTag
=
number
.
tagName
();
if
(
numberTag
==
QLatin1String
(
"c:PhoneNumber"
))
{
KContacts
::
PhoneNumber
phoneNumber
;
for
(
QDomElement
numberInfo
=
number
.
firstChildElement
();
!
numberInfo
.
isNull
();
numberInfo
=
numberInfo
.
nextSiblingElement
())
{
const
QString
numberInfoTag
=
numberInfo
.
tagName
();
if
(
numberInfoTag
==
QLatin1String
(
"c:Number"
))
{
phoneNumber
.
setNumber
(
numberInfo
.
text
());
}
else
{
qDebug
()
<<
" number info tag not supported yet:"
<<
numberInfoTag
;
}
}
if
(
!
phoneNumber
.
isEmpty
())
{
contact
.
insertPhoneNumber
(
phoneNumber
);
}
}
else
{
qDebug
()
<<
" number tag unknown:"
<<
numberTag
;
}
}
}
else
if
(
tag
==
QLatin1String
(
"c:IMAddressCollection"
))
{
}
else
if
(
tag
==
QLatin1String
(
"c:PhotoCollection"
))
{
}
else
if
(
tag
==
QLatin1String
(
"c:PhysicalAddressCollection"
))
{
for
(
QDomElement
address
=
e
.
firstChildElement
();
!
address
.
isNull
();
address
=
address
.
nextSiblingElement
())
{
const
QString
addressTag
=
address
.
tagName
();
if
(
addressTag
==
QLatin1String
(
"c:PhysicalAddress"
))
{
KContacts
::
Address
addressType
;
for
(
QDomElement
addressInfo
=
address
.
firstChildElement
();
!
addressInfo
.
isNull
();
addressInfo
=
addressInfo
.
nextSiblingElement
())
{
const
QString
addressInfoTag
=
addressInfo
.
tagName
();
if
(
addressInfoTag
==
QLatin1String
(
"c:AddressLabel"
))
{
addressType
.
setLabel
(
addressInfo
.
text
());
}
else
if
(
addressInfoTag
==
QLatin1String
(
"c:Street"
))
{
addressType
.
setStreet
(
addressInfo
.
text
());
}
else
if
(
addressInfoTag
==
QLatin1String
(
"c:Locality"
))
{
addressType
.
setLocality
(
addressInfo
.
text
());
}
else
if
(
addressInfoTag
==
QLatin1String
(
"c:Region"
))
{
addressType
.
setRegion
(
addressInfo
.
text
());
}
else
if
(
addressInfoTag
==
QLatin1String
(
"c:Country"
))
{
addressType
.
setCountry
(
addressInfo
.
text
());
}
else
if
(
addressInfoTag
==
QLatin1String
(
"c:PostalCode"
))
{
addressType
.
setPostalCode
(
addressInfo
.
text
());
}
else
if
(
addressInfoTag
==
QLatin1String
(
"c:POBox"
))
{
addressType
.
setPostOfficeBox
(
addressInfo
.
text
());
}
else
{
qDebug
()
<<
" address info tag not supported yet "
<<
addressInfoTag
;
}
}
if
(
!
addressType
.
isEmpty
())
{
contact
.
insertAddress
(
addressType
);
}
}
else
{
qDebug
()
<<
" address tag unknown:"
<<
addressTag
;
}
}
}
else
if
(
tag
==
QLatin1String
(
"c:PositionCollection"
))
{
for
(
QDomElement
position
=
e
.
firstChildElement
();
!
position
.
isNull
();
position
=
position
.
nextSiblingElement
())
{
const
QString
positionTag
=
position
.
tagName
();
...
...
Write
Preview
Markdown
is supported
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