Commit 5e91ae44 authored by Igor Kushnir's avatar Igor Kushnir
Browse files

Adapt to KDevPlatform's setOverrideCss API change

https://commits.kde.org/kdevelop/8ec324c888e702299627050eb93a99b4c53cabb3
just replaced the existing setOverrideCss() API with more convenient
CSS-overriding overloads. Use the new API and drop the no longer needed
glue code.
parent 7e84ac92
......@@ -9,8 +9,6 @@
#include <QProgressBar>
#include <QLabel>
#include <QVBoxLayout>
#include <QTemporaryFile>
#include <QTextStream>
#include <QUrl>
#include <KLocalizedString>
......@@ -18,23 +16,10 @@
#include "phpdocsplugin.h"
#include <documentation/standarddocumentationview.h>
QTemporaryFile* createStyleSheet(QObject* parent)
{
auto* file = new QTemporaryFile(parent);
bool ret = file->open();
Q_ASSERT(ret);
Q_UNUSED(ret);
QTextStream ts(file);
ts << ".page-tools { float: none !important; } body { background: white !important; };";
return file;
}
PhpDocumentationWidget::PhpDocumentationWidget(KDevelop::DocumentationFindWidget* find, const QUrl &url,
PhpDocsPlugin* provider, QWidget* parent)
: QStackedWidget(parent)
, m_loading(new QWidget(this))
, m_styleSheet(createStyleSheet(this))
, m_provider(provider)
{
m_part = new KDevelop::StandardDocumentationView(find, this);
......@@ -92,7 +77,8 @@ void PhpDocumentationWidget::linkClicked(const QUrl& url)
void PhpDocumentationWidget::documentLoaded()
{
m_part->setOverrideCss(QUrl::fromLocalFile(m_styleSheet->fileName()));
m_part->setOverrideCssCode(
QByteArrayLiteral(".page-tools { float: none !important; } body { background: white !important; };"));
setCurrentWidget(m_part);
removeWidget(m_loading);
......
......@@ -9,7 +9,6 @@
#include <QStackedWidget>
class QTemporaryFile;
class QUrl;
namespace KDevelop {
......@@ -36,7 +35,6 @@ private slots:
private:
KDevelop::StandardDocumentationView* m_part;
QWidget* m_loading;
QTemporaryFile* m_styleSheet;
PhpDocsPlugin* m_provider;
};
......
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