From 2aed7f61db5943affb0c6b300e9be3d71d999af9 Mon Sep 17 00:00:00 2001 From: Rainer Stransky Date: Wed, 19 Dec 2018 13:57:40 +0100 Subject: [PATCH 1/3] added linux support --- build_linux.sh | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 build_linux.sh diff --git a/build_linux.sh b/build_linux.sh new file mode 100755 index 0000000..91ec17b --- /dev/null +++ b/build_linux.sh @@ -0,0 +1,67 @@ +# Stop at any error +set -e + +export QTDIR=/usr/share/qt5/wrappers/ +export QTDIR=/usr/lib64/qt5 +# Location of the QT tools +if [ -z ${QTDIR+x} ]; then + echo "QTDIR path not defined- please set it to the location containing the Qt version to build against. For example:" + echo " export QTDIR=/Applications/Qt/5.10.0/clang_64" + exit 1 +fi + +QMAKE=${QTDIR}/bin/qmake +MAKE=make + +# location of the source tree +SOURCEDIR=`pwd`'/src' + +# Location to build PatternPaint +BUILDDIR=`pwd`'/build_linux' + + +################## Build JetiAppManager ################### +mkdir -p ${BUILDDIR} +pushd ${BUILDDIR} + +${QMAKE} ${SOURCEDIR}/JetiAppManager.pro \ + -r \ + -spec linux-g++ \ + CONFIG+=console \ + CONFIG+=x86_64 + +# CONFIG+=x86_64 + + +#${MAKE} clean +${MAKE} -j6 + +popd + + +################## Package using macdeployqt ################# +pushd ${BUILDDIR} + +APP=${BUILDDIR}/JetiAppManager.app + +# Integrate the system frameworks +${QTDIR}/bin/macdeployqt ${APP} -verbose=1 + + +################## make DMG ################# + +DMG_NAME=JetiAppManager + +mkdir ${DMG_NAME} +mv ${APP}/ ${DMG_NAME}/ + +hdiutil create -volname ${DMG_NAME} -srcfolder ${DMG_NAME} -ov -format UDZO ${DMG_NAME}.dmg + +rm -R ${DMG_NAME} + +popd + +echo "" +echo "#####################################" +echo "JetiAppManager created successfully !" +echo "" From daf39189647df376a2d6770592521a04ed35e5c1 Mon Sep 17 00:00:00 2001 From: Rainer Stransky Date: Wed, 19 Dec 2018 14:00:53 +0100 Subject: [PATCH 2/3] added linux support --- src/appmanager.cpp | 27 +++++++++++++++------------ src/defaults.h | 4 ++-- src/main.cpp | 1 + 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/appmanager.cpp b/src/appmanager.cpp index 3815626..66e1121 100644 --- a/src/appmanager.cpp +++ b/src/appmanager.cpp @@ -80,8 +80,8 @@ bool AppManager::uninstallApp(Transmitter transmitter, QString appName) QString destPath; QString appFolderPath = TRANSMITTER_APPFOLDER; - #ifdef __APPLE__ - // OSX path + #if defined(__APPLE__) || defined(__linux__) + // generic path destPath = transmitter.rootPath + app.destinationPath[i]; appFolderPath = transmitter.rootPath + appFolderPath; #elif _WIN32 @@ -158,8 +158,8 @@ bool AppManager::isHttpRedirect(QNetworkReply *reply) bool AppManager::isTransmitterValid(QString rootpath) { QString destFile = TRANSMITTER_CONFIGFILE; - #ifdef __APPLE__ - // OSX path + #if defined(__APPLE__) || defined(__linux__) + // generic path destFile = rootpath + destFile; #elif _WIN32 // WIN path @@ -178,8 +178,8 @@ bool AppManager::isTransmitterValid(QString rootpath) bool AppManager::isTransmitterSupportLua(QString rootpath) { QString destPath = TRANSMITTER_APPFOLDER; - #ifdef __APPLE__ - // OSX path + #if defined(__APPLE__) || defined(__linux__) + // generic path destPath = rootpath + destPath; #elif _WIN32 // WIN path @@ -408,6 +408,7 @@ void AppManager::downloadFinished(QNetworkReply *reply) emit(hasNewAppInformation()); emit(hasNewAppStatus()); + } }else if(fileType == installSourcefile){ @@ -423,8 +424,8 @@ void AppManager::downloadFinished(QNetworkReply *reply) if(sourceFileUrl == url && !transmitterList.isEmpty()){ QString destPath; - #ifdef __APPLE__ - // OSX path + #if defined(__APPLE__) || defined(__linux__) + // generic path destPath = transmitterList[currentTransmitterIndex].rootPath + app.destinationPath[i] + "/"; #elif _WIN32 // WIN path @@ -564,8 +565,8 @@ bool AppManager::isAppInstalled(Transmitter transmitter, QString appName) QUrl url = QUrl::fromEncoded(sourceList[i].toLocal8Bit()); QString destFile; - #ifdef __APPLE__ - // OSX path + #if defined(__APPLE__) || defined(__linux__) + // generic path destFile = transmitter.rootPath + app.destinationPath[i] + "/" + url.fileName(); #elif _WIN32 // WIN path @@ -603,8 +604,10 @@ void AppManager::checkAllAppsForUpdate(Transmitter transmitter) QUrl url = QUrl::fromEncoded(sourceList[i].toLocal8Bit()); QString destFile; - #ifdef __APPLE__ - // OSX path + #if defined(__APPLE__) || defined(__linux__) + // generic path + destFile = transmitter.rootPath + app.destinationPath[i] + "/" + url.fileName(); + #elif __linux__ destFile = transmitter.rootPath + app.destinationPath[i] + "/" + url.fileName(); #elif _WIN32 // WIN path diff --git a/src/defaults.h b/src/defaults.h index 26cdcea..eec9746 100644 --- a/src/defaults.h +++ b/src/defaults.h @@ -4,7 +4,7 @@ #endif // DEFAULTS_H // Version -#define JETIAPPMANAGER_VERSION "V0.7 beta" +#define JETIAPPMANAGER_VERSION "V0.6" // Default settings @@ -26,7 +26,7 @@ // Font sizes -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(__linux__) #define FONTSIZE_APP_DESCRIPTION 16 #define FONTSIZE_APP_VERSION 10 #define FONTSIZE_APP_AUTHOR 10 diff --git a/src/main.cpp b/src/main.cpp index 56bb7f7..2bbae3e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,7 @@ int main(int argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + qRegisterMetaTypeStreamOperators>("Data"); QApplication a(argc, argv); a.setOrganizationName("Nightflyer88"); From b2baba6509074a81d6c15343f47197c45222db87 Mon Sep 17 00:00:00 2001 From: Rainer Stransky Date: Wed, 19 Dec 2018 14:04:57 +0100 Subject: [PATCH 3/3] added linux support --- src/defaults.h | 2 +- src/main.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/defaults.h b/src/defaults.h index eec9746..8223172 100644 --- a/src/defaults.h +++ b/src/defaults.h @@ -4,7 +4,7 @@ #endif // DEFAULTS_H // Version -#define JETIAPPMANAGER_VERSION "V0.6" +#define JETIAPPMANAGER_VERSION "V0.7 beta" // Default settings diff --git a/src/main.cpp b/src/main.cpp index 2bbae3e..82fd116 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,6 +5,9 @@ int main(int argc, char *argv[]) { QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + // this is necessary for support of deserialization of the preference data for linux + // if this is missing an error message is given and no URLs are loaded: + // > QVariant::load: unknown user type with name QList qRegisterMetaTypeStreamOperators>("Data"); QApplication a(argc, argv);