Commit 9179039c authored by Luigi Toscano's avatar Luigi Toscano

Clean the status bar message from the HTML part

The message for the status bar that is returned by the HTML part
is considered rich text as it starts by "<qt>", but without real
HTML tags/rich text markers. So clean it before showing it (which
means the removal of the "<qt>" prefix).
Thanks Pino for the QTextDocument hint.

FIXED-IN: 5.7.1
BUG: 361932
parent 817e40d2
......@@ -54,6 +54,7 @@
#include <QMimeDatabase>
#include <QStatusBar>
#include <QDir>
#include <QTextDocument>
#include <QDialogButtonBox>
#include <QPushButton>
......@@ -117,7 +118,7 @@ MainWindow::MainWindow()
connect( mDoc, SIGNAL( setWindowCaption( const QString & ) ),
SLOT( setWindowTitle( const QString & ) ) );
connect( mDoc, SIGNAL( setStatusBarText( const QString & ) ),
SLOT( statusBarMessage( const QString & ) ) );
SLOT( statusBarRichTextMessage( const QString & ) ) );
connect( mDoc, SIGNAL( onURL( const QString & ) ),
SLOT( statusBarMessage( const QString & ) ) );
connect( mDoc, SIGNAL( started( KIO::Job * ) ),
......@@ -399,6 +400,13 @@ void MainWindow::slotInfoMessage(KJob *, const QString &m)
statusBarMessage(m);
}
void MainWindow::statusBarRichTextMessage(const QString &m)
{
QTextDocument richTextHolder;
richTextHolder.setHtml(m);
statusBar()->showMessage(richTextHolder.toPlainText());
}
void MainWindow::statusBarMessage(const QString &m)
{
statusBar()->showMessage(m);
......
......@@ -39,6 +39,7 @@ class MainWindow : public KXmlGuiWindow
public Q_SLOTS:
void print();
void statusBarRichTextMessage(const QString &m);
void statusBarMessage(const QString &m);
void slotShowHome();
void slotLastSearch();
......
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