Commit 69217d85 authored by Laurent Montel's avatar Laurent Montel 😁

Remove KParts::ReadOnlyPart

parent 672373e9
......@@ -60,8 +60,6 @@ public:
enum State {Idle, Started, Completed, Canceled};
virtual KParts::ReadOnlyPart *part() const = 0;
virtual qreal zoomFactor() const = 0;
/**
* Returns whether the frame can be removed from
......
......@@ -44,17 +44,6 @@
using namespace Akregator;
static void setPartGuiActive(KParts::ReadOnlyPart *part, bool active)
{
if (!part) {
return;
}
// When this event is sent to a KPart, the KPart StatusBarExtension shows or
// hides its items
KParts::GUIActivateEvent ev(active);
QApplication::sendEvent(part, &ev);
}
FrameManager::FrameManager(QWidget *mainWin, QObject *parent) : QObject(parent), m_mainWin(mainWin), m_currentFrame(0)
{
}
......@@ -87,7 +76,7 @@ void FrameManager::slotAddFrame(Frame *frame)
connect(frame, SIGNAL(signalOpenUrlRequest(Akregator::OpenUrlRequest&)), this, SLOT(slotOpenUrlRequest(Akregator::OpenUrlRequest&)));
setPartGuiActive(frame->part(), false);
//setPartGuiActive(frame->part(), false);
Q_EMIT signalFrameAdded(frame);
......@@ -134,12 +123,12 @@ void FrameManager::slotChangeFrame(int frameId)
Frame *oldFrame = m_currentFrame;
m_currentFrame = frame;
if (oldFrame) {
setPartGuiActive(oldFrame->part(), false);
}
//if (oldFrame) {
// setPartGuiActive(oldFrame->part(), false);
//}
if (frame) {
setPartGuiActive(frame->part(), true);
//setPartGuiActive(frame->part(), true);
// TODO: handle removable flag
......
......@@ -24,9 +24,8 @@
using namespace Akregator;
MainFrame::MainFrame(QWidget *parent, KParts::ReadOnlyPart *part, QWidget *visibleWidget)
MainFrame::MainFrame(QWidget *parent, QWidget *visibleWidget)
: Frame(parent),
m_part(part),
mArticleViewer(Q_NULLPTR)
{
setRemovable(false);
......
......@@ -29,7 +29,7 @@ class AKREGATOR_EXPORT MainFrame : public Frame
public:
MainFrame(QWidget *parent, KParts::ReadOnlyPart *part, QWidget *widget);
MainFrame(QWidget *parent, QWidget *widget);
virtual ~MainFrame();
QUrl url() const Q_DECL_OVERRIDE;
......@@ -38,10 +38,6 @@ public:
return false;
}
KParts::ReadOnlyPart *part() const Q_DECL_OVERRIDE
{
return m_part;
}
void setArticleViewer(Akregator::ArticleViewerWidget *articleViewer);
qreal zoomFactor() const Q_DECL_OVERRIDE;
......@@ -59,7 +55,6 @@ public Q_SLOTS:
void slotSaveImageOnDiskInFrame(int frameId);
void slotMute(int frameId, bool mute);
private:
KParts::ReadOnlyPart *m_part;
Akregator::ArticleViewerWidget *mArticleViewer;
};
......
......@@ -72,11 +72,6 @@ void WebEngineFrame::slotTitleChanged(const QString &title)
slotSetTitle(title);
}
KParts::ReadOnlyPart *WebEngineFrame::part() const
{
return Q_NULLPTR;
}
QUrl WebEngineFrame::url() const
{
return mArticleViewerWidgetNg->articleViewerNg()->url();
......
......@@ -32,7 +32,6 @@ public:
explicit WebEngineFrame(KActionCollection *ac, QWidget *parent = Q_NULLPTR);
~WebEngineFrame();
KParts::ReadOnlyPart *part() const Q_DECL_OVERRIDE;
QUrl url() const Q_DECL_OVERRIDE;
bool openUrl(const OpenUrlRequest &request) Q_DECL_OVERRIDE;
void loadConfig(const KConfigGroup &, const QString &) Q_DECL_OVERRIDE;
......
......@@ -242,7 +242,7 @@ MainWidget::MainWidget(Part *part, QWidget *parent, ActionManagerImpl *actionMan
m_articleViewer, &ArticleViewerWidget::setFilters);
mainTabLayout->addWidget(m_articleSplitter);
m_mainFrame = new MainFrame(this, m_part, m_mainTab);
m_mainFrame = new MainFrame(this, m_mainTab);
m_mainFrame->slotSetTitle(i18n("Articles"));
m_mainFrame->setArticleViewer(m_articleViewer);
connect(m_articleViewer->articleViewerWidgetNg()->articleViewerNg(), &ArticleViewerWebEngine::articleAction, this, &MainWidget::slotArticleAction);
......
......@@ -227,11 +227,7 @@ void TabWidget::slotSelectFrame(int frameId)
Frame *frame = d->framesById.value(frameId);
if (frame && frame != d->currentFrame()) {
setCurrentWidget(frame);
if (frame->part() && frame->part()->widget()) {
frame->part()->widget()->setFocus();
} else {
frame->setFocus();
}
frame->setFocus();
}
}
......
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