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
KAddressBook
Commits
8bc72824
Commit
8bc72824
authored
May 15, 2014
by
Laurent Montel
😁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix indent
parent
9538eff9
Changes
69
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
69 changed files
with
4650 additions
and
4650 deletions
+4650
-4650
aboutdata.cpp
aboutdata.cpp
+4
-4
aboutdata.h
aboutdata.h
+1
-1
contactfields.cpp
contactfields.cpp
+663
-663
contactfields.h
contactfields.h
+57
-57
contactselectiondialog.cpp
contactselectiondialog.cpp
+9
-9
contactselectiondialog.h
contactselectiondialog.h
+4
-4
contactselectionwidget.cpp
contactselectionwidget.cpp
+211
-211
contactselectionwidget.h
contactselectionwidget.h
+4
-4
contactsorter.cpp
contactsorter.cpp
+38
-38
contactsorter.h
contactsorter.h
+2
-2
contactswitcher.cpp
contactswitcher.cpp
+69
-69
contactswitcher.h
contactswitcher.h
+4
-4
globalcontactmodel.cpp
globalcontactmodel.cpp
+20
-20
globalcontactmodel.h
globalcontactmodel.h
+6
-6
kaddressbookpart.cpp
kaddressbookpart.cpp
+24
-24
kaddressbookpart.h
kaddressbookpart.h
+4
-4
main.cpp
main.cpp
+10
-10
mainwidget.cpp
mainwidget.cpp
+141
-141
mainwidget.h
mainwidget.h
+14
-14
mainwindow.cpp
mainwindow.cpp
+28
-28
mainwindow.h
mainwindow.h
+4
-4
modelcolumnmanager.cpp
modelcolumnmanager.cpp
+143
-143
modelcolumnmanager.h
modelcolumnmanager.h
+5
-5
printing/compact/compactstyle.cpp
printing/compact/compactstyle.cpp
+116
-116
printing/compact/compactstyle.h
printing/compact/compactstyle.h
+5
-5
printing/detailled/detailledstyle.cpp
printing/detailled/detailledstyle.cpp
+195
-195
printing/detailled/detailledstyle.h
printing/detailled/detailledstyle.h
+4
-4
printing/mike/mikesstyle.cpp
printing/mike/mikesstyle.cpp
+74
-74
printing/mike/mikesstyle.h
printing/mike/mikesstyle.h
+3
-3
printing/printingwizard.cpp
printing/printingwizard.cpp
+71
-71
printing/printingwizard.h
printing/printingwizard.h
+5
-5
printing/printprogress.cpp
printing/printprogress.cpp
+26
-26
printing/printprogress.h
printing/printprogress.h
+3
-3
printing/printstyle.cpp
printing/printstyle.cpp
+42
-42
printing/printstyle.h
printing/printstyle.h
+6
-6
printing/ringbinder/ringbinderstyle.cpp
printing/ringbinder/ringbinderstyle.cpp
+132
-132
printing/ringbinder/ringbinderstyle.h
printing/ringbinder/ringbinderstyle.h
+3
-3
printing/stylepage.cpp
printing/stylepage.cpp
+113
-113
printing/stylepage.h
printing/stylepage.h
+4
-4
quicksearchwidget.cpp
quicksearchwidget.cpp
+36
-36
quicksearchwidget.h
quicksearchwidget.h
+5
-5
startup.cpp
startup.cpp
+1
-1
startup.h
startup.h
+1
-1
xxport/csv/csv_xxport.cpp
xxport/csv/csv_xxport.cpp
+95
-95
xxport/csv/csv_xxport.h
xxport/csv/csv_xxport.h
+2
-2
xxport/csv/csvimportdialog.cpp
xxport/csv/csvimportdialog.cpp
+529
-529
xxport/csv/csvimportdialog.h
xxport/csv/csvimportdialog.h
+5
-5
xxport/csv/dateparser.cpp
xxport/csv/dateparser.cpp
+94
-94
xxport/csv/dateparser.h
xxport/csv/dateparser.h
+2
-2
xxport/csv/qcsvmodel.cpp
xxport/csv/qcsvmodel.cpp
+139
-139
xxport/csv/qcsvmodel.h
xxport/csv/qcsvmodel.h
+4
-4
xxport/csv/qcsvreader.cpp
xxport/csv/qcsvreader.cpp
+189
-189
xxport/csv/qcsvreader.h
xxport/csv/qcsvreader.h
+9
-9
xxport/csv/templateselectiondialog.cpp
xxport/csv/templateselectiondialog.cpp
+112
-112
xxport/csv/templateselectiondialog.h
xxport/csv/templateselectiondialog.h
+4
-4
xxport/gmx/gmx_xxport.cpp
xxport/gmx/gmx_xxport.cpp
+485
-485
xxport/gmx/gmx_xxport.h
xxport/gmx/gmx_xxport.h
+2
-2
xxport/ldap/ldap_xxport.cpp
xxport/ldap/ldap_xxport.cpp
+9
-9
xxport/ldap/ldap_xxport.h
xxport/ldap/ldap_xxport.h
+1
-1
xxport/ldif/ldif_xxport.cpp
xxport/ldif/ldif_xxport.cpp
+65
-65
xxport/ldif/ldif_xxport.h
xxport/ldif/ldif_xxport.h
+1
-1
xxport/shared/xxport.cpp
xxport/shared/xxport.cpp
+19
-19
xxport/shared/xxport.h
xxport/shared/xxport.h
+3
-3
xxport/vcard/vcard_xxport.cpp
xxport/vcard/vcard_xxport.cpp
+453
-453
xxport/vcard/vcard_xxport.h
xxport/vcard/vcard_xxport.h
+2
-2
xxport/xxportfactory.cpp
xxport/xxportfactory.cpp
+16
-16
xxport/xxportfactory.h
xxport/xxportfactory.h
+1
-1
xxportmanager.cpp
xxportmanager.cpp
+94
-94
xxportmanager.h
xxportmanager.h
+5
-5
No files found.
aboutdata.cpp
View file @
8bc72824
...
...
@@ -25,10 +25,10 @@
#include <KLocalizedString>
AboutData
::
AboutData
()
:
KAboutData
(
"kaddressbook"
,
0
,
ki18n
(
"KAddressBook"
),
KDEPIM_VERSION
,
ki18n
(
"The KDE Address Book Application"
),
KAboutData
::
License_GPL_V2
,
ki18n
(
"Copyright © 2007–2014 KAddressBook authors"
)
)
:
KAboutData
(
"kaddressbook"
,
0
,
ki18n
(
"KAddressBook"
),
KDEPIM_VERSION
,
ki18n
(
"The KDE Address Book Application"
),
KAboutData
::
License_GPL_V2
,
ki18n
(
"Copyright © 2007–2014 KAddressBook authors"
)
)
{
addAuthor
(
ki18n
(
"Laurent Montel"
),
ki18n
(
"Current maintainer"
),
"montel@kde.org"
);
addAuthor
(
ki18n
(
"Tobias Koenig"
),
ki18n
(
"Previous maintainer"
),
"tokoe@kde.org"
);
...
...
aboutdata.h
View file @
8bc72824
...
...
@@ -27,7 +27,7 @@
class
KADDRESSBOOK_EXPORT
AboutData
:
public
KAboutData
{
public:
public:
/**
* Creates a new about data object.
*/
...
...
contactfields.cpp
View file @
8bc72824
This diff is collapsed.
Click to expand it.
contactfields.h
View file @
8bc72824
...
...
@@ -25,68 +25,68 @@
class
ContactFields
{
public:
public:
/**
* Describes the standard fields that are available for every contact
*/
enum
Field
{
Undefined
=
0
,
FormattedName
,
Prefix
,
GivenName
,
AdditionalName
,
FamilyName
,
Suffix
,
NickName
,
Birthday
,
Anniversary
,
HomeAddressStreet
,
HomeAddressPostOfficeBox
,
HomeAddressLocality
,
HomeAddressRegion
,
HomeAddressPostalCode
,
HomeAddressCountry
,
HomeAddressLabel
,
BusinessAddressStreet
,
BusinessAddressPostOfficeBox
,
BusinessAddressLocality
,
BusinessAddressRegion
,
BusinessAddressPostalCode
,
BusinessAddressCountry
,
BusinessAddressLabel
,
HomePhone
,
BusinessPhone
,
MobilePhone
,
HomeFax
,
BusinessFax
,
CarPhone
,
Isdn
,
Pager
,
PreferredEmail
,
Email2
,
Email3
,
Email4
,
Mailer
,
Title
,
Role
,
Organization
,
Note
,
Homepage
,
BlogFeed
,
Profession
,
Office
,
Manager
,
Assistant
,
Spouse
Undefined
=
0
,
FormattedName
,
Prefix
,
GivenName
,
AdditionalName
,
FamilyName
,
Suffix
,
NickName
,
Birthday
,
Anniversary
,
HomeAddressStreet
,
HomeAddressPostOfficeBox
,
HomeAddressLocality
,
HomeAddressRegion
,
HomeAddressPostalCode
,
HomeAddressCountry
,
HomeAddressLabel
,
BusinessAddressStreet
,
BusinessAddressPostOfficeBox
,
BusinessAddressLocality
,
BusinessAddressRegion
,
BusinessAddressPostalCode
,
BusinessAddressCountry
,
BusinessAddressLabel
,
HomePhone
,
BusinessPhone
,
MobilePhone
,
HomeFax
,
BusinessFax
,
CarPhone
,
Isdn
,
Pager
,
PreferredEmail
,
Email2
,
Email3
,
Email4
,
Mailer
,
Title
,
Role
,
Organization
,
Note
,
Homepage
,
BlogFeed
,
Profession
,
Office
,
Manager
,
Assistant
,
Spouse
};
/**
...
...
contactselectiondialog.cpp
View file @
8bc72824
...
...
@@ -24,29 +24,29 @@
ContactSelectionDialog
::
ContactSelectionDialog
(
QItemSelectionModel
*
selectionModel
,
QWidget
*
parent
)
:
KDialog
(
parent
)
:
KDialog
(
parent
)
{
setCaption
(
i18n
(
"Select Contacts"
)
);
setButtons
(
Ok
|
Cancel
);
setCaption
(
i18n
(
"Select Contacts"
)
);
setButtons
(
Ok
|
Cancel
);
mSelectionWidget
=
new
ContactSelectionWidget
(
selectionModel
,
this
);
setMainWidget
(
mSelectionWidget
);
mSelectionWidget
=
new
ContactSelectionWidget
(
selectionModel
,
this
);
setMainWidget
(
mSelectionWidget
);
setInitialSize
(
QSize
(
450
,
220
)
);
setInitialSize
(
QSize
(
450
,
220
)
);
}
void
ContactSelectionDialog
::
setMessageText
(
const
QString
&
message
)
{
mSelectionWidget
->
setMessageText
(
message
);
mSelectionWidget
->
setMessageText
(
message
);
}
void
ContactSelectionDialog
::
setDefaultAddressBook
(
const
Akonadi
::
Collection
&
addressBook
)
{
mSelectionWidget
->
setDefaultAddressBook
(
addressBook
);
mSelectionWidget
->
setDefaultAddressBook
(
addressBook
);
}
KABC
::
Addressee
::
List
ContactSelectionDialog
::
selectedContacts
()
const
{
return
mSelectionWidget
->
selectedContacts
();
return
mSelectionWidget
->
selectedContacts
();
}
contactselectiondialog.h
View file @
8bc72824
...
...
@@ -29,7 +29,7 @@ class QItemSelectionModel;
namespace
Akonadi
{
class
Collection
;
class
Collection
;
}
/**
...
...
@@ -39,9 +39,9 @@ namespace Akonadi
*/
class
ContactSelectionDialog
:
public
KDialog
{
Q_OBJECT
Q_OBJECT
public:
public:
/**
* Creates a new contact selection dialog.
*
...
...
@@ -65,7 +65,7 @@ class ContactSelectionDialog : public KDialog
*/
KABC
::
Addressee
::
List
selectedContacts
()
const
;
private:
private:
ContactSelectionWidget
*
mSelectionWidget
;
};
...
...
contactselectionwidget.cpp
View file @
8bc72824
...
...
@@ -39,176 +39,176 @@
ContactSelectionWidget
::
ContactSelectionWidget
(
QItemSelectionModel
*
selectionModel
,
QWidget
*
parent
)
:
QWidget
(
parent
),
mSelectionModel
(
selectionModel
)
:
QWidget
(
parent
),
mSelectionModel
(
selectionModel
)
{
initGui
();
mSelectedContactsButton
->
setEnabled
(
mSelectionModel
->
hasSelection
()
);
mAddressBookSelection
->
setEnabled
(
false
);
mAddressBookSelectionRecursive
->
setEnabled
(
false
);
connect
(
mAddressBookContactsButton
,
SIGNAL
(
toggled
(
bool
)),
mAddressBookSelection
,
SLOT
(
setEnabled
(
bool
))
);
connect
(
mAddressBookContactsButton
,
SIGNAL
(
toggled
(
bool
)),
mAddressBookSelectionRecursive
,
SLOT
(
setEnabled
(
bool
))
);
// apply default configuration
if
(
mSelectionModel
->
hasSelection
()
)
{
mSelectedContactsButton
->
setChecked
(
true
);
}
else
{
mAllContactsButton
->
setChecked
(
true
);
}
initGui
();
mSelectedContactsButton
->
setEnabled
(
mSelectionModel
->
hasSelection
()
);
mAddressBookSelection
->
setEnabled
(
false
);
mAddressBookSelectionRecursive
->
setEnabled
(
false
);
connect
(
mAddressBookContactsButton
,
SIGNAL
(
toggled
(
bool
)),
mAddressBookSelection
,
SLOT
(
setEnabled
(
bool
))
);
connect
(
mAddressBookContactsButton
,
SIGNAL
(
toggled
(
bool
)),
mAddressBookSelectionRecursive
,
SLOT
(
setEnabled
(
bool
))
);
// apply default configuration
if
(
mSelectionModel
->
hasSelection
()
)
{
mSelectedContactsButton
->
setChecked
(
true
);
}
else
{
mAllContactsButton
->
setChecked
(
true
);
}
}
void
ContactSelectionWidget
::
setMessageText
(
const
QString
&
message
)
{
mMessageLabel
->
setText
(
message
);
mMessageLabel
->
setText
(
message
);
}
void
ContactSelectionWidget
::
setDefaultAddressBook
(
const
Akonadi
::
Collection
&
addressBook
)
{
mAddressBookSelection
->
setDefaultCollection
(
addressBook
);
mAddressBookSelection
->
setDefaultCollection
(
addressBook
);
}
KABC
::
Addressee
::
List
ContactSelectionWidget
::
selectedContacts
()
const
{
if
(
mAllContactsButton
->
isChecked
()
)
{
return
collectAllContacts
();
}
else
if
(
mSelectedContactsButton
->
isChecked
()
)
{
return
collectSelectedContacts
();
}
else
if
(
mAddressBookContactsButton
->
isChecked
()
)
{
return
collectAddressBookContacts
();
}
return
KABC
::
Addressee
::
List
();
if
(
mAllContactsButton
->
isChecked
()
)
{
return
collectAllContacts
();
}
else
if
(
mSelectedContactsButton
->
isChecked
()
)
{
return
collectSelectedContacts
();
}
else
if
(
mAddressBookContactsButton
->
isChecked
()
)
{
return
collectAddressBookContacts
();
}
return
KABC
::
Addressee
::
List
();
}
Akonadi
::
Item
::
List
ContactSelectionWidget
::
selectedContactsItem
()
const
{
if
(
mAllContactsButton
->
isChecked
()
)
{
return
collectAllContactsItem
();
}
else
if
(
mSelectedContactsButton
->
isChecked
()
)
{
return
collectSelectedContactsItem
();
}
else
if
(
mAddressBookContactsButton
->
isChecked
()
)
{
return
collectAddressBookContactsItem
();
}
return
Akonadi
::
Item
::
List
();
if
(
mAllContactsButton
->
isChecked
()
)
{
return
collectAllContactsItem
();
}
else
if
(
mSelectedContactsButton
->
isChecked
()
)
{
return
collectSelectedContactsItem
();
}
else
if
(
mAddressBookContactsButton
->
isChecked
()
)
{
return
collectAddressBookContactsItem
();
}
return
Akonadi
::
Item
::
List
();
}
void
ContactSelectionWidget
::
initGui
()
{
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
mMessageLabel
=
new
QLabel
;
layout
->
addWidget
(
mMessageLabel
);
QButtonGroup
*
group
=
new
QButtonGroup
(
this
);
QGroupBox
*
groupBox
=
new
QGroupBox
;
QGridLayout
*
boxLayout
=
new
QGridLayout
;
groupBox
->
setLayout
(
boxLayout
);
mAllContactsButton
=
new
QRadioButton
(
i18nc
(
"@option:radio"
,
"All contacts"
)
);
mAllContactsButton
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"All contacts from all your address books"
)
);
mAllContactsButton
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose this option you want to select all your contacts from "
"all your address books."
)
);
mSelectedContactsButton
=
new
QRadioButton
(
i18nc
(
"@option:radio"
,
"Selected contacts"
)
);
mSelectedContactsButton
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Only the contacts currently selected"
)
);
mSelectedContactsButton
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose this option if you want only the contacts you have already "
"selected in the graphical interface."
)
);
mAddressBookContactsButton
=
new
QRadioButton
(
i18nc
(
"@option:radio"
,
"All contacts from:"
)
);
mAddressBookContactsButton
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"All contacts from a chosen address book"
)
);
mAddressBookContactsButton
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose this option if you want to select all the contacts from only one "
"of your address books. Once this option is clicked you will be provided "
"a drop down box listing all those address books and permitted to select "
"the one you want."
)
);
mAddressBookSelection
=
new
Akonadi
::
CollectionComboBox
;
mAddressBookSelection
->
setMimeTypeFilter
(
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
mAddressBookSelection
->
setAccessRightsFilter
(
Akonadi
::
Collection
::
ReadOnly
);
mAddressBookSelection
->
setExcludeVirtualCollections
(
true
);
mAddressBookSelectionRecursive
=
new
QCheckBox
(
i18nc
(
"@option:check"
,
"Include Subfolders"
)
);
mAddressBookSelectionRecursive
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Select all subfolders including the top-level folder"
)
);
mAddressBookSelectionRecursive
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Check this box if you want to select all contacts from this folder, "
"including all subfolders. If you only want the contacts from the "
"top-level folder then leave this box unchecked."
)
);
group
->
addButton
(
mAllContactsButton
);
group
->
addButton
(
mSelectedContactsButton
);
group
->
addButton
(
mAddressBookContactsButton
);
boxLayout
->
addWidget
(
mAllContactsButton
,
0
,
0
,
1
,
2
);
boxLayout
->
addWidget
(
mSelectedContactsButton
,
1
,
0
,
1
,
2
);
boxLayout
->
addWidget
(
mAddressBookContactsButton
,
2
,
0
,
Qt
::
AlignTop
);
QVBoxLayout
*
addressBookLayout
=
new
QVBoxLayout
;
addressBookLayout
->
setMargin
(
0
);
addressBookLayout
->
addWidget
(
mAddressBookSelection
);
addressBookLayout
->
addWidget
(
mAddressBookSelectionRecursive
);
boxLayout
->
addLayout
(
addressBookLayout
,
2
,
1
);
layout
->
addWidget
(
groupBox
);
layout
->
addStretch
(
1
);
QVBoxLayout
*
layout
=
new
QVBoxLayout
(
this
);
mMessageLabel
=
new
QLabel
;
layout
->
addWidget
(
mMessageLabel
);
QButtonGroup
*
group
=
new
QButtonGroup
(
this
);
QGroupBox
*
groupBox
=
new
QGroupBox
;
QGridLayout
*
boxLayout
=
new
QGridLayout
;
groupBox
->
setLayout
(
boxLayout
);
mAllContactsButton
=
new
QRadioButton
(
i18nc
(
"@option:radio"
,
"All contacts"
)
);
mAllContactsButton
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"All contacts from all your address books"
)
);
mAllContactsButton
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose this option you want to select all your contacts from "
"all your address books."
)
);
mSelectedContactsButton
=
new
QRadioButton
(
i18nc
(
"@option:radio"
,
"Selected contacts"
)
);
mSelectedContactsButton
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Only the contacts currently selected"
)
);
mSelectedContactsButton
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose this option if you want only the contacts you have already "
"selected in the graphical interface."
)
);
mAddressBookContactsButton
=
new
QRadioButton
(
i18nc
(
"@option:radio"
,
"All contacts from:"
)
);
mAddressBookContactsButton
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"All contacts from a chosen address book"
)
);
mAddressBookContactsButton
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Choose this option if you want to select all the contacts from only one "
"of your address books. Once this option is clicked you will be provided "
"a drop down box listing all those address books and permitted to select "
"the one you want."
)
);
mAddressBookSelection
=
new
Akonadi
::
CollectionComboBox
;
mAddressBookSelection
->
setMimeTypeFilter
(
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
mAddressBookSelection
->
setAccessRightsFilter
(
Akonadi
::
Collection
::
ReadOnly
);
mAddressBookSelection
->
setExcludeVirtualCollections
(
true
);
mAddressBookSelectionRecursive
=
new
QCheckBox
(
i18nc
(
"@option:check"
,
"Include Subfolders"
)
);
mAddressBookSelectionRecursive
->
setToolTip
(
i18nc
(
"@info:tooltip"
,
"Select all subfolders including the top-level folder"
)
);
mAddressBookSelectionRecursive
->
setWhatsThis
(
i18nc
(
"@info:whatsthis"
,
"Check this box if you want to select all contacts from this folder, "
"including all subfolders. If you only want the contacts from the "
"top-level folder then leave this box unchecked."
)
);
group
->
addButton
(
mAllContactsButton
);
group
->
addButton
(
mSelectedContactsButton
);
group
->
addButton
(
mAddressBookContactsButton
);
boxLayout
->
addWidget
(
mAllContactsButton
,
0
,
0
,
1
,
2
);
boxLayout
->
addWidget
(
mSelectedContactsButton
,
1
,
0
,
1
,
2
);
boxLayout
->
addWidget
(
mAddressBookContactsButton
,
2
,
0
,
Qt
::
AlignTop
);
QVBoxLayout
*
addressBookLayout
=
new
QVBoxLayout
;
addressBookLayout
->
setMargin
(
0
);
addressBookLayout
->
addWidget
(
mAddressBookSelection
);
addressBookLayout
->
addWidget
(
mAddressBookSelectionRecursive
);
boxLayout
->
addLayout
(
addressBookLayout
,
2
,
1
);
layout
->
addWidget
(
groupBox
);
layout
->
addStretch
(
1
);
}
KABC
::
Addressee
::
List
ContactSelectionWidget
::
collectAllContacts
()
const
{
Akonadi
::
RecursiveItemFetchJob
*
job
=
new
Akonadi
::
RecursiveItemFetchJob
(
Akonadi
::
Collection
::
root
(),
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
job
->
fetchScope
().
fetchFullPayload
();
Akonadi
::
RecursiveItemFetchJob
*
job
=
new
Akonadi
::
RecursiveItemFetchJob
(
Akonadi
::
Collection
::
root
(),
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
job
->
fetchScope
().
fetchFullPayload
();
KABC
::
Addressee
::
List
contacts
;
if
(
!
job
->
exec
()
)
{
return
contacts
;
}
KABC
::
Addressee
::
List
contacts
;
if
(
!
job
->
exec
()
)
{
return
contacts
;
}
foreach
(
const
Akonadi
::
Item
&
item
,
job
->
items
()
)
{
if
(
item
.
isValid
()
&&
item
.
hasPayload
<
KABC
::
Addressee
>
()
)
{
contacts
.
append
(
item
.
payload
<
KABC
::
Addressee
>
()
);
foreach
(
const
Akonadi
::
Item
&
item
,
job
->
items
()
)
{
if
(
item
.
isValid
()
&&
item
.
hasPayload
<
KABC
::
Addressee
>
()
)
{
contacts
.
append
(
item
.
payload
<
KABC
::
Addressee
>
()
);
}
}
}
return
contacts
;
return
contacts
;
}
Akonadi
::
Item
::
List
ContactSelectionWidget
::
collectAllContactsItem
()
const
{
Akonadi
::
RecursiveItemFetchJob
*
job
=
new
Akonadi
::
RecursiveItemFetchJob
(
Akonadi
::
Collection
::
root
(),
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
job
->
fetchScope
().
fetchFullPayload
();
Akonadi
::
RecursiveItemFetchJob
*
job
=
new
Akonadi
::
RecursiveItemFetchJob
(
Akonadi
::
Collection
::
root
(),
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
job
->
fetchScope
().
fetchFullPayload
();
Akonadi
::
Item
::
List
lst
;
if
(
!
job
->
exec
()
)
{
return
lst
;
}
Akonadi
::
Item
::
List
lst
;
if
(
!
job
->
exec
()
)
{
return
lst
;
}
foreach
(
const
Akonadi
::
Item
&
item
,
job
->
items
()
)
{
if
(
item
.
isValid
()
&&
item
.
hasPayload
<
KABC
::
Addressee
>
()
)
{
lst
.
append
(
item
);
foreach
(
const
Akonadi
::
Item
&
item
,
job
->
items
()
)
{
if
(
item
.
isValid
()
&&
item
.
hasPayload
<
KABC
::
Addressee
>
()
)
{
lst
.
append
(
item
);
}
}
}
return
lst
;
return
lst
;
}
Akonadi
::
Item
::
List
ContactSelectionWidget
::
collectSelectedContactsItem
()
const
...
...
@@ -220,104 +220,104 @@ Akonadi::Item::List ContactSelectionWidget::collectSelectedContactsItem() const
KABC
::
Addressee
::
List
ContactSelectionWidget
::
collectSelectedContacts
()
const
{
KABC
::
Addressee
::
List
contacts
;
const
QModelIndexList
indexes
=
mSelectionModel
->
selectedRows
(
0
);
for
(
int
i
=
0
;
i
<
indexes
.
count
();
++
i
)
{
const
QModelIndex
index
=
indexes
.
at
(
i
);
if
(
index
.
isValid
()
)
{
const
Akonadi
::
Item
item
=
index
.
data
(
Akonadi
::
EntityTreeModel
::
ItemRole
).
value
<
Akonadi
::
Item
>
();
if
(
item
.
isValid
()
&&
item
.
hasPayload
<
KABC
::
Addressee
>
()
)
{
contacts
.
append
(
item
.
payload
<
KABC
::
Addressee
>
()
);
}
KABC
::
Addressee
::
List
contacts
;
const
QModelIndexList
indexes
=
mSelectionModel
->
selectedRows
(
0
);
for
(
int
i
=
0
;
i
<
indexes
.
count
();
++
i
)
{
const
QModelIndex
index
=
indexes
.
at
(
i
);
if
(
index
.
isValid
()
)
{
const
Akonadi
::
Item
item
=
index
.
data
(
Akonadi
::
EntityTreeModel
::
ItemRole
).
value
<
Akonadi
::
Item
>
();
if
(
item
.
isValid
()
&&
item
.
hasPayload
<
KABC
::
Addressee
>
()
)
{
contacts
.
append
(
item
.
payload
<
KABC
::
Addressee
>
()
);
}
}
}
}
return
contacts
;
return
contacts
;
}
KABC
::
Addressee
::
List
ContactSelectionWidget
::
collectAddressBookContacts
()
const
{
KABC
::
Addressee
::
List
contacts
;
const
Akonadi
::
Collection
collection
=
mAddressBookSelection
->
currentCollection
();
if
(
!
collection
.
isValid
()
)
{
return
contacts
;
}
if
(
mAddressBookSelectionRecursive
->
isChecked
()
)
{
Akonadi
::
RecursiveItemFetchJob
*
job
=
new
Akonadi
::
RecursiveItemFetchJob
(
collection
,
QStringList
()
<<
KABC
::
Addressee
::
mimeType
()
);
job
->
fetchScope
().
fetchFullPayload
();
KABC
::
Addressee
::
List
contacts
;
if
(
!
job
->
exec
()
)
{
return
contacts
;
const
Akonadi
::
Collection
collection
=
mAddressBookSelection
->
currentCollection
();
if
(
!
collection
.
isValid
()
)
{
return
contacts
;
}
foreach
(
const
Akonadi
::
Item
&
item
,
job
->
items
()
)
{