forked from qt-creator/qt-creator
Fixes: coreplugin: remove 'fat' BaseView constructor
Details: failed trial before the committee on un-qtish behaviour
This commit is contained in:
@@ -82,29 +82,10 @@ BaseView::BaseView(QObject *parent)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn BaseView::BaseView(const char *name, QWidget *widget, const QList<int> &context, Qt::DockWidgetArea position, QObject *parent)
|
|
||||||
|
|
||||||
Creates a view with the given properties.
|
|
||||||
|
|
||||||
\a name
|
|
||||||
\a widget
|
|
||||||
\a context
|
|
||||||
\a position
|
|
||||||
\a parent
|
|
||||||
*/
|
|
||||||
|
|
||||||
BaseView::BaseView(const char *name, QWidget *widget, const QList<int> &context, IView::ViewPosition position, QObject *parent)
|
|
||||||
: IView(parent),
|
|
||||||
m_viewName(name),
|
|
||||||
m_widget(widget),
|
|
||||||
m_context(context),
|
|
||||||
m_defaultPosition(position)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn BaseView::~BaseView()
|
\fn BaseView::~BaseView()
|
||||||
|
|
||||||
|
Destructor also destroys the widget.
|
||||||
*/
|
*/
|
||||||
BaseView::~BaseView()
|
BaseView::~BaseView()
|
||||||
{
|
{
|
||||||
|
@@ -40,14 +40,12 @@
|
|||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
||||||
class CORE_EXPORT BaseView
|
class CORE_EXPORT BaseView : public IView
|
||||||
: public IView
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BaseView(QObject *parent = 0);
|
BaseView(QObject *parent = 0);
|
||||||
BaseView(const char *name, QWidget *widget, const QList<int> &context, IView::ViewPosition position, QObject *parent = 0);
|
|
||||||
~BaseView();
|
~BaseView();
|
||||||
|
|
||||||
QList<int> context() const;
|
QList<int> context() const;
|
||||||
|
@@ -309,8 +309,10 @@ bool MainWindow::init(QString *errorMessage)
|
|||||||
|
|
||||||
// Add widget to the bottom, we create the view here instead of inside the
|
// Add widget to the bottom, we create the view here instead of inside the
|
||||||
// OutputPaneManager, since the ViewManager needs to be initilized before
|
// OutputPaneManager, since the ViewManager needs to be initilized before
|
||||||
m_outputView = new Core::BaseView("OutputWindow.Buttons",
|
m_outputView = new Core::BaseView;
|
||||||
OutputPaneManager::instance()->buttonsWidget(), QList<int>(), Core::IView::Second);
|
m_outputView->setUniqueViewName("OutputWindow.Buttons");
|
||||||
|
m_outputView->setWidget(OutputPaneManager::instance()->buttonsWidget());
|
||||||
|
m_outputView->setDefaultPosition(Core::IView::Second);
|
||||||
pm->addObject(m_outputView);
|
pm->addObject(m_outputView);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -57,6 +57,7 @@
|
|||||||
using namespace QuickOpen;
|
using namespace QuickOpen;
|
||||||
using namespace QuickOpen::Internal;
|
using namespace QuickOpen::Internal;
|
||||||
|
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
static bool filterLessThan(const IQuickOpenFilter *first, const IQuickOpenFilter *second)
|
static bool filterLessThan(const IQuickOpenFilter *first, const IQuickOpenFilter *second)
|
||||||
{
|
{
|
||||||
@@ -89,10 +90,12 @@ bool QuickOpenPlugin::initialize(const QStringList &, QString *)
|
|||||||
|
|
||||||
m_quickOpenToolWindow = new QuickOpenToolWindow(this);
|
m_quickOpenToolWindow = new QuickOpenToolWindow(this);
|
||||||
m_quickOpenToolWindow->setEnabled(false);
|
m_quickOpenToolWindow->setEnabled(false);
|
||||||
Core::BaseView *view = new Core::BaseView("QuickOpen.ToolWindow",
|
Core::BaseView *view = new Core::BaseView;
|
||||||
m_quickOpenToolWindow,
|
view->setUniqueViewName("QuickOpen.ToolWindow");
|
||||||
QList<int>() << core->uniqueIDManager()->uniqueIdentifier(QLatin1String("QuickOpenToolWindow")),
|
view->setWidget(m_quickOpenToolWindow);
|
||||||
Core::IView::First);
|
view->setContext(QList<int>() << core->uniqueIDManager()
|
||||||
|
->uniqueIdentifier(QLatin1String("QuickOpenToolWindow")));
|
||||||
|
view->setDefaultPosition(Core::IView::First);
|
||||||
addAutoReleasedObject(view);
|
addAutoReleasedObject(view);
|
||||||
|
|
||||||
const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow");
|
const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow");
|
||||||
|
Reference in New Issue
Block a user