From f67a7f00a670cb64917bf01e96bf840072f0dd86 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Wed, 27 Sep 2006 09:04:48 +0000 Subject: [PATCH] chm generator no longer needs qt3support svn path=/trunk/playground/graphics/okular/; revision=588870 --- generators/chm/CMakeLists.txt | 2 -- generators/chm/generator_chm.cpp | 7 ++++++- generators/chm/lib/kchmtreeviewitem.cpp | 5 +++++ generators/chm/lib/kchmtreeviewitem.h | 10 ++++++++-- generators/chm/lib/xchmfile.cpp | 9 +++++++-- generators/chm/lib/xchmfile.h | 9 ++++----- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/generators/chm/CMakeLists.txt b/generators/chm/CMakeLists.txt index 413355ae4..7043ea630 100644 --- a/generators/chm/CMakeLists.txt +++ b/generators/chm/CMakeLists.txt @@ -1,7 +1,5 @@ add_subdirectory( kio-msits ) -add_definitions (-DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS) - include_directories( ${CMAKE_SOURCE_DIR}/okular ${CMAKE_BINARY_DIR}/okular diff --git a/generators/chm/generator_chm.cpp b/generators/chm/generator_chm.cpp index 1524d1d48..1066efced 100644 --- a/generators/chm/generator_chm.cpp +++ b/generators/chm/generator_chm.cpp @@ -154,7 +154,12 @@ bool CHMGenerator::canGeneratePixmap ( bool /*async*/ ) kDebug() << "async is locked " << asyncLock.locked() << endl; return !asyncLock.locked(); }*/ - return !syncLock.locked(); + bool isLocked = true; + if (syncLock.tryLock()) { + syncLock.unlock(); + isLocked = false; + } + return !isLocked; } void CHMGenerator::generatePixmap( Okular::PixmapRequest * request ) diff --git a/generators/chm/lib/kchmtreeviewitem.cpp b/generators/chm/lib/kchmtreeviewitem.cpp index def6e1a56..325ed34bb 100644 --- a/generators/chm/lib/kchmtreeviewitem.cpp +++ b/generators/chm/lib/kchmtreeviewitem.cpp @@ -1,4 +1,6 @@ +#if 0 + /*************************************************************************** * Copyright (C) 2005 by Georgy Yunaev * * tim@krasnogorsk.ru * @@ -136,3 +138,6 @@ int KCHMMainTreeViewItem::width( const QFontMetrics & fm, const Q3ListView * lv, (QFontMetrics (myFont), lv, c)); } */ + +#endif + diff --git a/generators/chm/lib/kchmtreeviewitem.h b/generators/chm/lib/kchmtreeviewitem.h index 4fbac14df..92548b553 100644 --- a/generators/chm/lib/kchmtreeviewitem.h +++ b/generators/chm/lib/kchmtreeviewitem.h @@ -1,3 +1,5 @@ + + /*************************************************************************** * Copyright (C) 2005 by Georgy Yunaev * * tim@krasnogorsk.ru * @@ -20,8 +22,6 @@ #ifndef CTREEVIEWITEM_H #define CTREEVIEWITEM_H -#include - namespace KCHMImageType { const int IMAGE_NONE = -1; @@ -29,6 +29,10 @@ namespace KCHMImageType const int IMAGE_INDEX = -3; }; +#if 0 + +#include + /** @author Georgy Yunaev */ @@ -52,3 +56,5 @@ private: }; #endif + +#endif diff --git a/generators/chm/lib/xchmfile.cpp b/generators/chm/lib/xchmfile.cpp index 651fb2189..11b43a3c6 100644 --- a/generators/chm/lib/xchmfile.cpp +++ b/generators/chm/lib/xchmfile.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +// #include #include "xchmfile.h" #include "iconstorage.h" @@ -530,6 +530,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool return true; } +#if 0 bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool asIndex) { chmUnitInfo ui; @@ -705,18 +706,22 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a return true; } - +#endif bool CHMFile::ParseAndFillTopicsTree(QDomDocument *tree) { return ParseHhcAndFillTree (m_topicsFile, tree, false); } +#if 0 + bool CHMFile::ParseAndFillIndex(K3ListView *indexlist) { return ParseHhcAndFillTree (m_indexFile, indexlist, true); } +#endif + bool CHMFile::SearchWord (const QString& text, bool wholeWords, bool titlesOnly, KCHMSearchProgressResults_t& results, bool phrase_search) { bool partial = false; diff --git a/generators/chm/lib/xchmfile.h b/generators/chm/lib/xchmfile.h index 6ef033f2a..c7e275f9d 100644 --- a/generators/chm/lib/xchmfile.h +++ b/generators/chm/lib/xchmfile.h @@ -37,10 +37,9 @@ #include "kchmtextencoding.h" #include "chm_lib.h" -// #include class CHMGenerator; -class K3ListView; + class KCHMSearchResult { public: @@ -178,7 +177,7 @@ public: to this function. \return true if it's possible to build the tree, false otherwise. */ - bool ParseAndFillTopicsTree(QDomDocument*toBuild); + bool ParseAndFillTopicsTree(QDomDocument*toBuild); /*! \brief Attempts to fill a QListView by parsing the index file. @@ -188,7 +187,7 @@ public: to this function. \return true if it's possible to build the tree, false otherwise. */ - bool ParseAndFillIndex (K3ListView *indexlist); + // bool ParseAndFillIndex (K3ListView *indexlist); /*! \brief Fast search using the $FIftiMain file in the .chm. @@ -277,7 +276,7 @@ public: private: //! Parse the HHC or HHS file, and fill the context (asIndex is false) or index (asIndex is true) tree. bool ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool asIndex); - bool ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool asIndex); +// bool ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool asIndex); //! Parse the HHC or HHS file, and fill the data. bool ParseChmIndexFile ( const QString& file, bool asIndex, KCHMParsedIndexEntry_t & cont );