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
KAddressBook
Commits
f493a082
Commit
f493a082
authored
Aug 18, 2022
by
Laurent Montel
Browse files
Adapt to new api
parent
c0238c3d
Pipeline
#219885
failed with stage
in 4 minutes and 33 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
f493a082
...
...
@@ -55,7 +55,7 @@ set(QT_REQUIRED_VERSION "5.15.2")
find_package
(
Qt
${
QT_MAJOR_VERSION
}
${
QT_REQUIRED_VERSION
}
CONFIG REQUIRED Widgets Test DBus PrintSupport
)
set
(
LIBKDEPIM_LIB_VERSION
"5.21.40"
)
set
(
LIBGRANTLEETHEME_LIB_VERSION
"5.21.40"
)
set
(
PIMCOMMON_LIB_VERSION
"5.21.4
0
"
)
set
(
PIMCOMMON_LIB_VERSION
"5.21.4
1
"
)
set
(
AKONADI_SEARCH_VERSION
"5.21.40"
)
set
(
AKONADI_CONTACT_VERSION
"5.21.40"
)
...
...
src/mainwidget.cpp
View file @
f493a082
...
...
@@ -829,18 +829,20 @@ void MainWidget::setQRCodeShow(bool on)
}
}
Akonadi
::
Item
::
List
MainWidget
::
selectedItems
()
Akonadi
::
Item
::
List
MainWidget
::
selectedItems
(
bool
&
canceled
)
{
Akonadi
::
Item
::
List
items
;
QPointer
<
KAddressBookImportExport
::
ContactSelectionDialog
>
dlg
=
new
KAddressBookImportExport
::
ContactSelectionDialog
(
mItemView
->
selectionModel
(),
false
,
this
);
dlg
->
setDefaultAddressBook
(
currentAddressBook
());
if
(
!
dlg
->
exec
()
||
!
dlg
)
{
canceled
=
true
;
delete
dlg
;
return
items
;
}
items
=
dlg
->
selectedItems
();
canceled
=
false
;
delete
dlg
;
return
items
;
...
...
src/mainwidget.h
View file @
f493a082
...
...
@@ -67,16 +67,16 @@ public:
~
MainWidget
()
override
;
void
updateQuickSearchText
();
const
Akonadi
::
Item
::
List
collectSelectedAllContactsItem
();
Q_REQUIRED_RESULT
const
Akonadi
::
Item
::
List
collectSelectedAllContactsItem
();
/**
* Returns the address book collection that is currently
* selected by the user or an invalid collection if no
* address book is selected.
*/
Akonadi
::
Collection
currentAddressBook
()
const
;
Q_REQUIRED_RESULT
Akonadi
::
Collection
currentAddressBook
()
const
;
Akonadi
::
Item
::
List
selectedItems
();
Q_REQUIRED_RESULT
Akonadi
::
Item
::
List
selectedItems
(
bool
&
canceled
);
void
initializePluginActions
();
public
Q_SLOTS
:
...
...
src/plugininterface/kaddressbookplugininterface.cpp
View file @
f493a082
...
...
@@ -26,19 +26,20 @@ KAddressBookPluginInterface *KAddressBookPluginInterface::self()
return
&
s_self
;
}
void
KAddressBookPluginInterface
::
initializeInterfaceRequires
(
PimCommon
::
AbstractGenericPluginInterface
*
abstractInterface
)
bool
KAddressBookPluginInterface
::
initializeInterfaceRequires
(
PimCommon
::
AbstractGenericPluginInterface
*
abstractInterface
)
{
if
(
!
mMainWidget
)
{
qCCritical
(
KADDRESSBOOK_LOG
)
<<
"Main windows pointer not defined"
;
return
;
return
false
;
}
bool
canceled
=
false
;
auto
interface
=
static_cast
<
PimCommon
::
GenericPluginInterface
*>
(
abstractInterface
);
PimCommon
::
GenericPluginInterface
::
RequireTypes
requiresFeatures
=
interface
->
requiresFeatures
();
const
PimCommon
::
GenericPluginInterface
::
RequireTypes
requiresFeatures
=
interface
->
requiresFeatures
();
if
(
requiresFeatures
&
PimCommon
::
GenericPluginInterface
::
CurrentItems
)
{
interface
->
setCurrentItems
(
mMainWidget
->
collectSelectedAllContactsItem
());
}
if
(
requiresFeatures
&
PimCommon
::
GenericPluginInterface
::
Items
)
{
interface
->
setItems
(
mMainWidget
->
selectedItems
());
interface
->
setItems
(
mMainWidget
->
selectedItems
(
canceled
));
}
if
(
requiresFeatures
&
PimCommon
::
GenericPluginInterface
::
CurrentCollection
)
{
interface
->
setCurrentCollection
(
mMainWidget
->
currentAddressBook
());
...
...
@@ -46,6 +47,11 @@ void KAddressBookPluginInterface::initializeInterfaceRequires(PimCommon::Abstrac
if
(
requiresFeatures
&
PimCommon
::
GenericPluginInterface
::
Collections
)
{
qCDebug
(
KADDRESSBOOK_LOG
)
<<
"PimCommon::GenericPluginInterface::Collections not implemented"
;
}
if
(
canceled
)
{
return
false
;
}
else
{
return
true
;
}
}
void
KAddressBookPluginInterface
::
setMainWidget
(
MainWidget
*
mainWidget
)
...
...
src/plugininterface/kaddressbookplugininterface.h
View file @
f493a082
...
...
@@ -23,7 +23,7 @@ public:
void
setMainWidget
(
MainWidget
*
mainWidget
);
void
initializeInterfaceRequires
(
PimCommon
::
AbstractGenericPluginInterface
*
interface
)
override
;
bool
initializeInterfaceRequires
(
PimCommon
::
AbstractGenericPluginInterface
*
interface
)
override
;
static
KAddressBookPluginInterface
*
self
();
private:
...
...
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