Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Plasma Phonebook
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
KDE
Plasma Phonebook
Commits
2161d950
Verified
Commit
2161d950
authored
Aug 14, 2019
by
Bhushan Shah
Committed by
Jonah Brüchert
Sep 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add kpeople action plugin
Very initial scaffolding for creating a proper kpeople action plugin.
parent
92070652
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
1 deletion
+110
-1
CMakeLists.txt
CMakeLists.txt
+1
-1
src/CMakeLists.txt
src/CMakeLists.txt
+2
-0
src/kpeopleactionplugin/CMakeLists.txt
src/kpeopleactionplugin/CMakeLists.txt
+8
-0
src/kpeopleactionplugin/kpeopleactionsplugin.cpp
src/kpeopleactionplugin/kpeopleactionsplugin.cpp
+48
-0
src/kpeopleactionplugin/kpeopleactionsplugin.h
src/kpeopleactionplugin/kpeopleactionsplugin.h
+33
-0
src/kpeopleactionplugin/phonebook_kpeople_plugin.json
src/kpeopleactionplugin/phonebook_kpeople_plugin.json
+18
-0
No files found.
CMakeLists.txt
View file @
2161d950
...
...
@@ -29,7 +29,7 @@ include(KDECompilerSettings NO_POLICY_SCOPE)
################# Find dependencies #################
find_package
(
Qt5
${
QT_MIN_VERSION
}
REQUIRED NO_MODULE COMPONENTS Core Quick Test Gui Svg QuickControls2
)
find_package
(
KF5 REQUIRED COMPONENTS Kirigami2 Contacts
)
find_package
(
KF5 REQUIRED COMPONENTS Kirigami2 Contacts
People
)
################# Enable C++11 features for clang and gcc #################
...
...
src/CMakeLists.txt
View file @
2161d950
...
...
@@ -5,3 +5,5 @@ target_link_libraries(plasma-phonebook
KF5::Contacts
)
install
(
TARGETS plasma-phonebook
${
KF5_INSTALL_TARGETS_DEFAULT_ARGS
}
)
add_subdirectory
(
kpeopleactionplugin
)
src/kpeopleactionplugin/CMakeLists.txt
0 → 100644
View file @
2161d950
kcoreaddons_add_plugin
(
phonebook_kpeople_plugin SOURCES kpeopleactionsplugin.cpp JSON
"phonebook_kpeople_plugin.json"
INSTALL_NAMESPACE
"kpeople/actions"
)
target_link_libraries
(
phonebook_kpeople_plugin
KF5::CoreAddons
KF5::I18n
KF5::People
KF5::PeopleBackend
)
src/kpeopleactionplugin/kpeopleactionsplugin.cpp
0 → 100644
View file @
2161d950
/*
* Copyright (C) 2019 Bhushan Shah <bshah@kde.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "kpeopleactionsplugin.h"
#include <QDebug>
#include <KLocalizedString>
#include <KPluginFactory>
#include <KPeopleBackend/AbstractContact>
KPeopleActionsPlugin
::
KPeopleActionsPlugin
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
AbstractPersonAction
(
parent
)
{
Q_UNUSED
(
args
)
}
QList
<
QAction
*>
KPeopleActionsPlugin
::
actionsForPerson
(
const
KPeople
::
PersonData
&
data
,
QObject
*
parent
)
const
{
Q_UNUSED
(
parent
)
QList
<
QAction
*>
actions
;
QVariant
number
=
data
.
contactCustomProperty
(
KPeople
::
AbstractContact
::
PhoneNumberProperty
);
if
(
!
number
.
toString
().
isEmpty
())
{
QAction
*
action
=
new
QAction
(
QIcon
::
fromTheme
(
"call-start"
),
i18nc
(
"Action to tell user to call person using phone number"
,
"Call %1 on %2"
,
data
.
name
(),
number
.
toString
()));
actions
<<
action
;
}
return
actions
;
}
K_PLUGIN_FACTORY_WITH_JSON
(
KPeopleActionsPluginFactory
,
"phonebook_kpeople_plugin.json"
,
registerPlugin
<
KPeopleActionsPlugin
>
();
)
#include "kpeopleactionsplugin.moc"
src/kpeopleactionplugin/kpeopleactionsplugin.h
0 → 100644
View file @
2161d950
/*
* Copyright (C) 2019 Bhushan Shah <bshah@kde.org>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KPEOPLEACTIONSPLUGIN_H
#define KPEOPLEACTIONSPLUGIN_H
#include <QObject>
#include <KPeopleBackend/AbstractPersonAction>
class
KPeopleActionsPlugin
:
public
KPeople
::
AbstractPersonAction
{
Q_OBJECT
public:
KPeopleActionsPlugin
(
QObject
*
parent
,
const
QVariantList
&
args
);
QList
<
QAction
*>
actionsForPerson
(
const
KPeople
::
PersonData
&
data
,
QObject
*
parent
)
const
override
;
};
#endif // KPEOPLEACTIONSPLUGIN_H
src/kpeopleactionplugin/phonebook_kpeople_plugin.json
0 → 100644
View file @
2161d950
{
"Encoding"
:
"UTF-8"
,
"KPlugin"
:
{
"Authors"
:
[
{
"Email"
:
"bshah@kde.org"
,
"Name"
:
"Bhushan Shah"
}
],
"EnabledByDefault"
:
true
,
"Id"
:
"phonebook"
,
"License"
:
"GPL"
,
"ServiceTypes"
:
[
"KPeople/Plugin"
],
"Version"
:
"0.1"
}
}
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