Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from QuasarApp/version_1_1
Browse files Browse the repository at this point in the history
fix build from pro file
  • Loading branch information
EndrII committed Aug 16, 2018
2 parents 51a1a4c + a2a14db commit 4773835
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: qt-deployer
version: '1.1.0'
version: '1.1.1'
summary: Deploy Qt Project
description: |
Deploy Qt Projects. this application extract all depends library of executable and create launch script for your application. |
Expand Down
2 changes: 1 addition & 1 deletion source/CPP/baseclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

QString BaseClass::m_qtdir = QString();
QString BaseClass::m_outputdir = QString();
QString BaseClass::m_projectdir = QString();
QString BaseClass::m_projectfile = QString();
QString BaseClass::m_executablepath = QString();
QString BaseClass::m_binarycreator = QString();
QString BaseClass::projectName = QString();
Expand Down
2 changes: 1 addition & 1 deletion source/CPP/baseclass.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class BaseClass : public QObject
static QString m_qtdir;
static QString m_outputdir;
static QString m_binarycreator;
static QString m_projectdir;
static QString m_projectfile;
static QString m_executablepath;
static QString projectName;
static QString appIcon;
Expand Down
34 changes: 17 additions & 17 deletions source/CPP/buildmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,14 @@ bool BuildManager::createFulder(QDir& dir, QString &path, const QString &name) c
}

bool BuildManager::initFolders() {
QDir dir(m_projectdir);
if(!dir.cd("..")) {
return false;
}
QStringList filesList = findFilesInsideDir("*.pro", m_projectdir);

if(filesList.size() < 1){
QFileInfo pro(m_projectfile);
QDir dir = pro.absoluteDir();
if(!dir.cd("..")) {
return false;
}

QFile f(filesList.first());
QFile f(m_projectfile);
if(!f.open(QIODevice::ReadOnly | QIODevice::Text)){
return false;
}
Expand All @@ -76,18 +73,21 @@ bool BuildManager::initFolders() {

proFile.replace(" ", "");
int tempIndex = proFile.indexOf(QRegExp("TARGET=") );
if(tempIndex < 0){
return false;
}
int beginTarget = tempIndex + 7;
if(tempIndex < 0) {

tempIndex = proFile.indexOf("\n", beginTarget);
int longTraget = -1;
projectName = pro.baseName();
} else {
int beginTarget = tempIndex + 7;

if(tempIndex >= 0){
longTraget = tempIndex - beginTarget;
tempIndex = proFile.indexOf("\n", beginTarget);
int longTraget = -1;

if(tempIndex >= 0){
longTraget = tempIndex - beginTarget;
}
projectName = proFile.mid(beginTarget, longTraget);
}
projectName = proFile.mid(beginTarget, longTraget);


if(!createFulder(dir, tempBuildFolder, "Build-" + projectName)){
return false;
Expand All @@ -113,7 +113,7 @@ bool BuildManager::build(){

pQMake.setProgram(qmake);
pQMake.setWorkingDirectory(tempBuildFolder);
pQMake.setArguments(QStringList() << m_projectdir);
pQMake.setArguments(QStringList() << m_projectfile);

QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
env.insert("LD_LIBRARY_PATH", m_qtdir + "/lib");
Expand Down
2 changes: 1 addition & 1 deletion source/CPP/mainmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ void MainManager::prepare(const QString &qtdir, const QString &projectdir, const
if (S[S.count() - 1] == '/') S.remove(S.count() - 1, 1);

m_qtdir = list[0];
m_projectdir = list[1];
m_projectfile = list[1];

if(QFileInfo(icon).exists()){
appIcon = icon;
Expand Down
2 changes: 0 additions & 2 deletions source/CPP/mainmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ 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;
Expand Down
6 changes: 4 additions & 2 deletions source/CPP/pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ QStringList PluginManager::findPluginsFromModules()

QStringList PluginManager::extractModules()
{
QStringList proandprifiles = findFilesInsideDir("*.pro", m_projectdir);
proandprifiles << findFilesInsideDir("*.pri", m_projectdir);
QStringList proandprifiles =
findFilesInsideDir("*.pro", QFileInfo(m_projectfile).absoluteDir().path());
proandprifiles << findFilesInsideDir("*.pri",
QFileInfo(m_projectfile).absoluteDir().path());

QStringList modules;
for (const QString &file : proandprifiles)
Expand Down
2 changes: 1 addition & 1 deletion source/CPP/qmlmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void QmlManager::start()
m_foundImports.clear();
m_notFoundImports.clear();

extractImportsFromDir(m_projectdir);
extractImportsFromDir(QFileInfo(m_projectfile).absoluteDir().path());
removeInnerImports();
divideFoundAndNotFound();

Expand Down
2 changes: 1 addition & 1 deletion source/QML/About.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Item {
text: qsTr("This application forked by ShahriarSS
Page of original soft: https://github.com/ShahriarSS/QtLinuxDeployer
version: "+MainManager.appVer+"
version: "+MainManager.appVer()+"
Developers of fork:
* Programmer: Yankovich Andrei.
Expand Down
2 changes: 1 addition & 1 deletion source/QML/PathChooser.qml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ColumnLayout {
}

Button {
text: "Browse"
text: qsTr("Browse")
onClicked: fd.open()
Material.background: buttonColor
}
Expand Down
10 changes: 6 additions & 4 deletions source/QML/StartPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ Page {
}

PathChooser {
id: projectdir
title: qsTr("Project Directory")
id: projectfile
title: qsTr("Project File")
isdir: false

}

PathChooser {
Expand All @@ -44,10 +46,10 @@ Page {
text: qsTr("Next")
Material.background: buttonColor
Layout.alignment: Qt.AlignRight
enabled: qtdir.confirmed && projectdir.confirmed
enabled: qtdir.confirmed && projectfile.confirmed

onClicked: {
MainManager.prepare(qtdir.content, projectdir.content, icon.content)
MainManager.prepare(qtdir.content, projectfile.content, icon.content)

prp.outdir = MainManager.outDir
swipeview.currentIndex = 1
Expand Down

0 comments on commit 4773835

Please sign in to comment.