Commit c24eed11 authored by Jarek Kobus's avatar Jarek Kobus Committed by Jarek Kobus
Browse files

Check if project and its target are not null



Task-number: QTCREATORBUG-10437

Fix also the code, so that we always behave like target platform, not like
host platform.

Change-Id: I4d8705ca858f9a520dcd6a780e7ba2f2dd6cb047
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 9795976a
......@@ -84,14 +84,24 @@ LibraryDetailsController::LibraryDetailsController(
if (!Utils::HostOsInfo::isLinuxHost()) {
// project for which we are going to insert the snippet
const ProjectExplorer::Project *project =
ProjectExplorer::SessionManager::projectForFile(proFile);
// if its tool chain is maemo behave the same as we would be on linux
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(project->activeTarget()->kit());
if (tc
&& (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::HarmattanLinuxFlavor
|| tc->targetAbi().osFlavor() == ProjectExplorer::Abi::MaemoLinuxFlavor))
m_creatorPlatform = CreatorLinux;
const Project *project = SessionManager::projectForFile(proFile);
if (project && project->activeTarget()) {
// if its tool chain is maemo behave the same as we would be on linux
ProjectExplorer::ToolChain *tc = ToolChainKitInformation::toolChain(project->activeTarget()->kit());
if (tc) {
switch (tc->targetAbi().os()) {
case Abi::WindowsOS:
m_creatorPlatform = CreatorWindows;
break;
case Abi::MacOS:
m_creatorPlatform = CreatorMac;
break;
default:
m_creatorPlatform = CreatorLinux;
break;
}
}
}
}
setPlatformsVisible(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment