Commit 3ace5440 authored by Eike Ziller's avatar Eike Ziller

Reduce dependencies of CppPreProcessorDialog

It doesn't really need a CppEditorWidget

Change-Id: Ic36b1d467460cdcdce372df2887033bd9f5fff29
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent e793e2d8
...@@ -1995,7 +1995,7 @@ void CPPEditorWidget::showPreProcessorWidget() ...@@ -1995,7 +1995,7 @@ void CPPEditorWidget::showPreProcessorWidget()
if (projectParts.isEmpty()) if (projectParts.isEmpty())
projectParts << m_modelManager->fallbackProjectPart(); projectParts << m_modelManager->fallbackProjectPart();
CppPreProcessorDialog preProcessorDialog(this, projectParts); CppPreProcessorDialog preProcessorDialog(this, baseTextDocument()->filePath(), projectParts);
if (preProcessorDialog.exec() == QDialog::Accepted) { if (preProcessorDialog.exec() == QDialog::Accepted) {
QSharedPointer<SnapshotUpdater> updater QSharedPointer<SnapshotUpdater> updater
= m_modelManager->cppEditorSupport(editor())->snapshotUpdater(); = m_modelManager->cppEditorSupport(editor())->snapshotUpdater();
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include "cpppreprocessordialog.h" #include "cpppreprocessordialog.h"
#include "ui_cpppreprocessordialog.h" #include "ui_cpppreprocessordialog.h"
#include "cppeditor.h"
#include "cppeditorconstants.h" #include "cppeditorconstants.h"
#include "cppsnippetprovider.h" #include "cppsnippetprovider.h"
...@@ -44,11 +43,11 @@ static bool projectPartLessThan(const CppTools::ProjectPart::Ptr &projectPart1, ...@@ -44,11 +43,11 @@ static bool projectPartLessThan(const CppTools::ProjectPart::Ptr &projectPart1,
return projectPart1->displayName < projectPart2->displayName; return projectPart1->displayName < projectPart2->displayName;
} }
CppPreProcessorDialog::CppPreProcessorDialog(CPPEditorWidget *editorWidget, CppPreProcessorDialog::CppPreProcessorDialog(QWidget *parent, const QString &filePath,
const QList<CppTools::ProjectPart::Ptr> &projectParts) const QList<CppTools::ProjectPart::Ptr> &projectParts)
: QDialog(editorWidget) : QDialog(parent)
, m_ui(new Ui::CppPreProcessorDialog()) , m_ui(new Ui::CppPreProcessorDialog())
, m_filePath(editorWidget->editor()->document()->filePath()) , m_filePath(filePath)
{ {
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
......
...@@ -38,14 +38,12 @@ namespace CppEditor { ...@@ -38,14 +38,12 @@ namespace CppEditor {
namespace Internal { namespace Internal {
namespace Ui { class CppPreProcessorDialog; } namespace Ui { class CppPreProcessorDialog; }
class CPPEditorWidget;
class CppPreProcessorDialog : public QDialog class CppPreProcessorDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit CppPreProcessorDialog(CPPEditorWidget *editorWidget, explicit CppPreProcessorDialog(QWidget *parent, const QString &filePath,
const QList<CppTools::ProjectPart::Ptr> &projectParts); const QList<CppTools::ProjectPart::Ptr> &projectParts);
~CppPreProcessorDialog(); ~CppPreProcessorDialog();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment