Commit cc96d95e authored by Nicolas Fella's avatar Nicolas Fella

Request permission for storage access

We need it to access the KPeople db and VCard files
parent 09e40d1b
......@@ -4,6 +4,9 @@
android:versionName="0.0.1"
android:versionCode="1"
android:installLocation="auto">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Plasma Phonebook" android:icon="@drawable/phonebook">
<activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
......
......@@ -32,6 +32,10 @@ find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Test
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Kirigami2 People)
find_package(KF5Contacts "5.12.2" REQUIRED)
if(ANDROID)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS AndroidExtras)
endif()
################# Enable C++11 features for clang and gcc #################
set(CMAKE_CXX_STANDARD 11)
......
......@@ -12,7 +12,7 @@ target_link_libraries(plasma-phonebook
)
if(ANDROID)
target_link_libraries(plasma-phonebook KF5::Kirigami2 Qt5::Svg)
target_link_libraries(plasma-phonebook KF5::Kirigami2 Qt5::Svg Qt5::AndroidExtras)
kirigami_package_breeze_icons(ICONS
go-down-symbolic
......
......@@ -30,6 +30,9 @@
#include "imppmodel.h"
#include "contactimporter.h"
#ifdef Q_OS_ANDROID
#include <QtAndroid>
#endif
Q_DECL_EXPORT int main(int argc, char *argv[])
{
......@@ -48,6 +51,10 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
qmlRegisterUncreatableType<ImppModel>("org.kde.kcontacts", 1, 0, "ImppModel", "Get it from the Addressee");
qmlRegisterType<ContactImporter>("org.kde.phonebook", 1, 0, "ContactImporter");
#ifdef Q_OS_ANDROID
QtAndroid::requestPermissionsSync({"android.permission.WRITE_EXTERNAL_STORAGE"});
#endif
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
if (engine.rootObjects().isEmpty()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment