Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

This commit is contained in:
hjk
2009-01-28 18:35:46 +01:00
8 changed files with 43 additions and 9 deletions

View File

@@ -845,7 +845,7 @@ void Qt4ProFileNode::updateUiFiles()
}
addFileNodes(toAdd, this);
}
modelManager->updateSourceFiles(toUpdate);
m_project->addUiFilesToCodeModel(toUpdate);
}
ProFileReader *Qt4PriFileNode::createProFileReader() const

View File

@@ -255,6 +255,10 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
m_updateCodeModelTimer.setSingleShot(true);
m_updateCodeModelTimer.setInterval(20);
connect(&m_updateCodeModelTimer, SIGNAL(timeout()), this, SLOT(updateCodeModel()));
m_addUiFilesTimer.setSingleShot(true);
m_addUiFilesTimer.setInterval(20);
connect(&m_addUiFilesTimer, SIGNAL(timeout()), this, SLOT(addUiFiles()));
}
Qt4Project::~Qt4Project()
@@ -370,6 +374,27 @@ namespace {
};
}
void Qt4Project::addUiFilesToCodeModel(const QStringList &files)
{
// if we already have a full updateCodeModel() scheduled
// then we don't need to this seperately
// since that one will add also all the ui files
if (m_updateCodeModelTimer.isActive())
return;
m_addUiFilesTimer.start();
m_uiFilesToAdd << files;
}
void Qt4Project::addUiFiles()
{
if (m_updateCodeModelTimer.isActive())
return;
CppTools::CppModelManagerInterface *modelManager =
ExtensionSystem::PluginManager::instance()->getObject<CppTools::CppModelManagerInterface>();
modelManager->updateSourceFiles(m_uiFilesToAdd);
m_uiFilesToAdd.clear();
}
void Qt4Project::scheduleUpdateCodeModel()
{
m_updateCodeModelTimer.start();

View File

@@ -182,6 +182,9 @@ public:
void notifyChanged(const QString &name);
// called by qt4ProjectNode to add ui_*.h files to the codemodel
void addUiFilesToCodeModel(const QStringList &files);
public slots:
void update();
void proFileParseError(const QString &errorMessage);
@@ -200,6 +203,7 @@ private slots:
const Qt4ProjectManager::Internal::Qt4ProjectType oldType,
const Qt4ProjectManager::Internal::Qt4ProjectType newType);
void proFileUpdated(Qt4ProjectManager::Internal::Qt4ProFileNode *node);
void addUiFiles();
protected:
virtual void restoreSettingsImpl(ProjectExplorer::PersistentSettingsReader &settingsReader);
@@ -232,6 +236,8 @@ private:
Internal::Qt4ProjectFiles *m_projectFiles;
QTimer m_updateCodeModelTimer;
QTimer m_addUiFilesTimer;
QStringList m_uiFilesToAdd;
Internal::GCCPreprocessor m_preproc;
friend class Qt4ProjectFile;

View File

@@ -38,7 +38,6 @@ namespace ResourceEditor {
namespace Constants {
const char * const C_RESOURCEEDITOR = "Resource Editor";
const char * const C_RESOURCEWINDOW = "Resourcewindow";
const char * const C_RESOURCE_MIMETYPE = "application/vnd.nokia.xml.qt.resource";
} // namespace Constants

View File

@@ -161,7 +161,7 @@ bool ResourceEditorFile::save(const QString &name /*= QString()*/)
}
const char *ResourceEditorW::kind() const {
return ResourceEditor::Constants::C_RESOURCEWINDOW;
return ResourceEditor::Constants::C_RESOURCEEDITOR;
}
QString ResourceEditorFile::fileName() const