Commit 4a521392 authored by Ulf Hermann's avatar Ulf Hermann

Add support for qscxmlc and state chart files to project managers

Change-Id: Ic0ac337ea90310239a2b1e681083f2201a76afe8
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent e1da5418
......@@ -56,6 +56,7 @@ enum FileType {
HeaderType,
SourceType,
FormType,
StateChartType,
ResourceType,
QMLType,
ProjectFileType,
......
......@@ -565,6 +565,8 @@ ProjectExplorer::FileType QbsGroupNode::fileType(const qbs::GroupData &group,
return ProjectExplorer::ResourceType;
if (artifact.fileTags().contains(QLatin1String("ui")))
return ProjectExplorer::FormType;
if (artifact.fileTags().contains(QLatin1String("scxml")))
return ProjectExplorer::StateChartType;
return ProjectExplorer::UnknownFileType;
}
......
......@@ -96,6 +96,8 @@ static const FileTypeDataStorage fileTypeDataStorage[] = {
":/qmakeprojectmanager/images/sources.png", "*.c; *.cc; *.cpp; *.cp; *.cxx; *.c++;" },
{ FormType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Forms"),
":/qtsupport/images/forms.png", "*.ui;" },
{ StateChartType, Theme::ProjectExplorerForm, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "StateCharts"),
":/qtsupport/images/statecharts.png", "*.scxml;" },
{ ResourceType, Theme::ProjectExplorerResource, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "Resources"),
":/qtsupport/images/qt_qrc.png", "*.qrc;" },
{ QMLType, Theme::ProjectExplorerQML, QT_TRANSLATE_NOOP("QmakeProjectManager::QmakePriFileNode", "QML"),
......@@ -1387,8 +1389,9 @@ QStringList QmakePriFileNode::varNames(FileType type, QtSupport::ProFileReader *
foreach (const QString &var, listOfExtraCompilers) {
QStringList inputs = readerExact->values(var + QLatin1String(".input"));
foreach (const QString &input, inputs)
// FORMS and RESOURCES are handled below
// FORMS, RESOURCES, and STATECHARTS are handled below, HEADERS above
if (input != QLatin1String("FORMS")
&& input != QLatin1String("STATECHARTS")
&& input != QLatin1String("RESOURCES")
&& input != QLatin1String("HEADERS"))
vars << input;
......@@ -1401,6 +1404,9 @@ QStringList QmakePriFileNode::varNames(FileType type, QtSupport::ProFileReader *
case FormType:
vars << QLatin1String("FORMS");
break;
case StateChartType:
vars << QLatin1String("STATECHARTS");
break;
case ProjectFileType:
vars << QLatin1String("SUBDIRS");
break;
......
......@@ -233,6 +233,7 @@ BaseQtVersion::BaseQtVersion(const BaseQtVersion &other) :
m_linguistCommand(other.m_linguistCommand),
m_qmlsceneCommand(other.m_qmlsceneCommand),
m_qmlviewerCommand(other.m_qmlviewerCommand),
m_qscxmlcCommand(other.m_qscxmlcCommand),
m_qtAbis(other.m_qtAbis)
{
setupExpander();
......@@ -264,6 +265,7 @@ void BaseQtVersion::ctor(const FileName &qmakePath)
m_linguistCommand.clear();
m_qmlviewerCommand.clear();
m_uicCommand.clear();
m_qscxmlcCommand.clear();
m_mkspecUpToDate = false;
m_mkspecReadUpToDate = false;
m_versionInfoUpToDate = false;
......@@ -856,6 +858,16 @@ QString BaseQtVersion::qmlviewerCommand() const
return m_qmlviewerCommand;
}
QString BaseQtVersion::qscxmlcCommand() const
{
if (!isValid())
return QString();
if (m_qscxmlcCommand.isNull())
m_qscxmlcCommand = findQtBinary(QScxmlc);
return m_qscxmlcCommand;
}
QString BaseQtVersion::findQtBinary(Binaries binary) const
{
QString baseDir;
......@@ -875,6 +887,7 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
baseDir = m_mkspecValues.value(QLatin1String("QT.designer.bins"));
break;
case Uic:
case QScxmlc:
baseDir = qmakeProperty("QT_HOST_BINS");
break;
default:
......@@ -919,6 +932,9 @@ QString BaseQtVersion::findQtBinary(Binaries binary) const
<< QLatin1String("uic");
}
break;
case QScxmlc:
possibleCommands << HostOsInfo::withExecutableSuffix(QLatin1String("qscxmlc"));
break;
default:
Q_ASSERT(false);
}
......
......@@ -134,6 +134,7 @@ public:
virtual QString linguistCommand() const;
QString qmlsceneCommand() const;
QString qmlviewerCommand() const;
QString qscxmlcCommand() const;
virtual QString qtVersionString() const;
virtual QtVersionNumber qtVersion() const;
......@@ -250,7 +251,7 @@ private:
void setupExpander();
void updateSourcePath() const;
void updateVersionInfo() const;
enum Binaries { QmlViewer, QmlScene, Designer, Linguist, Uic };
enum Binaries { QmlViewer, QmlScene, Designer, Linguist, Uic, QScxmlc };
QString findQtBinary(Binaries binary) const;
void updateMkspec() const;
void setId(int id); // used by the qtversionmanager for legacy restore
......@@ -294,6 +295,7 @@ private:
mutable QString m_linguistCommand;
mutable QString m_qmlsceneCommand;
mutable QString m_qmlviewerCommand;
mutable QString m_qscxmlcCommand;
mutable QList<ProjectExplorer::Abi> m_qtAbis;
......
......@@ -104,6 +104,7 @@ QtcPlugin {
"images/qml.png",
"images/qt_project.png",
"images/qt_qrc.png",
"images/statecharts.png",
]
Group {
......
<RCC>
<qresource prefix="/qtsupport">
<file>images/forms.png</file>
<file>images/statecharts.png</file>
<file>images/qml.png</file>
<file>images/qt_project.png</file>
<file>images/qt_qrc.png</file>
......
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