Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
cac5663a
Commit
cac5663a
authored
Sep 04, 2009
by
Erik Verbruggen
Browse files
Modified the QML project to notify the DUI model manager when a file is added to the project.
parent
a5220933
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/duieditor/duimodelmanager.cpp
View file @
cac5663a
...
...
@@ -57,6 +57,8 @@ DuiModelManager::DuiModelManager(QObject *parent):
Snapshot
DuiModelManager
::
snapshot
()
const
{
QMutexLocker
locker
(
&
m_mutex
);
return
_snapshot
;
}
...
...
@@ -118,6 +120,8 @@ void DuiModelManager::emitDocumentUpdated(DuiDocument::Ptr doc)
void
DuiModelManager
::
onDocumentUpdated
(
DuiDocument
::
Ptr
doc
)
{
QMutexLocker
locker
(
&
m_mutex
);
_snapshot
.
insert
(
doc
);
}
...
...
src/plugins/duieditor/duimodelmanager.h
View file @
cac5663a
...
...
@@ -32,6 +32,7 @@
#include <QFuture>
#include <QFutureSynchronizer>
#include <QMutex>
#include "duidocument.h"
#include "duimodelmanagerinterface.h"
...
...
@@ -75,6 +76,7 @@ protected:
DuiModelManager
*
modelManager
);
private:
mutable
QMutex
m_mutex
;
Core
::
ICore
*
m_core
;
Snapshot
_snapshot
;
...
...
src/plugins/plugins.pro
View file @
cac5663a
...
...
@@ -176,3 +176,4 @@ plugin_qmlprojectmanager.subdir = qmlprojectmanager
plugin_qmlprojectmanager
.
depends
=
plugin_texteditor
plugin_qmlprojectmanager
.
depends
+=
plugin_projectexplorer
plugin_qmlprojectmanager
.
depends
+=
plugin_help
plugin_qmlprojectmanager
.
depends
+=
plugin_duieditor
src/plugins/qmlprojectmanager/qmlproject.cpp
View file @
cac5663a
...
...
@@ -39,6 +39,8 @@
#include <coreplugin/icore.h>
#include <coreplugin/editormanager/editormanager.h>
#include <duieditor/duimodelmanagerinterface.h>
#include <utils/synchronousprocess.h>
#include <utils/pathchooser.h>
...
...
@@ -62,7 +64,8 @@ using namespace QmlProjectManager::Internal;
QmlProject
::
QmlProject
(
Manager
*
manager
,
const
QString
&
fileName
)
:
m_manager
(
manager
),
m_fileName
(
fileName
)
m_fileName
(
fileName
),
m_modelManager
(
ExtensionSystem
::
PluginManager
::
instance
()
->
getObject
<
DuiEditor
::
DuiModelManagerInterface
>
())
{
QFileInfo
fileInfo
(
m_fileName
);
m_projectName
=
fileInfo
.
completeBaseName
();
...
...
@@ -118,6 +121,7 @@ void QmlProject::parseProject(RefreshOptions options)
if
(
options
&
Files
)
{
m_files
=
convertToAbsoluteFiles
(
readLines
(
filesFileName
()));
m_files
.
removeDuplicates
();
m_modelManager
->
updateSourceFiles
(
m_files
);
}
if
(
options
&
Configuration
)
{
...
...
src/plugins/qmlprojectmanager/qmlproject.h
View file @
cac5663a
...
...
@@ -41,6 +41,10 @@
#include <QtCore/QDir>
namespace
DuiEditor
{
class
DuiModelManagerInterface
;
}
namespace
QmlProjectManager
{
namespace
Internal
{
...
...
@@ -104,6 +108,7 @@ private:
QString
m_filesFileName
;
QmlProjectFile
*
m_file
;
QString
m_projectName
;
DuiEditor
::
DuiModelManagerInterface
*
m_modelManager
;
QStringList
m_files
;
...
...
src/plugins/qmlprojectmanager/qmlprojectmanager_dependencies.pri
View file @
cac5663a
include(../../plugins/projectexplorer/projectexplorer.pri)
include(../../plugins/texteditor/texteditor.pri)
include(../../plugins/duieditor/duieditor.pri)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment