Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/lintest/fb2edit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKandrashin Denis <mail@lintest.ru>2012-11-08 23:54:38 +0400
committerKandrashin Denis <mail@lintest.ru>2012-11-08 23:54:38 +0400
commitf4312cc08d79f57ea611727e09fdf67b197e4e45 (patch)
tree5058d9667ed799b7f88c626e521ea20aed5ab996
parent72e93d4f40d3a64cb40dc971d431aa9d25b98a0e (diff)
Log XML parsigg errors
-rw-r--r--source/fb2app.cpp2
-rw-r--r--source/fb2dock.cpp2
-rw-r--r--source/fb2main.cpp4
-rw-r--r--source/fb2main.hpp3
-rw-r--r--source/fb2page.hpp2
-rw-r--r--source/fb2read.cpp2
-rw-r--r--source/fb2xml.cpp6
-rw-r--r--source/fb2xml.hpp2
8 files changed, 13 insertions, 10 deletions
diff --git a/source/fb2app.cpp b/source/fb2app.cpp
index df6d716..fc2dbca 100644
--- a/source/fb2app.cpp
+++ b/source/fb2app.cpp
@@ -68,5 +68,7 @@ int main(int argc, char *argv[])
qInstallMsgHandler(fb2MessageHandler);
+ qRegisterMetaType<QXmlParseException>("QXmlParseException");
+
return app.exec();
}
diff --git a/source/fb2dock.cpp b/source/fb2dock.cpp
index 0a3c493..9bbcede 100644
--- a/source/fb2dock.cpp
+++ b/source/fb2dock.cpp
@@ -54,7 +54,7 @@ FbMainDock::FbMainDock(QWidget *parent)
addWidget(m_head);
addWidget(m_code);
- connect(m_text->page(), SIGNAL(log(FbMessage)), parent, SLOT(log(FbMessage)));
+ connect(m_text->page(), SIGNAL(log(QXmlParseException)), parent, SLOT(log(QXmlParseException)));
connect(m_text->page(), SIGNAL(status(QString)), parent, SLOT(status(QString)));
connect(m_head, SIGNAL(status(QString)), parent, SLOT(status(QString)));
connect(m_code, SIGNAL(status(QString)), parent, SLOT(status(QString)));
diff --git a/source/fb2main.cpp b/source/fb2main.cpp
index 29b4196..e8dd0fd 100644
--- a/source/fb2main.cpp
+++ b/source/fb2main.cpp
@@ -46,9 +46,9 @@ FbMainWindow::FbMainWindow(const QString &filename, ViewMode mode)
mainDock->load(filepath);
}
-void FbMainWindow::log(const FbMessage &msg)
+void FbMainWindow::log(const QXmlParseException &exception)
{
- logMessage(msg.msg());
+ logMessage(exception.message().simplified());
}
void FbMainWindow::logMessage(const QString &message)
diff --git a/source/fb2main.hpp b/source/fb2main.hpp
index 68eb620..cb64143 100644
--- a/source/fb2main.hpp
+++ b/source/fb2main.hpp
@@ -3,6 +3,7 @@
#include <QMainWindow>
#include <QDockWidget>
+#include <QXmlParseException>
QT_BEGIN_NAMESPACE
class QAction;
@@ -48,7 +49,7 @@ signals:
void showInspectorChecked(bool);
public slots:
- void log(const FbMessage &msg);
+ void log(const QXmlParseException &exception);
void logMessage(const QString &message);
void status(const QString &text);
diff --git a/source/fb2page.hpp b/source/fb2page.hpp
index 9bd478b..f94c4a3 100644
--- a/source/fb2page.hpp
+++ b/source/fb2page.hpp
@@ -47,8 +47,8 @@ public:
static QUrl createUrl();
signals:
+ void log(const QXmlParseException &exception);
void status(const QString &text);
- void log(const FbMessage &msg);
public slots:
void html(const QString &html, FbStore *store);
diff --git a/source/fb2read.cpp b/source/fb2read.cpp
index da361f7..8602a37 100644
--- a/source/fb2read.cpp
+++ b/source/fb2read.cpp
@@ -46,7 +46,7 @@ bool FbReadThread::parse()
FbReadHandler handler(writer);
connect(&handler, SIGNAL(binary(QString,QByteArray)), m_store, SLOT(binary(QString,QByteArray)));
-// connect(&handler, SIGNAL(log(FbMessage)), parent(), SIGNAL(log(FbMessage)));
+ connect(&handler, SIGNAL(log(QXmlParseException)), parent(), SIGNAL(log(QXmlParseException)));
#ifdef FB2_USE_LIBXML2
XML2::XmlReader reader;
diff --git a/source/fb2xml.cpp b/source/fb2xml.cpp
index 20cc8e2..60541bf 100644
--- a/source/fb2xml.cpp
+++ b/source/fb2xml.cpp
@@ -101,19 +101,19 @@ bool FbXmlHandler::endElement(const QString & namespaceURI, const QString & loca
bool FbXmlHandler::warning(const QXmlParseException& exception)
{
- emit log(FbMessage(exception, FbMessage::Warring));
+ emit log(exception);
return true;
}
bool FbXmlHandler::error(const QXmlParseException& exception)
{
- emit log(FbMessage(exception, FbMessage::Error));
+ emit log(exception);
return false;
}
bool FbXmlHandler::fatalError(const QXmlParseException &exception)
{
- emit log(FbMessage(exception, FbMessage::Fatal));
+ emit log(exception);
return false;
}
diff --git a/source/fb2xml.hpp b/source/fb2xml.hpp
index 6c6ebf1..0db74a2 100644
--- a/source/fb2xml.hpp
+++ b/source/fb2xml.hpp
@@ -43,7 +43,7 @@ public:
QString errorString() const;
signals:
- void log(const FbMessage &msg);
+ void log(const QXmlParseException &exception);
protected:
class NodeHandler