<commit_before>#include "librarydetailscontroller.h"
#include "ui_librarydetailswidget.h"
#include "findqt4profiles.h"
#include "qt4nodes.h"
#include "qt4buildconfiguration.h"

#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <projectexplorer/buildconfiguration.h>

#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QTextStream>

using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;

LibraryDetailsController::LibraryDetailsController(
        Ui::LibraryDetailsWidget *libraryDetails,
        const QString &proFile, QObject *parent) :
    QObject(parent),
    m_platforms(AddLibraryWizard::LinuxPlatform
                | AddLibraryWizard::MacPlatform
                | AddLibraryWizard::WindowsPlatform
                | AddLibraryWizard::SymbianPlatform),
    m_linkageType(AddLibraryWizard::NoLinkage),
    m_macLibraryType(AddLibraryWizard::NoLibraryType),
    m_proFile(proFile),
    m_ignoreGuiSignals(false),
    m_includePathChanged(false),
    m_linkageRadiosVisible(true),
    m_macLibraryRadiosVisible(true),
    m_includePathVisible(true),
    m_windowsGroupVisible(true),
    m_libraryDetailsWidget(libraryDetails)
{
#ifdef Q_OS_MAC
    m_creatorPlatform = CreatorMac;
#endif
#ifdef Q_OS_LINUX
    m_creatorPlatform = CreatorLinux;
#endif
#ifdef Q_OS_WIN
    m_creatorPlatform = CreatorWindows;

    // project for which we are going to insert the snippet
    const ProjectExplorer::Project *project =
            ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projectForFile(proFile);
    Qt4BuildConfiguration *qt4BuildConfiguration =
            qobject_cast<Qt4BuildConfiguration *>(project->activeTarget()->activeBuildConfiguration());
    if (qt4BuildConfiguration && qt4BuildConfiguration->toolChainType() == ProjectExplorer::ToolChain::GCC_MAEMO)
        m_creatorPlatform = CreatorLinux;
#endif

    if (creatorPlatform() == CreatorMac)
        setMacLibraryRadiosVisible(false);

    if (creatorPlatform() != CreatorWindows)
        setLinkageRadiosVisible(false);

    connect(m_libraryDetailsWidget->includePathChooser, SIGNAL(changed(QString)),
            this, SLOT(slotIncludePathChanged()));
    connect(m_libraryDetailsWidget->frameworkRadio, SIGNAL(clicked(bool)),
            this, SLOT(slotMacLibraryTypeChanged()));
    connect(m_libraryDetailsWidget->libraryRadio, SIGNAL(clicked(bool)),
            this, SLOT(slotMacLibraryTypeChanged()));
    connect(m_libraryDetailsWidget->useSubfoldersCheckBox, SIGNAL(toggled(bool)),<commit_msg>Fix AddLibraryWizard for Mac as well<commit_after>#include "librarydetailscontroller.h"
#include "ui_librarydetailswidget.h"
#include "findqt4profiles.h"
#include "qt4nodes.h"
#include "qt4buildconfiguration.h"

#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <projectexplorer/buildconfiguration.h>

#include <QtCore/QFileInfo>
#include <QtCore/QDir>
#include <QtCore/QTextStream>

using namespace Qt4ProjectManager;
using namespace Qt4ProjectManager::Internal;

LibraryDetailsController::LibraryDetailsController(
        Ui::LibraryDetailsWidget *libraryDetails,
        const QString &proFile, QObject *parent) :
    QObject(parent),
    m_platforms(AddLibraryWizard::LinuxPlatform
                | AddLibraryWizard::MacPlatform
                | AddLibraryWizard::WindowsPlatform
                | AddLibraryWizard::SymbianPlatform),
    m_linkageType(AddLibraryWizard::NoLinkage),
    m_macLibraryType(AddLibraryWizard::NoLibraryType),
    m_proFile(proFile),
    m_ignoreGuiSignals(false),
    m_includePathChanged(false),
    m_linkageRadiosVisible(true),
    m_macLibraryRadiosVisible(true),
    m_includePathVisible(true),
    m_windowsGroupVisible(true),
    m_libraryDetailsWidget(libraryDetails)
{
#ifdef Q_OS_MAC
    m_creatorPlatform = CreatorMac;
#endif
#ifdef Q_OS_LINUX
    m_creatorPlatform = CreatorLinux;
#endif
#ifdef Q_OS_WIN
    m_creatorPlatform = CreatorWindows;
#endif

#ifndef Q_OS_LINUX
    // project for which we are going to insert the snippet
    const ProjectExplorer::Project *project =
            ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projectForFile(proFile);
    // take active build configuration for it
    Qt4BuildConfiguration *qt4BuildConfiguration =
            qobject_cast<Qt4BuildConfiguration *>(project->activeTarget()->activeBuildConfiguration());
    // if its toolchain is maemo behave the same as we would be on linux
    if (qt4BuildConfiguration && qt4BuildConfiguration->toolChainType() == ProjectExplorer::ToolChain::GCC_MAEMO)
        m_creatorPlatform = CreatorLinux;
#endif

    if (creatorPlatform() == CreatorMac)
        setMacLibraryRadiosVisible(false);

    if (creatorPlatform() != CreatorWindows)
        setLinkageRadiosVisible(false);

    connect(m_libraryDetailsWidget->includePathChooser, SIGNAL(changed(QString)),
            this, SLOT(slotIncludePathChanged()));
    connect(m_libraryDetailsWidget->frameworkRadio, SIGNAL(clicked(bool)),
            this, SLOT(slotMacLibraryTypeChanged()));
    connect(m_libraryDetailsWidget->libraryRadio, SIGNAL(clicked(bool)),
            this, SLOT(slotMacLibraryTypeChanged()));
    connect(m_libraryDetailsWidget->useSubfoldersCheckBox, SIGNAL(toggled(bool)),
{'fraction_non_alphanumeric': 0.09829376854599406, 'fraction_numerical': 0.00370919881305638, 'mean_word_length': 5.220299884659746, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6612006', 'n_tokens_mistral': 1593, 'n_tokens_neox': 1537, 'n_words': 255}