mirror of
https://github.com/QuasarApp/QtDeployer.git
synced 2025-04-26 21:44:31 +00:00
added version cintrol
This commit is contained in:
parent
d9a43986d0
commit
a1966faa62
@ -1,5 +1,5 @@
|
||||
name: qt-deployer
|
||||
version: '1.0.2.core16'
|
||||
version: '1.0.3.core16'
|
||||
summary: Deploy Qt Project
|
||||
description: |
|
||||
Deploy Qt Projects. this application extract all depends library of executable and create launch script for your application. |
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "about.h"
|
||||
#include "ui_about.h"
|
||||
#include <QPixmap>
|
||||
#include "utils.h"
|
||||
|
||||
About::About(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
@ -12,6 +13,7 @@ About::About(QWidget *parent) :
|
||||
|
||||
ui->logo->setText("<img align=middle height=100 width=110 src='://icon' />");
|
||||
QString text = QString("<p style='text-align: left;'> </p>"
|
||||
"<p style='text-align: left;'>Version:" + Utils::getVersion() + "<br />%1 <a href='https://github.com/ShahriarSS/QtLinuxDeployer' target='_blank' rel='noopener'><span style='color: #00ff00;'>QtLinuxDeployer</span></a></p>"
|
||||
"<p style='text-align: left;'>%0<br />%1 <a href='https://github.com/ShahriarSS/QtLinuxDeployer' target='_blank' rel='noopener'><span style='color: #00ff00;'>QtLinuxDeployer</span></a></p>"
|
||||
"<p style='text-align: left;'><br /><span style='color: #00ff00;'>%2</span><br />* %3 <span style='color: #00ff00;'>%4</span>.<br />* %5<span style='color: #00ff00;'> %6</span>.</p>"
|
||||
"<p style='text-align: left;'>%7</p>"
|
||||
|
@ -115,24 +115,24 @@ bool BuildManager::build(){
|
||||
pQMake.setWorkingDirectory(tempBuildFolder);
|
||||
pQMake.setArguments(QStringList() << m_projectdir);
|
||||
|
||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||
env.insert("LD_LIBRARY_PATH", m_qtdir + "/lib");
|
||||
env.insert("QML_IMPORT_PATH", m_qtdir + "/qml");
|
||||
env.insert("QML2_IMPORT_PATH", m_qtdir + "/qml");
|
||||
env.insert("QT_PLUGIN_PATH", m_qtdir + "/plugins");
|
||||
env.insert("QT_QPA_PLATFORM_PLUGIN_PATH", m_qtdir + "/plugins/platforms");
|
||||
|
||||
pQMake.setProcessEnvironment(env);
|
||||
|
||||
pQMake.start();
|
||||
|
||||
if(pQMake.state() == QProcess::NotRunning){
|
||||
emit logChanged(tr("run qmake error!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!pQMake.waitForFinished()){
|
||||
emit logChanged(tr("run qmake error!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
pQMake.setProgram("make");
|
||||
|
||||
if(pQMake.state() == QProcess::NotRunning){
|
||||
emit logChanged(tr("run qmake error!"));
|
||||
return false;
|
||||
}
|
||||
|
||||
pQMake.setArguments(QStringList() << QString("-j%0").arg(QThread::idealThreadCount()));
|
||||
pQMake.start();
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "mainmanager.h"
|
||||
#include "utils.h"
|
||||
|
||||
QStringList MainManager::getAllExecutables()
|
||||
{
|
||||
@ -90,6 +91,10 @@ const QString& MainManager::outDir() const{
|
||||
return m_outputdir;
|
||||
}
|
||||
|
||||
QString MainManager::appVer() const{
|
||||
return Utils::getVersion();
|
||||
}
|
||||
|
||||
void MainManager::setState(int state)
|
||||
{
|
||||
if (m_state == state) return;
|
||||
|
@ -14,6 +14,8 @@ class MainManager : public BaseClass
|
||||
|
||||
Q_PROPERTY(int state READ state WRITE setState NOTIFY stateChanged)
|
||||
Q_PROPERTY(QString outDir READ outDir NOTIFY outDirChanged)
|
||||
Q_PROPERTY(QString appVer READ appVer)
|
||||
|
||||
|
||||
CppManager *m_cpp;
|
||||
QmlManager *m_qml;
|
||||
@ -45,6 +47,8 @@ public slots:
|
||||
void start(bool erase);
|
||||
const QString& outDir() const;
|
||||
|
||||
QString appVer() const;
|
||||
|
||||
bool hasPrems(const QString &path);
|
||||
QString stringFromUrl(QString url);
|
||||
bool pathExists(bool isdir, const QString &path);
|
||||
|
35
source/CPP/utils.cpp
Normal file
35
source/CPP/utils.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include "utils.h"
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
|
||||
|
||||
QString Utils::getVersion(){
|
||||
|
||||
QFileInfo f("./../snap/snapcraft.yaml");
|
||||
QFile file(f.absoluteFilePath());
|
||||
|
||||
if(file.open(QIODevice::ReadOnly)){
|
||||
QString yamlFile = file.readAll();
|
||||
file.close();
|
||||
|
||||
yamlFile.replace(" ", "");
|
||||
yamlFile.replace("'", "");
|
||||
|
||||
int tempIndex = yamlFile.indexOf(QRegExp("version:"));
|
||||
if(tempIndex < 0){
|
||||
return "error in yaml version";
|
||||
}
|
||||
int beginTarget = tempIndex + 8;
|
||||
|
||||
tempIndex = yamlFile.indexOf("\n", beginTarget);
|
||||
int longTraget = -1;
|
||||
|
||||
if(tempIndex >= 0){
|
||||
longTraget = tempIndex - beginTarget;
|
||||
}
|
||||
|
||||
return yamlFile.mid(beginTarget, longTraget);
|
||||
}
|
||||
|
||||
return file.errorString();
|
||||
}
|
14
source/CPP/utils.h
Normal file
14
source/CPP/utils.h
Normal file
@ -0,0 +1,14 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
#include <QString>
|
||||
|
||||
class Utils
|
||||
{
|
||||
private:
|
||||
Utils() = delete;
|
||||
public:
|
||||
static QString getVersion();
|
||||
|
||||
};
|
||||
|
||||
#endif // UTILS_H
|
@ -30,6 +30,7 @@ Item {
|
||||
text: qsTr("This application forked by ShahriarSS
|
||||
Page of original soft: https://github.com/ShahriarSS/QtLinuxDeployer
|
||||
|
||||
version: "+MainManager.appVer+"
|
||||
|
||||
Developers of fork:
|
||||
* Programmer: Yankovich Andrei.
|
||||
|
@ -1,7 +1,7 @@
|
||||
TEMPLATE = app
|
||||
|
||||
|
||||
lessThan(QT_MINOR_VERSION, 6){
|
||||
lessThan(QT_MINOR_VERSION, 8){
|
||||
QT += widgets
|
||||
}else {
|
||||
QT += qml quick
|
||||
@ -42,7 +42,8 @@ SOURCES += \
|
||||
CPP/outputmanager.cpp \
|
||||
CPP/pluginmanager.cpp \
|
||||
CPP/qmlmanager.cpp \
|
||||
CPP/buildmanager.cpp
|
||||
CPP/buildmanager.cpp \
|
||||
CPP/utils.cpp
|
||||
|
||||
HEADERS += \
|
||||
CPP/baseclass.h \
|
||||
@ -51,10 +52,11 @@ HEADERS += \
|
||||
CPP/outputmanager.h \
|
||||
CPP/pluginmanager.h \
|
||||
CPP/qmlmanager.h \
|
||||
CPP/buildmanager.h
|
||||
CPP/buildmanager.h \
|
||||
CPP/utils.h
|
||||
|
||||
|
||||
lessThan(QT_MINOR_VERSION, 6){
|
||||
lessThan(QT_MINOR_VERSION, 8){
|
||||
|
||||
SOURCES += \
|
||||
mainwindow.cpp \
|
||||
@ -77,7 +79,7 @@ TRANSLATIONS += \
|
||||
languages/en.ts \
|
||||
languages/ru.ts
|
||||
|
||||
VERSION = 1.0.0.0
|
||||
VERSION = 1.0.3.0
|
||||
TEMPLATE = app
|
||||
RC_ICONS = snap/icon.ico
|
||||
|
||||
@ -88,4 +90,6 @@ FORMS += \
|
||||
CPP/about.ui
|
||||
|
||||
DISTFILES += \
|
||||
../snap/snapcraft.yaml
|
||||
../snap/snapcraft.yaml \
|
||||
../snap/core18/snapcraft.yaml \
|
||||
../snap/dumpSnap/snapcraft.yaml
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include <QtGlobal>
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 7, 0))
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 8, 0))
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QQmlContext>
|
||||
@ -43,7 +43,7 @@ int main(int argc, char *argv[])
|
||||
QGuiApplication *app;;
|
||||
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
|
||||
app = new QGuiApplication(argc, argv);
|
||||
#else
|
||||
app = new QApplication(argc, argv);
|
||||
@ -74,7 +74,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
MainManager M(&C, &Q, &O, &P, &B);
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
auto *R = engine.rootContext();
|
||||
|
Loading…
x
Reference in New Issue
Block a user