Kandrashin Denis 12 лет назад
Родитель
Сommit
f4312cc08d
8 измененных файлов с 13 добавлено и 10 удалено
  1. 2 0
      source/fb2app.cpp
  2. 1 1
      source/fb2dock.cpp
  3. 2 2
      source/fb2main.cpp
  4. 2 1
      source/fb2main.hpp
  5. 1 1
      source/fb2page.hpp
  6. 1 1
      source/fb2read.cpp
  7. 3 3
      source/fb2xml.cpp
  8. 1 1
      source/fb2xml.hpp

+ 2 - 0
source/fb2app.cpp

@@ -68,5 +68,7 @@ int main(int argc, char *argv[])
 
     qInstallMsgHandler(fb2MessageHandler);
 
+    qRegisterMetaType<QXmlParseException>("QXmlParseException");
+
     return app.exec();
 }

+ 1 - 1
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)));

+ 2 - 2
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)

+ 2 - 1
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);
 

+ 1 - 1
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);

+ 1 - 1
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;

+ 3 - 3
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;
 }
 

+ 1 - 1
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