forked from qt-creator/qt-creator
Rework connections on the project pane for Qt4Projects.
Should fix a lot of corner cases, might introduce a few bugs. Also rename functions/slots to be better named. Generic Project Manager and CMake Project Manager are missing from this patch.
This commit is contained in:
@@ -85,13 +85,12 @@ signals:
|
|||||||
void displayNameChanged();
|
void displayNameChanged();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
BuildConfiguration(Project * project);
|
BuildConfiguration(Project *project);
|
||||||
BuildConfiguration(BuildConfiguration *source);
|
BuildConfiguration(BuildConfiguration *source);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<BuildStep *> m_buildSteps;
|
QList<BuildStep *> m_buildSteps;
|
||||||
QList<BuildStep *> m_cleanSteps;
|
QList<BuildStep *> m_cleanSteps;
|
||||||
|
|
||||||
QHash<QString, QVariant> m_values;
|
QHash<QString, QVariant> m_values;
|
||||||
Project *m_project;
|
Project *m_project;
|
||||||
};
|
};
|
||||||
|
@@ -124,7 +124,7 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
|
|||||||
<< tr("Build Environment"));
|
<< tr("Build Environment"));
|
||||||
m_baseEnvironmentComboBox->setCurrentIndex(rc->baseEnvironmentBase());
|
m_baseEnvironmentComboBox->setCurrentIndex(rc->baseEnvironmentBase());
|
||||||
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
this, SLOT(baseEnvironmentComboBoxChanged(int)));
|
this, SLOT(baseEnvironmentSelected(int)));
|
||||||
baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox);
|
baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox);
|
||||||
baseEnvironmentLayout->addStretch(10);
|
baseEnvironmentLayout->addStretch(10);
|
||||||
|
|
||||||
@@ -136,20 +136,20 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
|
|||||||
changed();
|
changed();
|
||||||
|
|
||||||
connect(m_userName, SIGNAL(textEdited(QString)),
|
connect(m_userName, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(setUserName(QString)));
|
this, SLOT(userNameEdited(QString)));
|
||||||
connect(m_executableChooser, SIGNAL(changed(QString)),
|
connect(m_executableChooser, SIGNAL(changed(QString)),
|
||||||
this, SLOT(setExecutable()));
|
this, SLOT(executableEdited()));
|
||||||
connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
|
connect(m_commandLineArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
|
||||||
this, SLOT(setCommandLineArguments(const QString&)));
|
this, SLOT(argumentsEdited(const QString&)));
|
||||||
connect(m_workingDirectory, SIGNAL(changed(QString)),
|
connect(m_workingDirectory, SIGNAL(changed(QString)),
|
||||||
this, SLOT(setWorkingDirectory()));
|
this, SLOT(workingDirectoryEdited()));
|
||||||
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
|
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(termToggled(bool)));
|
this, SLOT(termToggled(bool)));
|
||||||
|
|
||||||
connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
|
connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed()));
|
||||||
|
|
||||||
connect(m_environmentWidget, SIGNAL(userChangesUpdated()),
|
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
|
||||||
this, SLOT(userChangesUpdated()));
|
this, SLOT(userChangesChanged()));
|
||||||
|
|
||||||
connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()),
|
connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()),
|
||||||
this, SLOT(baseEnvironmentChanged()));
|
this, SLOT(baseEnvironmentChanged()));
|
||||||
@@ -157,12 +157,12 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE
|
|||||||
this, SLOT(userEnvironmentChangesChanged()));
|
this, SLOT(userEnvironmentChangesChanged()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomExecutableConfigurationWidget::userChangesUpdated()
|
void CustomExecutableConfigurationWidget::userChangesChanged()
|
||||||
{
|
{
|
||||||
m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
|
m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomExecutableConfigurationWidget::baseEnvironmentComboBoxChanged(int index)
|
void CustomExecutableConfigurationWidget::baseEnvironmentSelected(int index)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_runConfiguration->setBaseEnvironmentBase(CustomExecutableRunConfiguration::BaseEnvironmentBase(index));
|
m_runConfiguration->setBaseEnvironmentBase(CustomExecutableRunConfiguration::BaseEnvironmentBase(index));
|
||||||
@@ -176,7 +176,9 @@ void CustomExecutableConfigurationWidget::baseEnvironmentChanged()
|
|||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_baseEnvironmentComboBox->setCurrentIndex(CustomExecutableRunConfiguration::BaseEnvironmentBase(m_runConfiguration->baseEnvironmentBase()));
|
int index = CustomExecutableRunConfiguration::BaseEnvironmentBase(
|
||||||
|
m_runConfiguration->baseEnvironmentBase());
|
||||||
|
m_baseEnvironmentComboBox->setCurrentIndex(index);
|
||||||
m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment());
|
m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -186,26 +188,26 @@ void CustomExecutableConfigurationWidget::userEnvironmentChangesChanged()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CustomExecutableConfigurationWidget::setExecutable()
|
void CustomExecutableConfigurationWidget::executableEdited()
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_runConfiguration->setExecutable(m_executableChooser->path());
|
m_runConfiguration->setExecutable(m_executableChooser->path());
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
void CustomExecutableConfigurationWidget::setCommandLineArguments(const QString &commandLineArguments)
|
void CustomExecutableConfigurationWidget::argumentsEdited(const QString &arguments)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_runConfiguration->setCommandLineArguments(commandLineArguments);
|
m_runConfiguration->setCommandLineArguments(arguments);
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
void CustomExecutableConfigurationWidget::setWorkingDirectory()
|
void CustomExecutableConfigurationWidget::workingDirectoryEdited()
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_runConfiguration->setWorkingDirectory(m_workingDirectory->path());
|
m_runConfiguration->setWorkingDirectory(m_workingDirectory->path());
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CustomExecutableConfigurationWidget::setUserName(const QString &name)
|
void CustomExecutableConfigurationWidget::userNameEdited(const QString &name)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_runConfiguration->setUserName(name);
|
m_runConfiguration->setUserName(name);
|
||||||
@@ -250,18 +252,33 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(Project *pro)
|
|||||||
setName(tr("Custom Executable"));
|
setName(tr("Custom Executable"));
|
||||||
|
|
||||||
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
|
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
|
||||||
|
this, SLOT(activeBuildConfigurationChanged()));
|
||||||
|
|
||||||
|
m_lastActiveBuildConfiguration = pro->activeBuildConfiguration();
|
||||||
|
|
||||||
|
if (m_lastActiveBuildConfiguration) {
|
||||||
|
connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()),
|
||||||
this, SIGNAL(baseEnvironmentChanged()));
|
this, SIGNAL(baseEnvironmentChanged()));
|
||||||
|
}
|
||||||
// TODO
|
|
||||||
// connect(pro, SIGNAL(environmentChanged(ProjectExplorer::BuildConfiguration *)),
|
|
||||||
// this, SIGNAL(baseEnvironmentChanged()));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
|
CustomExecutableRunConfiguration::~CustomExecutableRunConfiguration()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CustomExecutableRunConfiguration::activeBuildConfigurationChanged()
|
||||||
|
{
|
||||||
|
if (m_lastActiveBuildConfiguration) {
|
||||||
|
disconnect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()),
|
||||||
|
this, SIGNAL(baseEnvironmentChanged()));
|
||||||
|
}
|
||||||
|
m_lastActiveBuildConfiguration = project()->activeBuildConfiguration();
|
||||||
|
if (m_lastActiveBuildConfiguration) {
|
||||||
|
connect(m_lastActiveBuildConfiguration, SIGNAL(environmentChanged()),
|
||||||
|
this, SIGNAL(baseEnvironmentChanged()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QString CustomExecutableRunConfiguration::type() const
|
QString CustomExecutableRunConfiguration::type() const
|
||||||
{
|
{
|
||||||
return "ProjectExplorer.CustomExecutableRunConfiguration";
|
return "ProjectExplorer.CustomExecutableRunConfiguration";
|
||||||
|
@@ -102,6 +102,8 @@ signals:
|
|||||||
void baseEnvironmentChanged();
|
void baseEnvironmentChanged();
|
||||||
void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff);
|
void userEnvironmentChangesChanged(const QList<ProjectExplorer::EnvironmentItem> &diff);
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void activeBuildConfigurationChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
enum BaseEnvironmentBase { CleanEnvironmentBase = 0,
|
||||||
@@ -126,6 +128,7 @@ private:
|
|||||||
QString m_userName;
|
QString m_userName;
|
||||||
QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges;
|
QList<ProjectExplorer::EnvironmentItem> m_userEnvironmentChanges;
|
||||||
BaseEnvironmentBase m_baseEnvironmentBase;
|
BaseEnvironmentBase m_baseEnvironmentBase;
|
||||||
|
ProjectExplorer::BuildConfiguration *m_lastActiveBuildConfiguration;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CustomExecutableRunConfigurationFactory : public IRunConfigurationFactory
|
class CustomExecutableRunConfigurationFactory : public IRunConfigurationFactory
|
||||||
@@ -154,16 +157,16 @@ public:
|
|||||||
private slots:
|
private slots:
|
||||||
void changed();
|
void changed();
|
||||||
|
|
||||||
void setExecutable();
|
void executableEdited();
|
||||||
void setCommandLineArguments(const QString &commandLineArguments);
|
void argumentsEdited(const QString &arguments);
|
||||||
void setUserName(const QString &name);
|
void userNameEdited(const QString &name);
|
||||||
void setWorkingDirectory();
|
void workingDirectoryEdited();
|
||||||
void termToggled(bool);
|
void termToggled(bool);
|
||||||
|
|
||||||
void userChangesUpdated();
|
void userChangesChanged();
|
||||||
void baseEnvironmentChanged();
|
void baseEnvironmentChanged();
|
||||||
void userEnvironmentChangesChanged();
|
void userEnvironmentChangesChanged();
|
||||||
void baseEnvironmentComboBoxChanged(int index);
|
void baseEnvironmentSelected(int index);
|
||||||
private:
|
private:
|
||||||
bool m_ignoreChange;
|
bool m_ignoreChange;
|
||||||
CustomExecutableRunConfiguration *m_runConfiguration;
|
CustomExecutableRunConfiguration *m_runConfiguration;
|
||||||
|
@@ -277,7 +277,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
|
|||||||
m_items[pos].unset = false;
|
m_items[pos].unset = false;
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
emit dataChanged(index, index);
|
emit dataChanged(index, index);
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// not found in m_items, so add it as a new variable
|
// not found in m_items, so add it as a new variable
|
||||||
@@ -287,7 +287,7 @@ bool EnvironmentModel::setData(const QModelIndex &index, const QVariant &value,
|
|||||||
m_items[index.row()].value = value.toString();
|
m_items[index.row()].value = value.toString();
|
||||||
m_items[index.row()].unset = false;
|
m_items[index.row()].unset = false;
|
||||||
emit dataChanged(index, index);
|
emit dataChanged(index, index);
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,14 +328,14 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
|||||||
m_items.insert(rowInChanges, item);
|
m_items.insert(rowInChanges, item);
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
|
emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return index(rowInResult, 0, QModelIndex());
|
return index(rowInResult, 0, QModelIndex());
|
||||||
} else {
|
} else {
|
||||||
beginInsertRows(QModelIndex(), rowInResult, rowInResult);
|
beginInsertRows(QModelIndex(), rowInResult, rowInResult);
|
||||||
m_items.insert(rowInChanges, item);
|
m_items.insert(rowInChanges, item);
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return index(rowInResult, 0, QModelIndex());
|
return index(rowInResult, 0, QModelIndex());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -343,7 +343,7 @@ QModelIndex EnvironmentModel::addVariable(const EnvironmentItem &item)
|
|||||||
beginInsertRows(QModelIndex(), newPos, newPos);
|
beginInsertRows(QModelIndex(), newPos, newPos);
|
||||||
m_items.insert(newPos, item);
|
m_items.insert(newPos, item);
|
||||||
endInsertRows();
|
endInsertRows();
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return index(newPos, 0, QModelIndex());
|
return index(newPos, 0, QModelIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -358,13 +358,13 @@ void EnvironmentModel::removeVariable(const QString &name)
|
|||||||
m_items.removeAt(rowInChanges);
|
m_items.removeAt(rowInChanges);
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
|
emit dataChanged(index(rowInResult, 0, QModelIndex()), index(rowInResult, 1, QModelIndex()));
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
} else {
|
} else {
|
||||||
beginRemoveRows(QModelIndex(), rowInResult, rowInResult);
|
beginRemoveRows(QModelIndex(), rowInResult, rowInResult);
|
||||||
m_items.removeAt(rowInChanges);
|
m_items.removeAt(rowInChanges);
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int removePos = findInChanges(name);
|
int removePos = findInChanges(name);
|
||||||
@@ -372,7 +372,7 @@ void EnvironmentModel::removeVariable(const QString &name)
|
|||||||
m_items.removeAt(removePos);
|
m_items.removeAt(removePos);
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -386,7 +386,7 @@ void EnvironmentModel::unset(const QString &name)
|
|||||||
m_items[pos].unset = true;
|
m_items[pos].unset = true;
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex()));
|
emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex()));
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pos = findInChangesInsertPosition(name);
|
pos = findInChangesInsertPosition(name);
|
||||||
@@ -394,13 +394,13 @@ void EnvironmentModel::unset(const QString &name)
|
|||||||
m_items[pos].unset = true;
|
m_items[pos].unset = true;
|
||||||
updateResultEnvironment();
|
updateResultEnvironment();
|
||||||
emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex()));
|
emit dataChanged(index(row, 0, QModelIndex()), index(row, 1, QModelIndex()));
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
int pos = findInChanges(name);
|
int pos = findInChanges(name);
|
||||||
m_items[pos].unset = true;
|
m_items[pos].unset = true;
|
||||||
emit dataChanged(index(pos, 1, QModelIndex()), index(pos, 1, QModelIndex()));
|
emit dataChanged(index(pos, 1, QModelIndex()), index(pos, 1, QModelIndex()));
|
||||||
emit userChangesUpdated();
|
emit userChangesChanged();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -440,8 +440,8 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
|
|||||||
{
|
{
|
||||||
m_model = new EnvironmentModel();
|
m_model = new EnvironmentModel();
|
||||||
m_model->setMergedEnvironments(true);
|
m_model->setMergedEnvironments(true);
|
||||||
connect(m_model, SIGNAL(userChangesUpdated()),
|
connect(m_model, SIGNAL(userChangesChanged()),
|
||||||
this, SIGNAL(userChangesUpdated()));
|
this, SIGNAL(userChangesChanged()));
|
||||||
|
|
||||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||||
vbox->setContentsMargins(0, 0, 0, 0);
|
vbox->setContentsMargins(0, 0, 0, 0);
|
||||||
@@ -509,7 +509,7 @@ EnvironmentWidget::EnvironmentWidget(QWidget *parent, QWidget *additionalDetails
|
|||||||
connect(m_environmentTreeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
|
connect(m_environmentTreeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)),
|
||||||
this, SLOT(environmentCurrentIndexChanged(QModelIndex, QModelIndex)));
|
this, SLOT(environmentCurrentIndexChanged(QModelIndex, QModelIndex)));
|
||||||
|
|
||||||
connect(m_model, SIGNAL(userChangesUpdated()), this, SLOT(updateSummaryText()));
|
connect(m_model, SIGNAL(userChangesChanged()), this, SLOT(updateSummaryText()));
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvironmentWidget::~EnvironmentWidget()
|
EnvironmentWidget::~EnvironmentWidget()
|
||||||
|
@@ -82,7 +82,7 @@ public:
|
|||||||
QList<EnvironmentItem> userChanges() const;
|
QList<EnvironmentItem> userChanges() const;
|
||||||
void setUserChanges(QList<EnvironmentItem> list);
|
void setUserChanges(QList<EnvironmentItem> list);
|
||||||
signals:
|
signals:
|
||||||
void userChangesUpdated();
|
void userChangesChanged();
|
||||||
private:
|
private:
|
||||||
void updateResultEnvironment();
|
void updateResultEnvironment();
|
||||||
int findInChanges(const QString &name) const;
|
int findInChanges(const QString &name) const;
|
||||||
@@ -115,7 +115,7 @@ public slots:
|
|||||||
void updateButtons();
|
void updateButtons();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void userChangesUpdated();
|
void userChangesChanged();
|
||||||
void detailsVisibleChanged(bool visible);
|
void detailsVisibleChanged(bool visible);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@@ -212,9 +212,9 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
|
|||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
connect(m_ui.makeLineEdit, SIGNAL(textEdited(QString)),
|
connect(m_ui.makeLineEdit, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(makeLineEditTextEdited()));
|
this, SLOT(makeEdited()));
|
||||||
connect(m_ui.makeArgumentsLineEdit, SIGNAL(textEdited(QString)),
|
connect(m_ui.makeArgumentsLineEdit, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(makeArgumentsLineEditTextEdited()));
|
this, SLOT(makeArgumentsLineEdited()));
|
||||||
|
|
||||||
connect(makeStep, SIGNAL(userArgumentsChanged()),
|
connect(makeStep, SIGNAL(userArgumentsChanged()),
|
||||||
this, SLOT(userArgumentsChanged()));
|
this, SLOT(userArgumentsChanged()));
|
||||||
@@ -300,13 +300,13 @@ void MakeStepConfigWidget::init()
|
|||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStepConfigWidget::makeLineEditTextEdited()
|
void MakeStepConfigWidget::makeEdited()
|
||||||
{
|
{
|
||||||
m_makeStep->m_makeCmd = m_ui.makeLineEdit->text();
|
m_makeStep->m_makeCmd = m_ui.makeLineEdit->text();
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MakeStepConfigWidget::makeArgumentsLineEditTextEdited()
|
void MakeStepConfigWidget::makeArgumentsLineEdited()
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_makeStep->setUserArguments(
|
m_makeStep->setUserArguments(
|
||||||
|
@@ -82,11 +82,10 @@ public:
|
|||||||
virtual bool immutable() const;
|
virtual bool immutable() const;
|
||||||
QStringList userArguments();
|
QStringList userArguments();
|
||||||
void setUserArguments(const QStringList &arguments);
|
void setUserArguments(const QStringList &arguments);
|
||||||
|
void setClean(bool clean);
|
||||||
|
|
||||||
virtual void restoreFromGlobalMap(const QMap<QString, QVariant> &map);
|
virtual void restoreFromGlobalMap(const QMap<QString, QVariant> &map);
|
||||||
|
|
||||||
void setClean(bool clean);
|
|
||||||
|
|
||||||
virtual void restoreFromLocalMap(const QMap<QString, QVariant> &map);
|
virtual void restoreFromLocalMap(const QMap<QString, QVariant> &map);
|
||||||
virtual void storeIntoLocalMap(QMap<QString, QVariant> &map);
|
virtual void storeIntoLocalMap(QMap<QString, QVariant> &map);
|
||||||
|
|
||||||
@@ -107,8 +106,10 @@ public:
|
|||||||
void init();
|
void init();
|
||||||
QString summaryText() const;
|
QString summaryText() const;
|
||||||
private slots:
|
private slots:
|
||||||
void makeLineEditTextEdited();
|
// User changes to our widgets
|
||||||
void makeArgumentsLineEditTextEdited();
|
void makeEdited();
|
||||||
|
void makeArgumentsLineEdited();
|
||||||
|
|
||||||
void updateMakeOverrideLabel();
|
void updateMakeOverrideLabel();
|
||||||
void updateDetails();
|
void updateDetails();
|
||||||
void userArgumentsChanged();
|
void userArgumentsChanged();
|
||||||
|
@@ -99,7 +99,6 @@ QStringList QMakeStep::allArguments()
|
|||||||
foreach (const QString &addedConfig, addedUserConfigArguments)
|
foreach (const QString &addedConfig, addedUserConfigArguments)
|
||||||
arguments.append("CONFIG+=" + addedConfig);
|
arguments.append("CONFIG+=" + addedConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!additonalArguments.isEmpty())
|
if (!additonalArguments.isEmpty())
|
||||||
arguments << additonalArguments;
|
arguments << additonalArguments;
|
||||||
|
|
||||||
@@ -232,17 +231,35 @@ void QMakeStep::storeIntoLocalMap(QMap<QString, QVariant> &map)
|
|||||||
AbstractProcessStep::storeIntoLocalMap(map);
|
AbstractProcessStep::storeIntoLocalMap(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////
|
||||||
|
// QMakeStepConfigWidget
|
||||||
|
////
|
||||||
|
|
||||||
QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
QMakeStepConfigWidget::QMakeStepConfigWidget(QMakeStep *step)
|
||||||
: BuildStepConfigWidget(), m_step(step), m_ignoreChange(false)
|
: BuildStepConfigWidget(), m_step(step), m_ignoreChange(false)
|
||||||
{
|
{
|
||||||
m_ui.setupUi(this);
|
m_ui.setupUi(this);
|
||||||
connect(m_ui.qmakeAdditonalArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
|
connect(m_ui.qmakeAdditonalArgumentsLineEdit, SIGNAL(textEdited(const QString&)),
|
||||||
this, SLOT(qmakeArgumentsLineEditTextEdited()));
|
this, SLOT(qmakeArgumentsLineEdited()));
|
||||||
connect(m_ui.buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(buildConfigurationChanged()));
|
connect(m_ui.buildConfigurationComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
|
this, SLOT(buildConfigurationSelected()));
|
||||||
connect(step, SIGNAL(userArgumentsChanged()),
|
connect(step, SIGNAL(userArgumentsChanged()),
|
||||||
this, SLOT(userArgumentsChanged()));
|
this, SLOT(userArgumentsChanged()));
|
||||||
connect(step->buildConfiguration(), SIGNAL(qtVersionChanged()),
|
connect(step->qt4BuildConfiguration(), SIGNAL(qtVersionChanged()),
|
||||||
this, SLOT(qtVersionChanged()));
|
this, SLOT(qtVersionChanged()));
|
||||||
|
connect(step->qt4BuildConfiguration(), SIGNAL(qmakeBuildConfigurationChanged()),
|
||||||
|
this, SLOT(qmakeBuildConfigChanged()));
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMakeStepConfigWidget::init()
|
||||||
|
{
|
||||||
|
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
|
||||||
|
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
||||||
|
|
||||||
|
qmakeBuildConfigChanged();
|
||||||
|
|
||||||
|
updateSummaryLabel();
|
||||||
|
updateEffectiveQMakeCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString QMakeStepConfigWidget::summaryText() const
|
QString QMakeStepConfigWidget::summaryText() const
|
||||||
@@ -250,13 +267,69 @@ QString QMakeStepConfigWidget::summaryText() const
|
|||||||
return m_summaryText;
|
return m_summaryText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString QMakeStepConfigWidget::displayName() const
|
||||||
|
{
|
||||||
|
return m_step->displayName();
|
||||||
|
}
|
||||||
|
|
||||||
void QMakeStepConfigWidget::qtVersionChanged()
|
void QMakeStepConfigWidget::qtVersionChanged()
|
||||||
{
|
{
|
||||||
updateTitleLabel();
|
updateSummaryLabel();
|
||||||
updateEffectiveQMakeCall();
|
updateEffectiveQMakeCall();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStepConfigWidget::updateTitleLabel()
|
void QMakeStepConfigWidget::qmakeBuildConfigChanged()
|
||||||
|
{
|
||||||
|
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
|
||||||
|
bool debug = bc->qmakeBuildConfiguration() & QtVersion::DebugBuild;
|
||||||
|
m_ignoreChange = true;
|
||||||
|
m_ui.buildConfigurationComboBox->setCurrentIndex(debug? 0 : 1);
|
||||||
|
m_ignoreChange = false;
|
||||||
|
updateSummaryLabel();
|
||||||
|
updateEffectiveQMakeCall();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMakeStepConfigWidget::userArgumentsChanged()
|
||||||
|
{
|
||||||
|
if (m_ignoreChange)
|
||||||
|
return;
|
||||||
|
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
|
||||||
|
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
||||||
|
updateSummaryLabel();
|
||||||
|
updateEffectiveQMakeCall();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMakeStepConfigWidget::qmakeArgumentsLineEdited()
|
||||||
|
{
|
||||||
|
m_ignoreChange = true;
|
||||||
|
m_step->setUserArguments(
|
||||||
|
ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text()));
|
||||||
|
m_ignoreChange = false;
|
||||||
|
|
||||||
|
updateSummaryLabel();
|
||||||
|
updateEffectiveQMakeCall();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMakeStepConfigWidget::buildConfigurationSelected()
|
||||||
|
{
|
||||||
|
if (m_ignoreChange)
|
||||||
|
return;
|
||||||
|
Qt4BuildConfiguration *bc = m_step->qt4BuildConfiguration();
|
||||||
|
QtVersion::QmakeBuildConfigs buildConfiguration = bc->qmakeBuildConfiguration();
|
||||||
|
if (m_ui.buildConfigurationComboBox->currentIndex() == 0) { // debug
|
||||||
|
buildConfiguration = buildConfiguration | QtVersion::DebugBuild;
|
||||||
|
} else {
|
||||||
|
buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild;
|
||||||
|
}
|
||||||
|
m_ignoreChange = true;
|
||||||
|
bc->setQMakeBuildConfiguration(buildConfiguration);
|
||||||
|
m_ignoreChange = false;
|
||||||
|
|
||||||
|
updateSummaryLabel();
|
||||||
|
updateEffectiveQMakeCall();
|
||||||
|
}
|
||||||
|
|
||||||
|
void QMakeStepConfigWidget::updateSummaryLabel()
|
||||||
{
|
{
|
||||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||||
const QtVersion *qtVersion = qt4bc->qtVersion();
|
const QtVersion *qtVersion = qt4bc->qtVersion();
|
||||||
@@ -280,63 +353,6 @@ void QMakeStepConfigWidget::updateTitleLabel()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QMakeStepConfigWidget::qmakeArgumentsLineEditTextEdited()
|
|
||||||
{
|
|
||||||
m_ignoreChange = true;
|
|
||||||
m_step->setUserArguments(
|
|
||||||
ProjectExplorer::Environment::parseCombinedArgString(m_ui.qmakeAdditonalArgumentsLineEdit->text()));
|
|
||||||
m_ignoreChange = false;
|
|
||||||
|
|
||||||
m_step->qt4BuildConfiguration()->qt4Project()->invalidateCachedTargetInformation();
|
|
||||||
updateTitleLabel();
|
|
||||||
updateEffectiveQMakeCall();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeStepConfigWidget::buildConfigurationChanged()
|
|
||||||
{
|
|
||||||
ProjectExplorer::BuildConfiguration *bc = m_step->buildConfiguration();
|
|
||||||
QtVersion::QmakeBuildConfigs buildConfiguration = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt());
|
|
||||||
if (m_ui.buildConfigurationComboBox->currentIndex() == 0) {
|
|
||||||
// debug
|
|
||||||
buildConfiguration = buildConfiguration | QtVersion::DebugBuild;
|
|
||||||
} else {
|
|
||||||
buildConfiguration = buildConfiguration & ~QtVersion::DebugBuild;
|
|
||||||
}
|
|
||||||
bc->setValue("buildConfiguration", int(buildConfiguration));
|
|
||||||
m_step->qt4BuildConfiguration()->qt4Project()->invalidateCachedTargetInformation();
|
|
||||||
updateTitleLabel();
|
|
||||||
updateEffectiveQMakeCall();
|
|
||||||
// TODO if exact parsing is the default, we need to update the code model
|
|
||||||
// and all the Qt4ProFileNodes
|
|
||||||
// m_step->qt4Project()->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
QString QMakeStepConfigWidget::displayName() const
|
|
||||||
{
|
|
||||||
return m_step->displayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeStepConfigWidget::userArgumentsChanged()
|
|
||||||
{
|
|
||||||
if (m_ignoreChange)
|
|
||||||
return;
|
|
||||||
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
|
|
||||||
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
|
||||||
updateTitleLabel();
|
|
||||||
updateEffectiveQMakeCall();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeStepConfigWidget::init()
|
|
||||||
{
|
|
||||||
QString qmakeArgs = ProjectExplorer::Environment::joinArgumentList(m_step->userArguments());
|
|
||||||
m_ui.qmakeAdditonalArgumentsLineEdit->setText(qmakeArgs);
|
|
||||||
ProjectExplorer::BuildConfiguration *bc = m_step->buildConfiguration();
|
|
||||||
bool debug = QtVersion::QmakeBuildConfig(bc->value("buildConfiguration").toInt()) & QtVersion::DebugBuild;
|
|
||||||
m_ui.buildConfigurationComboBox->setCurrentIndex(debug? 0 : 1);
|
|
||||||
updateTitleLabel();
|
|
||||||
updateEffectiveQMakeCall();
|
|
||||||
}
|
|
||||||
|
|
||||||
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
void QMakeStepConfigWidget::updateEffectiveQMakeCall()
|
||||||
{
|
{
|
||||||
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
Qt4BuildConfiguration *qt4bc = m_step->qt4BuildConfiguration();
|
||||||
|
@@ -109,16 +109,20 @@ class QMakeStepConfigWidget : public ProjectExplorer::BuildStepConfigWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QMakeStepConfigWidget(QMakeStep *step);
|
QMakeStepConfigWidget(QMakeStep *step);
|
||||||
QString displayName() const;
|
|
||||||
void init();
|
void init();
|
||||||
QString summaryText() const;
|
QString summaryText() const;
|
||||||
|
QString displayName() const;
|
||||||
private slots:
|
private slots:
|
||||||
void qmakeArgumentsLineEditTextEdited();
|
// slots for handling buildconfiguration/step signals
|
||||||
void buildConfigurationChanged();
|
|
||||||
void userArgumentsChanged();
|
|
||||||
void qtVersionChanged();
|
void qtVersionChanged();
|
||||||
|
void qmakeBuildConfigChanged();
|
||||||
|
void userArgumentsChanged();
|
||||||
|
|
||||||
|
// slots for dealing with user changes in our UI
|
||||||
|
void qmakeArgumentsLineEdited();
|
||||||
|
void buildConfigurationSelected();
|
||||||
private:
|
private:
|
||||||
void updateTitleLabel();
|
void updateSummaryLabel();
|
||||||
void updateEffectiveQMakeCall();
|
void updateEffectiveQMakeCall();
|
||||||
Ui::QMakeStep m_ui;
|
Ui::QMakeStep m_ui;
|
||||||
QMakeStep *m_step;
|
QMakeStep *m_step;
|
||||||
|
@@ -268,10 +268,14 @@ MaemoRunConfiguration::MaemoRunConfiguration(Project *project,
|
|||||||
connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()),
|
connect(&MaemoDeviceConfigurations::instance(), SIGNAL(updated()),
|
||||||
this, SLOT(updateDeviceConfigurations()));
|
this, SLOT(updateDeviceConfigurations()));
|
||||||
|
|
||||||
connect(project, SIGNAL(targetInformationChanged()), this,
|
connect(project, SIGNAL(targetInformationChanged()),
|
||||||
SLOT(invalidateCachedTargetInformation()));
|
this, SLOT(invalidateCachedTargetInformation()));
|
||||||
connect(project, SIGNAL(activeBuildConfigurationChanged()), this,
|
|
||||||
SLOT(invalidateCachedTargetInformation()));
|
connect(project, SIGNAL(targetInformationChanged()),
|
||||||
|
this, SLOT(enabledStateChanged()));
|
||||||
|
|
||||||
|
connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
|
|
||||||
qemu = new QProcess(this);
|
qemu = new QProcess(this);
|
||||||
connect(qemu, SIGNAL(error(QProcess::ProcessError)), &dumper,
|
connect(qemu, SIGNAL(error(QProcess::ProcessError)), &dumper,
|
||||||
@@ -315,6 +319,13 @@ QWidget *MaemoRunConfiguration::configurationWidget()
|
|||||||
return new MaemoRunConfigurationWidget(this);
|
return new MaemoRunConfigurationWidget(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MaemoRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath == pro->path())
|
||||||
|
invalidateCachedTargetInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void MaemoRunConfiguration::save(PersistentSettingsWriter &writer) const
|
void MaemoRunConfiguration::save(PersistentSettingsWriter &writer) const
|
||||||
{
|
{
|
||||||
writer.saveValue(DeviceIdKey, m_devConfig.internalId);
|
writer.saveValue(DeviceIdKey, m_devConfig.internalId);
|
||||||
|
@@ -46,6 +46,7 @@ namespace Internal {
|
|||||||
|
|
||||||
class MaemoManager;
|
class MaemoManager;
|
||||||
class MaemoToolChain;
|
class MaemoToolChain;
|
||||||
|
class Qt4ProFileNode;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
#define USE_SSL_PASSWORD 0
|
#define USE_SSL_PASSWORD 0
|
||||||
@@ -120,6 +121,7 @@ signals:
|
|||||||
void qemuProcessStatus(bool running);
|
void qemuProcessStatus(bool running);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
void updateDeviceConfigurations();
|
void updateDeviceConfigurations();
|
||||||
void invalidateCachedTargetInformation();
|
void invalidateCachedTargetInformation();
|
||||||
|
|
||||||
|
@@ -97,13 +97,20 @@ S60DeviceRunConfiguration::S60DeviceRunConfiguration(Project *project, const QSt
|
|||||||
else
|
else
|
||||||
setName(tr("QtS60DeviceRunConfiguration"));
|
setName(tr("QtS60DeviceRunConfiguration"));
|
||||||
|
|
||||||
connect(project, SIGNAL(activeBuildConfigurationChanged()),
|
|
||||||
this, SLOT(invalidateCachedTargetInformation()));
|
|
||||||
|
|
||||||
connect(project, SIGNAL(targetInformationChanged()),
|
connect(project, SIGNAL(targetInformationChanged()),
|
||||||
this, SLOT(invalidateCachedTargetInformation()));
|
this, SLOT(invalidateCachedTargetInformation()));
|
||||||
|
|
||||||
|
connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath == pro->path())
|
||||||
|
invalidateCachedTargetInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
S60DeviceRunConfiguration::~S60DeviceRunConfiguration()
|
S60DeviceRunConfiguration::~S60DeviceRunConfiguration()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@@ -51,6 +51,7 @@ namespace Qt4ProjectManager {
|
|||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
class Qt4ProFileNode;
|
||||||
|
|
||||||
class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
|
class S60DeviceRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||||
{
|
{
|
||||||
@@ -100,6 +101,7 @@ signals:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void invalidateCachedTargetInformation();
|
void invalidateCachedTargetInformation();
|
||||||
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProjectExplorer::ToolChain::ToolChainType toolChainType(ProjectExplorer::BuildConfiguration *configuration) const;
|
ProjectExplorer::ToolChain::ToolChainType toolChainType(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||||
|
@@ -62,17 +62,24 @@ S60EmulatorRunConfiguration::S60EmulatorRunConfiguration(Project *project, const
|
|||||||
else
|
else
|
||||||
setName(tr("QtSymbianEmulatorRunConfiguration"));
|
setName(tr("QtSymbianEmulatorRunConfiguration"));
|
||||||
|
|
||||||
connect(project, SIGNAL(activeBuildConfigurationChanged()),
|
|
||||||
this, SLOT(invalidateCachedTargetInformation()));
|
|
||||||
|
|
||||||
connect(project, SIGNAL(targetInformationChanged()),
|
connect(project, SIGNAL(targetInformationChanged()),
|
||||||
this, SLOT(invalidateCachedTargetInformation()));
|
this, SLOT(invalidateCachedTargetInformation()));
|
||||||
|
|
||||||
|
connect(project, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
S60EmulatorRunConfiguration::~S60EmulatorRunConfiguration()
|
S60EmulatorRunConfiguration::~S60EmulatorRunConfiguration()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void S60EmulatorRunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath == pro->path())
|
||||||
|
invalidateCachedTargetInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Qt4Project *S60EmulatorRunConfiguration::qt4Project() const
|
Qt4Project *S60EmulatorRunConfiguration::qt4Project() const
|
||||||
{
|
{
|
||||||
return static_cast<Qt4Project *>(project());
|
return static_cast<Qt4Project *>(project());
|
||||||
|
@@ -48,6 +48,7 @@ namespace Qt4ProjectManager {
|
|||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
class Qt4ProFileNode;
|
||||||
|
|
||||||
class S60EmulatorRunConfiguration : public ProjectExplorer::RunConfiguration
|
class S60EmulatorRunConfiguration : public ProjectExplorer::RunConfiguration
|
||||||
{
|
{
|
||||||
@@ -71,6 +72,7 @@ signals:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void invalidateCachedTargetInformation();
|
void invalidateCachedTargetInformation();
|
||||||
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateTarget();
|
void updateTarget();
|
||||||
|
@@ -45,13 +45,13 @@ namespace {
|
|||||||
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4Project *pro)
|
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4Project *pro)
|
||||||
: BuildConfiguration(pro)
|
: BuildConfiguration(pro)
|
||||||
{
|
{
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4BuildConfiguration *source)
|
Qt4BuildConfiguration::Qt4BuildConfiguration(Qt4BuildConfiguration *source)
|
||||||
: BuildConfiguration(source)
|
: BuildConfiguration(source)
|
||||||
{
|
{
|
||||||
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4BuildConfiguration::~Qt4BuildConfiguration()
|
Qt4BuildConfiguration::~Qt4BuildConfiguration()
|
||||||
@@ -59,6 +59,15 @@ Qt4BuildConfiguration::~Qt4BuildConfiguration()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4BuildConfiguration::init()
|
||||||
|
{
|
||||||
|
QtVersionManager *vm = QtVersionManager::instance();
|
||||||
|
connect(vm, SIGNAL(defaultQtVersionChanged()),
|
||||||
|
this, SLOT(defaultQtVersionChanged()));
|
||||||
|
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
|
||||||
|
this, SLOT(qtVersionsChanged(QList<int>)));
|
||||||
|
}
|
||||||
|
|
||||||
Qt4Project *Qt4BuildConfiguration::qt4Project() const
|
Qt4Project *Qt4BuildConfiguration::qt4Project() const
|
||||||
{
|
{
|
||||||
return static_cast<Qt4Project *>(project());
|
return static_cast<Qt4Project *>(project());
|
||||||
@@ -120,6 +129,14 @@ QString Qt4BuildConfiguration::buildDirectory() const
|
|||||||
return workingDirectory;
|
return workingDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4BuildConfiguration::setShadowBuildAndDirectory(bool shadowBuild, const QString &buildDirectory)
|
||||||
|
{
|
||||||
|
setValue("useShadowBuild", shadowBuild);
|
||||||
|
setValue("buildDirectory", buildDirectory);
|
||||||
|
emit buildDirectoryChanged();
|
||||||
|
emit targetInformationChanged();
|
||||||
|
}
|
||||||
|
|
||||||
ProjectExplorer::ToolChain *Qt4BuildConfiguration::toolChain() const
|
ProjectExplorer::ToolChain *Qt4BuildConfiguration::toolChain() const
|
||||||
{
|
{
|
||||||
ToolChain::ToolChainType tct = toolChainType();
|
ToolChain::ToolChainType tct = toolChainType();
|
||||||
@@ -199,15 +216,21 @@ int Qt4BuildConfiguration::qtVersionId() const
|
|||||||
|
|
||||||
void Qt4BuildConfiguration::setQtVersion(int id)
|
void Qt4BuildConfiguration::setQtVersion(int id)
|
||||||
{
|
{
|
||||||
|
if (qtVersionId() == id)
|
||||||
|
return;
|
||||||
|
|
||||||
setValue(KEY_QT_VERSION_ID, id);
|
setValue(KEY_QT_VERSION_ID, id);
|
||||||
emit qtVersionChanged();
|
emit qtVersionChanged();
|
||||||
qt4Project()->updateActiveRunConfiguration();
|
emit targetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4BuildConfiguration::setToolChainType(ProjectExplorer::ToolChain::ToolChainType type)
|
void Qt4BuildConfiguration::setToolChainType(ProjectExplorer::ToolChain::ToolChainType type)
|
||||||
{
|
{
|
||||||
|
if (value("ToolChain").toInt() == type)
|
||||||
|
return;
|
||||||
setValue("ToolChain", (int)type);
|
setValue("ToolChain", (int)type);
|
||||||
qt4Project()->updateActiveRunConfiguration();
|
emit toolChainTypeChanged();
|
||||||
|
emit targetInformationChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::ToolChain::ToolChainType Qt4BuildConfiguration::toolChainType() const
|
ProjectExplorer::ToolChain::ToolChainType Qt4BuildConfiguration::toolChainType() const
|
||||||
@@ -224,6 +247,37 @@ ProjectExplorer::ToolChain::ToolChainType Qt4BuildConfiguration::toolChainType()
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QtVersion::QmakeBuildConfigs Qt4BuildConfiguration::qmakeBuildConfiguration() const
|
||||||
|
{
|
||||||
|
return QtVersion::QmakeBuildConfigs(value("buildConfiguration").toInt());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4BuildConfiguration::setQMakeBuildConfiguration(QtVersion::QmakeBuildConfigs config)
|
||||||
|
{
|
||||||
|
if (value("buildConfiguration").toInt() == int(config))
|
||||||
|
return;
|
||||||
|
setValue("buildConfiguration", int(config));
|
||||||
|
emit qmakeBuildConfigurationChanged();
|
||||||
|
emit targetInformationChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4BuildConfiguration::getConfigCommandLineArguments(QStringList *addedUserConfigs, QStringList *removedUserConfigs) const
|
||||||
|
{
|
||||||
|
QtVersion::QmakeBuildConfigs defaultBuildConfiguration = qtVersion()->defaultBuildConfig();
|
||||||
|
QtVersion::QmakeBuildConfigs userBuildConfiguration = qmakeBuildConfiguration();
|
||||||
|
if (removedUserConfigs) {
|
||||||
|
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(userBuildConfiguration & QtVersion::BuildAll))
|
||||||
|
(*removedUserConfigs) << "debug_and_release";
|
||||||
|
}
|
||||||
|
if (addedUserConfigs) {
|
||||||
|
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (userBuildConfiguration & QtVersion::BuildAll))
|
||||||
|
(*addedUserConfigs) << "debug_and_release";
|
||||||
|
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(userBuildConfiguration & QtVersion::DebugBuild))
|
||||||
|
(*addedUserConfigs) << "release";
|
||||||
|
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (userBuildConfiguration & QtVersion::DebugBuild))
|
||||||
|
(*addedUserConfigs) << "debug";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QMakeStep *Qt4BuildConfiguration::qmakeStep() const
|
QMakeStep *Qt4BuildConfiguration::qmakeStep() const
|
||||||
{
|
{
|
||||||
@@ -243,6 +297,24 @@ MakeStep *Qt4BuildConfiguration::makeStep() const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4BuildConfiguration::defaultQtVersionChanged()
|
||||||
|
{
|
||||||
|
if (qtVersionId() == 0) {
|
||||||
|
emit qtVersionChanged();
|
||||||
|
emit targetInformationChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4BuildConfiguration::qtVersionsChanged(const QList<int> &changedVersions)
|
||||||
|
{
|
||||||
|
if (changedVersions.contains(qtVersionId())) {
|
||||||
|
if (!qtVersion()->isValid())
|
||||||
|
setQtVersion(0);
|
||||||
|
emit qtVersionChanged();
|
||||||
|
emit targetInformationChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// returns true if both are equal
|
// returns true if both are equal
|
||||||
bool Qt4BuildConfiguration::compareToImportFrom(const QString &workingDirectory)
|
bool Qt4BuildConfiguration::compareToImportFrom(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
@@ -375,28 +447,4 @@ QString Qt4BuildConfiguration::extractSpecFromArgumentList(const QStringList &li
|
|||||||
parsedSpec = parsedSpec.toLower();
|
parsedSpec = parsedSpec.toLower();
|
||||||
#endif
|
#endif
|
||||||
return parsedSpec;
|
return parsedSpec;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
QtVersion::QmakeBuildConfigs Qt4BuildConfiguration::qmakeBuildConfiguration() const
|
|
||||||
{
|
|
||||||
return QtVersion::QmakeBuildConfigs(value("buildConfiguration").toInt());
|
|
||||||
}
|
|
||||||
|
|
||||||
void Qt4BuildConfiguration::getConfigCommandLineArguments(QStringList *addedUserConfigs, QStringList *removedUserConfigs) const
|
|
||||||
{
|
|
||||||
QtVersion::QmakeBuildConfigs defaultBuildConfiguration = qtVersion()->defaultBuildConfig();
|
|
||||||
QtVersion::QmakeBuildConfigs userBuildConfiguration = qmakeBuildConfiguration();
|
|
||||||
if (removedUserConfigs) {
|
|
||||||
if ((defaultBuildConfiguration & QtVersion::BuildAll) && !(userBuildConfiguration & QtVersion::BuildAll))
|
|
||||||
(*removedUserConfigs) << "debug_and_release";
|
|
||||||
}
|
|
||||||
if (addedUserConfigs) {
|
|
||||||
if (!(defaultBuildConfiguration & QtVersion::BuildAll) && (userBuildConfiguration & QtVersion::BuildAll))
|
|
||||||
(*addedUserConfigs) << "debug_and_release";
|
|
||||||
if ((defaultBuildConfiguration & QtVersion::DebugBuild) && !(userBuildConfiguration & QtVersion::DebugBuild))
|
|
||||||
(*addedUserConfigs) << "release";
|
|
||||||
if (!(defaultBuildConfiguration & QtVersion::DebugBuild) && (userBuildConfiguration & QtVersion::DebugBuild))
|
|
||||||
(*addedUserConfigs) << "debug";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
|
|
||||||
#include <projectexplorer/buildconfiguration.h>
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/toolchain.h>
|
#include <projectexplorer/toolchain.h>
|
||||||
|
#include "qtversionmanager.h"
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
|
|
||||||
@@ -62,6 +63,7 @@ public:
|
|||||||
void setUseSystemEnvironment(bool b);
|
void setUseSystemEnvironment(bool b);
|
||||||
|
|
||||||
virtual QString buildDirectory() const;
|
virtual QString buildDirectory() const;
|
||||||
|
void setShadowBuildAndDirectory(bool shadowBuild, const QString &buildDirectory);
|
||||||
|
|
||||||
//returns the qtVersion, if the project is set to use the default qt version, then
|
//returns the qtVersion, if the project is set to use the default qt version, then
|
||||||
// that is returned
|
// that is returned
|
||||||
@@ -81,6 +83,9 @@ public:
|
|||||||
void setToolChainType(ProjectExplorer::ToolChain::ToolChainType type);
|
void setToolChainType(ProjectExplorer::ToolChain::ToolChainType type);
|
||||||
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
ProjectExplorer::ToolChain::ToolChainType toolChainType() const;
|
||||||
|
|
||||||
|
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration() const;
|
||||||
|
void setQMakeBuildConfiguration(QtVersion::QmakeBuildConfigs config);
|
||||||
|
void getConfigCommandLineArguments(QStringList *addedUserConfigs, QStringList *removedUserConfigs) const;
|
||||||
|
|
||||||
// Those functions are used in a few places.
|
// Those functions are used in a few places.
|
||||||
// The drawback is that we shouldn't actually depend on them beeing always there
|
// The drawback is that we shouldn't actually depend on them beeing always there
|
||||||
@@ -97,11 +102,26 @@ public:
|
|||||||
static QStringList removeSpecFromArgumentList(const QStringList &old);
|
static QStringList removeSpecFromArgumentList(const QStringList &old);
|
||||||
static QString extractSpecFromArgumentList(const QStringList &list, QString directory, QtVersion *version);
|
static QString extractSpecFromArgumentList(const QStringList &list, QString directory, QtVersion *version);
|
||||||
|
|
||||||
QtVersion::QmakeBuildConfigs qmakeBuildConfiguration() const;
|
|
||||||
void getConfigCommandLineArguments(QStringList *addedUserConfigs, QStringList *removedUserConfigs) const;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
/// emitted if the qt version changes (either directly, or because the default qt version changed
|
||||||
|
/// or because the user changed the settings for the qt version
|
||||||
void qtVersionChanged();
|
void qtVersionChanged();
|
||||||
|
/// emitted iff the setToolChainType() funciton is called, not emitted for qtversion changes
|
||||||
|
/// even if those result in a toolchain change
|
||||||
|
void toolChainTypeChanged();
|
||||||
|
/// emitted for setQMakeBuildConfig, not emitted for qt version changes, even
|
||||||
|
/// if those change the qmakebuildconfig
|
||||||
|
void qmakeBuildConfigurationChanged();
|
||||||
|
|
||||||
|
/// a covenience signal, emitted if either the qtversion, the toolchainType or the qmake build
|
||||||
|
/// configuration changed
|
||||||
|
void targetInformationChanged();
|
||||||
|
private slots:
|
||||||
|
void defaultQtVersionChanged();
|
||||||
|
void qtVersionsChanged(const QList<int> &changedVersions);
|
||||||
|
private:
|
||||||
|
void init();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
@@ -54,7 +54,7 @@ Qt4BuildEnvironmentWidget::Qt4BuildEnvironmentWidget(Qt4Project *project)
|
|||||||
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this, m_clearSystemEnvironmentCheckBox);
|
m_buildEnvironmentWidget = new ProjectExplorer::EnvironmentWidget(this, m_clearSystemEnvironmentCheckBox);
|
||||||
vbox->addWidget(m_buildEnvironmentWidget);
|
vbox->addWidget(m_buildEnvironmentWidget);
|
||||||
|
|
||||||
connect(m_buildEnvironmentWidget, SIGNAL(userChangesUpdated()),
|
connect(m_buildEnvironmentWidget, SIGNAL(userChangesChanged()),
|
||||||
this, SLOT(environmentModelUserChangesUpdated()));
|
this, SLOT(environmentModelUserChangesUpdated()));
|
||||||
|
|
||||||
connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
|
connect(m_clearSystemEnvironmentCheckBox, SIGNAL(toggled(bool)),
|
||||||
|
@@ -768,8 +768,6 @@ Qt4ProFileNode::Qt4ProFileNode(Qt4Project *project,
|
|||||||
m_updateTimer.setInterval(100);
|
m_updateTimer.setInterval(100);
|
||||||
m_updateTimer.setSingleShot(true);
|
m_updateTimer.setSingleShot(true);
|
||||||
|
|
||||||
connect(m_project, SIGNAL(activeBuildConfigurationChanged()),
|
|
||||||
this, SLOT(update()));
|
|
||||||
connect(&m_updateTimer, SIGNAL(timeout()),
|
connect(&m_updateTimer, SIGNAL(timeout()),
|
||||||
this, SLOT(update()));
|
this, SLOT(update()));
|
||||||
|
|
||||||
|
@@ -40,14 +40,7 @@
|
|||||||
#include "qt4buildenvironmentwidget.h"
|
#include "qt4buildenvironmentwidget.h"
|
||||||
#include "qt4projectmanagerconstants.h"
|
#include "qt4projectmanagerconstants.h"
|
||||||
#include "projectloadwizard.h"
|
#include "projectloadwizard.h"
|
||||||
#include "qtversionmanager.h"
|
|
||||||
#include "qt4buildconfiguration.h"
|
#include "qt4buildconfiguration.h"
|
||||||
#include "qt4buildconfiguration.h"
|
|
||||||
|
|
||||||
#ifdef QTCREATOR_WITH_S60
|
|
||||||
#include "qt-s60/gccetoolchain.h"
|
|
||||||
#include "qt-s60/rvcttoolchain.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagemanager.h>
|
#include <coreplugin/messagemanager.h>
|
||||||
@@ -236,6 +229,12 @@ Qt4BuildConfigurationFactory::Qt4BuildConfigurationFactory(Qt4Project *project)
|
|||||||
m_project(project)
|
m_project(project)
|
||||||
{
|
{
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
QtVersionManager *vm = QtVersionManager::instance();
|
||||||
|
connect(vm, SIGNAL(defaultQtVersionChanged()),
|
||||||
|
this, SLOT(update()));
|
||||||
|
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
|
||||||
|
this, SLOT(update()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4BuildConfigurationFactory::~Qt4BuildConfigurationFactory()
|
Qt4BuildConfigurationFactory::~Qt4BuildConfigurationFactory()
|
||||||
@@ -320,7 +319,8 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
|
|||||||
m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)),
|
m_buildConfigurationFactory(new Qt4BuildConfigurationFactory(this)),
|
||||||
m_fileInfo(new Qt4ProjectFile(this, fileName, this)),
|
m_fileInfo(new Qt4ProjectFile(this, fileName, this)),
|
||||||
m_isApplication(true),
|
m_isApplication(true),
|
||||||
m_projectFiles(new Qt4ProjectFiles)
|
m_projectFiles(new Qt4ProjectFiles),
|
||||||
|
m_lastActiveQt4BuildConfiguration(0)
|
||||||
{
|
{
|
||||||
m_manager->registerProject(this);
|
m_manager->registerProject(this);
|
||||||
|
|
||||||
@@ -340,26 +340,11 @@ Qt4BuildConfiguration *Qt4Project::activeQt4BuildConfiguration() const
|
|||||||
return static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
|
return static_cast<Qt4BuildConfiguration *>(activeBuildConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4Project::defaultQtVersionChanged()
|
void Qt4Project::qtVersionChanged()
|
||||||
{
|
{
|
||||||
if (activeQt4BuildConfiguration()->qtVersionId() == 0)
|
|
||||||
m_rootProjectNode->update();
|
m_rootProjectNode->update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4Project::qtVersionsChanged()
|
|
||||||
{
|
|
||||||
QtVersionManager *vm = QtVersionManager::instance();
|
|
||||||
foreach (BuildConfiguration *bc, buildConfigurations()) {
|
|
||||||
Qt4BuildConfiguration *qt4bc = static_cast<Qt4BuildConfiguration *>(bc);
|
|
||||||
if (!vm->version(qt4bc->qtVersionId())->isValid()) {
|
|
||||||
qt4bc->setQtVersion(0);
|
|
||||||
if (qt4bc == activeBuildConfiguration())
|
|
||||||
m_rootProjectNode->update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_buildConfigurationFactory->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Qt4Project::updateFileList()
|
void Qt4Project::updateFileList()
|
||||||
{
|
{
|
||||||
Qt4ProjectFiles newFiles;
|
Qt4ProjectFiles newFiles;
|
||||||
@@ -420,13 +405,6 @@ bool Qt4Project::restoreSettingsImpl(PersistentSettingsReader &settingsReader)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now connect
|
// Now connect
|
||||||
QtVersionManager *vm = QtVersionManager::instance();
|
|
||||||
connect(vm, SIGNAL(defaultQtVersionChanged()),
|
|
||||||
this, SLOT(defaultQtVersionChanged()));
|
|
||||||
connect(vm, SIGNAL(qtVersionsChanged()),
|
|
||||||
this, SLOT(qtVersionsChanged()));
|
|
||||||
|
|
||||||
|
|
||||||
connect(m_nodesWatcher, SIGNAL(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &)),
|
connect(m_nodesWatcher, SIGNAL(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &)),
|
||||||
this, SLOT(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &)));
|
this, SLOT(foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &)));
|
||||||
connect(m_nodesWatcher, SIGNAL(foldersAdded()), this, SLOT(checkForNewApplicationProjects()));
|
connect(m_nodesWatcher, SIGNAL(foldersAdded()), this, SLOT(checkForNewApplicationProjects()));
|
||||||
@@ -441,10 +419,47 @@ bool Qt4Project::restoreSettingsImpl(PersistentSettingsReader &settingsReader)
|
|||||||
const Qt4ProjectManager::Internal::Qt4ProjectType)));
|
const Qt4ProjectManager::Internal::Qt4ProjectType)));
|
||||||
|
|
||||||
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)),
|
connect(m_nodesWatcher, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)),
|
||||||
this, SLOT(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)));
|
this, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *)));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(activeBuildConfigurationChanged()),
|
||||||
|
this, SLOT(slotActiveBuildConfigurationChanged()));
|
||||||
|
|
||||||
|
m_lastActiveQt4BuildConfiguration = activeQt4BuildConfiguration();
|
||||||
|
if (m_lastActiveQt4BuildConfiguration) {
|
||||||
|
connect(m_lastActiveQt4BuildConfiguration, SIGNAL(qtVersionChanged()),
|
||||||
|
this, SLOT(update()));
|
||||||
|
connect(m_lastActiveQt4BuildConfiguration, SIGNAL(targetInformationChanged()),
|
||||||
|
this, SIGNAL(targetInformationChanged()));
|
||||||
|
connect(m_lastActiveQt4BuildConfiguration, SIGNAL(environmentChanged()),
|
||||||
|
this, SIGNAL(environmentChanged()));
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4Project::slotActiveBuildConfigurationChanged()
|
||||||
|
{
|
||||||
|
if (m_lastActiveQt4BuildConfiguration) {
|
||||||
|
disconnect(m_lastActiveQt4BuildConfiguration, SIGNAL(qtVersionChanged()),
|
||||||
|
this, SLOT(update()));
|
||||||
|
disconnect(m_lastActiveQt4BuildConfiguration, SIGNAL(targetInformationChanged()),
|
||||||
|
this, SIGNAL(targetInformationChanged()));
|
||||||
|
disconnect(m_lastActiveQt4BuildConfiguration, SIGNAL(environmentChanged()),
|
||||||
|
this, SIGNAL(environmentChanged()));
|
||||||
|
}
|
||||||
|
m_lastActiveQt4BuildConfiguration = activeQt4BuildConfiguration();
|
||||||
|
if (m_lastActiveQt4BuildConfiguration) {
|
||||||
|
connect(m_lastActiveQt4BuildConfiguration, SIGNAL(qtVersionChanged()),
|
||||||
|
this, SLOT(update()));
|
||||||
|
connect(m_lastActiveQt4BuildConfiguration, SIGNAL(targetInformationChanged()),
|
||||||
|
this, SIGNAL(targetInformationChanged()));
|
||||||
|
connect(m_lastActiveQt4BuildConfiguration, SIGNAL(environmentChanged()),
|
||||||
|
this, SIGNAL(environmentChanged()));
|
||||||
|
}
|
||||||
|
emit environmentChanged();
|
||||||
|
emit targetInformationChanged();
|
||||||
|
}
|
||||||
|
|
||||||
void Qt4Project::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer)
|
void Qt4Project::saveSettingsImpl(ProjectExplorer::PersistentSettingsWriter &writer)
|
||||||
{
|
{
|
||||||
Project::saveSettingsImpl(writer);
|
Project::saveSettingsImpl(writer);
|
||||||
@@ -482,7 +497,7 @@ Qt4BuildConfiguration *Qt4Project::addQt4BuildConfiguration(QString displayName,
|
|||||||
if (qmakeBuildConfiguration & QtVersion::BuildAll) // debug_and_release => explicit targets
|
if (qmakeBuildConfiguration & QtVersion::BuildAll) // debug_and_release => explicit targets
|
||||||
makeStep->setUserArguments(QStringList() << (debug ? "debug" : "release"));
|
makeStep->setUserArguments(QStringList() << (debug ? "debug" : "release"));
|
||||||
|
|
||||||
bc->setValue("buildConfiguration", int(qmakeBuildConfiguration));
|
bc->setQMakeBuildConfiguration(qmakeBuildConfiguration);
|
||||||
|
|
||||||
// Finally set the qt version
|
// Finally set the qt version
|
||||||
bool defaultQtVersion = (qtversion == 0);
|
bool defaultQtVersion = (qtversion == 0);
|
||||||
@@ -845,13 +860,6 @@ Qt4ProFileNode *Qt4Project::rootProjectNode() const
|
|||||||
return m_rootProjectNode;
|
return m_rootProjectNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Qt4Project::updateActiveRunConfiguration()
|
|
||||||
{
|
|
||||||
emit runConfigurationsEnabledStateChanged();
|
|
||||||
emit targetInformationChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
BuildConfigWidget *Qt4Project::createConfigWidget()
|
BuildConfigWidget *Qt4Project::createConfigWidget()
|
||||||
{
|
{
|
||||||
return new Qt4ProjectConfigWidget(this);
|
return new Qt4ProjectConfigWidget(this);
|
||||||
@@ -969,17 +977,6 @@ void Qt4Project::projectTypeChanged(Qt4ProFileNode *node, const Qt4ProjectType o
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4Project::proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node)
|
|
||||||
{
|
|
||||||
foreach (RunConfiguration *rc, runConfigurations()) {
|
|
||||||
if (Qt4RunConfiguration *qt4rc = qobject_cast<Qt4RunConfiguration *>(rc)) {
|
|
||||||
if (qt4rc->proFilePath() == node->path()) {
|
|
||||||
qt4rc->invalidateCachedTargetInformation();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Qt4Project::hasSubNode(Qt4PriFileNode *root, const QString &path)
|
bool Qt4Project::hasSubNode(Qt4PriFileNode *root, const QString &path)
|
||||||
{
|
{
|
||||||
if (root->path() == path)
|
if (root->path() == path)
|
||||||
@@ -1015,11 +1012,6 @@ void Qt4Project::notifyChanged(const QString &name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4Project::invalidateCachedTargetInformation()
|
|
||||||
{
|
|
||||||
emit targetInformationChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Handle special case were a subproject of the qt directory is opened, and
|
Handle special case were a subproject of the qt directory is opened, and
|
||||||
qt was configured to be built as a shadow build -> also build in the sub-
|
qt was configured to be built as a shadow build -> also build in the sub-
|
||||||
|
@@ -135,6 +135,7 @@ public:
|
|||||||
ProjectExplorer::BuildConfiguration *clone(ProjectExplorer::BuildConfiguration *source) const;
|
ProjectExplorer::BuildConfiguration *clone(ProjectExplorer::BuildConfiguration *source) const;
|
||||||
ProjectExplorer::BuildConfiguration *restore() const;
|
ProjectExplorer::BuildConfiguration *restore() const;
|
||||||
|
|
||||||
|
private slots:
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -191,21 +192,18 @@ public:
|
|||||||
|
|
||||||
void notifyChanged(const QString &name);
|
void notifyChanged(const QString &name);
|
||||||
|
|
||||||
// Is called by qmakestep qt4configurationwidget if the settings change
|
|
||||||
// Informs all Qt4RunConfigurations that their cached values are now invalid
|
|
||||||
// the Qt4RunConfigurations will update as soon as asked
|
|
||||||
|
|
||||||
// TODO remove
|
|
||||||
void invalidateCachedTargetInformation();
|
|
||||||
|
|
||||||
virtual QByteArray predefinedMacros(const QString &fileName) const;
|
virtual QByteArray predefinedMacros(const QString &fileName) const;
|
||||||
virtual QStringList includePaths(const QString &fileName) const;
|
virtual QStringList includePaths(const QString &fileName) const;
|
||||||
virtual QStringList frameworkPaths(const QString &fileName) const;
|
virtual QStringList frameworkPaths(const QString &fileName) const;
|
||||||
|
|
||||||
// TODO can i remove this?
|
|
||||||
void updateActiveRunConfiguration();
|
|
||||||
signals:
|
signals:
|
||||||
|
/// convenience signal, emitted if either the active buildconfiguration emits
|
||||||
|
/// targetInformationChanged() or if the active build configuration changes
|
||||||
void targetInformationChanged();
|
void targetInformationChanged();
|
||||||
|
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node);
|
||||||
|
/// convenience signal, emitted if either the active buildconfiguration emits
|
||||||
|
/// environmentChanged() or if the active build configuration changes
|
||||||
|
void environmentChanged();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void update();
|
void update();
|
||||||
@@ -214,8 +212,8 @@ public slots:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateCodeModel();
|
void updateCodeModel();
|
||||||
void defaultQtVersionChanged();
|
void qtVersionChanged();
|
||||||
void qtVersionsChanged();
|
void slotActiveBuildConfigurationChanged();
|
||||||
void updateFileList();
|
void updateFileList();
|
||||||
|
|
||||||
void foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &);
|
void foldersAboutToBeAdded(FolderNode *, const QList<FolderNode*> &);
|
||||||
@@ -224,7 +222,6 @@ private slots:
|
|||||||
void projectTypeChanged(Qt4ProjectManager::Internal::Qt4ProFileNode *node,
|
void projectTypeChanged(Qt4ProjectManager::Internal::Qt4ProFileNode *node,
|
||||||
const Qt4ProjectManager::Internal::Qt4ProjectType oldType,
|
const Qt4ProjectManager::Internal::Qt4ProjectType oldType,
|
||||||
const Qt4ProjectManager::Internal::Qt4ProjectType newType);
|
const Qt4ProjectManager::Internal::Qt4ProjectType newType);
|
||||||
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual bool restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &settingsReader);
|
virtual bool restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &settingsReader);
|
||||||
@@ -261,6 +258,8 @@ private:
|
|||||||
QList<Qt4ProjectManager::Internal::Qt4ProFileNode *> m_proFilesForCodeModelUpdate;
|
QList<Qt4ProjectManager::Internal::Qt4ProFileNode *> m_proFilesForCodeModelUpdate;
|
||||||
|
|
||||||
QMap<QString, Internal::CodeModelInfo> m_codeModelInfo;
|
QMap<QString, Internal::CodeModelInfo> m_codeModelInfo;
|
||||||
|
Internal::Qt4BuildConfiguration *m_lastActiveQt4BuildConfiguration;
|
||||||
|
|
||||||
friend class Qt4ProjectFile;
|
friend class Qt4ProjectFile;
|
||||||
friend class Internal::Qt4ProjectConfigWidget;
|
friend class Internal::Qt4ProjectConfigWidget;
|
||||||
};
|
};
|
||||||
|
@@ -51,10 +51,12 @@ bool debug = false;
|
|||||||
|
|
||||||
using namespace Qt4ProjectManager;
|
using namespace Qt4ProjectManager;
|
||||||
using namespace Qt4ProjectManager::Internal;
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
using ProjectExplorer::ToolChain;
|
||||||
|
|
||||||
Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
|
Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
|
||||||
: BuildConfigWidget(),
|
: BuildConfigWidget(),
|
||||||
m_buildConfiguration(0)
|
m_buildConfiguration(0),
|
||||||
|
m_ignoreChange(false)
|
||||||
{
|
{
|
||||||
Q_UNUSED(project);
|
Q_UNUSED(project);
|
||||||
QVBoxLayout *vbox = new QVBoxLayout(this);
|
QVBoxLayout *vbox = new QVBoxLayout(this);
|
||||||
@@ -75,22 +77,22 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
|
|||||||
m_ui->invalidQtWarningLabel->setVisible(false);
|
m_ui->invalidQtWarningLabel->setVisible(false);
|
||||||
|
|
||||||
connect(m_ui->nameLineEdit, SIGNAL(textEdited(QString)),
|
connect(m_ui->nameLineEdit, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(changeConfigName(QString)));
|
this, SLOT(configNameEdited(QString)));
|
||||||
|
|
||||||
connect(m_ui->shadowBuildCheckBox, SIGNAL(clicked(bool)),
|
connect(m_ui->shadowBuildCheckBox, SIGNAL(clicked(bool)),
|
||||||
this, SLOT(shadowBuildCheckBoxClicked(bool)));
|
this, SLOT(shadowBuildClicked(bool)));
|
||||||
|
|
||||||
connect(m_ui->shadowBuildDirEdit, SIGNAL(beforeBrowsing()),
|
connect(m_ui->shadowBuildDirEdit, SIGNAL(beforeBrowsing()),
|
||||||
this, SLOT(onBeforeBeforeShadowBuildDirBrowsed()));
|
this, SLOT(onBeforeBeforeShadowBuildDirBrowsed()));
|
||||||
|
|
||||||
connect(m_ui->shadowBuildDirEdit, SIGNAL(changed(QString)),
|
connect(m_ui->shadowBuildDirEdit, SIGNAL(changed(QString)),
|
||||||
this, SLOT(shadowBuildLineEditTextChanged()));
|
this, SLOT(shadowBuildEdited()));
|
||||||
|
|
||||||
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
||||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
|
this, SLOT(qtVersionSelected(QString)));
|
||||||
|
|
||||||
connect(m_ui->toolChainComboBox, SIGNAL(activated(int)),
|
connect(m_ui->toolChainComboBox, SIGNAL(activated(int)),
|
||||||
this, SLOT(selectToolChain(int)));
|
this, SLOT(toolChainSelected(int)));
|
||||||
|
|
||||||
connect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
|
connect(m_ui->importLabel, SIGNAL(linkActivated(QString)),
|
||||||
this, SLOT(importLabelClicked()));
|
this, SLOT(importLabelClicked()));
|
||||||
@@ -98,12 +100,10 @@ Qt4ProjectConfigWidget::Qt4ProjectConfigWidget(Qt4Project *project)
|
|||||||
connect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
|
connect(m_ui->manageQtVersionPushButtons, SIGNAL(clicked()),
|
||||||
this, SLOT(manageQtVersions()));
|
this, SLOT(manageQtVersions()));
|
||||||
|
|
||||||
QtVersionManager *vm = QtVersionManager::instance();
|
|
||||||
|
|
||||||
connect(vm, SIGNAL(qtVersionsChanged()),
|
QtVersionManager *vm = QtVersionManager::instance();
|
||||||
this, SLOT(setupQtVersionsComboBox()));
|
connect(vm, SIGNAL(qtVersionsChanged(QList<int>)),
|
||||||
connect(vm, SIGNAL(qtVersionsChanged()),
|
this, SLOT(qtVersionsChanged()));
|
||||||
this, SLOT(updateDetails()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
|
Qt4ProjectConfigWidget::~Qt4ProjectConfigWidget()
|
||||||
@@ -148,10 +148,23 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc)
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "Qt4ProjectConfigWidget::init() for"<<bc->displayName();
|
qDebug() << "Qt4ProjectConfigWidget::init() for"<<bc->displayName();
|
||||||
|
|
||||||
|
if (m_buildConfiguration) {
|
||||||
|
disconnect(m_buildConfiguration, SIGNAL(buildDirectoryChanged()),
|
||||||
|
this, SLOT(buildDirectoryChanged()));
|
||||||
|
disconnect(m_buildConfiguration, SIGNAL(qtVersionChanged()),
|
||||||
|
this, SLOT(qtVersionChanged()));
|
||||||
|
}
|
||||||
|
|
||||||
m_buildConfiguration = static_cast<Qt4BuildConfiguration *>(bc);
|
m_buildConfiguration = static_cast<Qt4BuildConfiguration *>(bc);
|
||||||
|
|
||||||
|
connect(m_buildConfiguration, SIGNAL(buildDirectoryChanged()),
|
||||||
|
this, SLOT(buildDirectoryChanged()));
|
||||||
|
connect(m_buildConfiguration, SIGNAL(qtVersionChanged()),
|
||||||
|
this, SLOT(qtVersionChanged()));
|
||||||
|
|
||||||
m_ui->nameLineEdit->setText(m_buildConfiguration->displayName());
|
m_ui->nameLineEdit->setText(m_buildConfiguration->displayName());
|
||||||
|
|
||||||
setupQtVersionsComboBox();
|
qtVersionsChanged();
|
||||||
|
|
||||||
bool shadowBuild = m_buildConfiguration->value("useShadowBuild").toBool();
|
bool shadowBuild = m_buildConfiguration->value("useShadowBuild").toBool();
|
||||||
m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
|
m_ui->shadowBuildCheckBox->setChecked(shadowBuild);
|
||||||
@@ -163,18 +176,25 @@ void Qt4ProjectConfigWidget::init(ProjectExplorer::BuildConfiguration *bc)
|
|||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::changeConfigName(const QString &newName)
|
void Qt4ProjectConfigWidget::qtVersionChanged()
|
||||||
|
{
|
||||||
|
updateImportLabel();
|
||||||
|
updateToolChainCombo();
|
||||||
|
updateDetails();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4ProjectConfigWidget::configNameEdited(const QString &newName)
|
||||||
{
|
{
|
||||||
m_buildConfiguration->setDisplayName(newName);
|
m_buildConfiguration->setDisplayName(newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
|
void Qt4ProjectConfigWidget::qtVersionsChanged()
|
||||||
{
|
{
|
||||||
if (!m_buildConfiguration) // not yet initialized
|
if (!m_buildConfiguration) // not yet initialized
|
||||||
return;
|
return;
|
||||||
|
|
||||||
disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
disconnect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
||||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
|
this, SLOT(qtVersionSelected(QString)));
|
||||||
|
|
||||||
QtVersionManager *vm = QtVersionManager::instance();
|
QtVersionManager *vm = QtVersionManager::instance();
|
||||||
|
|
||||||
@@ -200,7 +220,14 @@ void Qt4ProjectConfigWidget::setupQtVersionsComboBox()
|
|||||||
|
|
||||||
// And connect again
|
// And connect again
|
||||||
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
connect(m_ui->qtVersionComboBox, SIGNAL(currentIndexChanged(QString)),
|
||||||
this, SLOT(qtVersionComboBoxCurrentIndexChanged(QString)));
|
this, SLOT(qtVersionSelected(QString)));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Qt4ProjectConfigWidget::buildDirectoryChanged()
|
||||||
|
{
|
||||||
|
m_ui->shadowBuildDirEdit->setPath(m_buildConfiguration->value("buildDirectory").toString());
|
||||||
|
updateDetails();
|
||||||
|
updateImportLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::onBeforeBeforeShadowBuildDirBrowsed()
|
void Qt4ProjectConfigWidget::onBeforeBeforeShadowBuildDirBrowsed()
|
||||||
@@ -210,21 +237,35 @@ void Qt4ProjectConfigWidget::onBeforeBeforeShadowBuildDirBrowsed()
|
|||||||
m_ui->shadowBuildDirEdit->setInitialBrowsePathBackup(initialDirectory);
|
m_ui->shadowBuildDirEdit->setInitialBrowsePathBackup(initialDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::shadowBuildCheckBoxClicked(bool checked)
|
void Qt4ProjectConfigWidget::shadowBuildClicked(bool checked)
|
||||||
{
|
{
|
||||||
m_ui->shadowBuildDirEdit->setEnabled(checked);
|
m_ui->shadowBuildDirEdit->setEnabled(checked);
|
||||||
m_browseButton->setEnabled(checked);
|
m_browseButton->setEnabled(checked);
|
||||||
bool b = m_ui->shadowBuildCheckBox->isChecked();
|
bool b = m_ui->shadowBuildCheckBox->isChecked();
|
||||||
m_buildConfiguration->setValue("useShadowBuild", b);
|
|
||||||
if (b)
|
m_ignoreChange = true;
|
||||||
m_buildConfiguration->setValue("buildDirectory", m_ui->shadowBuildDirEdit->path());
|
m_buildConfiguration->setShadowBuildAndDirectory(b, b ? m_ui->shadowBuildDirEdit->path() : QString::null);
|
||||||
else
|
m_ignoreChange = false;
|
||||||
m_buildConfiguration->setValue("buildDirectory", QVariant(QString::null));
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
m_buildConfiguration->qt4Project()->invalidateCachedTargetInformation();
|
|
||||||
updateImportLabel();
|
updateImportLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4ProjectConfigWidget::shadowBuildEdited()
|
||||||
|
{
|
||||||
|
if (m_buildConfiguration->value("buildDirectory").toString() == m_ui->shadowBuildDirEdit->path())
|
||||||
|
return;
|
||||||
|
m_ignoreChange = true;
|
||||||
|
m_buildConfiguration->setShadowBuildAndDirectory(true, m_ui->shadowBuildDirEdit->path());
|
||||||
|
m_ignoreChange = false;
|
||||||
|
|
||||||
|
// if the directory already exists
|
||||||
|
// check if we have a build in there and
|
||||||
|
// offer to import it
|
||||||
|
updateImportLabel();
|
||||||
|
updateDetails();
|
||||||
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::updateImportLabel()
|
void Qt4ProjectConfigWidget::updateImportLabel()
|
||||||
{
|
{
|
||||||
bool visible = false;
|
bool visible = false;
|
||||||
@@ -251,20 +292,6 @@ void Qt4ProjectConfigWidget::updateImportLabel()
|
|||||||
m_ui->importLabel->setVisible(visible);
|
m_ui->importLabel->setVisible(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::shadowBuildLineEditTextChanged()
|
|
||||||
{
|
|
||||||
if (m_buildConfiguration->value("buildDirectory").toString() == m_ui->shadowBuildDirEdit->path())
|
|
||||||
return;
|
|
||||||
m_buildConfiguration->setValue("buildDirectory", m_ui->shadowBuildDirEdit->path());
|
|
||||||
// if the directory already exists
|
|
||||||
// check if we have a build in there and
|
|
||||||
// offer to import it
|
|
||||||
updateImportLabel();
|
|
||||||
|
|
||||||
m_buildConfiguration->qt4Project()->invalidateCachedTargetInformation();
|
|
||||||
updateDetails();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::importLabelClicked()
|
void Qt4ProjectConfigWidget::importLabelClicked()
|
||||||
{
|
{
|
||||||
if (!m_buildConfiguration->qmakeStep() || !m_buildConfiguration->makeStep())
|
if (!m_buildConfiguration->qmakeStep() || !m_buildConfiguration->makeStep())
|
||||||
@@ -301,7 +328,7 @@ void Qt4ProjectConfigWidget::importLabelClicked()
|
|||||||
qmakeStep->setUserArguments(additionalArguments);
|
qmakeStep->setUserArguments(additionalArguments);
|
||||||
MakeStep *makeStep = m_buildConfiguration->makeStep();
|
MakeStep *makeStep = m_buildConfiguration->makeStep();
|
||||||
|
|
||||||
m_buildConfiguration->setValue("buildConfiguration", int(qmakeBuildConfig));
|
m_buildConfiguration->setQMakeBuildConfiguration(qmakeBuildConfig);
|
||||||
// Adjust command line arguments, this is ugly as hell
|
// Adjust command line arguments, this is ugly as hell
|
||||||
// If we are switching to BuildAll we want "release" in there and no "debug"
|
// If we are switching to BuildAll we want "release" in there and no "debug"
|
||||||
// or "debug" in there and no "release"
|
// or "debug" in there and no "release"
|
||||||
@@ -319,12 +346,12 @@ void Qt4ProjectConfigWidget::importLabelClicked()
|
|||||||
makeStep->setUserArguments(makeCmdArguments);
|
makeStep->setUserArguments(makeCmdArguments);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setupQtVersionsComboBox();
|
// All our widgets are updated by signals from the buildconfiguration
|
||||||
updateDetails();
|
// if not, there's either a signal missing
|
||||||
updateImportLabel();
|
// or we don't respond to it correctly
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::qtVersionComboBoxCurrentIndexChanged(const QString &)
|
void Qt4ProjectConfigWidget::qtVersionSelected(const QString &)
|
||||||
{
|
{
|
||||||
//Qt Version
|
//Qt Version
|
||||||
int newQtVersion;
|
int newQtVersion;
|
||||||
@@ -337,9 +364,10 @@ void Qt4ProjectConfigWidget::qtVersionComboBoxCurrentIndexChanged(const QString
|
|||||||
bool isValid = vm->version(newQtVersion)->isValid();
|
bool isValid = vm->version(newQtVersion)->isValid();
|
||||||
m_ui->invalidQtWarningLabel->setVisible(!isValid);
|
m_ui->invalidQtWarningLabel->setVisible(!isValid);
|
||||||
if (newQtVersion != m_buildConfiguration->qtVersionId()) {
|
if (newQtVersion != m_buildConfiguration->qtVersionId()) {
|
||||||
|
m_ignoreChange = true;
|
||||||
m_buildConfiguration->setQtVersion(newQtVersion);
|
m_buildConfiguration->setQtVersion(newQtVersion);
|
||||||
|
m_ignoreChange = false;
|
||||||
updateToolChainCombo();
|
updateToolChainCombo();
|
||||||
m_buildConfiguration->qt4Project()->update();
|
|
||||||
}
|
}
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
@@ -348,27 +376,21 @@ void Qt4ProjectConfigWidget::updateToolChainCombo()
|
|||||||
{
|
{
|
||||||
m_ui->toolChainComboBox->clear();
|
m_ui->toolChainComboBox->clear();
|
||||||
QList<ProjectExplorer::ToolChain::ToolChainType> toolchains = m_buildConfiguration->qtVersion()->possibleToolChainTypes();
|
QList<ProjectExplorer::ToolChain::ToolChainType> toolchains = m_buildConfiguration->qtVersion()->possibleToolChainTypes();
|
||||||
using namespace ProjectExplorer;
|
|
||||||
foreach (ToolChain::ToolChainType toolchain, toolchains) {
|
foreach (ToolChain::ToolChainType toolchain, toolchains) {
|
||||||
m_ui->toolChainComboBox->addItem(ToolChain::toolChainName(toolchain), qVariantFromValue(toolchain));
|
m_ui->toolChainComboBox->addItem(ToolChain::toolChainName(toolchain), qVariantFromValue(toolchain));
|
||||||
}
|
}
|
||||||
m_ui->toolChainComboBox->setEnabled(toolchains.size() > 1);
|
m_ui->toolChainComboBox->setEnabled(toolchains.size() > 1);
|
||||||
setToolChain(toolchains.indexOf(m_buildConfiguration->toolChainType()));
|
m_ui->toolChainComboBox->setCurrentIndex(toolchains.indexOf(m_buildConfiguration->toolChainType()));
|
||||||
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::selectToolChain(int index)
|
void Qt4ProjectConfigWidget::toolChainSelected(int index)
|
||||||
{
|
|
||||||
setToolChain(index);
|
|
||||||
m_buildConfiguration->qt4Project()->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Qt4ProjectConfigWidget::setToolChain(int index)
|
|
||||||
{
|
{
|
||||||
ProjectExplorer::ToolChain::ToolChainType selectedToolChainType =
|
ProjectExplorer::ToolChain::ToolChainType selectedToolChainType =
|
||||||
m_ui->toolChainComboBox->itemData(index,
|
m_ui->toolChainComboBox->itemData(index,
|
||||||
Qt::UserRole).value<ProjectExplorer::ToolChain::ToolChainType>();
|
Qt::UserRole).value<ProjectExplorer::ToolChain::ToolChainType>();
|
||||||
|
m_ignoreChange = true;
|
||||||
m_buildConfiguration->setToolChainType(selectedToolChainType);
|
m_buildConfiguration->setToolChainType(selectedToolChainType);
|
||||||
if (m_ui->toolChainComboBox->currentIndex() != index)
|
m_ignoreChange = false;
|
||||||
m_ui->toolChainComboBox->setCurrentIndex(index);
|
|
||||||
updateDetails();
|
updateDetails();
|
||||||
}
|
}
|
||||||
|
@@ -56,25 +56,29 @@ public:
|
|||||||
void init(ProjectExplorer::BuildConfiguration *bc);
|
void init(ProjectExplorer::BuildConfiguration *bc);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void changeConfigName(const QString &newName);
|
// User changes in our widgets
|
||||||
void setupQtVersionsComboBox();
|
void configNameEdited(const QString &newName);
|
||||||
void shadowBuildCheckBoxClicked(bool checked);
|
void shadowBuildClicked(bool checked);
|
||||||
void onBeforeBeforeShadowBuildDirBrowsed();
|
void onBeforeBeforeShadowBuildDirBrowsed();
|
||||||
void shadowBuildLineEditTextChanged();
|
void shadowBuildEdited();
|
||||||
void importLabelClicked();
|
void qtVersionSelected(const QString &);
|
||||||
void qtVersionComboBoxCurrentIndexChanged(const QString &);
|
void toolChainSelected(int index);
|
||||||
void manageQtVersions();
|
void manageQtVersions();
|
||||||
void selectToolChain(int index);
|
void importLabelClicked();
|
||||||
void updateDetails();
|
|
||||||
|
|
||||||
|
// Changes triggered from creator
|
||||||
|
void qtVersionsChanged();
|
||||||
|
void qtVersionChanged();
|
||||||
|
void buildDirectoryChanged();
|
||||||
private:
|
private:
|
||||||
|
void updateDetails();
|
||||||
void updateToolChainCombo();
|
void updateToolChainCombo();
|
||||||
void updateImportLabel();
|
void updateImportLabel();
|
||||||
void setToolChain(int index);
|
|
||||||
Ui::Qt4ProjectConfigWidget *m_ui;
|
Ui::Qt4ProjectConfigWidget *m_ui;
|
||||||
QAbstractButton *m_browseButton;
|
QAbstractButton *m_browseButton;
|
||||||
Qt4BuildConfiguration *m_buildConfiguration;
|
Qt4BuildConfiguration *m_buildConfiguration;
|
||||||
Utils::DetailsWidget *m_detailsContainer;
|
Utils::DetailsWidget *m_detailsContainer;
|
||||||
|
bool m_ignoreChange;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
@@ -72,18 +72,14 @@ Qt4RunConfiguration::Qt4RunConfiguration(Qt4Project *pro, const QString &proFile
|
|||||||
else
|
else
|
||||||
setName(tr("Qt4RunConfiguration"));
|
setName(tr("Qt4RunConfiguration"));
|
||||||
|
|
||||||
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
|
|
||||||
this, SLOT(invalidateCachedTargetInformation()));
|
|
||||||
|
|
||||||
connect(pro, SIGNAL(targetInformationChanged()),
|
connect(pro, SIGNAL(targetInformationChanged()),
|
||||||
this, SLOT(invalidateCachedTargetInformation()));
|
this, SLOT(invalidateCachedTargetInformation()));
|
||||||
|
|
||||||
connect(pro, SIGNAL(activeBuildConfigurationChanged()),
|
connect(pro, SIGNAL(environmentChanged()),
|
||||||
this, SIGNAL(baseEnvironmentChanged()));
|
this, SIGNAL(baseEnvironmentChanged()));
|
||||||
|
|
||||||
// TODO
|
connect(pro, SIGNAL(proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode*)),
|
||||||
// connect(pro, SIGNAL(environmentChanged(ProjectExplorer::BuildConfiguration *)),
|
this, SLOT(proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode*)));
|
||||||
// this, SIGNAL(baseEnvironmentChanged()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Qt4RunConfiguration::~Qt4RunConfiguration()
|
Qt4RunConfiguration::~Qt4RunConfiguration()
|
||||||
@@ -123,6 +119,12 @@ bool Qt4RunConfiguration::isEnabled(ProjectExplorer::BuildConfiguration *configu
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Qt4RunConfiguration::proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro)
|
||||||
|
{
|
||||||
|
if (m_proFilePath == pro->path())
|
||||||
|
invalidateCachedTargetInformation();
|
||||||
|
}
|
||||||
|
|
||||||
//////
|
//////
|
||||||
/// Qt4RunConfigurationWidget
|
/// Qt4RunConfigurationWidget
|
||||||
/////
|
/////
|
||||||
@@ -205,7 +207,7 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
|||||||
<< tr("Build Environment"));
|
<< tr("Build Environment"));
|
||||||
m_baseEnvironmentComboBox->setCurrentIndex(qt4RunConfiguration->baseEnvironmentBase());
|
m_baseEnvironmentComboBox->setCurrentIndex(qt4RunConfiguration->baseEnvironmentBase());
|
||||||
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)),
|
||||||
this, SLOT(baseEnvironmentComboBoxChanged(int)));
|
this, SLOT(baseEnvironmentSelected(int)));
|
||||||
baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox);
|
baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox);
|
||||||
baseEnvironmentLayout->addStretch(10);
|
baseEnvironmentLayout->addStretch(10);
|
||||||
|
|
||||||
@@ -216,20 +218,20 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run
|
|||||||
vboxTopLayout->addWidget(m_environmentWidget);
|
vboxTopLayout->addWidget(m_environmentWidget);
|
||||||
|
|
||||||
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
|
connect(m_workingDirectoryEdit, SIGNAL(changed(QString)),
|
||||||
this, SLOT(setWorkingDirectory()));
|
this, SLOT(workDirectoryEdited()));
|
||||||
|
|
||||||
connect(resetButton, SIGNAL(clicked()),
|
connect(resetButton, SIGNAL(clicked()),
|
||||||
this, SLOT(resetWorkingDirectory()));
|
this, SLOT(workingDirectoryReseted()));
|
||||||
|
|
||||||
connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
|
connect(m_argumentsLineEdit, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(setCommandLineArguments(QString)));
|
this, SLOT(argumentsEdited(QString)));
|
||||||
connect(m_nameLineEdit, SIGNAL(textEdited(QString)),
|
connect(m_nameLineEdit, SIGNAL(textEdited(QString)),
|
||||||
this, SLOT(nameEdited(QString)));
|
this, SLOT(nameEdited(QString)));
|
||||||
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
|
connect(m_useTerminalCheck, SIGNAL(toggled(bool)),
|
||||||
this, SLOT(termToggled(bool)));
|
this, SLOT(termToggled(bool)));
|
||||||
|
|
||||||
connect(m_environmentWidget, SIGNAL(userChangesUpdated()),
|
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
|
||||||
this, SLOT(userChangesUpdated()));
|
this, SLOT(userChangesEdited()));
|
||||||
|
|
||||||
connect(qt4RunConfiguration, SIGNAL(workingDirectoryChanged(QString)),
|
connect(qt4RunConfiguration, SIGNAL(workingDirectoryChanged(QString)),
|
||||||
this, SLOT(workingDirectoryChanged(QString)));
|
this, SLOT(workingDirectoryChanged(QString)));
|
||||||
@@ -263,7 +265,7 @@ void Qt4RunConfigurationWidget::updateSummary()
|
|||||||
m_detailsContainer->setSummaryText(text);
|
m_detailsContainer->setSummaryText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::baseEnvironmentComboBoxChanged(int index)
|
void Qt4RunConfigurationWidget::baseEnvironmentSelected(int index)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_qt4RunConfiguration->setBaseEnvironmentBase(Qt4RunConfiguration::BaseEnvironmentBase(index));
|
m_qt4RunConfiguration->setBaseEnvironmentBase(Qt4RunConfiguration::BaseEnvironmentBase(index));
|
||||||
@@ -288,14 +290,14 @@ void Qt4RunConfigurationWidget::userEnvironmentChangesChanged(const QList<Projec
|
|||||||
m_environmentWidget->setUserChanges(userChanges);
|
m_environmentWidget->setUserChanges(userChanges);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::userChangesUpdated()
|
void Qt4RunConfigurationWidget::userChangesEdited()
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_qt4RunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
|
m_qt4RunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::setWorkingDirectory()
|
void Qt4RunConfigurationWidget::workDirectoryEdited()
|
||||||
{
|
{
|
||||||
if (m_ignoreChange)
|
if (m_ignoreChange)
|
||||||
return;
|
return;
|
||||||
@@ -304,24 +306,24 @@ void Qt4RunConfigurationWidget::setWorkingDirectory()
|
|||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::resetWorkingDirectory()
|
void Qt4RunConfigurationWidget::workingDirectoryReseted()
|
||||||
{
|
{
|
||||||
// This emits a signal connected to workingDirectoryChanged()
|
// This emits a signal connected to workingDirectoryChanged()
|
||||||
// that sets the m_workingDirectoryEdit
|
// that sets the m_workingDirectoryEdit
|
||||||
m_qt4RunConfiguration->setWorkingDirectory("");
|
m_qt4RunConfiguration->setWorkingDirectory("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::setCommandLineArguments(const QString &args)
|
void Qt4RunConfigurationWidget::argumentsEdited(const QString &args)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_qt4RunConfiguration->setCommandLineArguments(args);
|
m_qt4RunConfiguration->setArguments(args);
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfigurationWidget::nameEdited(const QString &name)
|
void Qt4RunConfigurationWidget::nameEdited(const QString &name)
|
||||||
{
|
{
|
||||||
m_ignoreChange = true;
|
m_ignoreChange = true;
|
||||||
m_qt4RunConfiguration->nameEdited(name);
|
m_qt4RunConfiguration->setUserName(name);
|
||||||
m_ignoreChange = false;
|
m_ignoreChange = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -527,7 +529,7 @@ void Qt4RunConfiguration::setWorkingDirectory(const QString &wd)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfiguration::setCommandLineArguments(const QString &argumentsString)
|
void Qt4RunConfiguration::setArguments(const QString &argumentsString)
|
||||||
{
|
{
|
||||||
m_commandLineArguments = ProjectExplorer::Environment::parseCombinedArgString(argumentsString);
|
m_commandLineArguments = ProjectExplorer::Environment::parseCombinedArgString(argumentsString);
|
||||||
emit commandLineArgumentsChanged(argumentsString);
|
emit commandLineArgumentsChanged(argumentsString);
|
||||||
@@ -539,14 +541,14 @@ void Qt4RunConfiguration::setRunMode(RunMode runMode)
|
|||||||
emit runModeChanged(runMode);
|
emit runModeChanged(runMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt4RunConfiguration::nameEdited(const QString &name)
|
void Qt4RunConfiguration::setUserName(const QString &name)
|
||||||
{
|
{
|
||||||
if (name == "") {
|
if (name == "") {
|
||||||
setName(tr("Qt4RunConfiguration"));
|
|
||||||
m_userSetName = false;
|
m_userSetName = false;
|
||||||
|
setName(tr("Qt4RunConfiguration"));
|
||||||
} else {
|
} else {
|
||||||
setName(name);
|
|
||||||
m_userSetName = true;
|
m_userSetName = true;
|
||||||
|
setName(name);
|
||||||
}
|
}
|
||||||
emit nameChanged(name);
|
emit nameChanged(name);
|
||||||
}
|
}
|
||||||
|
@@ -53,8 +53,8 @@ namespace Qt4ProjectManager {
|
|||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class Qt4PriFileNode;
|
class Qt4PriFileNode;
|
||||||
|
class Qt4ProFileNode;
|
||||||
|
|
||||||
class Qt4RunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
class Qt4RunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
||||||
{
|
{
|
||||||
@@ -109,9 +109,10 @@ signals:
|
|||||||
void effectiveTargetInformationChanged();
|
void effectiveTargetInformationChanged();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void setCommandLineArguments(const QString &argumentsString);
|
void proFileUpdate(Qt4ProjectManager::Internal::Qt4ProFileNode *pro);
|
||||||
|
void setArguments(const QString &argumentsString);
|
||||||
void setWorkingDirectory(const QString &workingDirectory);
|
void setWorkingDirectory(const QString &workingDirectory);
|
||||||
void nameEdited(const QString&);
|
void setUserName(const QString&);
|
||||||
void setRunMode(RunMode runMode);
|
void setRunMode(RunMode runMode);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -152,11 +153,11 @@ protected:
|
|||||||
void showEvent(QShowEvent *event);
|
void showEvent(QShowEvent *event);
|
||||||
void hideEvent(QHideEvent *event);
|
void hideEvent(QHideEvent *event);
|
||||||
private slots:
|
private slots:
|
||||||
void setWorkingDirectory();
|
void workDirectoryEdited();
|
||||||
void resetWorkingDirectory();
|
void workingDirectoryReseted();
|
||||||
void setCommandLineArguments(const QString &arguments);
|
void argumentsEdited(const QString &arguments);
|
||||||
void nameEdited(const QString &name);
|
void nameEdited(const QString &name);
|
||||||
void userChangesUpdated();
|
void userChangesEdited();
|
||||||
|
|
||||||
void workingDirectoryChanged(const QString &workingDirectory);
|
void workingDirectoryChanged(const QString &workingDirectory);
|
||||||
void commandLineArgumentsChanged(const QString &args);
|
void commandLineArgumentsChanged(const QString &args);
|
||||||
@@ -169,7 +170,7 @@ private slots:
|
|||||||
void termToggled(bool);
|
void termToggled(bool);
|
||||||
void usingDyldImageSuffixToggled(bool);
|
void usingDyldImageSuffixToggled(bool);
|
||||||
void usingDyldImageSuffixChanged(bool);
|
void usingDyldImageSuffixChanged(bool);
|
||||||
void baseEnvironmentComboBoxChanged(int index);
|
void baseEnvironmentSelected(int index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateSummary();
|
void updateSummary();
|
||||||
|
@@ -181,8 +181,9 @@ void QtVersionManager::addVersion(QtVersion *version)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(version != 0, return);
|
QTC_ASSERT(version != 0, return);
|
||||||
m_versions.append(version);
|
m_versions.append(version);
|
||||||
m_uniqueIdToIndex.insert(version->uniqueId(), m_versions.count() - 1);
|
int uniqueId = version->uniqueId();
|
||||||
emit qtVersionsChanged();
|
m_uniqueIdToIndex.insert(uniqueId, m_versions.count() - 1);
|
||||||
|
emit qtVersionsChanged(QList<int>() << uniqueId);
|
||||||
writeVersionsIntoSettings();
|
writeVersionsIntoSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,8 +191,9 @@ void QtVersionManager::removeVersion(QtVersion *version)
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(version != 0, return);
|
QTC_ASSERT(version != 0, return);
|
||||||
m_versions.removeAll(version);
|
m_versions.removeAll(version);
|
||||||
m_uniqueIdToIndex.remove(version->uniqueId());
|
int uniqueId = version->uniqueId();
|
||||||
emit qtVersionsChanged();
|
m_uniqueIdToIndex.remove(uniqueId);
|
||||||
|
emit qtVersionsChanged(QList<int>() << uniqueId);
|
||||||
writeVersionsIntoSettings();
|
writeVersionsIntoSettings();
|
||||||
delete version;
|
delete version;
|
||||||
}
|
}
|
||||||
@@ -378,21 +380,78 @@ QtVersion *QtVersionManager::defaultVersion() const
|
|||||||
return m_emptyVersion;
|
return m_emptyVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class SortByUniqueId
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
bool operator()(QtVersion *a, QtVersion *b)
|
||||||
|
{
|
||||||
|
return a->uniqueId() < b->uniqueId();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
bool QtVersionManager::equals(QtVersion *a, QtVersion *b)
|
||||||
|
{
|
||||||
|
if (a->m_qmakeCommand != b->m_qmakeCommand)
|
||||||
|
return false;
|
||||||
|
if (a->m_id != b->m_id)
|
||||||
|
return false;
|
||||||
|
if (a->m_mingwDirectory != b->m_mingwDirectory
|
||||||
|
|| a->m_msvcVersion != b->m_msvcVersion
|
||||||
|
|| a->m_mwcDirectory != b->m_mwcDirectory)
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newDefaultVersion)
|
void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newDefaultVersion)
|
||||||
{
|
{
|
||||||
bool versionPathsChanged = m_versions.size() != newVersions.size();
|
// We want to preserve the same order as in the settings dialog
|
||||||
if (!versionPathsChanged) {
|
// so we sort a copy
|
||||||
for (int i = 0; i < m_versions.size(); ++i) {
|
QList<QtVersion *> sortedNewVersions = newVersions;
|
||||||
if (m_versions.at(i)->qmakeCommand() != newVersions.at(i)->qmakeCommand()) {
|
SortByUniqueId sortByUniqueId;
|
||||||
versionPathsChanged = true;
|
qSort(sortedNewVersions.begin(), sortedNewVersions.end(), sortByUniqueId);
|
||||||
break;
|
qSort(m_versions.begin(), m_versions.end(), sortByUniqueId);
|
||||||
|
|
||||||
|
QList<int> changedVersions;
|
||||||
|
// So we trying to find the minimal set of changed versions,
|
||||||
|
// iterate over both sorted list
|
||||||
|
|
||||||
|
// newVersions and oldVersions iterator
|
||||||
|
QList<QtVersion *>::const_iterator nit, nend, oit, oend;
|
||||||
|
nit = sortedNewVersions.constBegin();
|
||||||
|
nend = sortedNewVersions.constEnd();
|
||||||
|
oit = m_versions.constBegin();
|
||||||
|
oend = m_versions.constEnd();
|
||||||
|
|
||||||
|
while (nit != nend && oit != oend) {
|
||||||
|
int nid = (*nit)->uniqueId();
|
||||||
|
int oid = (*oit)->uniqueId();
|
||||||
|
if (nid < oid) {
|
||||||
|
changedVersions.push_back(nid);
|
||||||
|
++nit;
|
||||||
|
} else if (oid < nid) {
|
||||||
|
changedVersions.push_back(oid);
|
||||||
|
++oit;
|
||||||
|
} else {
|
||||||
|
if (!equals(*oit, *nit))
|
||||||
|
changedVersions.push_back(oid);
|
||||||
|
++oit;
|
||||||
|
++nit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (nit != nend) {
|
||||||
|
changedVersions.push_back((*nit)->uniqueId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (oit != oend) {
|
||||||
|
changedVersions.push_back((*oit)->uniqueId());
|
||||||
|
}
|
||||||
|
|
||||||
qDeleteAll(m_versions);
|
qDeleteAll(m_versions);
|
||||||
m_versions.clear();
|
m_versions.clear();
|
||||||
m_versions = newVersions;
|
m_versions = newVersions;
|
||||||
if (versionPathsChanged)
|
|
||||||
|
if (!changedVersions.isEmpty())
|
||||||
updateDocumentation();
|
updateDocumentation();
|
||||||
updateUniqueIdToIndexMap();
|
updateUniqueIdToIndexMap();
|
||||||
|
|
||||||
@@ -402,13 +461,13 @@ void QtVersionManager::setNewQtVersions(QList<QtVersion *> newVersions, int newD
|
|||||||
emitDefaultChanged = true;
|
emitDefaultChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
emit qtVersionsChanged();
|
|
||||||
if (emitDefaultChanged) {
|
|
||||||
emit defaultQtVersionChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
updateExamples();
|
updateExamples();
|
||||||
writeVersionsIntoSettings();
|
writeVersionsIntoSettings();
|
||||||
|
|
||||||
|
if (!changedVersions.isEmpty())
|
||||||
|
emit qtVersionsChanged(changedVersions);
|
||||||
|
if (emitDefaultChanged)
|
||||||
|
emit defaultQtVersionChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
@@ -214,12 +214,14 @@ public:
|
|||||||
static QString findQMakeBinaryFromMakefile(const QString &directory);
|
static QString findQMakeBinaryFromMakefile(const QString &directory);
|
||||||
signals:
|
signals:
|
||||||
void defaultQtVersionChanged();
|
void defaultQtVersionChanged();
|
||||||
void qtVersionsChanged();
|
void qtVersionsChanged(const QList<int> &uniqueIds);
|
||||||
void updateExamples(QString, QString, QString);
|
void updateExamples(QString, QString, QString);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void updateExamples();
|
void updateExamples();
|
||||||
private:
|
private:
|
||||||
|
// This function is really simplistic...
|
||||||
|
static bool equals(QtVersion *a, QtVersion *b);
|
||||||
static QString findQMakeLine(const QString &directory);
|
static QString findQMakeLine(const QString &directory);
|
||||||
static QString trimLine(const QString line);
|
static QString trimLine(const QString line);
|
||||||
static QStringList splitLine(const QString &line);
|
static QStringList splitLine(const QString &line);
|
||||||
|
Reference in New Issue
Block a user