Skip to content

Commit

Permalink
fix some WSL issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mjoppich committed Mar 27, 2018
1 parent 203fad3 commit 7ed9fd1
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 64 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,20 @@ cmake_minimum_required(VERSION 3.0)
# Add folder where are supportive functions
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")


IF (FALSE)

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_CXX_COMPILER clang++)
set (CMAKE_C_COMPILER clang)
set (CMAKE_TOOLCHAIN_PREFIX llvm-)

ENDIF(FALSE)

set (CMAKE_CXX_STANDARD 11)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")


MACRO(COPY_IF_DIFFERENT FROM_DIR TO_DIR FILES TARGETS TAGS)
# Macro to implement copy_if_different for a list of files
# Arguments -
Expand Down Expand Up @@ -92,7 +102,7 @@ if (UNIX AND NOT APPLE)
message(STATUS ">>> Linux")

set(Qt5_DIR "")
LIST(APPEND Qt5_DIR "~/Qt/5.8/gcc_64/" "~/Qt/5.7/gcc_64/" "/usr/local/qt/5.7/gcc_64/")
LIST(APPEND Qt5_DIR "~/Qt/5.8/gcc_64/" "~/Qt/5.7/gcc_64/" "/usr/local/qt/5.7/gcc_64/" "/home/mjoppich/qt/qt-everywhere-src-5.10.0/qtbase" "/opt/Qt5.10.0/5.10.0/gcc_64/")

set(ENV{OPENSSL_ROOT_DIR} "/home/users/joppich/libs/openssl/lib/")
set(ENV{LUA_DIR} "/home/users/joppich/libs/lua/")
Expand Down Expand Up @@ -445,7 +455,7 @@ endif()
endif()


if (UNIX AND NOT APPLE)
if (UNIX AND NOT APPLE AND FALSE)
get_filename_component(QT5GUI_DIR ${Qt5_GuiLocation} DIRECTORY)

add_custom_command( TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT5GUI_DIR}/libicudata.so.56 ${PROJECT_BINARY_DIR})
Expand Down
10 changes: 3 additions & 7 deletions src/app/ProcessLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,9 @@ class ProcessLauncher : public QObject
m_sParam = sParam;
m_bWindowsProcNoHandle = bWindowsProcNoHandle;

if (!m_bWindowsProcNoHandle)
{
m_pProcess = new QProcess();
} else {
//m_pThread = NULL;//new ProcessThread(m_sProgram + " " + m_sParam);
m_pProcess = new QProcess();
}

m_pProcess = new QProcess();

}

void setProgram(QString sProg)
Expand Down
3 changes: 3 additions & 0 deletions src/app/QClickableLabel.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ class QClickableLabel : public QLabel
QClickableLabel( const QString & text, QWidget * parent = 0 )
: QLabel(text, parent)
{
QFont font("Monospace");
font.setStyleHint(QFont::TypeWriter);

this->setFont(font);
}

~QClickableLabel(){}
Expand Down
1 change: 1 addition & 0 deletions src/parsing/nodes/ExecutionExecuteNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ class ExecutionExecuteNode : public ExecutionExecutableNode {
std::string sProgram = sLocation + m_sExecutable;

bool bWSL = this->asBool(this->getNodeValueOrValue(m_sWSL, m_sWSL, pID2Node, pInputID2Value, pInputID2FunctionWidget));
bWSL = bWSL && this->onWindows();

ProcessLauncher* pLauncher = new ProcessLauncher(QString(sProgram.c_str()), QString(sCLArg.c_str()), bWSL);

Expand Down
16 changes: 14 additions & 2 deletions src/parsing/nodes/ExecutionIfNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ExecutionIfNode : public ExecutionExecutableNode {

m_sNotSet = "#NOTSET#";

m_sCompareMode = this->getDomElementAttribute(pElement, "comp", "is_set").toStdString();
m_sCompareMode = this->getDomElementAttribute(pElement, "comp", "is_set").toUpper().toStdString();
m_sValue1 = this->getDomElementAttribute(pElement, "value1", QString(m_sNotSet.c_str())).toStdString();
m_sValue2 = this->getDomElementAttribute(pElement, "value2", QString(m_sNotSet.c_str())).toStdString();

Expand All @@ -43,7 +43,19 @@ class ExecutionIfNode : public ExecutionExecutableNode {

m_vValidCompareModes.push_back("is_set");
m_vValidCompareModes.push_back("equals");
m_vValidCompareModes.push_back("EQUALS");

int oldElemCount = m_vValidCompareModes.size();
for (int i = 0; i < oldElemCount; ++i)
{
std::string& sElem = m_vValidCompareModes.at(i);

std::string sElemUp = std::string(sElem);
std::transform(sElemUp.begin(), sElemUp.end(),sElemUp.begin(), ::toupper);

m_vValidCompareModes.push_back(sElemUp);

}


}

Expand Down
14 changes: 13 additions & 1 deletion src/parsing/nodes/ExecutionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ class ExecutionNode {

}

bool onWindows()
{
return (QSysInfo::windowsVersion() != QSysInfo::WV_None);
}

bool checkWSL(QString& sWSLStr,
std::map< std::string, ExecutionNode*>* pID2Node,
std::map<std::string, std::string>* pInputID2Value,
Expand All @@ -117,7 +122,9 @@ class ExecutionNode {

std::string sValue = this->getNodeValueOrValue(sWSLStr.toStdString(), sWSLStr.toStdString(), pID2Node, pInputID2Value, pInputID2FunctionWidget );

if (QString(sValue.c_str()).compare("TRUE", Qt::CaseInsensitive) == 0)

// relocation must be demanded, and we must be on windows
if ((QString(sValue.c_str()).compare("TRUE", Qt::CaseInsensitive) == 0) && this->onWindows())
{
bWSL = true;
}
Expand Down Expand Up @@ -355,6 +362,11 @@ class ExecutionNode {
{
Validable<std::string> oReturn("", false);


if ((sID.size() > 3) && (sID[0] == '$') && (sID[1] == '{') && (sID[sID.size()-1] == '}')) {
sID = sID.substr(2, sID.size() - 3);
}

std::map<std::string, std::string>::iterator oIt = pInputID2Value->find( sID );

// either the id is an input field
Expand Down
52 changes: 0 additions & 52 deletions templates/test.gui

This file was deleted.

0 comments on commit 7ed9fd1

Please sign in to comment.