Commit 7c12dad4 authored by con's avatar con

Make it possible to use non-autodetected Qt for Symbian.

Users can specify a S60 SDK root for Qt for Symbian versions
now.
parent 1ef61e07
......@@ -214,6 +214,16 @@ S60Devices::Device S60Devices::deviceForId(const QString &id) const
return Device();
}
S60Devices::Device S60Devices::deviceForEpocRoot(const QString &root) const
{
foreach (const S60Devices::Device &i, m_devices) {
if (i.epocRoot == root) {
return i;
}
}
return Device();
}
QString S60Devices::cleanedRootPath(const QString &deviceRoot)
{
QString path = deviceRoot;
......
......@@ -63,6 +63,7 @@ public:
QList<Device> devices() const;
bool detectQtForDevices();
Device deviceForId(const QString &id) const;
Device deviceForEpocRoot(const QString &root) const;
static QString cleanedRootPath(const QString &deviceRoot);
signals:
......
......@@ -177,6 +177,7 @@ void S60Manager::updateQtVersions()
deviceVersion->setName(deviceVersion->name().arg(deviceVersion->qtVersionString()));
versionsToAdd.append(deviceVersion);
}
deviceVersion->setS60SDKDirectory(device.epocRoot);
}
// remove old autodetected versions
foreach (QtVersion *version, versions) {
......@@ -202,8 +203,9 @@ ProjectExplorer::ToolChain *S60Manager::createGCCEToolChain(const Qt4ProjectMana
return new GCCEToolChain(deviceForQtVersion(version));
}
ProjectExplorer::ToolChain *S60Manager::createRVCTToolChain(const Qt4ProjectManager::QtVersion *version,
ProjectExplorer::ToolChain::ToolChainType type) const
ProjectExplorer::ToolChain *S60Manager::createRVCTToolChain(
const Qt4ProjectManager::QtVersion *version,
ProjectExplorer::ToolChain::ToolChainType type) const
{
return new RVCTToolChain(deviceForQtVersion(version), type);
}
......@@ -215,15 +217,19 @@ S60Devices::Device S60Manager::deviceForQtVersion(const Qt4ProjectManager::QtVer
if (version->isAutodetected())
deviceId = deviceIdFromDetectionSource(version->autodetectionSource());
if (deviceId.isEmpty()) { // it's not an s60 autodetected version
// have a look if we find the device root anyhow
QString qtPath = version->versionInfo().value("QT_INSTALL_DATA");
if (QFile::exists(QString::fromLatin1("%1/epoc32").arg(qtPath))) {
device.epocRoot = qtPath;
device.toolsRoot = device.epocRoot;
device.qt = device.epocRoot;
device.isDefault = false;
device.name = QString::fromLatin1("SDK");
device.id = QString::fromLatin1("SDK");
// try to find a device entry belonging to the root given in Qt prefs
QString sdkRoot = version->s60SDKDirectory();
device = m_devices->deviceForEpocRoot(sdkRoot);
if (device.epocRoot.isEmpty()) { // no device found
// check if we can construct a dummy one
if (QFile::exists(QString::fromLatin1("%1/epoc32").arg(sdkRoot))) {
device.epocRoot = sdkRoot;
device.toolsRoot = device.epocRoot;
device.qt = QFileInfo(QFileInfo(version->qmakeCommand()).path()).path();
device.isDefault = false;
device.name = QString::fromLatin1("Manual");
device.id = QString::fromLatin1("Manual");
}
}
} else {
device = m_devices->deviceForId(deviceId);
......
......@@ -122,6 +122,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
m_ui->mingwPath->setPromptDialogTitle(tr("Select the MinGW Directory"));
m_ui->mwcPath->setExpectedKind(Utils::PathChooser::Directory);
m_ui->mwcPath->setPromptDialogTitle(tr("Select Carbide Install Directory"));
m_ui->s60SDKPath->setExpectedKind(Utils::PathChooser::Directory);
m_ui->s60SDKPath->setPromptDialogTitle(tr("Select S60 SDK Root"));
m_ui->addButton->setIcon(QIcon(Core::Constants::ICON_PLUS));
m_ui->delButton->setIcon(QIcon(Core::Constants::ICON_MINUS));
......@@ -167,6 +169,8 @@ QtOptionsPageWidget::QtOptionsPageWidget(QWidget *parent, QList<QtVersion *> ver
#ifdef QTCREATOR_WITH_S60
connect(m_ui->mwcPath, SIGNAL(changed(QString)),
this, SLOT(updateCurrentMwcDirectory()));
connect(m_ui->s60SDKPath, SIGNAL(changed(QString)),
this, SLOT(updateCurrentS60SDKDirectory()));
#endif
connect(m_ui->addButton, SIGNAL(clicked()),
......@@ -367,6 +371,8 @@ void QtOptionsPageWidget::updateState()
m_ui->nameEdit->setEnabled(enabled && !isAutodetected);
m_ui->qmakePath->setEnabled(enabled && !isAutodetected);
m_ui->mingwPath->setEnabled(enabled);
m_ui->mwcPath->setEnabled(enabled);
m_ui->s60SDKPath->setEnabled(enabled && !isAutodetected);
const bool hasLog = enabled && !m_ui->qtdirList->currentItem()->data(2, Qt::UserRole).toString().isEmpty();
m_ui->showLogButton->setEnabled(hasLog);
......@@ -388,10 +394,12 @@ void QtOptionsPageWidget::makeMSVCVisible(bool visible)
m_ui->msvcNotFoundLabel->setVisible(false);
}
void QtOptionsPageWidget::makeMWCVisible(bool visible)
void QtOptionsPageWidget::makeS60Visible(bool visible)
{
m_ui->mwcLabel->setVisible(visible);
m_ui->mwcPath->setVisible(visible);
m_ui->s60SDKLabel->setVisible(visible);
m_ui->s60SDKPath->setVisible(visible);
}
void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
......@@ -401,7 +409,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
if (index < 0) {
makeMSVCVisible(false);
makeMingwVisible(false);
makeMWCVisible(false);
makeS60Visible(false);
return;
}
m_ui->errorLabel->setText("");
......@@ -409,12 +417,12 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
if (types.contains(ProjectExplorer::ToolChain::MinGW)) {
makeMSVCVisible(false);
makeMingwVisible(true);
makeMWCVisible(false);
makeS60Visible(false);
m_ui->mingwPath->setPath(m_versions.at(index)->mingwDirectory());
} else if (types.contains(ProjectExplorer::ToolChain::MSVC) || types.contains(ProjectExplorer::ToolChain::WINCE)){
makeMSVCVisible(false);
makeMingwVisible(false);
makeMWCVisible(false);
makeS60Visible(false);
QStringList msvcEnvironments = ProjectExplorer::ToolChain::availableMSVCVersions();
if (msvcEnvironments.count() == 0) {
m_ui->msvcLabel->setVisible(true);
......@@ -432,16 +440,20 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
m_ui->msvcComboBox->blockSignals(block);
}
#ifdef QTCREATOR_WITH_S60
} else if (types.contains(ProjectExplorer::ToolChain::WINSCW)) {
} else if (types.contains(ProjectExplorer::ToolChain::WINSCW)
|| types.contains(ProjectExplorer::ToolChain::RVCT_ARMV5)
|| types.contains(ProjectExplorer::ToolChain::RVCT_ARMV6)
|| types.contains(ProjectExplorer::ToolChain::GCCE)) {
makeMSVCVisible(false);
makeMingwVisible(false);
makeMWCVisible(true);
makeS60Visible(true);
m_ui->mwcPath->setPath(m_versions.at(index)->mwcDirectory());
m_ui->s60SDKPath->setPath(m_versions.at(index)->s60SDKDirectory());
#endif
} else if (types.contains(ProjectExplorer::ToolChain::INVALID)) {
makeMSVCVisible(false);
makeMingwVisible(false);
makeMWCVisible(false);
makeS60Visible(false);
if (!m_versions.at(index)->isInstalled())
m_ui->errorLabel->setText(tr("The Qt Version identified by %1 is not installed. Run make install")
.arg(QDir::toNativeSeparators(m_versions.at(index)->qmakeCommand())));
......@@ -450,7 +462,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
} else { //ProjectExplorer::ToolChain::GCC
makeMSVCVisible(false);
makeMingwVisible(false);
makeMWCVisible(false);
makeS60Visible(false);
m_ui->errorLabel->setText(tr("Found Qt version %1, using mkspec %2")
.arg(m_versions.at(index)->qtVersionString(),
m_versions.at(index)->mkspec()));
......@@ -458,7 +470,7 @@ void QtOptionsPageWidget::showEnvironmentPage(QTreeWidgetItem *item)
} else {
makeMSVCVisible(false);
makeMingwVisible(false);
makeMWCVisible(false);
makeS60Visible(false);
}
}
......@@ -654,6 +666,15 @@ void QtOptionsPageWidget::updateCurrentMwcDirectory()
return;
m_versions[currentItemIndex]->setMwcDirectory(m_ui->mwcPath->path());
}
void QtOptionsPageWidget::updateCurrentS60SDKDirectory()
{
QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
Q_ASSERT(currentItem);
int currentItemIndex = indexForTreeItem(currentItem);
if (currentItemIndex < 0)
return;
m_versions[currentItemIndex]->setS60SDKDirectory(m_ui->s60SDKPath->path());
}
#endif
QList<QSharedPointerQtVersion> QtOptionsPageWidget::versions() const
......
......@@ -109,7 +109,7 @@ private slots:
void updateState();
void makeMingwVisible(bool visible);
void makeMSVCVisible(bool visible);
void makeMWCVisible(bool visible);
void makeS60Visible(bool visible);
void onQtBrowsed();
void onMingwBrowsed();
void defaultChanged(int index);
......@@ -118,6 +118,7 @@ private slots:
void updateCurrentMingwDirectory();
#ifdef QTCREATOR_WITH_S60
void updateCurrentMwcDirectory();
void updateCurrentS60SDKDirectory();
#endif
void msvcVersionChanged();
void buildDebuggingHelper();
......
......@@ -126,6 +126,7 @@ QtVersionManager::QtVersionManager()
version->setMsvcVersion(s->value("msvcVersion").toString());
#ifdef QTCREATOR_WITH_S60
version->setMwcDirectory(s->value("MwcDirectory").toString());
version->setS60SDKDirectory(s->value("S60SDKDirectory").toString());
#endif
m_versions.append(version);
}
......@@ -245,6 +246,7 @@ void QtVersionManager::writeVersionsIntoSettings()
s->setValue("autodetectionSource", version->autodetectionSource());
#ifdef QTCREATOR_WITH_S60
s->setValue("MwcDirectory", version->mwcDirectory());
s->setValue("S60SDKDirectory", version->s60SDKDirectory());
#endif
}
s->endArray();
......@@ -1170,6 +1172,15 @@ void QtVersion::setMwcDirectory(const QString &directory)
{
m_mwcDirectory = directory;
}
QString QtVersion::s60SDKDirectory() const
{
return m_s60SDKDirectory;
}
void QtVersion::setS60SDKDirectory(const QString &directory)
{
m_s60SDKDirectory = directory;
}
#endif
QString QtVersion::mingwDirectory() const
......
......@@ -86,6 +86,8 @@ public:
#ifdef QTCREATOR_WITH_S60
QString mwcDirectory() const;
void setMwcDirectory(const QString &directory);
QString s60SDKDirectory() const;
void setS60SDKDirectory(const QString &directory);
#endif
QString mingwDirectory() const;
void setMingwDirectory(const QString &directory);
......@@ -141,6 +143,7 @@ private:
bool m_hasDebuggingHelper;
#ifdef QTCREATOR_WITH_S60
QString m_mwcDirectory;
QString m_s60SDKDirectory;
#endif
mutable bool m_mkspecUpToDate;
......
......@@ -100,7 +100,7 @@ p, li { white-space: pre-wrap; }
</item>
</layout>
</item>
<item row="6" column="1">
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="debuggingHelperStateLabel">
......@@ -193,30 +193,40 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="debuggingHelperLabel">
<item row="5" column="0">
<widget class="QLabel" name="s60SDKLabel">
<property name="text">
<string>Debugging Helper:</string>
<string>S60 SDK:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QLabel" name="errorLabel">
<property name="text">
<string/>
</property>
</widget>
<item row="5" column="1">
<widget class="Utils::PathChooser" name="s60SDKPath" native="true"/>
</item>
<item row="5" column="0">
<item row="6" column="0">
<widget class="QLabel" name="mwcLabel">
<property name="text">
<string>Carbide Directory:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="6" column="1">
<widget class="Utils::PathChooser" name="mwcPath" native="true"/>
</item>
<item row="7" column="0">
<widget class="QLabel" name="debuggingHelperLabel">
<property name="text">
<string>Debugging Helper:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QLabel" name="errorLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment