Commit 98434636 authored by Camilo higuita's avatar Camilo higuita

push fixes

parent 60c4a0b6
......@@ -79,10 +79,10 @@ if (ANDROID)
target_link_libraries(vvave Qt5::AndroidExtras)
# kde_source_files_enable_exceptions(union src/pix.cpp)
else()
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica Contacts)
find_package(KF5 ${KF5_VERSION} REQUIRED COMPONENTS I18n Notifications Config KIO Attica Contacts People)
find_package(Qt5 REQUIRED COMPONENTS WebEngine)
target_link_libraries(union KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Attica KF5::Contacts)
target_link_libraries(union KF5::ConfigCore KF5::Notifications KF5::KIOCore KF5::I18n KF5::Attica KF5::Contacts KF5::People)
endif()
if (TARGET create-apk-union)
......
......@@ -26,7 +26,7 @@
#include <KContacts/Addressee>
#include <KContacts/VCardConverter>
#include "kcontactsinterface.h"
#include <kpeople/personsmodel.h>
using namespace KContacts;
......@@ -35,6 +35,17 @@ kcontactsinterface::kcontactsinterface(QObject *parent) : QObject(parent)
}
FMH::MODEL_LIST kcontactsinterface::getContacts(const QString &query)
{
KPeople::PersonsModel model;
qDebug()<< "KPEOPLE CONCTAS" << model.rowCount();
for(auto i = 0 ; i< model.rowCount(); i++)
qDebug()<< "KPEOPLE CONCTAS" << model.get(i, KPeople::PersonsModel::FormattedNameRole);
return FMH::MODEL_LIST();
}
void kcontactsinterface::addContact(QString name, QString tel)
{
// addresses
......
......@@ -22,12 +22,18 @@
#define KCONTACTSINTERFACE_H
#include <QObject>
#ifdef STATIC_MAUIKIT
#include "fmh.h"
#else
#include <MauiKit/fmh.h>
#endif
class kcontactsinterface : public QObject
{
Q_OBJECT
public:
explicit kcontactsinterface(QObject *parent = nullptr);
FMH::MODEL_LIST getContacts(const QString &query);
signals:
......
......@@ -4,6 +4,8 @@
#ifdef Q_OS_ANDROID
#include "./src/interfaces/androidintents.h"
#else
#include "./src/interfaces/kcontactsinterface.h"
#endif
Synchroniser::Synchroniser(QObject *parent) : QObject (parent)
......@@ -19,6 +21,9 @@ FMH::MODEL_LIST Synchroniser::getContacts(const QString &query)
#ifdef Q_OS_ANDROID
AndroidIntents android;
data << android.getContacts();
#else Q_OS_LINUX
kcontactsinterface kcontacts;
data << kcontacts.getContacts("");
#endif
return data;
......
......@@ -3,11 +3,6 @@ import QtQuick.Controls 2.3
import org.kde.mauikit 1.0 as Maui
import QtQuick.Layouts 1.3
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.6 as Kirigami
import org.kde.people 1.0 as KPeople
import "views/contacts"
import "views/dialer"
import "widgets"
......@@ -43,7 +38,7 @@ Maui.ApplicationWindow
// onSearchButtonClicked: footBar.visible = !footBar.visible
leftIcon.visible: false
rightIcon.visible: false
headBar.implicitHeight: toolBarHeight * 1.5
headBar.implicitHeight: toolBarHeight * 1.2
headBar.drawBorder: false
headBarBGColor: backgroundColor
headBarFGColor: textColor
......@@ -64,10 +59,11 @@ Maui.ApplicationWindow
{
id: _contactsButton
Layout.fillWidth: isMobile
Layout.fillHeight: true
iconName: "view-media-artist"
iconColor: currentView === views.contacts ? highlightColor : textColor
// text: qsTr("Contacts")
height: parent.height
// height: parent.height
showIndicator: currentView === views.contacts
onClicked: currentView = views.contacts
......@@ -79,7 +75,7 @@ Maui.ApplicationWindow
Layout.fillWidth: isMobile
iconName: "view-list-icons"
height: parent.height
Layout.fillHeight: true
iconColor: currentView === views.dialer ? highlightColor : textColor
// text: qsTr("Dialer")
// visible: isAndroid
......@@ -95,7 +91,7 @@ Maui.ApplicationWindow
Layout.fillWidth: isMobile
iconName: "view-media-recent"
height: parent.height
Layout.fillHeight: true
iconColor: currentView === views.recent ? highlightColor : textColor
// text: qsTr("Recent")
// visible: isAndroid
......@@ -109,7 +105,7 @@ Maui.ApplicationWindow
Layout.fillWidth: isMobile
iconName: "draw-star"
height: parent.height
Layout.fillHeight: true
iconColor: currentView === views.favs ? highlightColor : textColor
// text: qsTr("Favorites")
showIndicator: currentView === views.favs
......@@ -149,19 +145,18 @@ Maui.ApplicationWindow
ContactsView
{
id: _favsView
// list.sqlquery : "select * from contacts where fav = 1"
listView.model: PlasmaCore.SortFilterModel {
sourceModel: KPeople.PersonsSortFilterProxyModel {
sourceModel: KPeople.PersonsModel {
id: contactsModel
}
}
sortRole: "display"
filterRole: "display"
filterRegExp: ".*" + searchField.text + ".*"
sortOrder: Qt.AscendingOrder
}
list.sqlquery : "select * from contacts where fav = 1"
// listView.model: KPeople.PersonsModel {
// id: contactsModel
// }
// listView.delegate: Rectangle
// {
// color: "pink"
// height: 60
// width : 120
// }
}
}
......
......@@ -258,7 +258,7 @@ Maui.Dialog
{
Layout.fillWidth: true
spacing: space.small
visible: contact.org
visible: contact.org && contact.org.length
Label
{
......
......@@ -23,7 +23,7 @@ Maui.Page
{
iconName: "list-add-user"
iconColor: "white"
onClicked: _contactDialog.open()
onClicked: _newContactDialog.open()
}
footBar.colorScheme.borderColor: "transparent"
......@@ -60,7 +60,7 @@ Maui.Page
{
id: _searchField
height: toolBarHeightAlt
anchors.horizontalCenter: parent.horizontalCenter
anchors.centerIn: parent
width: isWide ? control.width * 0.8 : control.width * 0.95
// height: rowHeight
placeholderText: qsTr("Search contacts... ")
......
......@@ -18,6 +18,11 @@ linux:unix:!android {
QT += KIOCore KIOFileWidgets KIOWidgets KNTLM
LIBS += -lMauiKit
SOURCES += src/interfaces/kcontactsinterface.cpp
HEADERS += src/interfaces/kcontactsinterface.h
} else:android {
message(Building helpers for Android)
......@@ -47,7 +52,6 @@ SOURCES += \
src/interfaces/synchroniser.cpp \
src/db/db.cpp \
src/db/dbactions.cpp \
src/interfaces/kcontactsinterface.cpp
RESOURCES += \
$$PWD/src/qml.qrc \
......@@ -65,5 +69,4 @@ HEADERS += \
src/models/basemodel.h \
src/models/contacts/contactsmodel.h \
src/interfaces/synchroniser.h \
src/interfaces/kcontactsinterface.h
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