Changeset View
Changeset View
Standalone View
Standalone View
babe.cpp
1 | #include "babe.h" | 1 | #include "babe.h" | ||
---|---|---|---|---|---|
2 | 2 | | |||
3 | #include "db/collectionDB.h" | 3 | #include "db/collectionDB.h" | ||
4 | #include "db/conthread.h" | 4 | #include "db/conthread.h" | ||
5 | #include "settings/BabeSettings.h" | 5 | #include "settings/BabeSettings.h" | ||
6 | #include "pulpo/pulpo.h" | 6 | #include "pulpo/pulpo.h" | ||
7 | #include "utils/babeconsole.h" | 7 | #include "utils/babeconsole.h" | ||
8 | 8 | | |||
9 | #include <QPalette> | 9 | #include <QPalette> | ||
10 | #include <QWidget> | | |||
11 | #include <QColor> | 10 | #include <QColor> | ||
12 | #include <QIcon> | 11 | #include <QIcon> | ||
13 | #include <QApplication> | 12 | #include <QGuiApplication> | ||
14 | #include <QDesktopWidget> | | |||
15 | #include <QDirIterator> | 13 | #include <QDirIterator> | ||
16 | #include <QtQml> | 14 | #include <QtQml> | ||
17 | #include <QDesktopServices> | 15 | #include <QDesktopServices> | ||
16 | #include <QCursor> | ||||
18 | 17 | | |||
19 | //#include "Python.h" | 18 | //#include "Python.h" | ||
20 | 19 | | |||
21 | #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) | 20 | #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) | ||
21 | #include <QWidget> | ||||
22 | #include "kde/notify.h" | 22 | #include "kde/notify.h" | ||
23 | #include "kde/kdeconnect.h" | 23 | #include "kde/kdeconnect.h" | ||
24 | #endif | 24 | #endif | ||
25 | 25 | | |||
26 | #if defined(Q_OS_ANDROID) | 26 | #if defined(Q_OS_ANDROID) | ||
27 | #include "android/notificationclient.h" | 27 | #include "android/notificationclient.h" | ||
28 | #include "android/android.h" | 28 | #include "android/android.h" | ||
29 | #include <QAndroidJniObject> | 29 | #include <QAndroidJniObject> | ||
▲ Show 20 Lines • Show All 645 Lines • ▼ Show 20 Line(s) | |||||
675 | bool Babe::isMobile() | 675 | bool Babe::isMobile() | ||
676 | { | 676 | { | ||
677 | return BAE::isMobile(); | 677 | return BAE::isMobile(); | ||
678 | } | 678 | } | ||
679 | 679 | | |||
680 | int Babe::screenGeometry(QString side) | 680 | int Babe::screenGeometry(QString side) | ||
681 | { | 681 | { | ||
682 | side = side.toLower(); | 682 | side = side.toLower(); | ||
683 | auto geo = QApplication::desktop()->screenGeometry(); | 683 | auto geo = QGuiApplication::primaryScreen()->geometry(); | ||
684 | 684 | | |||
685 | if(side == "width") | 685 | if(side == "width") | ||
686 | return geo.width(); | 686 | return geo.width(); | ||
687 | else if(side == "height") | 687 | else if(side == "height") | ||
688 | return geo.height(); | 688 | return geo.height(); | ||
689 | else return 0; | 689 | else return 0; | ||
690 | } | 690 | } | ||
691 | 691 | | |||
▲ Show 20 Lines • Show All 195 Lines • ▼ Show 20 Line(s) | 829 | { | |||
887 | 887 | | |||
888 | return mapList; | 888 | return mapList; | ||
889 | } | 889 | } | ||
890 | 890 | | |||
891 | QVariantList Babe::getDevices() | 891 | QVariantList Babe::getDevices() | ||
892 | { | 892 | { | ||
893 | #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) | 893 | #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) | ||
894 | return KdeConnect::getDevices(); | 894 | return KdeConnect::getDevices(); | ||
895 | #else | ||||
896 | return {}; | ||||
895 | #endif | 897 | #endif | ||
896 | } | 898 | } | ||
897 | 899 | | |||
898 | bool Babe::sendToDevice(const QString &name, const QString &id, const QString &url) | 900 | bool Babe::sendToDevice(const QString &name, const QString &id, const QString &url) | ||
899 | { | 901 | { | ||
900 | #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) | 902 | #if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID)) | ||
901 | return KdeConnect::sendToDevice(name, id, url) ? true : false; | 903 | return KdeConnect::sendToDevice(name, id, url) ? true : false; | ||
904 | #else | ||||
905 | return {}; | ||||
902 | #endif | 906 | #endif | ||
903 | } | 907 | } | ||
904 | 908 | | |||
905 | void Babe::debug(const QString &msg) | 909 | void Babe::debug(const QString &msg) | ||
906 | { | 910 | { | ||
907 | emit this->message(msg); | 911 | emit this->message(msg); | ||
908 | } | 912 | } | ||
909 | 913 | | |||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |