Commit f4721eaa authored by hjk's avatar hjk

Fixes: coreplugin: remove 'fat' BaseView constructor

    Details:  failed trial before the committee on un-qtish behaviour
parent 62d78bb0
......@@ -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()
Destructor also destroys the widget.
*/
BaseView::~BaseView()
{
......
......@@ -40,14 +40,12 @@
namespace Core {
class CORE_EXPORT BaseView
: public IView
class CORE_EXPORT BaseView : public IView
{
Q_OBJECT
public:
BaseView(QObject *parent = 0);
BaseView(const char *name, QWidget *widget, const QList<int> &context, IView::ViewPosition position, QObject *parent = 0);
~BaseView();
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
// OutputPaneManager, since the ViewManager needs to be initilized before
m_outputView = new Core::BaseView("OutputWindow.Buttons",
OutputPaneManager::instance()->buttonsWidget(), QList<int>(), Core::IView::Second);
m_outputView = new Core::BaseView;
m_outputView->setUniqueViewName("OutputWindow.Buttons");
m_outputView->setWidget(OutputPaneManager::instance()->buttonsWidget());
m_outputView->setDefaultPosition(Core::IView::Second);
pm->addObject(m_outputView);
return true;
}
......
......@@ -57,6 +57,7 @@
using namespace QuickOpen;
using namespace QuickOpen::Internal;
namespace {
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->setEnabled(false);
Core::BaseView *view = new Core::BaseView("QuickOpen.ToolWindow",
m_quickOpenToolWindow,
QList<int>() << core->uniqueIDManager()->uniqueIdentifier(QLatin1String("QuickOpenToolWindow")),
Core::IView::First);
Core::BaseView *view = new Core::BaseView;
view->setUniqueViewName("QuickOpen.ToolWindow");
view->setWidget(m_quickOpenToolWindow);
view->setContext(QList<int>() << core->uniqueIDManager()
->uniqueIdentifier(QLatin1String("QuickOpenToolWindow")));
view->setDefaultPosition(Core::IView::First);
addAutoReleasedObject(view);
const QString actionId = QLatin1String("QtCreator.View.QuickOpen.ToolWindow");
......
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