Refactor build system.
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
include(../config.pri)
|
||||
include(../common/defines.pri)
|
||||
|
||||
QT += qml quick core network sql
|
||||
TEMPLATE += app
|
||||
TARGET = qcma_android
|
||||
TEMPLATE=app
|
||||
QT += network sql
|
||||
CONFIG += mobility
|
||||
|
||||
android {
|
||||
QT += androidextras
|
||||
QT += androidextras
|
||||
}
|
||||
|
||||
QT -= gui
|
||||
LIBS += -L../common -lqcma_common
|
||||
CONFIG += mobility
|
||||
|
||||
# this library needs to link statically their deps but Qt doesn't pass --static to PKGCONFIG
|
||||
QMAKE_CXXFLAGS += $$system(pkg-config --static --cflags libvitamtp)
|
||||
LIBS += -lvitamtp -lxml2 -liconv
|
||||
|
||||
SOURCES += \
|
||||
main_android.cpp \
|
||||
@@ -34,3 +29,9 @@ DISTFILES += \
|
||||
android-src/gradlew.bat
|
||||
|
||||
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android-src
|
||||
|
||||
include(../common/common.pri)
|
||||
|
||||
android {
|
||||
LIBS += -lvitamtp -lxml2 -liconv
|
||||
}
|
||||
|
||||
@@ -25,10 +25,15 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QHostInfo>
|
||||
#include <QSettings>
|
||||
#include <QStandardPaths>
|
||||
#include <QTextStream>
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
#include <QAndroidJniObject>
|
||||
#endif
|
||||
|
||||
#include <vitamtp.h>
|
||||
|
||||
ServiceManager::ServiceManager(QObject *obj_parent)
|
||||
@@ -211,9 +216,13 @@ void ServiceManager::loadDefaultSettings()
|
||||
|
||||
settings.setValue("protocolVersion", VITAMTP_PROTOCOL_MAX_VERSION);
|
||||
|
||||
#ifdef Q_OS_ANDROID
|
||||
QString deviceName = QAndroidJniObject::getStaticObjectField(
|
||||
"android/os/Build", "MODEL", "Ljava/lang/String;")
|
||||
.toString();
|
||||
#else
|
||||
QString deviceName = QHostInfo::localHostName();
|
||||
#endif
|
||||
|
||||
qDebug("Detected device model: %s", qPrintable(deviceName));
|
||||
settings.setValue("hostName", deviceName);
|
||||
|
||||
Reference in New Issue
Block a user