Sfoglia il codice sorgente

Remove compiler warnings

Kandrashin Denis 13 anni fa
parent
commit
8326a0cca6

+ 0 - 0
cmake/FindLibXML2.cmake → 3rdparty/cmake/FindLibXML2.cmake


+ 0 - 0
cmake/FindQScintilla.cmake → 3rdparty/cmake/FindQScintilla.cmake


+ 1 - 1
CMakeLists.txt

@@ -11,7 +11,7 @@ cmake_minimum_required(VERSION 2.6.0)
 
 project(fb2edit)
 
-set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
+set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/3rdparty/cmake)
 
 find_package( Qt4 4.7.0 COMPONENTS QtCore QtGui QtMain QtNetwork QtWebkit QtXml QtXmlPatterns REQUIRED )
 find_package( QScintilla REQUIRED )

+ 56 - 0
fb2edit.pro

@@ -0,0 +1,56 @@
+HEADERS = \
+    source/fb2app.h \
+    source/fb2head.h \
+    source/fb2main.h \
+    source/fb2read.h \
+    source/fb2tree.h \
+    source/fb2save.h \
+    source/fb2view.h \
+    source/fb2xml.h \
+    source/fb2xml2.h
+
+SOURCES = \
+    source/fb2app.cpp \
+    source/fb2head.cpp \
+    source/fb2main.cpp \
+    source/fb2read.cpp \
+    source/fb2tree.cpp \
+    source/fb2save.cpp \
+    source/fb2view.cpp \
+    source/fb2xml.cpp \
+    source/fb2xml2.cpp
+
+RESOURCES = \
+    source/res/fb2edit.qrc
+
+TARGET = fb2edit
+
+TRANSLATIONS = source/ts/ru.ts
+
+VERSION = 0.01.1
+
+QT += xml
+QT += webkit
+QT += network
+
+LIBS += -lqscintilla2
+
+OTHER_FILES += \
+    source/res/style.css \
+    source/res/blank.fb2
+
+if (win32) {
+
+    INCLUDEPATH += ../libxml2/include
+    INCLUDEPATH += ../iconv/include
+
+    LIBS += -L../libxml2/lib -llibxml2
+    LIBS += -L../iconv/lib -liconv
+    LIBS += -L../zlib/lib -lzlib
+
+} else {
+
+    INCLUDEPATH += /usr/include/libxml2
+    LIBS += -lxml2
+
+}

+ 0 - 55
source/fb2edit.pro

@@ -1,55 +0,0 @@
-HEADERS = \
-    fb2app.h \
-    fb2head.h \
-    fb2main.h \
-    fb2read.h \
-    fb2tree.h \
-    fb2save.h \
-    fb2view.h \
-    fb2xml.h \
-    fb2xml2.h
-
-SOURCES = \
-    fb2app.cpp \
-    fb2head.cpp \
-    fb2main.cpp \
-    fb2read.cpp \
-    fb2tree.cpp \
-    fb2save.cpp \
-    fb2view.cpp \
-    fb2xml.cpp \
-    fb2xml2.cpp
-
-RESOURCES = \
-    res/fb2edit.qrc
-
-TARGET = fb2edit
-
-TRANSLATIONS = ts/ru.ts
-
-VERSION = 0.01.1
-
-QT += xml
-QT += webkit
-QT += network
-
-LIBS += -lqscintilla2
-
-OTHER_FILES += res/style.css \
-    res/blank.fb2
-
-if (win32) {
-
-    INCLUDEPATH += ../libxml2/include
-    INCLUDEPATH += ../iconv/include
-
-    LIBS += -L../libxml2/lib -llibxml2
-    LIBS += -L../iconv/lib -liconv
-    LIBS += -L../zlib/lib -lzlib
-
-} else {
-
-    INCLUDEPATH += /usr/include/libxml2
-    LIBS += -lxml2
-
-}

+ 1 - 0
source/fb2head.cpp

@@ -128,6 +128,7 @@ QString Fb2HeadItem::value() const
             if (numb.isEmpty() || numb == "0") return text;
             return text + ", " + tr("#") + numb;
         } break;
+        default: ;
     }
     if (m_list.count()) return QString();
     return m_element.toPlainText().simplified();

+ 1 - 1
source/fb2read.cpp

@@ -11,8 +11,8 @@
 Fb2ReadThread::Fb2ReadThread(QObject *parent, const QString &filename, const QString &xml)
     : QThread(parent)
     , m_filename(filename)
-    , m_abort(false)
     , m_xml(xml)
+    , m_abort(false)
 {
     connect(this, SIGNAL(html(QString, QString)), parent, SLOT(html(QString, QString)));
 }

+ 2 - 1
source/fb2xml.cpp

@@ -73,7 +73,8 @@ bool Fb2XmlHandler::startElement(const QString & namespaceURI, const QString & l
     Q_UNUSED(localName);
     const QString name = qName.toLower();
     if (m_handler) return m_handler->doStart(name, attributes);
-    return m_handler = CreateRoot(name, attributes);
+    m_handler = CreateRoot(name, attributes);
+    return m_handler;
 }
 
 bool Fb2XmlHandler::isWhiteSpace(const QString &str)

+ 0 - 475
source/ts/ru.ts

@@ -1,475 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0">
-<context>
-    <name>Fb2HeadItem</name>
-    <message>
-        <location filename="../fb2head.cpp" line="11"/>
-        <source>Book</source>
-        <translation type="unfinished">Книга</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="12"/>
-        <source>File</source>
-        <translation type="unfinished">Файл</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="13"/>
-        <source>Publish</source>
-        <translation type="unfinished">Публикация</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="14"/>
-        <source>Add-ons</source>
-        <translation type="unfinished">Дополнения</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="15"/>
-        <source>Genre</source>
-        <translation type="unfinished">Жанр</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="16"/>
-        <source>Author</source>
-        <translation type="unfinished">Автор</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="17"/>
-        <source>Title</source>
-        <translation type="unfinished">Заголовок</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="18"/>
-        <source>Annotation</source>
-        <translation type="unfinished">Аннотация</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="19"/>
-        <source>Cover</source>
-        <translation type="unfinished">Обложка</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="20"/>
-        <source>Date</source>
-        <translation type="unfinished">Дата</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="21"/>
-        <source>Language</source>
-        <translation type="unfinished">Язык</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="22"/>
-        <source>Translator</source>
-        <translation type="unfinished">Переводчик</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="23"/>
-        <source>Sequence</source>
-        <translation type="unfinished">Серия</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="24"/>
-        <source>First name</source>
-        <translation type="unfinished">Имя</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="25"/>
-        <source>Middle name</source>
-        <translation type="unfinished">Отчество</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="26"/>
-        <source>Last name</source>
-        <translation type="unfinished">Фамилия</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="27"/>
-        <source>History</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="129"/>
-        <source>#</source>
-        <translation>№</translation>
-    </message>
-</context>
-<context>
-    <name>Fb2HeadModel</name>
-    <message>
-        <location filename="../fb2head.cpp" line="231"/>
-        <source>Key</source>
-        <translation type="unfinished">Ключ</translation>
-    </message>
-    <message>
-        <location filename="../fb2head.cpp" line="232"/>
-        <source>Value</source>
-        <translation>Значение</translation>
-    </message>
-</context>
-<context>
-    <name>Fb2MainWindow</name>
-    <message>
-        <location filename="../fb2main.cpp" line="70"/>
-        <source>Message log</source>
-        <translation>Информационные сообщения</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="134"/>
-        <source>Open file</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="177"/>
-        <source>Save As...</source>
-        <translation>Сохранить как...</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="184"/>
-        <source>About fb2edit</source>
-        <translation>О программе...</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="185"/>
-        <location filename="../fb2main.cpp" line="415"/>
-        <source>The &lt;b&gt;fb2edit&lt;/b&gt; is application for editing FB2-files.</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="216"/>
-        <source>&amp;File</source>
-        <translation>&amp;Файл</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="217"/>
-        <source>File</source>
-        <translation>Файл</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="220"/>
-        <source>&amp;New</source>
-        <translation>&amp;Новый</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="223"/>
-        <source>Create a new file</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="228"/>
-        <source>&amp;Open...</source>
-        <translation>&amp;Открыть...</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="230"/>
-        <source>Open an existing file</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="235"/>
-        <source>&amp;Save</source>
-        <translation>&amp;Сохранить</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="237"/>
-        <source>Save the document to disk</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="242"/>
-        <source>Save &amp;As...</source>
-        <translation>Сохрать &amp;как...</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="244"/>
-        <source>Save the document under a new name</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="250"/>
-        <source>&amp;Close</source>
-        <translation>&amp;Закрыть</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="252"/>
-        <source>Close this window</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="256"/>
-        <source>E&amp;xit</source>
-        <translation>&amp;Выход</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="258"/>
-        <source>Exit the application</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="262"/>
-        <source>&amp;Edit</source>
-        <translation>&amp;Правка</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="632"/>
-        <location filename="../fb2main.cpp" line="713"/>
-        <location filename="../fb2main.cpp" line="843"/>
-        <source>Edit</source>
-        <translation>Правка</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="763"/>
-        <source>&amp;Bold</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="769"/>
-        <source>&amp;Italic</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="775"/>
-        <source>&amp;Strikethrough</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="266"/>
-        <location filename="../fb2main.cpp" line="721"/>
-        <source>&amp;Undo</source>
-        <translation>&amp;Отменить</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="272"/>
-        <location filename="../fb2main.cpp" line="728"/>
-        <source>&amp;Redo</source>
-        <translation>&amp;Повторить</translation>
-    </message>
-    <message>
-        <source>Undo</source>
-        <translation type="obsolete">Отменить</translation>
-    </message>
-    <message>
-        <source>Redo</source>
-        <translation type="obsolete">Повторить</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="280"/>
-        <location filename="../fb2main.cpp" line="737"/>
-        <source>Cu&amp;t</source>
-        <translation>Вы&amp;резать</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="283"/>
-        <location filename="../fb2main.cpp" line="740"/>
-        <source>Cut the current selection&apos;s contents to the clipboard</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="287"/>
-        <location filename="../fb2main.cpp" line="745"/>
-        <source>&amp;Copy</source>
-        <translation>&amp;Копировать</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="290"/>
-        <location filename="../fb2main.cpp" line="748"/>
-        <source>Copy the current selection&apos;s contents to the clipboard</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="294"/>
-        <location filename="../fb2main.cpp" line="753"/>
-        <source>&amp;Paste</source>
-        <translation>&amp;Вставить</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="297"/>
-        <location filename="../fb2main.cpp" line="756"/>
-        <source>Paste the clipboard&apos;s contents into the current selection</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="303"/>
-        <source>&amp;Settings</source>
-        <translation type="unfinished">&amp;Настройки</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="305"/>
-        <source>Application settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="309"/>
-        <source>&amp;Insert</source>
-        <comment>Main menu</comment>
-        <translation type="unfinished">&amp;Вставка</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="311"/>
-        <source>&amp;Append</source>
-        <translation type="unfinished">&amp;Добавить</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="316"/>
-        <source>&amp;Delete</source>
-        <translation type="unfinished">&amp;Удалить</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="323"/>
-        <source>Fo&amp;rmat</source>
-        <translation>Фо&amp;рмат</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="390"/>
-        <source>&amp;Contents</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="394"/>
-        <source>&amp;Web inspector</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <source>Format</source>
-        <translation type="obsolete">Формат</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="325"/>
-        <source>Bold</source>
-        <translation>Жирный</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="330"/>
-        <source>Italic</source>
-        <translation>Курсив</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="335"/>
-        <source>Strikethrough</source>
-        <translation>Зачеркнутый</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="339"/>
-        <location filename="../fb2main.cpp" line="780"/>
-        <source>Superscript</source>
-        <translation>Верхний индекс</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="343"/>
-        <location filename="../fb2main.cpp" line="785"/>
-        <source>Subscript</source>
-        <translation>Нижний индекс</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="347"/>
-        <source>&amp;View</source>
-        <translation>&amp;Вид</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="353"/>
-        <source>&amp;Text</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="361"/>
-        <source>&amp;Head</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="368"/>
-        <source>&amp;XML</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="377"/>
-        <source>Zoom in</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="381"/>
-        <source>Zoom out</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="385"/>
-        <source>Zoom original</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="399"/>
-        <source>&amp;Help</source>
-        <translation>&amp;?</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="401"/>
-        <source>&amp;About</source>
-        <translation>&amp;О программа...</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="402"/>
-        <source>Show the application&apos;s About box</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="406"/>
-        <source>About &amp;Qt</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="407"/>
-        <source>Show the Qt library&apos;s About box</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="414"/>
-        <source>Settings</source>
-        <translation type="unfinished"></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="425"/>
-        <source>Contents</source>
-        <translation>Содержание</translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="520"/>
-        <source>Ready</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="544"/>
-        <source>The document has been modified. Do you want to save your changes?</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2main.cpp" line="559"/>
-        <source>Cannot write file %1: %2.</source>
-        <translation></translation>
-    </message>
-</context>
-<context>
-    <name>QObject</name>
-    <message>
-        <location filename="../fb2read.cpp" line="51"/>
-        <location filename="../fb2read.cpp" line="73"/>
-        <source>Cannot read file %1: %2.</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2read.cpp" line="386"/>
-        <source>The file is not an FB2 file.</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2xml.cpp" line="96"/>
-        <location filename="../fb2xml.cpp" line="105"/>
-        <location filename="../fb2xml.cpp" line="114"/>
-        <source>Parse error at line %1, column %2: %3</source>
-        <translation></translation>
-    </message>
-    <message>
-        <location filename="../fb2save.cpp" line="269"/>
-        <source>The tag &lt;body&gt; was not found.</source>
-        <translation type="unfinished"></translation>
-    </message>
-</context>
-</TS>