Commit ca64b2ca authored by Nicolas Fella's avatar Nicolas Fella Committed by Laurent Montel
Browse files

Remove dead code in OpenUrlRequest

setArgs and setBrowserArgs are never called, so anything reading those can be removed
parent dfcf777d
Pipeline #168887 passed with stage
in 1 minute and 22 seconds
......@@ -183,8 +183,7 @@ void FrameManager::slotSetStatusText(Frame *frame, const QString &statusText)
void FrameManager::openUrl(OpenUrlRequest &request)
{
if (request.browserArgs().newTab() || request.browserArgs().forcesNewWindow() || request.options() == OpenUrlRequest::NewTab
|| (m_currentFrame->id() == 0)) {
if (request.options() == OpenUrlRequest::NewTab || (m_currentFrame->id() == 0)) {
int newFrameId = -1;
Q_EMIT signalRequestNewFrame(newFrameId);
request.setFrameId(newFrameId);
......@@ -221,12 +220,7 @@ void FrameManager::openInExternalBrowser(const OpenUrlRequest &request)
}
}
if (request.args().mimeType().isEmpty()) {
QDesktopServices::openUrl(url);
} else {
auto job = new KIO::OpenUrlJob(url, request.args().mimeType());
job->start();
}
QDesktopServices::openUrl(url);
}
void FrameManager::slotOpenUrlRequest(OpenUrlRequest &request, bool useOpenInBackgroundSetting)
......@@ -240,7 +234,7 @@ void FrameManager::slotOpenUrlRequest(OpenUrlRequest &request, bool useOpenInBac
if (useOpenInBackgroundSetting) {
// Honour user's preference for foreground/background tabs
if (request.options() == OpenUrlRequest::NewTab || request.browserArgs().newTab()) {
if (request.options() == OpenUrlRequest::NewTab) {
request.setOpenInBackground(Settings::lMBBehaviour() == Settings::EnumLMBBehaviour::OpenInBackground);
}
}
......
......@@ -47,37 +47,8 @@ void OpenUrlRequest::setOpenInBackground(bool background)
m_inBackground = background;
}
KParts::OpenUrlArguments OpenUrlRequest::args() const
{
return m_args;
}
void OpenUrlRequest::setArgs(const KParts::OpenUrlArguments &args)
{
// m_hasArgs = true;
m_args = args;
}
KParts::BrowserArguments OpenUrlRequest::browserArgs() const
{
return m_browserArgs;
}
void OpenUrlRequest::setBrowserArgs(const KParts::BrowserArguments &args)
{
m_browserArgs = args;
}
OpenUrlRequest::Options OpenUrlRequest::options() const
{
if (m_options == None && m_browserArgs.frameName == QLatin1String("_blank")) {
if (Settings::newWindowInTab()) {
return NewTab;
} else {
return ExternalBrowser;
}
}
return m_options;
}
......@@ -88,10 +59,9 @@ void OpenUrlRequest::setOptions(OpenUrlRequest::Options options)
QString OpenUrlRequest::debugInfo() const
{
return QStringLiteral("url=%1 mimeType=%2 newTab=%3 forcesNewWindow=%4 options=%5")
.arg(m_url.url(), m_args.mimeType())
.arg(m_browserArgs.newTab())
.arg(m_browserArgs.forcesNewWindow())
return QStringLiteral("url=%1 options=%2")
.arg(m_url.url())
.arg(m_options);
}
......
......@@ -8,8 +8,6 @@
#pragma once
#include <kparts/browserextension.h>
#include <QUrl>
#include "akregator_export.h"
......@@ -39,12 +37,6 @@ public:
Q_REQUIRED_RESULT QUrl url() const;
void setUrl(const QUrl &url);
Q_REQUIRED_RESULT KParts::OpenUrlArguments args() const;
void setArgs(const KParts::OpenUrlArguments &args);
Q_REQUIRED_RESULT KParts::BrowserArguments browserArgs() const;
void setBrowserArgs(const KParts::BrowserArguments &args);
Q_REQUIRED_RESULT Options options() const;
void setOptions(Options options);
......@@ -59,8 +51,6 @@ public:
private:
int m_frameId = -1;
QUrl m_url;
KParts::OpenUrlArguments m_args;
KParts::BrowserArguments m_browserArgs;
Options m_options;
bool m_inBackground = false;
bool m_wasHandled = false;
......
Supports Markdown
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