Commit cd9bd8d5 authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Changed the .qmlproject file format.

parent d3f43f5d
......@@ -6,11 +6,4 @@
<comment>Qml Project file</comment>
<glob pattern="*.qmlproject"/>
</mime-type>
<mime-type type="application/vnd.nokia.qt.qml.files">
<sub-class-of type="text/plain"/>
<comment>Qml Project Files</comment>
<glob pattern="*.files"/>
</mime-type>
</mime-info>
......@@ -114,10 +114,7 @@ QmlProject::QmlProject(Manager *manager, const QString &fileName)
m_fileName(fileName)
{
QFileInfo fileInfo(m_fileName);
QDir dir = fileInfo.dir();
m_projectName = fileInfo.completeBaseName();
m_filesFileName = QFileInfo(dir, m_projectName + QLatin1String(".files")).absoluteFilePath();
m_projectName = fileInfo.completeBaseName();
m_file = new QmlProjectFile(this, fileName);
m_rootNode = new QmlProjectNode(this, m_file);
......@@ -136,7 +133,7 @@ QmlProject::~QmlProject()
}
QString QmlProject::filesFileName() const
{ return m_filesFileName; }
{ return m_fileName; }
static QStringList readLines(const QString &absoluteFileName)
{
......
......@@ -34,7 +34,7 @@ namespace QmlProjectManager {
namespace Constants {
const char *const PROJECTCONTEXT = "QmlProject.ProjectContext";
const char *const QMLMIMETYPE = "text/x-qml-project"; // ### FIXME
const char *const QMLMIMETYPE = "text/x-qml-project"; // ### FIXME
const char *const MAKESTEP = "QmlProjectManager.MakeStep";
// contexts
......@@ -43,14 +43,8 @@ const char *const C_FILESEDITOR = ".files Editor";
// kinds
const char *const PROJECT_KIND = "Qml";
const char *const FILES_EDITOR = ".files Editor";
const char *const FILES_MIMETYPE = "application/vnd.nokia.qt.qml.files";
const char *const INCLUDES_EDITOR = ".includes Editor";
const char *const INCLUDES_MIMETYPE = "application/vnd.nokia.qt.qml.includes";
const char *const CONFIG_EDITOR = ".includes Editor";
const char *const CONFIG_MIMETYPE = "application/vnd.nokia.qt.qml.config";
const char *const FILES_EDITOR = ".qmlproject Editor";
const char *const FILES_MIMETYPE = QMLMIMETYPE;
} // namespace Constants
} // namespace QmlProjectManager
......
......@@ -52,8 +52,6 @@ ProjectFilesFactory::ProjectFilesFactory(Manager *manager,
m_actionHandler(handler)
{
m_mimeTypes.append(QLatin1String(Constants::FILES_MIMETYPE));
m_mimeTypes.append(QLatin1String(Constants::INCLUDES_MIMETYPE));
m_mimeTypes.append(QLatin1String(Constants::CONFIG_MIMETYPE));
}
ProjectFilesFactory::~ProjectFilesFactory()
......
......@@ -264,7 +264,7 @@ bool QmlProjectWizard::isValidDir(const QFileInfo &fileInfo) const
}
Core::GeneratedFiles QmlProjectWizard::generateFiles(const QWizard *w,
QString *errorMessage) const
QString *errorMessage) const
{
Q_UNUSED(errorMessage)
......@@ -273,7 +273,6 @@ Core::GeneratedFiles QmlProjectWizard::generateFiles(const QWizard *w,
const QDir dir(projectPath);
const QString projectName = wizard->projectName();
const QString creatorFileName = QFileInfo(dir, projectName + QLatin1String(".qmlproject")).absoluteFilePath();
const QString filesFileName = QFileInfo(dir, projectName + QLatin1String(".files")).absoluteFilePath();
Core::ICore *core = Core::ICore::instance();
Core::MimeDatabase *mimeDatabase = core->mimeDatabase();
......@@ -284,13 +283,9 @@ Core::GeneratedFiles QmlProjectWizard::generateFiles(const QWizard *w,
getFileList(dir, projectPath, suffixes, &sources, &paths);
Core::GeneratedFile generatedCreatorFile(creatorFileName);
generatedCreatorFile.setContents(QLatin1String("[General]\n"));
Core::GeneratedFile generatedFilesFile(filesFileName);
generatedFilesFile.setContents(sources.join(QLatin1String("\n")));
generatedCreatorFile.setContents(sources.join(QLatin1String("\n")));
Core::GeneratedFiles files;
files.append(generatedFilesFile);
files.append(generatedCreatorFile);
return files;
......
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