forked from qt-creator/qt-creator
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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user