Commit 8d00ab65 authored by Harald Sitter's avatar Harald Sitter 🦄

make mainwindow derive from part and part the xmlwindow

first step to merging the two classes
parent 3cabf11e
......@@ -58,12 +58,11 @@ namespace Filelight {
MainWindow::MainWindow()
// : KParts::MainWindow()
: KXmlGuiWindow()
, m_part(new Part(nullptr, this, QList<QVariant>()))
: Part(nullptr, nullptr, QList<QVariant>())
, m_part(this)
, m_histories(0)
{
// setXMLFile("filelightui.rc");
m_part = static_cast<Part *>(new Part(nullptr, this, QList<QVariant>()));
setStandardToolBarMenuEnabled(true);
setupActions();
......
......@@ -30,12 +30,13 @@ class KRecentFilesAction;
class HistoryCollection;
#include "part.h"
namespace Filelight {
class Part;
class MainWindow : public KXmlGuiWindow // Maybe use qmainwindow
class MainWindow : public Part // Maybe use qmainwindow
{
Q_OBJECT
......
......@@ -58,7 +58,7 @@ BrowserExtension::BrowserExtension(Part *parent)
Part::Part(QWidget *parentWidget, QObject *parent, const QList<QVariant>&)
// : ReadOnlyPart(parent)
: QObject(parent)
: KXmlGuiWindow(parentWidget)
, m_summary(0)
, m_ext(new BrowserExtension(this))
, m_statusbar(new StatusBarExtension(this))
......@@ -230,12 +230,6 @@ void Part::setUrl(const QUrl &url)
m_url = url;
}
void Part::stateChanged(const QString &state)
{
#warning port this calls xmlguiclient::stateChanged in parts
// Q_ASSERT(false);
}
void Part::setWidget(QWidget *widget)
{
m_widget = widget;
......
......@@ -27,6 +27,8 @@
#include <KParts/Part>
#include <QUrl>
#include <KXmlGuiWindow>
#include <QLabel>
// COMPAT
......@@ -76,7 +78,7 @@ signals:
class Part : public
// KParts::ReadOnlyPart
QObject
KXmlGuiWindow
{
Q_OBJECT
......@@ -132,7 +134,6 @@ public:
QWidget *widget() const;
private:
void setUrl(const QUrl &url);
void stateChanged(const QString &state);
void setWidget(QWidget *widget);
QWidget *m_widget = nullptr;
QUrl m_url;
......
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