Make document model static and add some document related methods

Change-Id: Ibcb863e67a2433529c9d2b6dec237f9d8b1d8d50
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
Eike Ziller
2013-07-09 11:52:44 +02:00
parent 7b1941c792
commit 354cd410b0
25 changed files with 121 additions and 112 deletions

View File

@@ -225,8 +225,8 @@ void QbsProjectManagerPlugin::updateBuildActions()
QString file;
if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) {
file = currentEditor->document()->filePath();
if (Core::IDocument *currentDocument= Core::EditorManager::currentDocument()) {
file = currentDocument->filePath();
ProjectExplorer::SessionManager *session = m_projectExplorer->session();
ProjectExplorer::Node *node = session->nodeForFile(file);
ProjectExplorer::Project *project
@@ -296,8 +296,8 @@ void QbsProjectManagerPlugin::buildFile()
{
QString file;
QbsProject *project = 0;
if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) {
file = currentEditor->document()->filePath();
if (Core::IDocument *currentDocument= Core::EditorManager::currentDocument()) {
file = currentDocument->filePath();
project = qobject_cast<QbsProject *>(m_projectExplorer->session()->projectForFile(file));
}
@@ -319,8 +319,8 @@ void QbsProjectManagerPlugin::buildProduct()
{
QbsProject *project = 0;
QbsProductNode *product = 0;
if (Core::IEditor *currentEditor = Core::EditorManager::currentEditor()) {
const QString file = currentEditor->document()->filePath();
if (Core::IDocument *currentDocument= Core::EditorManager::currentDocument()) {
const QString file = currentDocument->filePath();
ProjectExplorer::SessionManager *session = m_projectExplorer->session();
project = qobject_cast<QbsProject *>(session->projectForFile(file));