2012-10-02 09:12:39 +02:00
|
|
|
/****************************************************************************
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2013-01-28 17:12:19 +01:00
|
|
|
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
|
2012-10-02 09:12:39 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** This file is part of Qt Creator.
|
2008-12-02 12:01:29 +01:00
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
|
** a written agreement between you and Digia. For licensing terms and
|
|
|
|
|
** conditions see http://qt.digia.com/licensing. For further information
|
|
|
|
|
** use the contact form at http://qt.digia.com/contact-us.
|
2008-12-02 14:17:16 +01:00
|
|
|
**
|
2009-02-25 09:15:00 +01:00
|
|
|
** GNU Lesser General Public License Usage
|
2012-10-02 09:12:39 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
|
|
|
** General Public License version 2.1 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
|
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
|
|
|
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Digia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Digia Qt LGPL Exception
|
2010-12-17 16:01:08 +01:00
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
2012-10-02 09:12:39 +02:00
|
|
|
****************************************************************************/
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakeprojectmanager.h"
|
2008-12-02 16:19:05 +01:00
|
|
|
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakeprojectmanagerconstants.h"
|
|
|
|
|
#include "qmakeprojectmanagerplugin.h"
|
|
|
|
|
#include "qmakenodes.h"
|
|
|
|
|
#include "qmakeproject.h"
|
2011-04-13 13:54:15 +02:00
|
|
|
#include "profileeditor.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
#include "qmakestep.h"
|
2013-10-16 12:10:22 +02:00
|
|
|
#include "qmakebuildconfiguration.h"
|
2011-04-13 13:54:15 +02:00
|
|
|
#include "addlibrarywizard.h"
|
2011-02-06 16:23:02 +01:00
|
|
|
#include "wizards/qtquickapp.h"
|
2011-02-06 19:32:39 +01:00
|
|
|
#include "wizards/html5app.h"
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2010-03-17 17:45:33 +01:00
|
|
|
#include <projectexplorer/projectexplorer.h>
|
2009-01-14 15:08:46 +01:00
|
|
|
#include <projectexplorer/buildmanager.h>
|
2009-09-25 11:35:44 +02:00
|
|
|
#include <projectexplorer/session.h>
|
2012-04-24 15:49:09 +02:00
|
|
|
#include <projectexplorer/target.h>
|
2009-12-08 12:48:43 +01:00
|
|
|
#include <utils/qtcassert.h>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2012-02-15 10:42:41 +01:00
|
|
|
#include <QDir>
|
|
|
|
|
#include <QFileInfo>
|
|
|
|
|
#include <QVariant>
|
|
|
|
|
#include <QMessageBox>
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-09-05 11:46:07 +02:00
|
|
|
using namespace ProjectExplorer;
|
2013-10-16 11:02:37 +02:00
|
|
|
using namespace QmakeProjectManager;
|
|
|
|
|
using namespace QmakeProjectManager::Internal;
|
2008-12-02 12:01:29 +01:00
|
|
|
|
|
|
|
|
// Known file types of a Qt 4 project
|
2013-10-29 17:37:39 +01:00
|
|
|
static const char *qmakeFileTypes[] = {
|
2009-01-16 16:30:22 +01:00
|
|
|
"CppHeaderFiles",
|
|
|
|
|
"CppSourceFiles",
|
|
|
|
|
"Qt4FormFiles",
|
|
|
|
|
"Qt4ResourceFiles"
|
|
|
|
|
};
|
2008-12-02 12:01:29 +01:00
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
QmakeManager::QmakeManager(QmakeProjectManagerPlugin *plugin)
|
2009-12-08 12:48:43 +01:00
|
|
|
: m_plugin(plugin),
|
2012-04-30 22:35:30 +03:00
|
|
|
m_contextNode(0),
|
2008-12-02 12:01:29 +01:00
|
|
|
m_contextProject(0),
|
2013-07-11 16:24:51 +02:00
|
|
|
m_contextFile(0)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
QmakeManager::~QmakeManager()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::registerProject(QmakeProject *project)
|
2008-12-02 18:14:06 +01:00
|
|
|
{
|
|
|
|
|
m_projects.append(project);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::unregisterProject(QmakeProject *project)
|
2008-12-02 18:14:06 +01:00
|
|
|
{
|
|
|
|
|
m_projects.removeOne(project);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::notifyChanged(const QString &name)
|
2008-12-02 18:14:06 +01:00
|
|
|
{
|
2013-10-29 14:22:31 +01:00
|
|
|
foreach (QmakeProject *pro, m_projects)
|
2008-12-02 18:14:06 +01:00
|
|
|
pro->notifyChanged(name);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
QString QmakeManager::mimeType() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2013-10-16 11:02:37 +02:00
|
|
|
return QLatin1String(QmakeProjectManager::Constants::PROFILE_MIMETYPE);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
ProjectExplorer::Project *QmakeManager::openProject(const QString &fileName, QString *errorString)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2013-05-27 11:17:47 +02:00
|
|
|
if (!QFileInfo(fileName).isFile()) {
|
2011-09-05 13:47:29 +02:00
|
|
|
if (errorString)
|
2013-05-27 11:17:47 +02:00
|
|
|
*errorString = tr("Failed opening project '%1': Project is not a file")
|
|
|
|
|
.arg(fileName);
|
2008-12-02 12:01:29 +01:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 14:22:31 +01:00
|
|
|
return new QmakeProject(this, fileName);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
ProjectExplorer::Node *QmakeManager::contextNode() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
return m_contextNode;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::setContextNode(ProjectExplorer::Node *node)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
m_contextNode = node;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
ProjectExplorer::Project *QmakeManager::contextProject() const
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-04-30 22:35:30 +03:00
|
|
|
return m_contextProject;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::setContextProject(ProjectExplorer::Project *project)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2012-04-30 22:35:30 +03:00
|
|
|
m_contextProject = project;
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
ProjectExplorer::FileNode *QmakeManager::contextFile() const
|
2012-05-04 16:25:41 +03:00
|
|
|
{
|
|
|
|
|
return m_contextFile;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::setContextFile(ProjectExplorer::FileNode *file)
|
2012-05-04 16:25:41 +03:00
|
|
|
{
|
|
|
|
|
m_contextFile = file;
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::addLibrary()
|
2011-04-13 13:54:15 +02:00
|
|
|
{
|
2012-05-08 09:43:14 +02:00
|
|
|
ProFileEditorWidget *editor =
|
|
|
|
|
qobject_cast<ProFileEditorWidget*>(Core::EditorManager::currentEditor()->widget());
|
2011-04-13 13:54:15 +02:00
|
|
|
if (editor)
|
2013-07-04 13:30:26 +02:00
|
|
|
addLibrary(editor->editorDocument()->filePath(), editor);
|
2011-04-13 13:54:15 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::addLibraryContextMenu()
|
2011-04-13 13:54:15 +02:00
|
|
|
{
|
|
|
|
|
ProjectExplorer::Node *node = ProjectExplorer::ProjectExplorerPlugin::instance()->currentNode();
|
2013-10-29 14:22:31 +01:00
|
|
|
if (qobject_cast<QmakeProFileNode *>(node))
|
2011-04-13 13:54:15 +02:00
|
|
|
addLibrary(node->path());
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::addLibrary(const QString &fileName, ProFileEditorWidget *editor)
|
2011-04-13 13:54:15 +02:00
|
|
|
{
|
|
|
|
|
AddLibraryWizard wizard(fileName, Core::EditorManager::instance());
|
|
|
|
|
if (wizard.exec() != QDialog::Accepted)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
TextEditor::BaseTextEditor *editable = 0;
|
|
|
|
|
if (editor) {
|
|
|
|
|
editable = editor->editor();
|
|
|
|
|
} else {
|
|
|
|
|
editable = qobject_cast<TextEditor::BaseTextEditor *>
|
2013-10-16 11:02:37 +02:00
|
|
|
(Core::EditorManager::openEditor(fileName, QmakeProjectManager::Constants::PROFILE_EDITOR_ID,
|
2013-05-31 12:52:53 +02:00
|
|
|
Core::EditorManager::DoNotMakeVisible));
|
2011-04-13 13:54:15 +02:00
|
|
|
}
|
|
|
|
|
if (!editable)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
const int endOfDoc = editable->position(TextEditor::ITextEditor::EndOfDoc);
|
|
|
|
|
editable->setCursorPosition(endOfDoc);
|
|
|
|
|
QString snippet = wizard.snippet();
|
|
|
|
|
|
|
|
|
|
// add extra \n in case the last line is not empty
|
|
|
|
|
int line, column;
|
|
|
|
|
editable->convertPosition(endOfDoc, &line, &column);
|
2013-04-18 18:21:17 +02:00
|
|
|
if (!editable->textDocument()->textAt(endOfDoc - column, column).simplified().isEmpty())
|
2011-04-13 13:54:15 +02:00
|
|
|
snippet = QLatin1Char('\n') + snippet;
|
|
|
|
|
|
|
|
|
|
editable->insert(snippet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::runQMake()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2013-09-05 11:46:07 +02:00
|
|
|
runQMake(SessionManager::startupProject(), 0);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::runQMakeContextMenu()
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-01-13 18:00:02 +01:00
|
|
|
runQMake(m_contextProject, m_contextNode);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::runQMake(ProjectExplorer::Project *p, ProjectExplorer::Node *node)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
2010-07-09 16:07:45 +02:00
|
|
|
if (!ProjectExplorer::ProjectExplorerPlugin::instance()->saveModifiedFiles())
|
|
|
|
|
return;
|
2013-10-29 17:37:39 +01:00
|
|
|
QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(p);
|
|
|
|
|
QTC_ASSERT(qmakeProject, return);
|
2010-01-13 18:00:02 +01:00
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
if (!qmakeProject->activeTarget() ||
|
|
|
|
|
!qmakeProject->activeTarget()->activeBuildConfiguration())
|
2012-01-17 16:52:32 +01:00
|
|
|
return;
|
2010-02-08 15:50:06 +01:00
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
QmakeBuildConfiguration *bc = static_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration());
|
2012-04-24 15:49:09 +02:00
|
|
|
QMakeStep *qs = bc->qmakeStep();
|
2009-07-21 15:01:16 +02:00
|
|
|
if (!qs)
|
|
|
|
|
return;
|
2012-04-24 15:49:09 +02:00
|
|
|
|
2008-12-02 12:01:29 +01:00
|
|
|
//found qmakeStep, now use it
|
2009-07-21 15:01:16 +02:00
|
|
|
qs->setForced(true);
|
2010-01-13 18:00:02 +01:00
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
if (node != 0 && node != qmakeProject->rootProjectNode())
|
2013-10-29 14:22:31 +01:00
|
|
|
if (QmakeProFileNode *profile = qobject_cast<QmakeProFileNode *>(node))
|
2010-01-13 18:00:02 +01:00
|
|
|
bc->setSubNodeBuild(profile);
|
|
|
|
|
|
2013-09-05 14:36:20 +02:00
|
|
|
BuildManager::appendStep(qs, tr("QMake"));
|
2010-01-13 18:00:02 +01:00
|
|
|
bc->setSubNodeBuild(0);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::buildSubDirContextMenu()
|
2010-04-30 11:50:04 +02:00
|
|
|
{
|
2012-05-14 15:41:55 +04:00
|
|
|
handleSubDirContextMenu(BUILD, false);
|
2010-04-30 11:50:04 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::cleanSubDirContextMenu()
|
2010-04-30 11:50:04 +02:00
|
|
|
{
|
2012-05-14 15:41:55 +04:00
|
|
|
handleSubDirContextMenu(CLEAN, false);
|
2010-04-30 11:50:04 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::rebuildSubDirContextMenu()
|
2010-04-30 11:50:04 +02:00
|
|
|
{
|
2012-05-14 15:41:55 +04:00
|
|
|
handleSubDirContextMenu(REBUILD, false);
|
2010-04-30 11:50:04 +02:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::buildFileContextMenu()
|
2012-05-14 15:41:55 +04:00
|
|
|
{
|
|
|
|
|
handleSubDirContextMenu(BUILD, true);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::buildFile()
|
2013-04-30 15:12:48 +02:00
|
|
|
{
|
2013-07-09 11:52:44 +02:00
|
|
|
if (Core::IDocument *currentDocument= Core::EditorManager::currentDocument()) {
|
2013-10-28 19:42:56 +02:00
|
|
|
const QString file = currentDocument->filePath();
|
2013-09-05 11:46:07 +02:00
|
|
|
FileNode *node = qobject_cast<FileNode *>(SessionManager::nodeForFile(file));
|
|
|
|
|
Project *project = SessionManager::projectForFile(file);
|
2013-04-30 15:12:48 +02:00
|
|
|
|
|
|
|
|
if (project && node)
|
|
|
|
|
handleSubDirContextMenu(BUILD, true, project, node->projectNode(), node);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isFileBuild)
|
2010-01-13 18:00:02 +01:00
|
|
|
{
|
2013-04-30 15:12:48 +02:00
|
|
|
handleSubDirContextMenu(action, isFileBuild, m_contextProject, m_contextNode, m_contextFile);
|
|
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
void QmakeManager::handleSubDirContextMenu(QmakeManager::Action action, bool isFileBuild,
|
2013-04-30 15:12:48 +02:00
|
|
|
ProjectExplorer::Project *contextProject,
|
|
|
|
|
ProjectExplorer::Node *contextNode,
|
|
|
|
|
ProjectExplorer::FileNode *contextFile)
|
|
|
|
|
{
|
2013-10-29 17:37:39 +01:00
|
|
|
QmakeProject *qmakeProject = qobject_cast<QmakeProject *>(contextProject);
|
|
|
|
|
QTC_ASSERT(qmakeProject, return);
|
2010-01-13 18:00:02 +01:00
|
|
|
|
2013-10-29 17:37:39 +01:00
|
|
|
if (!qmakeProject->activeTarget() ||
|
|
|
|
|
!qmakeProject->activeTarget()->activeBuildConfiguration())
|
2010-02-08 15:50:06 +01:00
|
|
|
return;
|
|
|
|
|
|
2013-04-30 15:12:48 +02:00
|
|
|
if (!contextNode || !contextFile)
|
2012-05-14 22:58:34 +03:00
|
|
|
isFileBuild = false;
|
2013-10-29 17:37:39 +01:00
|
|
|
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(qmakeProject->activeTarget()->activeBuildConfiguration());
|
2012-04-24 15:49:09 +02:00
|
|
|
if (!bc)
|
|
|
|
|
return;
|
|
|
|
|
|
2013-10-28 19:42:56 +02:00
|
|
|
if (contextNode) {
|
2013-10-29 14:22:31 +01:00
|
|
|
if (QmakePriFileNode *prifile = qobject_cast<QmakePriFileNode *>(contextNode)) {
|
|
|
|
|
if (QmakeProFileNode *profile = prifile->proFileNode()) {
|
2013-10-29 17:37:39 +01:00
|
|
|
if (profile != qmakeProject->rootProjectNode() || isFileBuild)
|
2013-10-28 19:42:56 +02:00
|
|
|
bc->setSubNodeBuild(profile);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-01-13 18:00:02 +01:00
|
|
|
|
2012-05-14 22:58:34 +03:00
|
|
|
if (isFileBuild)
|
2013-04-30 15:12:48 +02:00
|
|
|
bc->setFileNodeBuild(contextFile);
|
2013-09-05 14:36:20 +02:00
|
|
|
if (ProjectExplorerPlugin::instance()->saveModifiedFiles()) {
|
|
|
|
|
const Core::Id buildStep = ProjectExplorer::Constants::BUILDSTEPS_BUILD;
|
|
|
|
|
const Core::Id cleanStep = ProjectExplorer::Constants::BUILDSTEPS_CLEAN;
|
2010-07-16 14:00:41 +02:00
|
|
|
if (action == BUILD) {
|
2013-09-05 14:36:20 +02:00
|
|
|
const QString name = ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
|
|
|
|
BuildManager::buildList(bc->stepList(buildStep), name);
|
2010-07-16 14:00:41 +02:00
|
|
|
} else if (action == CLEAN) {
|
2013-09-05 14:36:20 +02:00
|
|
|
const QString name = ProjectExplorerPlugin::displayNameForStepId(cleanStep);
|
|
|
|
|
BuildManager::buildList(bc->stepList(cleanStep), name);
|
2010-07-16 14:00:41 +02:00
|
|
|
} else if (action == REBUILD) {
|
2011-11-07 16:16:31 +01:00
|
|
|
QStringList names;
|
2013-09-05 14:36:20 +02:00
|
|
|
names << ProjectExplorerPlugin::displayNameForStepId(cleanStep)
|
|
|
|
|
<< ProjectExplorerPlugin::displayNameForStepId(buildStep);
|
2011-11-07 16:16:31 +01:00
|
|
|
|
2010-07-16 14:00:41 +02:00
|
|
|
QList<ProjectExplorer::BuildStepList *> stepLists;
|
2012-01-13 14:20:45 +01:00
|
|
|
stepLists << bc->stepList(cleanStep) << bc->stepList(buildStep);
|
2013-09-05 14:36:20 +02:00
|
|
|
BuildManager::buildLists(stepLists, names);
|
2010-04-30 11:50:04 +02:00
|
|
|
}
|
|
|
|
|
}
|
2010-01-13 18:00:02 +01:00
|
|
|
|
|
|
|
|
bc->setSubNodeBuild(0);
|
2012-05-04 16:25:41 +03:00
|
|
|
bc->setFileNodeBuild(0);
|
2008-12-02 12:01:29 +01:00
|
|
|
}
|
|
|
|
|
|
2013-10-29 15:15:10 +01:00
|
|
|
QString QmakeManager::fileTypeId(ProjectExplorer::FileType type)
|
2008-12-02 12:01:29 +01:00
|
|
|
{
|
|
|
|
|
switch (type) {
|
|
|
|
|
case HeaderType:
|
2013-10-29 17:37:39 +01:00
|
|
|
return QLatin1String(qmakeFileTypes[0]);
|
2008-12-02 12:01:29 +01:00
|
|
|
case SourceType:
|
2013-10-29 17:37:39 +01:00
|
|
|
return QLatin1String(qmakeFileTypes[1]);
|
2008-12-02 12:01:29 +01:00
|
|
|
case FormType:
|
2013-10-29 17:37:39 +01:00
|
|
|
return QLatin1String(qmakeFileTypes[2]);
|
2008-12-02 12:01:29 +01:00
|
|
|
case ResourceType:
|
2013-10-29 17:37:39 +01:00
|
|
|
return QLatin1String(qmakeFileTypes[3]);
|
2008-12-02 12:01:29 +01:00
|
|
|
case UnknownFileType:
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return QString();
|
|
|
|
|
}
|
2010-12-08 12:03:33 +01:00
|
|
|
|