Commit 98434636 authored by Camilo higuita's avatar Camilo higuita

push fixes

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