forked from qt-creator/qt-creator
Export Qt4PriFileNode
Change-Id: I4e6dd89a8ddd95aa21ebf5555c05349f541bd83e Reviewed-on: http://codereview.qt.nokia.com/4335 Reviewed-by: Christian Kandeler <christian.kandeler@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
This commit is contained in:
@@ -64,9 +64,9 @@ namespace Qt4ProjectManager {
|
|||||||
class Qt4Project;
|
class Qt4Project;
|
||||||
class Qt4BaseTarget;
|
class Qt4BaseTarget;
|
||||||
class Qt4ProFileNode;
|
class Qt4ProFileNode;
|
||||||
|
class Qt4PriFileNode;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class Qt4PriFileNode;
|
|
||||||
class Qt4RunConfigurationFactory;
|
class Qt4RunConfigurationFactory;
|
||||||
|
|
||||||
class Qt4RunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
class Qt4RunConfiguration : public ProjectExplorer::LocalApplicationRunConfiguration
|
||||||
|
@@ -88,22 +88,22 @@ struct FileTypeDataStorage {
|
|||||||
|
|
||||||
static const FileTypeDataStorage fileTypeDataStorage[] = {
|
static const FileTypeDataStorage fileTypeDataStorage[] = {
|
||||||
{ ProjectExplorer::HeaderType,
|
{ ProjectExplorer::HeaderType,
|
||||||
QT_TRANSLATE_NOOP("Qt4ProjectManager::Internal::Qt4PriFileNode", "Headers"),
|
QT_TRANSLATE_NOOP("Qt4ProjectManager::Qt4PriFileNode", "Headers"),
|
||||||
":/qt4projectmanager/images/headers.png" },
|
":/qt4projectmanager/images/headers.png" },
|
||||||
{ ProjectExplorer::SourceType,
|
{ ProjectExplorer::SourceType,
|
||||||
QT_TRANSLATE_NOOP("Qt4ProjectManager::Internal::Qt4PriFileNode", "Sources"),
|
QT_TRANSLATE_NOOP("Qt4ProjectManager::Qt4PriFileNode", "Sources"),
|
||||||
":/qt4projectmanager/images/sources.png" },
|
":/qt4projectmanager/images/sources.png" },
|
||||||
{ ProjectExplorer::FormType,
|
{ ProjectExplorer::FormType,
|
||||||
QT_TRANSLATE_NOOP("Qt4ProjectManager::Internal::Qt4PriFileNode", "Forms"),
|
QT_TRANSLATE_NOOP("Qt4ProjectManager::Qt4PriFileNode", "Forms"),
|
||||||
":/qt4projectmanager/images/forms.png" },
|
":/qt4projectmanager/images/forms.png" },
|
||||||
{ ProjectExplorer::ResourceType,
|
{ ProjectExplorer::ResourceType,
|
||||||
QT_TRANSLATE_NOOP("Qt4ProjectManager::Internal::Qt4PriFileNode", "Resources"),
|
QT_TRANSLATE_NOOP("Qt4ProjectManager::Qt4PriFileNode", "Resources"),
|
||||||
":/qt4projectmanager/images/qt_qrc.png" },
|
":/qt4projectmanager/images/qt_qrc.png" },
|
||||||
{ ProjectExplorer::QMLType,
|
{ ProjectExplorer::QMLType,
|
||||||
QT_TRANSLATE_NOOP("Qt4ProjectManager::Internal::Qt4PriFileNode", "QML"),
|
QT_TRANSLATE_NOOP("Qt4ProjectManager::Qt4PriFileNode", "QML"),
|
||||||
":/qt4projectmanager/images/qml.ico" }, // TODO icon
|
":/qt4projectmanager/images/qml.ico" }, // TODO icon
|
||||||
{ ProjectExplorer::UnknownFileType,
|
{ ProjectExplorer::UnknownFileType,
|
||||||
QT_TRANSLATE_NOOP("Qt4ProjectManager::Internal::Qt4PriFileNode", "Other files"),
|
QT_TRANSLATE_NOOP("Qt4ProjectManager::Qt4PriFileNode", "Other files"),
|
||||||
":/qt4projectmanager/images/unknown.png" }
|
":/qt4projectmanager/images/unknown.png" }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ Q_GLOBAL_STATIC_WITH_INITIALIZER(Qt4NodeStaticData, qt4NodeStaticData, {
|
|||||||
overlayIcon, desiredSize);
|
overlayIcon, desiredSize);
|
||||||
QIcon folderIcon;
|
QIcon folderIcon;
|
||||||
folderIcon.addPixmap(folderPixmap);
|
folderIcon.addPixmap(folderPixmap);
|
||||||
const QString desc = Qt4ProjectManager::Internal::Qt4PriFileNode::tr(fileTypeDataStorage[i].typeName);
|
const QString desc = Qt4ProjectManager::Qt4PriFileNode::tr(fileTypeDataStorage[i].typeName);
|
||||||
x->fileTypeData.push_back(Qt4NodeStaticData::FileTypeData(fileTypeDataStorage[i].type,
|
x->fileTypeData.push_back(Qt4NodeStaticData::FileTypeData(fileTypeDataStorage[i].type,
|
||||||
desc, folderIcon));
|
desc, folderIcon));
|
||||||
}
|
}
|
||||||
@@ -162,8 +162,8 @@ static void clearQt4NodeStaticData()
|
|||||||
|
|
||||||
enum { debug = 0 };
|
enum { debug = 0 };
|
||||||
|
|
||||||
namespace Qt4ProjectManager {
|
using namespace Qt4ProjectManager;
|
||||||
namespace Internal {
|
using namespace Qt4ProjectManager::Internal;
|
||||||
|
|
||||||
Qt4PriFile::Qt4PriFile(Qt4PriFileNode *qt4PriFile)
|
Qt4PriFile::Qt4PriFile(Qt4PriFileNode *qt4PriFile)
|
||||||
: IFile(qt4PriFile), m_priFile(qt4PriFile)
|
: IFile(qt4PriFile), m_priFile(qt4PriFile)
|
||||||
@@ -266,6 +266,8 @@ void Qt4PriFileNode::scheduleUpdate()
|
|||||||
m_qt4ProFileNode->scheduleUpdate();
|
m_qt4ProFileNode->scheduleUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Qt4ProjectManager {
|
||||||
|
namespace Internal {
|
||||||
struct InternalNode
|
struct InternalNode
|
||||||
{
|
{
|
||||||
QMap<QString, InternalNode*> subnodes;
|
QMap<QString, InternalNode*> subnodes;
|
||||||
@@ -482,7 +484,8 @@ struct InternalNode
|
|||||||
projectNode->addFileNodes(filesToAdd, folder);
|
projectNode->addFileNodes(filesToAdd, folder);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QStringList Qt4PriFileNode::baseVPaths(QtSupport::ProFileReader *reader, const QString &projectDir)
|
QStringList Qt4PriFileNode::baseVPaths(QtSupport::ProFileReader *reader, const QString &projectDir)
|
||||||
{
|
{
|
||||||
@@ -1331,9 +1334,6 @@ Qt4NodesWatcher::Qt4NodesWatcher(QObject *parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
|
|
||||||
|
|
||||||
const Qt4ProFileNode *Qt4ProFileNode::findProFileFor(const QString &fileName) const
|
const Qt4ProFileNode *Qt4ProFileNode::findProFileFor(const QString &fileName) const
|
||||||
{
|
{
|
||||||
if (fileName == path())
|
if (fileName == path())
|
||||||
@@ -1609,7 +1609,7 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
|
|||||||
if (debug)
|
if (debug)
|
||||||
qDebug() << "Qt4ProFileNode - updating files for file " << m_projectFilePath;
|
qDebug() << "Qt4ProFileNode - updating files for file " << m_projectFilePath;
|
||||||
|
|
||||||
Qt4ProjectType projectType = Internal::proFileTemplateTypeToProjectType(
|
Qt4ProjectType projectType = proFileTemplateTypeToProjectType(
|
||||||
(evalResult == EvalOk ? m_readerExact : m_readerCumulative)->templateType());
|
(evalResult == EvalOk ? m_readerExact : m_readerCumulative)->templateType());
|
||||||
if (projectType != m_projectType) {
|
if (projectType != m_projectType) {
|
||||||
Qt4ProjectType oldType = m_projectType;
|
Qt4ProjectType oldType = m_projectType;
|
||||||
@@ -1885,7 +1885,7 @@ QStringList Qt4ProFileNode::updateUiFiles()
|
|||||||
return QStringList();
|
return QStringList();
|
||||||
|
|
||||||
// Find all ui files
|
// Find all ui files
|
||||||
Internal::FindUiFileNodesVisitor uiFilesVisitor;
|
FindUiFileNodesVisitor uiFilesVisitor;
|
||||||
this->accept(&uiFilesVisitor);
|
this->accept(&uiFilesVisitor);
|
||||||
const QList<ProjectExplorer::FileNode*> uiFiles = uiFilesVisitor.uiFileNodes;
|
const QList<ProjectExplorer::FileNode*> uiFiles = uiFilesVisitor.uiFileNodes;
|
||||||
|
|
||||||
@@ -2329,7 +2329,7 @@ void Qt4ProFileNode::createUiCodeModelSupport()
|
|||||||
// Only those two project types can have ui files for us
|
// Only those two project types can have ui files for us
|
||||||
if (m_projectType == ApplicationTemplate || m_projectType == LibraryTemplate) {
|
if (m_projectType == ApplicationTemplate || m_projectType == LibraryTemplate) {
|
||||||
// Find all ui files
|
// Find all ui files
|
||||||
Internal::FindUiFileNodesVisitor uiFilesVisitor;
|
FindUiFileNodesVisitor uiFilesVisitor;
|
||||||
this->accept(&uiFilesVisitor);
|
this->accept(&uiFilesVisitor);
|
||||||
const QList<ProjectExplorer::FileNode*> uiFiles = uiFilesVisitor.uiFileNodes;
|
const QList<ProjectExplorer::FileNode*> uiFiles = uiFilesVisitor.uiFileNodes;
|
||||||
|
|
||||||
@@ -2361,5 +2361,3 @@ void Qt4ProFileNode::createUiCodeModelSupport()
|
|||||||
delete it.value();
|
delete it.value();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Qt4ProjectManager
|
|
||||||
|
@@ -92,8 +92,6 @@ enum Qt4Variable {
|
|||||||
SymbianCapabilities
|
SymbianCapabilities
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Internal {
|
|
||||||
|
|
||||||
// Import base classes into namespace
|
// Import base classes into namespace
|
||||||
using ProjectExplorer::Node;
|
using ProjectExplorer::Node;
|
||||||
using ProjectExplorer::FileNode;
|
using ProjectExplorer::FileNode;
|
||||||
@@ -112,12 +110,15 @@ using ProjectExplorer::ProjectFileType;
|
|||||||
|
|
||||||
using ProjectExplorer::FileType;
|
using ProjectExplorer::FileType;
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
class Qt4UiCodeModelSupport;
|
class Qt4UiCodeModelSupport;
|
||||||
class ProFileReader;
|
class ProFileReader;
|
||||||
class Qt4PriFile;
|
class Qt4PriFile;
|
||||||
|
struct InternalNode;
|
||||||
|
}
|
||||||
|
|
||||||
// Implements ProjectNode for qt4 pro files
|
// Implements ProjectNode for qt4 pro files
|
||||||
class Qt4PriFileNode : public ProjectExplorer::ProjectNode
|
class QT4PROJECTMANAGER_EXPORT Qt4PriFileNode : public ProjectExplorer::ProjectNode
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -195,7 +196,7 @@ private:
|
|||||||
QString m_projectFilePath;
|
QString m_projectFilePath;
|
||||||
QString m_projectDir;
|
QString m_projectDir;
|
||||||
|
|
||||||
QMap<QString, Qt4UiCodeModelSupport *> m_uiCodeModelSupport;
|
QMap<QString, Internal::Qt4UiCodeModelSupport *> m_uiCodeModelSupport;
|
||||||
Internal::Qt4PriFile *m_qt4PriFile;
|
Internal::Qt4PriFile *m_qt4PriFile;
|
||||||
|
|
||||||
// Memory is cheap...
|
// Memory is cheap...
|
||||||
@@ -207,11 +208,12 @@ private:
|
|||||||
|
|
||||||
// managed by Qt4ProFileNode
|
// managed by Qt4ProFileNode
|
||||||
friend class Qt4ProjectManager::Qt4ProFileNode;
|
friend class Qt4ProjectManager::Qt4ProFileNode;
|
||||||
friend class Qt4PriFile; // for scheduling updates on modified
|
friend class Internal::Qt4PriFile; // for scheduling updates on modified
|
||||||
// internal temporary subtree representation
|
// internal temporary subtree representation
|
||||||
friend struct InternalNode;
|
friend struct Internal::InternalNode;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace Internal {
|
||||||
class Qt4PriFile : public Core::IFile
|
class Qt4PriFile : public Core::IFile
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@@ -316,7 +318,7 @@ struct QT4PROJECTMANAGER_EXPORT ProjectVersion {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Implements ProjectNode for qt4 pro files
|
// Implements ProjectNode for qt4 pro files
|
||||||
class QT4PROJECTMANAGER_EXPORT Qt4ProFileNode : public Internal::Qt4PriFileNode
|
class QT4PROJECTMANAGER_EXPORT Qt4ProFileNode : public Qt4PriFileNode
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@@ -54,18 +54,17 @@ class ProFileReader;
|
|||||||
|
|
||||||
namespace Qt4ProjectManager {
|
namespace Qt4ProjectManager {
|
||||||
class Qt4ProFileNode;
|
class Qt4ProFileNode;
|
||||||
|
class Qt4PriFileNode;
|
||||||
class Qt4BaseTarget;
|
class Qt4BaseTarget;
|
||||||
class Qt4BuildConfiguration;
|
class Qt4BuildConfiguration;
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
class DeployHelperRunStep;
|
class DeployHelperRunStep;
|
||||||
class FileItem;
|
class FileItem;
|
||||||
class Qt4PriFileNode;
|
|
||||||
class GCCPreprocessor;
|
class GCCPreprocessor;
|
||||||
struct Qt4ProjectFiles;
|
struct Qt4ProjectFiles;
|
||||||
class Qt4ProjectConfigWidget;
|
class Qt4ProjectConfigWidget;
|
||||||
class Qt4ProjectFile;
|
class Qt4ProjectFile;
|
||||||
class Qt4PriFileNode;
|
|
||||||
class Qt4NodesWatcher;
|
class Qt4NodesWatcher;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,8 +132,8 @@ public:
|
|||||||
// For Qt4ProFileNode after a on disk change
|
// For Qt4ProFileNode after a on disk change
|
||||||
void updateFileList();
|
void updateFileList();
|
||||||
|
|
||||||
void watchFolders(const QStringList &l, Internal::Qt4PriFileNode *node);
|
void watchFolders(const QStringList &l, Qt4PriFileNode *node);
|
||||||
void unwatchFolders(const QStringList &l, Internal::Qt4PriFileNode *node);
|
void unwatchFolders(const QStringList &l, Qt4PriFileNode *node);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool, bool);
|
void proFileUpdated(Qt4ProjectManager::Qt4ProFileNode *node, bool, bool);
|
||||||
@@ -167,7 +166,7 @@ private:
|
|||||||
static void collectAllfProFiles(QList<Qt4ProFileNode *> &list, Qt4ProFileNode *node);
|
static void collectAllfProFiles(QList<Qt4ProFileNode *> &list, Qt4ProFileNode *node);
|
||||||
static void collectApplicationProFiles(QList<Qt4ProFileNode *> &list, Qt4ProFileNode *node);
|
static void collectApplicationProFiles(QList<Qt4ProFileNode *> &list, Qt4ProFileNode *node);
|
||||||
static void findProFile(const QString& fileName, Qt4ProFileNode *root, QList<Qt4ProFileNode *> &list);
|
static void findProFile(const QString& fileName, Qt4ProFileNode *root, QList<Qt4ProFileNode *> &list);
|
||||||
static bool hasSubNode(Internal::Qt4PriFileNode *root, const QString &path);
|
static bool hasSubNode(Qt4PriFileNode *root, const QString &path);
|
||||||
|
|
||||||
static bool equalFileList(const QStringList &a, const QStringList &b);
|
static bool equalFileList(const QStringList &a, const QStringList &b);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user