Merge branch 'develop' of github.com:MultiMC/MultiMC5 into develop

This commit is contained in:
Forkk 2014-01-08 21:50:58 -06:00
commit 0b1e0221f0
2 changed files with 16 additions and 9 deletions

View File

@ -532,13 +532,6 @@ ENDIF()
################################ COMPILE ################################
# ICNS file for OS X
IF(APPLE)
SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns)
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/MultiMC.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
SET(MULTIMC_SOURCES ${MULTIMC_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/MultiMC.icns)
ENDIF(APPLE)
# Link additional libraries
IF(WIN32)
SET(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS}
@ -667,6 +660,11 @@ FILE(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\")
COMPONENT Runtime
)
# ICNS file for OS X
IF(APPLE)
INSTALL(FILES MultiMC.icns DESTINATION MultiMC.app/Contents/Resources)
ENDIF()
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake"

View File

@ -20,6 +20,9 @@ void JavaChecker::performCheck()
process->setArguments(args);
process->setProgram(path);
process->setProcessChannelMode(QProcess::SeparateChannels);
QLOG_DEBUG() << "Running java checker!";
QLOG_DEBUG() << "Java: " + path;
QLOG_DEBUG() << "Args: {" + args.join("|") + "}";
connect(process.get(), SIGNAL(finished(int, QProcess::ExitStatus)), this,
SLOT(finished(int, QProcess::ExitStatus)));
@ -42,15 +45,19 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status)
result.path = path;
result.id = id;
}
QLOG_DEBUG() << "Java checker finished with status " << status << " exit code " << exitcode;
if (status == QProcess::CrashExit || exitcode == 1)
{
QLOG_DEBUG() << "Java checker failed!";
emit checkFinished(result);
return;
}
bool success = true;
QString p_stdout = _process->readAllStandardOutput();
QLOG_DEBUG() << p_stdout;
QMap<QString, QString> results;
QStringList lines = p_stdout.split("\n", QString::SkipEmptyParts);
for(QString line : lines)
@ -70,6 +77,7 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status)
if(!results.contains("os.arch") || !results.contains("java.version") || !success)
{
QLOG_DEBUG() << "Java checker failed - couldn't extract required information.";
emit checkFinished(result);
return;
}
@ -84,7 +92,7 @@ void JavaChecker::finished(int exitcode, QProcess::ExitStatus status)
result.mojangPlatform = is_64 ? "64" : "32";
result.realPlatform = os_arch;
result.javaVersion = java_version;
QLOG_DEBUG() << "Java checker succeeded.";
emit checkFinished(result);
}
@ -93,7 +101,7 @@ void JavaChecker::error(QProcess::ProcessError err)
if(err == QProcess::FailedToStart)
{
killTimer.stop();
QLOG_DEBUG() << "Java checker has failed to start.";
JavaCheckResult result;
{
result.path = path;
@ -110,6 +118,7 @@ void JavaChecker::timeout()
// NO MERCY. NO ABUSE.
if(process)
{
QLOG_DEBUG() << "Java checker has been killed by timeout.";
process->kill();
}
}