Changeset 561 for trunk/tools/assistant/lib
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 72 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/assistant/lib/fulltextsearch/qanalyzer.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 ** 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 28 35 { 29 36 analyzer = _CL_POINTER(other.analyzer); 37 deleteCLuceneAnalyzer = other.deleteCLuceneAnalyzer; 30 38 } 31 39 -
trunk/tools/assistant/lib/fulltextsearch/qanalyzer_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qclucene-config_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qclucene_global_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 29 36 #include <QtCore/QChar> 30 37 #include <QtCore/QString> 38 39 #if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T) 40 # if !defined(TCHAR) 41 # define TCHAR wchar_t 42 # endif 43 #else 44 # include <windows.h> 45 #endif 31 46 32 47 QT_BEGIN_HEADER … … 88 103 #endif 89 104 90 #if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)91 # if !defined(TCHAR)92 # define TCHAR wchar_t93 # endif94 #else95 # include <windows.h>96 #endif97 98 105 namespace { 99 106 TCHAR* QStringToTChar(const QString &str) -
trunk/tools/assistant/lib/fulltextsearch/qdocument.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 30 37 { 31 38 document = _CL_POINTER(other.document); 39 deleteCLuceneDocument = other.deleteCLuceneDocument; 32 40 } 33 41 -
trunk/tools/assistant/lib/fulltextsearch/qdocument_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qfield.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 24 31 deleteCLuceneField = true; 25 32 } 26 33 27 34 QCLuceneFieldPrivate::QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other) 28 35 : QSharedData() 29 36 { 30 37 field = _CL_POINTER(other.field); 38 deleteCLuceneField = other.deleteCLuceneField; 31 39 } 32 40 … … 51 59 TCHAR* fieldName = QStringToTChar(name); 52 60 TCHAR* fieldValue = QStringToTChar(value); 53 61 54 62 d->field = new lucene::document::Field(fieldName, fieldValue, configs); 55 63 … … 67 75 reader->d->deleteCLuceneReader = false; // clucene takes ownership 68 76 d->field = new lucene::document::Field(fieldName, reader->d->reader, configs); 69 77 70 78 delete [] fieldName; 71 79 } -
trunk/tools/assistant/lib/fulltextsearch/qfield_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qfilter.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 27 34 { 28 35 filter = _CL_POINTER(other.filter); 36 deleteCLuceneFilter = other.deleteCLuceneFilter; 29 37 } 30 38 -
trunk/tools/assistant/lib/fulltextsearch/qfilter_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qhits.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 23 30 deleteCLuceneHits = true; 24 31 } 25 32 26 33 QCLuceneHitsPrivate::QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other) 27 34 : QSharedData() 28 35 { 29 36 hits = _CL_POINTER(other.hits); 37 deleteCLuceneHits = other.deleteCLuceneHits; 30 38 } 31 39 … … 37 45 38 46 39 QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, 47 QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, 40 48 const QCLuceneQuery &query, const QCLuceneFilter &filter) 41 49 : d(new QCLuceneHitsPrivate()) -
trunk/tools/assistant/lib/fulltextsearch/qhits_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qindexreader.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 28 35 { 29 36 reader = _CL_POINTER(other.reader); 37 deleteCLuceneIndexReader = other.deleteCLuceneIndexReader; 30 38 } 31 39 -
trunk/tools/assistant/lib/fulltextsearch/qindexreader_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qindexwriter.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 28 35 { 29 36 writer = _CL_POINTER(other.writer); 37 deleteCLuceneIndexWriter = other.deleteCLuceneIndexWriter; 30 38 } 31 39 -
trunk/tools/assistant/lib/fulltextsearch/qindexwriter_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qquery.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 29 36 { 30 37 query = _CL_POINTER(other.query); 38 deleteCLuceneQuery = other.deleteCLuceneQuery; 31 39 } 32 40 -
trunk/tools/assistant/lib/fulltextsearch/qquery_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qqueryparser.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 29 36 { 30 37 queryParser = _CL_POINTER(other.queryParser); 38 deleteCLuceneQueryParser = other.deleteCLuceneQueryParser; 31 39 } 32 40 … … 38 46 39 47 40 QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, 48 QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, 41 49 QCLuceneAnalyzer &analyzer) 42 50 : d(new QCLuceneQueryParserPrivate()) … … 45 53 { 46 54 TCHAR *fieldName = QStringToTChar(field); 47 48 d->queryParser = new lucene::queryParser::QueryParser(fieldName, 55 56 d->queryParser = new lucene::queryParser::QueryParser(fieldName, 49 57 analyzer.d->analyzer); 50 58 … … 114 122 } 115 123 116 QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, 124 QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, 117 125 const QStringList &fieldList, 118 126 QCLuceneAnalyzer &analyzer) … … 144 152 qint32 flag = flags.at(i); 145 153 switch (flag) { 146 case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: { 154 case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: { 147 155 retValue->add(q, true, true, false); 148 156 } break; -
trunk/tools/assistant/lib/fulltextsearch/qqueryparser_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qreader.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 17 24 QT_BEGIN_NAMESPACE 18 25 19 QCLuceneReaderPrivate::QCLuceneReaderPrivate() 26 QCLuceneReaderPrivate::QCLuceneReaderPrivate() 20 27 : QSharedData() 21 { 22 reader = 0; 28 { 29 reader = 0; 23 30 deleteCLuceneReader = true; 24 31 } … … 26 33 QCLuceneReaderPrivate::QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other) 27 34 : QSharedData() 28 { 29 reader = _CL_POINTER(other.reader); 35 { 36 reader = _CL_POINTER(other.reader); 37 deleteCLuceneReader = other.deleteCLuceneReader; 30 38 } 31 39 32 QCLuceneReaderPrivate::~QCLuceneReaderPrivate() 33 { 40 QCLuceneReaderPrivate::~QCLuceneReaderPrivate() 41 { 34 42 if (deleteCLuceneReader) 35 43 _CLDECDELETE(reader); 36 44 } 37 38 45 39 46 QCLuceneReader::QCLuceneReader() … … 63 70 } 64 71 65 QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, 72 QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, 66 73 bool copyData) 67 74 : QCLuceneReader() -
trunk/tools/assistant/lib/fulltextsearch/qreader_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 45 52 { 46 53 public: 47 QCLuceneReaderPrivate(); 54 QCLuceneReaderPrivate(); 48 55 QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other); 49 56 50 57 ~QCLuceneReaderPrivate(); 51 58 52 59 Reader* reader; 53 60 bool deleteCLuceneReader; -
trunk/tools/assistant/lib/fulltextsearch/qsearchable.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 ** 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 27 34 { 28 35 searchable = _CL_POINTER(other.searchable); 36 deleteCLuceneSearchable = other.deleteCLuceneSearchable; 29 37 } 30 38 … … 64 72 } 65 73 66 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 74 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 67 75 const QCLuceneFilter &filter) 68 76 { … … 70 78 } 71 79 72 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 80 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 73 81 const QCLuceneSort &sort) 74 82 { … … 76 84 } 77 85 78 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 86 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 79 87 const QCLuceneFilter &filter, 80 88 const QCLuceneSort &sort) … … 87 95 : QCLuceneSearcher() 88 96 { 89 lucene::search::IndexSearcher *searcher = 97 lucene::search::IndexSearcher *searcher = 90 98 new lucene::search::IndexSearcher(path); 91 99 … … 132 140 : QCLuceneSearcher() 133 141 { 134 lucene::search::Searchable** list= 142 lucene::search::Searchable** list= 135 143 _CL_NEWARRAY(lucene::search::Searchable*, searchables.count()); 136 144 … … 162 170 if (searcher == 0) 163 171 return 0; 164 172 165 173 return qint32(searcher->subDoc(int32_t(index))); 166 174 } … … 173 181 if (searcher == 0) 174 182 return 0; 175 183 176 184 return qint32(searcher->subSearcher(int32_t(index))); 177 185 } … … 184 192 if (searcher == 0) 185 193 return 0; 186 194 187 195 return qint32(searcher->searcherIndex(int32_t(index))); 188 196 } -
trunk/tools/assistant/lib/fulltextsearch/qsearchable_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qsort.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 28 35 { 29 36 sort = _CL_POINTER(other.sort); 37 deleteCLuceneSort = other.deleteCLuceneSort; 30 38 } 31 39 -
trunk/tools/assistant/lib/fulltextsearch/qsort_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qterm.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 28 35 { 29 36 term = _CL_POINTER(other.term); 37 deleteCLuceneTerm = other.deleteCLuceneTerm; 30 38 } 31 39 -
trunk/tools/assistant/lib/fulltextsearch/qterm_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qtoken.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 28 35 { 29 36 token = _CL_POINTER(other.token); 37 deleteCLuceneToken = other.deleteCLuceneToken; 30 38 } 31 39 -
trunk/tools/assistant/lib/fulltextsearch/qtoken_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qtokenizer.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qtokenizer_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/fulltextsearch/qtokenstream.cpp
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ … … 27 34 { 28 35 tokenStream = _CL_POINTER(other.tokenStream); 36 deleteCLuceneTokenStream = other.deleteCLuceneTokenStream; 29 37 } 30 38 -
trunk/tools/assistant/lib/fulltextsearch/qtokenstream_p.h
r2 r561 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 200 9 Nokia Corporation and/or its subsidiary(-ies).4 ** Contact: Qt Software Information (qt-info@nokia.com)3 ** Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team. 4 ** All rights reserved. 5 5 ** 6 ** This file is part of the QCLucene library and is distributable under 7 ** the terms of the LGPL license as specified in the license.txt file. 6 ** Portion Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 7 ** All rights reserved. 8 ** 9 ** This file may be used under the terms of the GNU Lesser General Public 10 ** License version 2.1 as published by the Free Software Foundation and 11 ** appearing in the file LICENSE.LGPL included in the packaging of this file. 12 ** Please review the following information to ensure the GNU Lesser General 13 ** Public License version 2.1 requirements will be met: 14 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 8 15 ** 9 16 ****************************************************************************/ -
trunk/tools/assistant/lib/lib.pro
r552 r561 1 QT += sql xml network 1 QT += sql \ 2 xml \ 3 network 2 4 TEMPLATE = lib 3 5 TARGET = QtHelp 4 DEFINES += QHELP_LIB QT_CLUCENE_SUPPORT 5 CONFIG += qt warn_on 6 6 DEFINES += QHELP_LIB \ 7 QT_CLUCENE_SUPPORT 8 CONFIG += qt \ 9 warn_on 7 10 include(../../../src/qbase.pri) 8 9 11 QMAKE_TARGET_PRODUCT = Help 10 QMAKE_TARGET_DESCRIPTION = Help application framework. 12 QMAKE_TARGET_DESCRIPTION = Help \ 13 application \ 14 framework. 11 15 DEFINES -= QT_ASCII_CAST_WARNINGS 12 13 16 qclucene = QtCLucene$${QT_LIBINFIX} 14 if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { 17 if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { 15 18 mac:qclucene = $${qclucene}_debug 16 19 win32|os2:qclucene = $${qclucene}d 17 20 } 18 linux-lsb-g++:LIBS += --lsb-shared-libs=$$qclucene 19 unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork QtSql QtXml 20 LIBS += -l$$qclucene 21 unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork QtSql QtXml 21 linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene 22 unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \ 23 QtSql \ 24 QtXml 25 LIBS_PRIVATE += -l$$qclucene 22 26 23 27 RESOURCES += helpsystem.qrc 24 25 28 SOURCES += qhelpenginecore.cpp \ 26 qhelpengine.cpp \ 27 qhelpdbreader.cpp \ 28 qhelpcontentwidget.cpp \ 29 qhelpindexwidget.cpp \ 30 qhelpgenerator.cpp \ 31 qhelpdatainterface.cpp \ 32 qhelpprojectdata.cpp \ 33 qhelpcollectionhandler.cpp \ 34 qhelpsearchengine.cpp \ 35 qhelpsearchquerywidget.cpp \ 36 qhelpsearchresultwidget.cpp \ 37 qhelpsearchindex_default.cpp \ 38 qhelpsearchindexwriter_default.cpp \ 39 qhelpsearchindexreader_default.cpp 29 qhelpengine.cpp \ 30 qhelpdbreader.cpp \ 31 qhelpcontentwidget.cpp \ 32 qhelpindexwidget.cpp \ 33 qhelpgenerator.cpp \ 34 qhelpdatainterface.cpp \ 35 qhelpprojectdata.cpp \ 36 qhelpcollectionhandler.cpp \ 37 qhelpsearchengine.cpp \ 38 qhelpsearchquerywidget.cpp \ 39 qhelpsearchresultwidget.cpp \ 40 qhelpsearchindex_default.cpp \ 41 qhelpsearchindexwriter_default.cpp \ 42 qhelpsearchindexreader_default.cpp \ 43 qhelpsearchindexreader.cpp \ 44 qhelp_global.cpp 40 45 41 46 # access to clucene 42 47 SOURCES += qhelpsearchindexwriter_clucene.cpp \ 43 qhelpsearchindexreader_clucene.cpp 44 48 qhelpsearchindexreader_clucene.cpp 45 49 HEADERS += qhelpenginecore.h \ 46 qhelpengine.h \ 47 qhelpengine_p.h \ 48 qhelp_global.h \ 49 qhelpdbreader_p.h \ 50 qhelpcontentwidget.h \ 51 qhelpindexwidget.h \ 52 qhelpgenerator_p.h \ 53 qhelpdatainterface_p.h \ 54 qhelpprojectdata_p.h \ 55 qhelpcollectionhandler_p.h \ 56 qhelpsearchengine.h \ 57 qhelpsearchquerywidget.h \ 58 qhelpsearchresultwidget.h \ 59 qhelpsearchindex_default_p.h \ 60 qhelpsearchindexwriter_default_p.h \ 61 qhelpsearchindexreader_default_p.h 50 qhelpengine.h \ 51 qhelpengine_p.h \ 52 qhelp_global.h \ 53 qhelpdbreader_p.h \ 54 qhelpcontentwidget.h \ 55 qhelpindexwidget.h \ 56 qhelpgenerator_p.h \ 57 qhelpdatainterface_p.h \ 58 qhelpprojectdata_p.h \ 59 qhelpcollectionhandler_p.h \ 60 qhelpsearchengine.h \ 61 qhelpsearchquerywidget.h \ 62 qhelpsearchresultwidget.h \ 63 qhelpsearchindex_default_p.h \ 64 qhelpsearchindexwriter_default_p.h \ 65 qhelpsearchindexreader_default_p.h \ 66 qhelpsearchindexreader_p.h 62 67 63 68 # access to clucene 64 69 HEADERS += qhelpsearchindexwriter_clucene_p.h \ 65 70 qhelpsearchindexreader_clucene_p.h -
trunk/tools/assistant/lib/qhelp_global.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 46 46 #include <QtCore/QString> 47 47 #include <QtCore/QObject> 48 #include <QtCore/QRegExp>49 #include <QtCore/QMutexLocker>50 #include <QtGui/QTextDocument>51 48 52 49 QT_BEGIN_HEADER … … 66 63 class QHelpGlobal { 67 64 public: 68 static QString uniquifyConnectionName(const QString &name, void *pointer) 69 { 70 static int counter = 0; 71 static QMutex mutex; 65 static QString uniquifyConnectionName(const QString &name, void *pointer); 66 static QString documentTitle(const QString &content); 67 static QString codecFromData(const QByteArray &data); 72 68 73 QMutexLocker locker(&mutex); 74 if (++counter > 1000) 75 counter = 0; 76 77 return QString::fromLatin1("%1-%2-%3") 78 .arg(name).arg(long(pointer)).arg(counter); 79 }; 80 81 static QString documentTitle(const QString &content) 82 { 83 QString title = QObject::tr("Untitled"); 84 if (!content.isEmpty()) { 85 int start = content.indexOf(QLatin1String("<title>"), 0, Qt::CaseInsensitive) + 7; 86 int end = content.indexOf(QLatin1String("</title>"), 0, Qt::CaseInsensitive); 87 if ((end - start) > 0) { 88 title = content.mid(start, end - start); 89 if (Qt::mightBeRichText(title) || title.contains(QLatin1Char('&'))) { 90 QTextDocument doc; 91 doc.setHtml(title); 92 title = doc.toPlainText(); 93 } 94 } 95 } 96 return title; 97 }; 98 99 static QString charsetFromData(const QByteArray &data) 100 { 101 QString content = QString::fromUtf8(data.constData(), data.size()); 102 int start = 103 content.indexOf(QLatin1String("<meta"), 0, Qt::CaseInsensitive); 104 if (start > 0) { 105 int end; 106 QRegExp r(QLatin1String("charset=([^\"\\s]+)")); 107 while (start != -1) { 108 end = content.indexOf(QLatin1Char('>'), start) + 1; 109 const QString &meta = content.mid(start, end - start).toLower(); 110 if (r.indexIn(meta) != -1) 111 return r.cap(1); 112 start = content.indexOf(QLatin1String("<meta"), end, 113 Qt::CaseInsensitive); 114 } 115 } 116 return QLatin1String("utf-8"); 117 } 69 private: 70 static QString codecFromHtmlData(const QByteArray &data); 71 static QString codecFromXmlData(const QByteArray &data); 118 72 }; 119 73 -
trunk/tools/assistant/lib/qhelpcollectionhandler.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 77 77 if (m_dbOpened) 78 78 return true; 79 emit error(tr("The collection file is not set up yet!")); 79 emit error(tr("The collection file '%1' is not set up yet!"). 80 arg(m_collectionFile)); 80 81 return false; 81 82 } … … 135 136 QFileInfo fi(fileName); 136 137 if (fi.exists()) { 137 emit error(tr("The specified collection file already exists!")); 138 emit error(tr("The collection file '%1' already exists!"). 139 arg(fileName)); 138 140 return false; 139 141 } … … 282 284 283 285 if (filterNameId < 0) { 284 emit error(tr("Unknown filter !"));286 emit error(tr("Unknown filter '%1'!").arg(filterName)); 285 287 return false; 286 288 } … … 387 389 QString ns = reader.namespaceName(); 388 390 if (ns.isEmpty()) { 389 emit error(tr("Invalid documentation file !"));391 emit error(tr("Invalid documentation file '%1'!").arg(fileName)); 390 392 return false; 391 393 } … … 554 556 namespaceId = m_query.lastInsertId().toInt(); 555 557 if (namespaceId < 1) { 556 emit error(tr("Cannot register namespace !"));558 emit error(tr("Cannot register namespace '%1'!").arg(nspace)); 557 559 return -1; 558 560 } … … 578 580 if (!db.open()) { 579 581 QSqlDatabase::removeDatabase(QLatin1String("optimize")); 580 emit error(tr("Cannot open database to optimize!"));582 emit error(tr("Cannot open database '%1' to optimize!").arg(fileName)); 581 583 return; 582 584 } -
trunk/tools/assistant/lib/qhelpcollectionhandler_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpcontentwidget.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 519 519 header()->hide(); 520 520 setUniformRowHeights(true); 521 connect(this, SIGNAL(activated( const QModelIndex&)),522 this, SLOT(showLink( const QModelIndex&)));521 connect(this, SIGNAL(activated(QModelIndex)), 522 this, SLOT(showLink(QModelIndex))); 523 523 } 524 524 -
trunk/tools/assistant/lib/qhelpcontentwidget.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpdatainterface.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpdatainterface_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpdbreader.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 93 93 db.setDatabaseName(m_dbName); 94 94 if (!db.open()) { 95 /*: The placeholders are: %1 - The name of the database which cannot be opened 96 %2 - The unique id for the connection 97 %3 - The actual error string */ 95 98 m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text()); 96 99 QSqlDatabase::removeDatabase(m_uniqueId); -
trunk/tools/assistant/lib/qhelpdbreader_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpengine.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 81 81 connect(helpEngineCore, SIGNAL(setupFinished()), 82 82 this, SLOT(applyCurrentFilter())); 83 connect(helpEngineCore, SIGNAL(currentFilterChanged( const QString&)),83 connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)), 84 84 this, SLOT(applyCurrentFilter())); 85 85 -
trunk/tools/assistant/lib/qhelpengine.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpengine_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpenginecore.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 67 67 q = helpEngineCore; 68 68 collectionHandler = new QHelpCollectionHandler(collectionFile, helpEngineCore); 69 connect(collectionHandler, SIGNAL(error( const QString&)),70 this, SLOT(errorReceived( const QString&)));69 connect(collectionHandler, SIGNAL(error(QString)), 70 this, SLOT(errorReceived(QString))); 71 71 needsSetup = true; 72 72 } … … 176 176 indices or contents. If you need one of those use QHelpEngine 177 177 instead. 178 179 When creating a custom help viewer the viewer can be 180 configured by writing a custom collection file which could contain various 181 keywords to be used to configure the help engine. These keywords and values 182 and their meaning can be found in the help information for 183 \l{assistant-custom-help-viewer.html#creating-a-custom-help-collection-file} 184 {creating a custom help collection file} for Assistant. 178 185 */ 179 186 … … 353 360 QString QHelpEngineCore::documentationFileName(const QString &namespaceName) 354 361 { 355 QString res; 356 if (!d->setup()) 357 return res; 358 const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations(); 359 foreach(const QHelpCollectionHandler::DocInfo info, docList) { 360 if (info.namespaceName == namespaceName) { 361 QFileInfo fi(d->collectionHandler->collectionFile()); 362 fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName); 363 res = QDir::cleanPath(fi.absoluteFilePath()); 364 break; 362 if (d->setup()) { 363 const QHelpCollectionHandler::DocInfoList docList = 364 d->collectionHandler->registeredDocumentations(); 365 foreach(const QHelpCollectionHandler::DocInfo info, docList) { 366 if (info.namespaceName == namespaceName) { 367 if (QDir::isAbsolutePath(info.fileName)) 368 return QDir::cleanPath(info.fileName); 369 370 QFileInfo fi(d->collectionHandler->collectionFile()); 371 fi.setFile(fi.absolutePath() + QDir::separator() + info.fileName); 372 return QDir::cleanPath(fi.absoluteFilePath()); 373 } 365 374 } 366 375 } 367 return res;376 return QString(); 368 377 } 369 378 -
trunk/tools/assistant/lib/qhelpenginecore.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpgenerator.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 468 468 emit statusChanged(tr("Insert files...")); 469 469 QList<int> filterAtts; 470 foreach (QString filterAtt, filterAttributes) { 471 d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?")); 470 foreach (const QString &filterAtt, filterAttributes) { 471 d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable " 472 "WHERE Name=?")); 472 473 d->query->bindValue(0, filterAtt); 473 474 d->query->exec(); … … 483 484 return false; 484 485 ++filterSetId; 485 foreach (int attId, filterAtts) { 486 d->query->prepare(QLatin1String("INSERT INTO FileAttributeSetTable VALUES(?, ?)")); 486 foreach (const int &attId, filterAtts) { 487 d->query->prepare(QLatin1String("INSERT INTO FileAttributeSetTable " 488 "VALUES(?, ?)")); 487 489 d->query->bindValue(0, filterSetId); 488 490 d->query->bindValue(1, attId); 489 491 d->query->exec(); 490 492 } 491 492 QString title;493 QString charSet;494 QMap<int, QSet<int> > tmpFileFilterMap;495 QList<FileNameTableData> fileNameDataList;496 QList<QByteArray> fileDataList;497 493 498 494 int tableFileId = 1; … … 501 497 tableFileId = d->query->value(0).toInt() + 1; 502 498 499 QString title; 500 QString charSet; 503 501 FileNameTableData fileNameData; 502 QList<QByteArray> fileDataList; 503 QMap<int, QSet<int> > tmpFileFilterMap; 504 QList<FileNameTableData> fileNameDataList; 504 505 505 506 int i = 0; 506 foreach (QString file, files) { 507 QFileInfo fi(rootPath + QDir::separator() + file); 507 foreach (const QString &file, files) { 508 const QString fileName = QDir::cleanPath(file); 509 if (fileName.startsWith(QLatin1String("../"))) { 510 emit warning(tr("The referenced file %1 must be inside or within a " 511 "subdirectory of (%2). Skipping it.").arg(fileName).arg(rootPath)); 512 continue; 513 } 514 515 QFile fi(rootPath + QDir::separator() + fileName); 508 516 if (!fi.exists()) { 509 517 emit warning(tr("The file %1 does not exist! Skipping it.") 510 .arg( fi.absoluteFilePath()));518 .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName))); 511 519 continue; 512 520 } 513 521 514 QFile f(fi.absoluteFilePath()); 515 if (!f.open(QIODevice::ReadOnly)) { 522 if (!fi.open(QIODevice::ReadOnly)) { 516 523 emit warning(tr("Cannot open file %1! Skipping it.") 517 .arg( fi.absoluteFilePath()));524 .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName))); 518 525 continue; 519 526 } 520 527 521 title.clear(); 522 QByteArray data; 523 data = f.readAll(); 524 525 if (fi.suffix() == QLatin1String("html") || fi.suffix() == QLatin1String("htm")) { 526 charSet = QHelpGlobal::charsetFromData(data); 527 QTextStream stream(&data); 528 stream.setCodec(QTextCodec::codecForName(charSet.toLatin1().constData())); 529 title = QHelpGlobal::documentTitle(stream.readAll()); 528 QByteArray data = fi.readAll(); 529 if (fileName.endsWith(QLatin1String(".html")) 530 || fileName.endsWith(QLatin1String(".htm"))) { 531 charSet = QHelpGlobal::codecFromData(data); 532 QTextStream stream(&data); 533 stream.setCodec(QTextCodec::codecForName(charSet.toLatin1().constData())); 534 title = QHelpGlobal::documentTitle(stream.readAll()); 530 535 } else { 531 title = fi.fileName(); 532 } 533 534 QString fName = QDir::cleanPath(file); 535 if (fName.startsWith(QLatin1String("./"))) 536 fName = fName.mid(2); 536 title = fileName.mid(fileName.lastIndexOf(QLatin1Char('/')) + 1); 537 } 537 538 538 539 int fileId = -1; 539 if (!d->fileMap.contains(f Name)) {540 if (!d->fileMap.contains(fileName)) { 540 541 fileDataList.append(qCompress(data)); 541 542 542 fileNameData.name = f Name;543 fileNameData.name = fileName; 543 544 fileNameData.fileId = tableFileId; 544 545 fileNameData.title = title; 545 546 fileNameDataList.append(fileNameData); 546 547 547 d->fileMap.insert(f Name, tableFileId);548 d->fileMap.insert(fileName, tableFileId); 548 549 d->fileFilterMap.insert(tableFileId, filterAtts.toSet()); 549 550 tmpFileFilterMap.insert(tableFileId, filterAtts.toSet()); … … 551 552 ++tableFileId; 552 553 } else { 553 fileId = d->fileMap.value(f Name);554 foreach ( intfilter, filterAtts) {554 fileId = d->fileMap.value(fileName); 555 foreach (const int &filter, filterAtts) { 555 556 if (!d->fileFilterMap.value(fileId).contains(filter) 556 557 && !tmpFileFilterMap.value(fileId).contains(filter)) { … … 566 567 QMap<int, QSet<int> >::const_iterator it = tmpFileFilterMap.constBegin(); 567 568 while (it != tmpFileFilterMap.constEnd()) { 568 QSet<int>::const_iterator i = it.value().constBegin(); 569 while (i != it.value().constEnd()) { 570 d->query->prepare(QLatin1String("INSERT INTO FileFilterTable VALUES(?, ?)")); 571 d->query->bindValue(0, *i); 569 QSet<int>::const_iterator si = it.value().constBegin(); 570 while (si != it.value().constEnd()) { 571 d->query->prepare(QLatin1String("INSERT INTO FileFilterTable " 572 "VALUES(?, ?)")); 573 d->query->bindValue(0, *si); 572 574 d->query->bindValue(1, it.key()); 573 575 d->query->exec(); 574 ++ i;576 ++si; 575 577 } 576 578 ++it; … … 579 581 QList<QByteArray>::const_iterator fileIt = fileDataList.constBegin(); 580 582 while (fileIt != fileDataList.constEnd()) { 581 d->query->prepare(QLatin1String("INSERT INTO FileDataTable VALUES (Null, ?)")); 583 d->query->prepare(QLatin1String("INSERT INTO FileDataTable VALUES " 584 "(Null, ?)")); 582 585 d->query->bindValue(0, *fileIt); 583 586 d->query->exec(); … … 587 590 } 588 591 589 QList<FileNameTableData>::const_iterator fileNameIt = fileNameDataList.constBegin(); 592 QList<FileNameTableData>::const_iterator fileNameIt = 593 fileNameDataList.constBegin(); 590 594 while (fileNameIt != fileNameDataList.constEnd()) { 591 d->query->prepare(QLatin1String("INSERT INTO FileNameTable (FolderId, Name, FileId, Title)"592 " VALUES (?, ?, ?, ?)"));595 d->query->prepare(QLatin1String("INSERT INTO FileNameTable " 596 "(FolderId, Name, FileId, Title) VALUES (?, ?, ?, ?)")); 593 597 d->query->bindValue(0, 1); 594 598 d->query->bindValue(1, (*fileNameIt).name); … … 610 614 } 611 615 612 bool QHelpGenerator::registerCustomFilter(const QString &filterName, const QStringList &filterAttribs,613 616 bool QHelpGenerator::registerCustomFilter(const QString &filterName, 617 const QStringList &filterAttribs, bool forceUpdate) 614 618 { 615 619 if (!d->query) -
trunk/tools/assistant/lib/qhelpgenerator_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpindexwidget.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 131 131 m_mutex.unlock(); 132 132 wait(); 133 m_abort = false; 133 134 } 134 135 … … 165 166 m_mutex.lock(); 166 167 if (m_abort) { 167 m_abort = false;168 168 m_mutex.unlock(); 169 169 return; … … 182 182 indicesSet.insert(s); 183 183 if (m_abort) { 184 m_abort = false;185 184 m_mutex.unlock(); 186 185 return; … … 195 194 m_indices = indicesSet.values(); 196 195 qSort(m_indices.begin(), m_indices.end(), caseInsensitiveLessThan); 197 m_abort = false;198 196 m_mutex.unlock(); 199 197 } … … 392 390 setEditTriggers(QAbstractItemView::NoEditTriggers); 393 391 setUniformItemSizes(true); 394 connect(this, SIGNAL(activated( const QModelIndex&)),395 this, SLOT(showLink( const QModelIndex&)));392 connect(this, SIGNAL(activated(QModelIndex)), 393 this, SLOT(showLink(QModelIndex))); 396 394 } 397 395 -
trunk/tools/assistant/lib/qhelpindexwidget.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpprojectdata.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 42 42 #include "qhelpprojectdata_p.h" 43 43 44 #include <QtCore/QDir> 44 45 #include <QtCore/QFileInfo> 45 46 #include <QtCore/QStack> 46 47 #include <QtCore/QMap> 48 #include <QtCore/QRegExp> 47 49 #include <QtCore/QVariant> 48 50 #include <QtXml/QXmlStreamReader> … … 74 76 void readFiles(); 75 77 void raiseUnknownTokenError(); 78 void addMatchingFiles(const QString &pattern); 79 80 QMap<QString, QStringList> dirEntriesCache; 76 81 }; 77 82 … … 162 167 if (isStartElement()) { 163 168 if (name() == QLatin1String("filterAttribute")) 164 filterSectionList.last().addFilterAttribute(readElementText()); 169 filterSectionList.last().addFilterAttribute(readElementText()); 165 170 else if (name() == QLatin1String("toc")) 166 171 readTOC(); … … 245 250 if (isStartElement()) { 246 251 if (name() == QLatin1String("file")) 247 filterSectionList.last().addFile(readElementText());252 addMatchingFiles(readElementText()); 248 253 else 249 254 raiseUnknownTokenError(); … … 259 264 } 260 265 261 266 // Expand file pattern and add matches into list. If the pattern does not match 267 // any files, insert the pattern itself so the QHelpGenerator will emit a 268 // meaningful warning later. 269 void QHelpProjectDataPrivate::addMatchingFiles(const QString &pattern) 270 { 271 // The pattern matching is expensive, so we skip it if no 272 // wildcard symbols occur in the string. 273 if (!pattern.contains('?') && !pattern.contains('*') 274 && !pattern.contains('[') && !pattern.contains(']')) { 275 filterSectionList.last().addFile(pattern); 276 return; 277 } 278 279 QFileInfo fileInfo(rootPath + '/' + pattern); 280 const QDir &dir = fileInfo.dir(); 281 const QString &path = dir.canonicalPath(); 282 283 // QDir::entryList() is expensive, so we cache the results. 284 QMap<QString, QStringList>::ConstIterator it = dirEntriesCache.find(path); 285 const QStringList &entries = it != dirEntriesCache.constEnd() ? 286 it.value() : dir.entryList(QDir::Files); 287 if (it == dirEntriesCache.constEnd()) 288 dirEntriesCache.insert(path, entries); 289 290 bool matchFound = false; 291 #ifdef Q_OS_WIN 292 Qt::CaseSensitivity cs = Qt::CaseInsensitive; 293 #else 294 Qt::CaseSensitivity cs = Qt::CaseSensitive; 295 #endif 296 QRegExp regExp(fileInfo.fileName(), cs, QRegExp::Wildcard); 297 foreach (const QString &file, entries) { 298 if (regExp.exactMatch(file)) { 299 matchFound = true; 300 filterSectionList.last(). 301 addFile(QFileInfo(pattern).dir().path() + '/' + file); 302 } 303 } 304 if (!matchFound) 305 filterSectionList.last().addFile(pattern); 306 } 262 307 263 308 /*! … … 325 370 326 371 /*! 327 \ reimp372 \internal 328 373 */ 329 374 QString QHelpProjectData::namespaceName() const … … 333 378 334 379 /*! 335 \ reimp380 \internal 336 381 */ 337 382 QString QHelpProjectData::virtualFolder() const … … 341 386 342 387 /*! 343 \ reimp388 \internal 344 389 */ 345 390 QList<QHelpDataCustomFilter> QHelpProjectData::customFilters() const … … 349 394 350 395 /*! 351 \ reimp396 \internal 352 397 */ 353 398 QList<QHelpDataFilterSection> QHelpProjectData::filterSections() const … … 357 402 358 403 /*! 359 \ reimp404 \internal 360 405 */ 361 406 QMap<QString, QVariant> QHelpProjectData::metaData() const … … 365 410 366 411 /*! 367 \ reimp412 \internal 368 413 */ 369 414 QString QHelpProjectData::rootPath() const -
trunk/tools/assistant/lib/qhelpprojectdata_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpsearchengine.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 45 45 #include "qhelpsearchresultwidget.h" 46 46 47 #include "qhelpsearchindexreader_p.h" 47 48 #if defined(QT_CLUCENE_SUPPORT) 48 49 # include "qhelpsearchindexreader_clucene_p.h" … … 85 86 , helpEngine(helpEngine) 86 87 { 87 hitList.clear();88 88 indexReader = 0; 89 89 indexWriter = 0; … … 92 92 ~QHelpSearchEnginePrivate() 93 93 { 94 hitList.clear();95 94 delete indexReader; 96 95 delete indexWriter; 97 96 } 98 97 99 int hit sCount() const98 int hitCount() const 100 99 { 101 100 int count = 0; 102 101 if (indexReader) 103 count = indexReader->hit sCount();102 count = indexReader->hitCount(); 104 103 105 104 return count; … … 108 107 QList<QHelpSearchEngine::SearchHit> hits(int start, int end) const 109 108 { 110 QList<QHelpSearchEngine::SearchHit> returnValue; 111 if (indexReader) { 112 for (int i = start; i < end && i < hitsCount(); ++i) 113 returnValue.append(indexReader->hit(i)); 114 } 115 return returnValue; 109 return indexReader ? 110 indexReader->hits(start, end) : 111 QList<QHelpSearchEngine::SearchHit>(); 116 112 } 117 113 … … 132 128 } 133 129 134 if (indexWriter) { 135 indexWriter->cancelIndexing(); 136 indexWriter->updateIndex(helpEngine->collectionFile(), 137 indexFilesFolder(), reindex); 138 } 130 indexWriter->cancelIndexing(); 131 indexWriter->updateIndex(helpEngine->collectionFile(), 132 indexFilesFolder(), reindex); 139 133 } 140 134 … … 154 148 155 149 if (!indexReader) { 156 indexReader = new QHelpSearchIndexReader(); 157 150 #if defined(QT_CLUCENE_SUPPORT) 151 indexReader = new QHelpSearchIndexReaderClucene(); 152 #else 153 indexReader = new QHelpSearchIndexReaderDefault(); 154 #endif // QT_CLUCENE_SUPPORT 158 155 connect(indexReader, SIGNAL(searchingStarted()), this, SIGNAL(searchingStarted())); 159 156 connect(indexReader, SIGNAL(searchingFinished(int)), this, SIGNAL(searchingFinished(int))); 160 157 } 161 158 162 if (indexReader) { 163 m_queryList = queryList; 164 indexReader->cancelSearching(); 165 indexReader->search(helpEngine->collectionFile(), indexFilesFolder(), queryList); 166 } 159 m_queryList = queryList; 160 indexReader->cancelSearching(); 161 indexReader->search(helpEngine->collectionFile(), indexFilesFolder(), queryList); 167 162 } 168 163 … … 190 185 #if defined(QT_CLUCENE_SUPPORT) 191 186 if (indexWriter && !helpEngine.isNull()) { 192 indexWriter->optimizeIndex(); 187 indexWriter->optimizeIndex(); 193 188 } 194 189 #endif … … 201 196 QHelpSearchResultWidget *resultWidget; 202 197 203 QHelpSearchIndexReader *indexReader;198 qt::fulltextsearch::QHelpSearchIndexReader *indexReader; 204 199 QHelpSearchIndexWriter *indexWriter; 205 200 206 201 QPointer<QHelpEngineCore> helpEngine; 207 QList<QHelpSearchEngine::SearchHit> hitList;208 202 209 203 QList<QHelpSearchQuery> m_queryList; … … 244 238 245 239 \value DEFAULT the default field provided by the search widget, several terms should be 246 split ted and stored in the wordlist except search terms enclosed in quotes.240 split and stored in the word list except search terms enclosed in quotes. 247 241 \value FUZZY a field only provided in use with clucene. Terms should be split in seperate 248 242 words and passed to the search engine. … … 331 325 { 332 326 d = new QHelpSearchEnginePrivate(helpEngine); 333 327 334 328 connect(helpEngine, SIGNAL(setupFinished()), this, SLOT(indexDocumentation())); 335 329 … … 372 366 373 367 /*! 368 \obsolete 374 369 Returns the amount of hits the search engine found. 370 \sa hitCount() 375 371 */ 376 372 int QHelpSearchEngine::hitsCount() const 377 373 { 378 return d->hitsCount(); 374 return d->hitCount(); 375 } 376 377 /*! 378 \since 4.6 379 Returns the amount of hits the search engine found. 380 */ 381 int QHelpSearchEngine::hitCount() const 382 { 383 return d->hitCount(); 379 384 } 380 385 -
trunk/tools/assistant/lib/qhelpsearchengine.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 87 87 QHelpSearchResultWidget* resultWidget(); 88 88 89 int hitsCount() const; 89 #ifdef QT_DEPRECATED 90 QT_DEPRECATED int hitsCount() const; 91 #endif 92 int hitCount() const; 90 93 91 94 typedef QPair<QString, QString> SearchHit; -
trunk/tools/assistant/lib/qhelpsearchindex_default.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpsearchindex_default_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 60 60 namespace clucene { 61 61 62 QHelpSearchIndexReader::QHelpSearchIndexReader() 63 : QThread() 64 , m_cancel(false) 62 QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() 63 : QHelpSearchIndexReader() 65 64 { 66 65 // nothing todo 67 66 } 68 67 69 QHelpSearchIndexReader::~QHelpSearchIndexReader() 70 { 71 mutex.lock(); 72 this->m_cancel = true; 73 waitCondition.wakeOne(); 74 mutex.unlock(); 75 76 wait(); 77 } 78 79 void QHelpSearchIndexReader::cancelSearching() 80 { 81 mutex.lock(); 82 this->m_cancel = true; 83 mutex.unlock(); 84 } 85 86 void QHelpSearchIndexReader::search(const QString &collectionFile, const QString &indexFilesFolder, 87 const QList<QHelpSearchQuery> &queryList) 88 { 89 QMutexLocker lock(&mutex); 90 91 this->hitList.clear(); 92 this->m_cancel = false; 93 this->m_query = queryList; 94 this->m_collectionFile = collectionFile; 95 this->m_indexFilesFolder = indexFilesFolder; 96 97 start(QThread::NormalPriority); 98 } 99 100 int QHelpSearchIndexReader::hitsCount() const 101 { 102 return hitList.count(); 103 } 104 105 QHelpSearchEngine::SearchHit QHelpSearchIndexReader::hit(int index) const 106 { 107 return hitList.at(index); 108 } 109 110 void QHelpSearchIndexReader::run() 68 QHelpSearchIndexReaderClucene::~QHelpSearchIndexReaderClucene() 69 { 70 } 71 72 73 void QHelpSearchIndexReaderClucene::run() 111 74 { 112 75 mutex.lock(); … … 214 177 #if !defined(QT_NO_EXCEPTIONS) 215 178 } catch(...) { 179 mutex.lock(); 216 180 hitList.clear(); 181 mutex.unlock(); 217 182 emit searchingFinished(0); 218 183 } … … 221 186 } 222 187 223 bool QHelpSearchIndexReader ::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery,188 bool QHelpSearchIndexReaderClucene::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, 224 189 QCLuceneStandardAnalyzer &analyzer) 225 190 { … … 238 203 } 239 204 240 bool QHelpSearchIndexReader ::buildQuery(QCLuceneBooleanQuery &booleanQuery,205 bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuery, 241 206 const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer) 242 207 { … … 338 303 } 339 304 340 bool QHelpSearchIndexReader ::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery,305 bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery, 341 306 const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer) 342 307 { … … 361 326 } 362 327 363 void QHelpSearchIndexReader ::boostSearchHits(const QHelpEngineCore &engine,328 void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine, 364 329 QList<QHelpSearchEngine::SearchHit> &hitList, const QList<QHelpSearchQuery> &queryList) 365 330 { … … 417 382 } while (it != hitMap.constBegin()); 418 383 boostedList += hitList.mid(count, hitList.count()); 419 384 mutex.lock(); 420 385 hitList = boostedList; 386 mutex.unlock(); 421 387 } 422 388 } -
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 54 54 // 55 55 56 #include "qhelpsearch engine.h"56 #include "qhelpsearchindexreader_p.h" 57 57 58 58 #include "fulltextsearch/qanalyzer_p.h" 59 59 #include "fulltextsearch/qquery_p.h" 60 61 #include <QtCore/QList>62 #include <QtCore/QMutex>63 #include <QtCore/QObject>64 #include <QtCore/QString>65 #include <QtCore/QThread>66 #include <QtCore/QWaitCondition>67 68 class QHelpEngineCore;69 60 70 61 QT_BEGIN_NAMESPACE … … 74 65 namespace clucene { 75 66 76 class QHelpSearchIndexReader : public QThread67 class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader 77 68 { 78 69 Q_OBJECT 79 70 80 71 public: 81 QHelpSearchIndexReader(); 82 ~QHelpSearchIndexReader(); 83 84 void cancelSearching(); 85 void search(const QString &collectionFile, 86 const QString &indexFilesFolder, 87 const QList<QHelpSearchQuery> &queryList); 88 89 int hitsCount() const; 90 QHelpSearchEngine::SearchHit hit(int index) const; 91 92 signals: 93 void searchingStarted(); 94 void searchingFinished(int hits); 72 QHelpSearchIndexReaderClucene(); 73 ~QHelpSearchIndexReaderClucene(); 95 74 96 75 private: … … 104 83 void boostSearchHits(const QHelpEngineCore &engine, QList<QHelpSearchEngine::SearchHit> &hitList, 105 84 const QList<QHelpSearchQuery> &queryList); 106 107 private:108 QMutex mutex;109 QList<QHelpSearchEngine::SearchHit> hitList;110 QWaitCondition waitCondition;111 112 bool m_cancel;113 QString m_collectionFile;114 QList<QHelpSearchQuery> m_query;115 QString m_indexFilesFolder;116 85 }; 117 86 -
trunk/tools/assistant/lib/qhelpsearchindexreader_default.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 493 493 494 494 495 QHelpSearchIndexReader::QHelpSearchIndexReader() 496 : QThread() 497 , m_cancel(false) 495 QHelpSearchIndexReaderDefault::QHelpSearchIndexReaderDefault() 496 : QHelpSearchIndexReader() 498 497 { 499 498 // nothing todo 500 499 } 501 500 502 QHelpSearchIndexReader::~QHelpSearchIndexReader() 503 { 504 mutex.lock(); 505 this->m_cancel = true; 506 waitCondition.wakeOne(); 507 mutex.unlock(); 508 509 wait(); 510 } 511 512 void QHelpSearchIndexReader::cancelSearching() 513 { 514 mutex.lock(); 515 this->m_cancel = true; 516 mutex.unlock(); 517 } 518 519 void QHelpSearchIndexReader::search(const QString &collectionFile, 520 const QString &indexFilesFolder, 521 const QList<QHelpSearchQuery> &queryList) 522 { 523 QMutexLocker lock(&mutex); 524 525 this->hitList.clear(); 526 this->m_cancel = false; 527 this->m_query = queryList; 528 this->m_collectionFile = collectionFile; 529 this->m_indexFilesFolder = indexFilesFolder; 530 531 start(QThread::NormalPriority); 532 } 533 534 int QHelpSearchIndexReader::hitsCount() const 535 { 536 return hitList.count(); 537 } 538 539 QHelpSearchEngine::SearchHit QHelpSearchIndexReader::hit(int index) const 540 { 541 return hitList.at(index); 542 } 543 544 void QHelpSearchIndexReader::run() 501 QHelpSearchIndexReaderDefault::~QHelpSearchIndexReaderDefault() 502 { 503 } 504 505 void QHelpSearchIndexReaderDefault::run() 545 506 { 546 507 mutex.lock(); … … 572 533 if (!engine.setupData()) 573 534 return; 574 535 575 536 const QStringList registeredDocs = engine.registeredDocumentations(); 576 537 const QStringList indexedNamespaces = engine.customValue(key).toString(). -
trunk/tools/assistant/lib/qhelpsearchindexreader_default_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 55 55 56 56 #include "qhelpsearchindex_default_p.h" 57 #include "qhelpsearch engine.h"57 #include "qhelpsearchindexreader_p.h" 58 58 59 59 #include <QtCore/QHash> 60 60 #include <QtCore/QPair> 61 #include <QtCore/QList>62 #include <QtCore/QMutex>63 #include <QtCore/QString>64 #include <QtCore/QThread>65 #include <QtCore/QObject>66 #include <QtCore/QVector>67 #include <QtCore/QByteArray>68 #include <QtCore/QStringList>69 #include <QtCore/QWaitCondition>70 61 71 62 QT_BEGIN_NAMESPACE … … 122 113 123 114 124 class QHelpSearchIndexReader : public QThread115 class QHelpSearchIndexReaderDefault : public QHelpSearchIndexReader 125 116 { 126 117 Q_OBJECT 127 118 128 119 public: 129 QHelpSearchIndexReader(); 130 ~QHelpSearchIndexReader(); 131 132 void cancelSearching(); 133 void search(const QString &collectionFile, 134 const QString &indexFilesFolder, 135 const QList<QHelpSearchQuery> &queryList); 136 137 int hitsCount() const; 138 QHelpSearchEngine::SearchHit hit(int index) const; 139 140 signals: 141 void searchingStarted(); 142 void searchingFinished(int hits); 120 QHelpSearchIndexReaderDefault(); 121 ~QHelpSearchIndexReaderDefault(); 143 122 144 123 private: … … 146 125 147 126 private: 148 QMutex mutex;149 127 Reader m_reader; 150 QWaitCondition waitCondition;151 QList<QHelpSearchEngine::SearchHit> hitList;152 153 bool m_cancel;154 QList<QHelpSearchQuery> m_query;155 QString m_collectionFile;156 QString m_indexFilesFolder;157 128 }; 158 129 -
trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 431 431 { 432 432 QTextStream textStream(data); 433 QByteArray charSet = QHelpGlobal::charsetFromData(data).toLatin1();434 textStream.setCodec(QTextCodec::codecForName(c harSet.constData()));433 const QByteArray &codec = QHelpGlobal::codecFromData(data).toLatin1(); 434 textStream.setCodec(QTextCodec::codecForName(codec.constData())); 435 435 436 436 QString stream = textStream.readAll(); … … 579 579 const QString &indexFilesFolder, bool reindex) 580 580 { 581 wait(); 581 582 mutex.lock(); 582 583 this->m_cancel = false; … … 591 592 void QHelpSearchIndexWriter::optimizeIndex() 592 593 { 593 if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) { 594 if (QCLuceneIndexReader::isLocked(m_indexFilesFolder)) 595 return; 596 597 QCLuceneStandardAnalyzer analyzer; 598 QCLuceneIndexWriter writer(m_indexFilesFolder, analyzer, false); 599 writer.optimize(); 600 writer.close(); 601 } 594 #if !defined(QT_NO_EXCEPTIONS) 595 try { 596 #endif 597 if (QCLuceneIndexReader::indexExists(m_indexFilesFolder)) { 598 if (QCLuceneIndexReader::isLocked(m_indexFilesFolder)) 599 return; 600 601 QCLuceneStandardAnalyzer analyzer; 602 QCLuceneIndexWriter writer(m_indexFilesFolder, analyzer, false); 603 writer.optimize(); 604 writer.close(); 605 } 606 #if !defined(QT_NO_EXCEPTIONS) 607 } catch (...) { 608 qWarning("Full Text Search, could not optimize index."); 609 return; 610 } 611 #endif 602 612 } 603 613 … … 640 650 QFileInfo fInfo(indexPath); 641 651 if (fInfo.exists() && !fInfo.isWritable()) { 642 qWarning("Full Text Search, could not create index (missing permissions ).");652 qWarning("Full Text Search, could not create index (missing permissions for '%s').", qPrintable(indexPath)); 643 653 return; 644 654 } … … 721 731 #if !defined(QT_NO_EXCEPTIONS) 722 732 } catch (...) { 723 qWarning("Full Text Search, could not create index writer."); 733 qWarning("Full Text Search, could not create index writer in '%s'.", 734 qPrintable(indexPath)); 724 735 return; 725 736 } 726 737 #endif 727 738 728 writer->setMergeFactor(100); 729 writer->setMinMergeDocs(1000); 730 writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); 739 #if !defined(QT_NO_EXCEPTIONS) 740 try { 741 #endif 742 writer->setMergeFactor(100); 743 writer->setMinMergeDocs(1000); 744 writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); 745 #if !defined(QT_NO_EXCEPTIONS) 746 } catch (...) { 747 qWarning("Full Text Search, could not set writer properties."); 748 return; 749 } 750 #endif 731 751 732 752 QStringList namespaces; … … 734 754 mutexLocker.relock(); 735 755 if (m_cancel) { 736 writer->close(); 737 delete writer; 756 closeIndexWriter(writer); 738 757 emit indexingFinished(); 739 758 return; … … 778 797 } 779 798 780 writer->close(); 781 delete writer; 799 closeIndexWriter(writer); 782 800 783 801 mutexLocker.relock(); … … 814 832 QCLuceneDocument document; 815 833 DocumentHelper helper(url.toString(), engine.fileData(url)); 816 if (helper.addFieldsToDocument(&document, namespaceName, attrList)) 817 writer->addDocument(document, analyzer); 818 834 if (helper.addFieldsToDocument(&document, namespaceName, attrList)) { 835 #if !defined(QT_NO_EXCEPTIONS) 836 try { 837 #endif 838 writer->addDocument(document, analyzer); 839 #if !defined(QT_NO_EXCEPTIONS) 840 } catch (...) { 841 qWarning("Full Text Search, could not properly add documents."); 842 return false; 843 } 844 #endif 845 } 819 846 locker.relock(); 820 847 if (m_cancel) … … 822 849 locker.unlock(); 823 850 } 824 825 851 return true; 826 852 } … … 862 888 } 863 889 890 void QHelpSearchIndexWriter::closeIndexWriter(QCLuceneIndexWriter *writer) 891 { 892 #if !defined(QT_NO_EXCEPTIONS) 893 try { 894 #endif 895 writer->close(); 896 delete writer; 897 #if !defined(QT_NO_EXCEPTIONS) 898 } catch (...) { 899 qWarning("Full Text Search, could not properly close index writer."); 900 } 901 #endif 902 } 864 903 865 904 } // namespace clucene -
trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 105 105 const QString &namespaceName, const QStringList &attributes) const; 106 106 107 void closeIndexWriter(QCLuceneIndexWriter *writer); 108 107 109 private: 108 110 QMutex mutex; -
trunk/tools/assistant/lib/qhelpsearchindexwriter_default.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 185 185 bool reindex) 186 186 { 187 wait(); 187 188 QMutexLocker lock(&mutex); 188 189 … … 275 276 276 277 QTextStream s(data); 277 QString en = QHelpGlobal::c harsetFromData(data);278 QString en = QHelpGlobal::codecFromData(data); 278 279 s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); 279 280 -
trunk/tools/assistant/lib/qhelpsearchindexwriter_default_p.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 44 44 #include <QtCore/QDebug> 45 45 46 #include <QtCore/QAbstractListModel> 46 47 #include <QtCore/QObject> 47 48 #include <QtCore/QStringList> 48 49 #include <QtCore/QtGlobal> 50 51 #include <QtGui/QCompleter> 49 52 #include <QtGui/QLabel> 50 53 #include <QtGui/QLayout> … … 61 64 62 65 private: 66 struct QueryHistory { 67 explicit QueryHistory() : curQuery(-1) {} 68 QList<QList<QHelpSearchQuery> > queries; 69 int curQuery; 70 }; 71 72 class CompleterModel : public QAbstractListModel 73 { 74 public: 75 explicit CompleterModel(QObject *parent) 76 : QAbstractListModel(parent) {} 77 78 int rowCount(const QModelIndex &parent = QModelIndex()) const 79 { 80 return parent.isValid() ? 0 : termList.size(); 81 } 82 83 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const 84 { 85 if (!index.isValid() || index.row() >= termList.count()|| 86 (role != Qt::EditRole && role != Qt::DisplayRole)) 87 return QVariant(); 88 return termList.at(index.row()); 89 } 90 91 void addTerm(const QString &term) 92 { 93 if (!termList.contains(term)) { 94 termList.append(term); 95 reset(); 96 } 97 } 98 99 private: 100 QStringList termList; 101 }; 102 63 103 QHelpSearchQueryWidgetPrivate() 64 : QObject() 104 : QObject(), simpleSearch(true), 105 searchCompleter(new CompleterModel(this), this) 65 106 { 66 107 searchButton = 0; … … 137 178 } 138 179 180 void saveQuery(const QList<QHelpSearchQuery> &query, QueryHistory &queryHist) 181 { 182 // We only add the query to the list if it is different from the last one. 183 bool insert = false; 184 if (queryHist.queries.empty()) 185 insert = true; 186 else { 187 const QList<QHelpSearchQuery> &lastQuery = queryHist.queries.last(); 188 if (lastQuery.size() != query.size()) { 189 insert = true; 190 } else { 191 for (int i = 0; i < query.size(); ++i) { 192 if (query.at(i).fieldName != lastQuery.at(i).fieldName 193 || query.at(i).wordList != lastQuery.at(i).wordList) { 194 insert = true; 195 break; 196 } 197 } 198 } 199 } 200 if (insert) { 201 queryHist.queries.append(query); 202 foreach (const QHelpSearchQuery &queryPart, query) { 203 static_cast<CompleterModel *>(searchCompleter.model())-> 204 addTerm(queryPart.wordList.join(" ")); 205 } 206 } 207 } 208 209 void nextOrPrevQuery(int maxOrMinIndex, int addend, 210 QToolButton *thisButton, QToolButton *otherButton) 211 { 212 QueryHistory *queryHist; 213 QList<QLineEdit *> lineEdits; 214 if (simpleSearch) { 215 queryHist = &simpleQueries; 216 lineEdits << defaultQuery; 217 } else { 218 queryHist = &complexQueries; 219 lineEdits << allQuery << atLeastQuery << similarQuery 220 << withoutQuery << exactQuery; 221 } 222 foreach (QLineEdit *lineEdit, lineEdits) 223 lineEdit->clear(); 224 225 // Otherwise, the respective button would be disabled. 226 Q_ASSERT(queryHist->curQuery != maxOrMinIndex); 227 228 queryHist->curQuery += addend; 229 const QList<QHelpSearchQuery> &query = 230 queryHist->queries.at(queryHist->curQuery); 231 foreach (const QHelpSearchQuery &queryPart, query) { 232 QLineEdit *lineEdit = 0; 233 switch (queryPart.fieldName) { 234 case QHelpSearchQuery::DEFAULT: 235 lineEdit = defaultQuery; 236 break; 237 case QHelpSearchQuery::ALL: 238 lineEdit = allQuery; 239 break; 240 case QHelpSearchQuery::ATLEAST: 241 lineEdit = atLeastQuery; 242 break; 243 case QHelpSearchQuery::FUZZY: 244 lineEdit = similarQuery; 245 break; 246 case QHelpSearchQuery::WITHOUT: 247 lineEdit = withoutQuery; 248 break; 249 case QHelpSearchQuery::PHRASE: 250 lineEdit = exactQuery; 251 break; 252 default: 253 Q_ASSERT(0); 254 } 255 lineEdit->setText(queryPart.wordList.join(" ")); 256 } 257 258 if (queryHist->curQuery == maxOrMinIndex) 259 thisButton->setEnabled(false); 260 otherButton->setEnabled(true); 261 } 262 263 void enableOrDisableToolButtons() 264 { 265 const QueryHistory &queryHist = 266 simpleSearch ? simpleQueries : complexQueries; 267 prevQueryButton->setEnabled(queryHist.curQuery > 0); 268 nextQueryButton->setEnabled(queryHist.curQuery < 269 queryHist.queries.size() - 1); 270 } 271 139 272 private slots: 140 273 void showHideAdvancedSearch() 141 274 { 142 bool hidden = advancedSearchWidget->isHidden(); 143 if (hidden) { 275 if (simpleSearch) { 144 276 advancedSearchWidget->show(); 145 277 showHideAdvancedSearchButton->setText((QLatin1String("-"))); … … 149 281 } 150 282 151 defaultQuery->setEnabled(!hidden); 283 simpleSearch = !simpleSearch; 284 defaultQuery->setEnabled(simpleSearch); 285 enableOrDisableToolButtons(); 286 } 287 288 void searchRequested() 289 { 290 QList<QHelpSearchQuery> queryList; 291 #if !defined(QT_CLUCENE_SUPPORT) 292 queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, 293 QStringList(defaultQuery->text()))); 294 295 #else 296 if (defaultQuery->isEnabled()) { 297 queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, 298 buildTermList(escapeString(defaultQuery->text())))); 299 } else { 300 const QRegExp exp(QLatin1String("\\s+")); 301 QStringList lst = similarQuery->text().split(exp, QString::SkipEmptyParts); 302 if (!lst.isEmpty()) { 303 QStringList fuzzy; 304 foreach (const QString term, lst) 305 fuzzy += buildTermList(escapeString(term)); 306 queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); 307 } 308 309 lst = withoutQuery->text().split(exp, QString::SkipEmptyParts); 310 if (!lst.isEmpty()) { 311 QStringList without; 312 foreach (const QString term, lst) 313 without.append(escapeString(term)); 314 queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); 315 } 316 317 if (!exactQuery->text().isEmpty()) { 318 QString phrase = exactQuery->text().remove(QLatin1Char('\"')); 319 phrase = escapeString(phrase.simplified()); 320 queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, QStringList(phrase))); 321 } 322 323 lst = allQuery->text().split(exp, QString::SkipEmptyParts); 324 if (!lst.isEmpty()) { 325 QStringList all; 326 foreach (const QString term, lst) 327 all.append(escapeString(term)); 328 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); 329 } 330 331 lst = atLeastQuery->text().split(exp, QString::SkipEmptyParts); 332 if (!lst.isEmpty()) { 333 QStringList atLeast; 334 foreach (const QString term, lst) 335 atLeast += buildTermList(escapeString(term)); 336 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); 337 } 338 } 339 #endif 340 QueryHistory &queryHist = simpleSearch ? simpleQueries : complexQueries; 341 saveQuery(queryList, queryHist); 342 queryHist.curQuery = queryHist.queries.size() - 1; 343 if (queryHist.curQuery > 0) 344 prevQueryButton->setEnabled(true); 345 nextQueryButton->setEnabled(false); 346 } 347 348 void nextQuery() 349 { 350 nextOrPrevQuery((simpleSearch ? simpleQueries : complexQueries).queries.size() - 1, 351 1, nextQueryButton, prevQueryButton); 352 } 353 354 void prevQuery() 355 { 356 nextOrPrevQuery(0, -1, prevQueryButton, nextQueryButton); 152 357 } 153 358 … … 155 360 friend class QHelpSearchQueryWidget; 156 361 362 bool simpleSearch; 157 363 QPushButton *searchButton; 158 364 QWidget* advancedSearchWidget; … … 164 370 QLineEdit *allQuery; 165 371 QLineEdit *atLeastQuery; 372 QToolButton *nextQueryButton; 373 QToolButton *prevQueryButton; 374 QueryHistory simpleQueries; 375 QueryHistory complexQueries; 376 QCompleter searchCompleter; 166 377 }; 167 378 … … 200 411 QLabel *label = new QLabel(tr("Search for:"), this); 201 412 d->defaultQuery = new QLineEdit(this); 413 d->defaultQuery->setCompleter(&d->searchCompleter); 414 d->prevQueryButton = new QToolButton(this); 415 d->prevQueryButton->setArrowType(Qt::LeftArrow); 416 d->prevQueryButton->setToolTip(tr("Previous search")); 417 d->prevQueryButton->setEnabled(false); 418 d->nextQueryButton = new QToolButton(this); 419 d->nextQueryButton->setArrowType(Qt::RightArrow); 420 d->nextQueryButton->setToolTip(tr("Next search")); 421 d->nextQueryButton->setEnabled(false); 202 422 d->searchButton = new QPushButton(tr("Search"), this); 203 423 hBoxLayout->addWidget(label); 204 424 hBoxLayout->addWidget(d->defaultQuery); 425 hBoxLayout->addWidget(d->prevQueryButton); 426 hBoxLayout->addWidget(d->nextQueryButton); 205 427 hBoxLayout->addWidget(d->searchButton); 206 428 207 429 vLayout->addLayout(hBoxLayout); 208 430 431 connect(d->prevQueryButton, SIGNAL(clicked()), d, SLOT(prevQuery())); 432 connect(d->nextQueryButton, SIGNAL(clicked()), d, SLOT(nextQuery())); 209 433 connect(d->searchButton, SIGNAL(clicked()), this, SIGNAL(search())); 210 434 connect(d->defaultQuery, SIGNAL(returnPressed()), this, SIGNAL(search())); … … 237 461 gLayout->addWidget(label, 0, 0); 238 462 d->similarQuery = new QLineEdit(this); 463 d->similarQuery->setCompleter(&d->searchCompleter); 239 464 gLayout->addWidget(d->similarQuery, 0, 1); 240 465 … … 242 467 gLayout->addWidget(label, 1, 0); 243 468 d->withoutQuery = new QLineEdit(this); 469 d->withoutQuery->setCompleter(&d->searchCompleter); 244 470 gLayout->addWidget(d->withoutQuery, 1, 1); 245 471 … … 247 473 gLayout->addWidget(label, 2, 0); 248 474 d->exactQuery = new QLineEdit(this); 475 d->exactQuery->setCompleter(&d->searchCompleter); 249 476 gLayout->addWidget(d->exactQuery, 2, 1); 250 477 … … 252 479 gLayout->addWidget(label, 3, 0); 253 480 d->allQuery = new QLineEdit(this); 481 d->allQuery->setCompleter(&d->searchCompleter); 254 482 gLayout->addWidget(d->allQuery, 3, 1); 255 483 … … 257 485 gLayout->addWidget(label, 4, 0); 258 486 d->atLeastQuery = new QLineEdit(this); 487 d->atLeastQuery->setCompleter(&d->searchCompleter); 259 488 gLayout->addWidget(d->atLeastQuery, 4, 1); 260 489 … … 270 499 d, SLOT(showHideAdvancedSearch())); 271 500 #endif 501 connect(this, SIGNAL(search()), d, SLOT(searchRequested())); 272 502 } 273 503 … … 286 516 QList<QHelpSearchQuery> QHelpSearchQueryWidget::query() const 287 517 { 288 #if !defined(QT_CLUCENE_SUPPORT) 289 QList<QHelpSearchQuery> queryList; 290 queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, 291 QStringList(d->defaultQuery->text()))); 292 293 return queryList; 294 #else 295 QList<QHelpSearchQuery> queryList; 296 if (d->defaultQuery->isEnabled()) { 297 queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, 298 d->buildTermList(d->escapeString(d->defaultQuery->text())))); 299 } else { 300 const QRegExp exp(QLatin1String("\\s+")); 301 QStringList lst = d->similarQuery->text().split(exp, QString::SkipEmptyParts); 302 if (!lst.isEmpty()) { 303 QStringList fuzzy; 304 foreach (const QString term, lst) 305 fuzzy += d->buildTermList(d->escapeString(term)); 306 queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); 307 } 308 309 lst = d->withoutQuery->text().split(exp, QString::SkipEmptyParts); 310 if (!lst.isEmpty()) { 311 QStringList without; 312 foreach (const QString term, lst) 313 without.append(d->escapeString(term)); 314 queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); 315 } 316 317 if (!d->exactQuery->text().isEmpty()) { 318 QString phrase = d->exactQuery->text().remove(QLatin1Char('\"')); 319 phrase = d->escapeString(phrase.simplified()); 320 queryList.append(QHelpSearchQuery(QHelpSearchQuery::PHRASE, QStringList(phrase))); 321 } 322 323 lst = d->allQuery->text().split(exp, QString::SkipEmptyParts); 324 if (!lst.isEmpty()) { 325 QStringList all; 326 foreach (const QString term, lst) 327 all.append(d->escapeString(term)); 328 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); 329 } 330 331 lst = d->atLeastQuery->text().split(exp, QString::SkipEmptyParts); 332 if (!lst.isEmpty()) { 333 QStringList atLeast; 334 foreach (const QString term, lst) 335 atLeast += d->buildTermList(d->escapeString(term)); 336 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); 337 } 338 } 339 return queryList; 340 #endif 518 const QHelpSearchQueryWidgetPrivate::QueryHistory &queryHist = 519 d->simpleSearch ? d->simpleQueries : d->complexQueries; 520 return queryHist.queries.isEmpty() ? 521 QList<QHelpSearchQuery>() : queryHist.queries.last(); 341 522 } 342 523 -
trunk/tools/assistant/lib/qhelpsearchquerywidget.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** -
trunk/tools/assistant/lib/qhelpsearchresultwidget.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 68 68 { 69 69 header()->hide(); 70 connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, 71 this, SLOT(itemActivated(QTreeWidgetItem*, 70 connect(this, SIGNAL(itemActivated(QTreeWidgetItem*,int)), 71 this, SLOT(itemActivated(QTreeWidgetItem*,int))); 72 72 } 73 73 … … 100 100 : QTextBrowser(parent) 101 101 { 102 connect(this, SIGNAL(anchorClicked( const QUrl&)),103 this, SIGNAL(requestShowLink( const QUrl&)));102 connect(this, SIGNAL(anchorClicked(QUrl)), 103 this, SIGNAL(requestShowLink(QUrl))); 104 104 setContextMenuPolicy(Qt::NoContextMenu); 105 105 } … … 170 170 { 171 171 if (!searchEngine.isNull() 172 && resultLastToShow < searchEngine->hit sCount()) {172 && resultLastToShow < searchEngine->hitCount()) { 173 173 resultLastToShow += 20; 174 174 resultFirstToShow += 20; … … 176 176 resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow, 177 177 resultLastToShow), isIndexing); 178 if (resultLastToShow >= searchEngine->hit sCount())178 if (resultLastToShow >= searchEngine->hitCount()) 179 179 updateNextButtonState(false); 180 180 } … … 185 185 { 186 186 if (!searchEngine.isNull()) { 187 resultLastToShow = searchEngine->hit sCount();187 resultLastToShow = searchEngine->hitCount(); 188 188 resultFirstToShow = resultLastToShow - (resultLastToShow % 20); 189 189 … … 215 215 if (!searchEngine.isNull()) { 216 216 int count = resultLastToShow % 20; 217 if (count == 0 || resultLastToShow != searchEngine->hit sCount())217 if (count == 0 || resultLastToShow != searchEngine->hitCount()) 218 218 count = 20; 219 219 … … 299 299 300 300 if (!searchEngine.isNull()) { 301 count = searchEngine->hit sCount();301 count = searchEngine->hitCount(); 302 302 if (count > 0) { 303 303 first = resultFirstToShow +1; … … 386 386 vLayout->addWidget(d->resultTextBrowser); 387 387 388 connect(d->resultTextBrowser, SIGNAL(requestShowLink( const QUrl&)), this,389 SIGNAL(requestShowLink( const QUrl&)));388 connect(d->resultTextBrowser, SIGNAL(requestShowLink(QUrl)), this, 389 SIGNAL(requestShowLink(QUrl))); 390 390 391 391 connect(d->nextResultPage, SIGNAL(clicked()), d, SLOT(showNextResultPage())); … … 402 402 d->resultTreeWidget = new QDefaultResultWidget(this); 403 403 vLayout->addWidget(d->resultTreeWidget); 404 connect(d->resultTreeWidget, SIGNAL(requestShowLink( const QUrl&)), this,405 SIGNAL(requestShowLink( const QUrl&)));404 connect(d->resultTreeWidget, SIGNAL(requestShowLink(QUrl)), this, 405 SIGNAL(requestShowLink(QUrl))); 406 406 #endif 407 407 -
trunk/tools/assistant/lib/qhelpsearchresultwidget.h
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 **
Note:
See TracChangeset
for help on using the changeset viewer.