Changeset 561 for trunk/tools/assistant
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 172 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/compat/config.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/compat/config.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/compat/docuparser.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/compat/docuparser.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/compat/fontsettingsdialog.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/compat/fontsettingsdialog.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/compat/helpdialog.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 ** … … 263 263 connect(ui.listBookmarks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTreeItemMenu(QPoint))); 264 264 265 connect(ui.termsEdit, SIGNAL(textChanged( const QString&)), this, SLOT(updateSearchButton(const QString&)));265 connect(ui.termsEdit, SIGNAL(textChanged(QString)), this, SLOT(updateSearchButton(QString))); 266 266 267 267 connect(ui.resultBox, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showListItemMenu(QPoint))); -
trunk/tools/assistant/compat/helpdialog.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/compat/helpdialog.ui
r2 r561 4 4 ** 5 5 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 ** Contact: Qt Software Information (qt-info@nokia.com) 6 ** All rights reserved. 7 ** Contact: Nokia Corporation (qt-info@nokia.com) 7 8 ** 8 9 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 23 24 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 25 ** 25 ** In addition, as a special exception, Nokia gives you certain 26 ** additional rights. These rights are described in the Nokia Qt LGPL 27 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 28 ** package. 26 ** In addition, as a special exception, Nokia gives you certain additional 27 ** rights. These rights are described in the Nokia Qt LGPL Exception 28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 29 ** 30 30 ** GNU General Public License Usage … … 36 36 ** met: http://www.gnu.org/copyleft/gpl.html. 37 37 ** 38 ** If you are unsure which license is appropriate for your use, please39 ** contact the sales department at qt-sales@nokia.com.38 ** If you have questions regarding the use of this file, please contact 39 ** Nokia at qt-info@nokia.com. 40 40 ** $QT_END_LICENSE$ 41 41 ** … … 270 270 <widget class="QLineEdit" name="termsEdit" > 271 271 <property name="toolTip" > 272 <string>Enter searchword(s) .</string>272 <string>Enter searchword(s)</string> 273 273 </property> 274 274 <property name="whatsThis" > … … 308 308 <widget class="QPushButton" name="helpButton" > 309 309 <property name="toolTip" > 310 <string>Display the help page .</string>310 <string>Display the help page</string> 311 311 </property> 312 312 <property name="whatsThis" > … … 337 337 <widget class="QPushButton" name="searchButton" > 338 338 <property name="toolTip" > 339 <string>Start searching .</string>339 <string>Start searching</string> 340 340 </property> 341 341 <property name="whatsThis" > -
trunk/tools/assistant/compat/helpwindow.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/compat/helpwindow.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/compat/index.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/compat/index.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/compat/lib/lib.pro
r552 r561 33 33 CONFIG += qt_install_headers 34 34 HEADERS_PRI = $$QT_BUILD_TREE/include/QtAssistant/headers.pri 35 include($$HEADERS_PRI )|clear(HEADERS_PRI)35 include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI) 36 36 37 37 #mac frameworks -
trunk/tools/assistant/compat/lib/qassistantclient.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 ** … … 76 76 Assistant as an application's help tool. 77 77 78 \inmodule QtAssistant79 78 \ingroup helpsystem 80 79 -
trunk/tools/assistant/compat/lib/qassistantclient.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/compat/lib/qassistantclient_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 ** -
trunk/tools/assistant/compat/main.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/compat/mainwindow.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 ** … … 141 141 ui.actionSyncToc->setIcon(QIcon(MacIconPath + QLatin1String("/synctoc.png"))); 142 142 ui.actionHelpWhatsThis->setIcon(QIcon(MacIconPath + QLatin1String("/whatsthis.png"))); 143 #elif defined(Q_WS_X11) 144 ui.actionGoNext->setIcon(QIcon::fromTheme("go-next" , ui.actionGoNext->icon())); 145 ui.actionGoPrevious->setIcon(QIcon::fromTheme("go-previous" , ui.actionGoPrevious->icon())); 146 ui.actionGoHome->setIcon(QIcon::fromTheme("user-home" , ui.actionGoHome->icon())); 147 ui.actionEditCopy->setIcon(QIcon::fromTheme("edit-copy" , ui.actionEditCopy->icon())); 148 ui.actionEditFind->setIcon(QIcon::fromTheme("edit-find" , ui.actionEditFind->icon())); 149 ui.actionFilePrint->setIcon(QIcon::fromTheme("document-print" , ui.actionFilePrint->icon())); 150 ui.actionZoomOut->setIcon(QIcon::fromTheme("zoom-out" , ui.actionZoomOut->icon())); 151 ui.actionZoomIn->setIcon(QIcon::fromTheme("zoom-in" , ui.actionZoomIn->icon())); 152 ui.actionSyncToc->setIcon(QIcon::fromTheme("view-refresh" , ui.actionSyncToc->icon())); 143 153 #endif 144 154 } … … 313 323 QMessageBox box(this); 314 324 315 // TODO: Remove these variables for 4.6.0. Must keep this way for 4.5.x due to string freeze.316 QString edition;317 QString info;318 QString moreInfo;319 320 325 box.setText(QString::fromLatin1("<center><img src=\":/trolltech/assistant/images/assistant-128.png\">" 321 326 "<h3>%1</h3>" 322 "<p>Version %2 %3</p></center>" 323 "<p>%4</p>" 324 "<p>%5</p>" 325 "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>" 326 "<p>The program is provided AS IS with NO WARRANTY OF ANY KIND," 327 " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" 328 " PARTICULAR PURPOSE.<p/>") 329 .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)).arg(edition).arg(info).arg(moreInfo)); 327 "<p>Version %2</p></center>" 328 "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>") 329 .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR))); 330 330 box.setWindowTitle(tr("Qt Assistant")); 331 331 box.setIcon(QMessageBox::NoIcon); … … 399 399 } 400 400 401 #ifndef QT_NO_PRINTER 401 402 class PrintThread : public QThread 402 403 { … … 434 435 } 435 436 }; 437 #endif //QT_NO_PRINTER 436 438 437 439 void MainWindow::on_actionFilePrint_triggered() -
trunk/tools/assistant/compat/mainwindow.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/compat/mainwindow.ui
r2 r561 3 3 ** 4 4 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 5 ** All rights reserved. 6 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 7 ** 6 8 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 24 ** 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. 25 ** In addition, as a special exception, Nokia gives you certain additional 26 ** rights. These rights are described in the Nokia Qt LGPL Exception 27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 28 ** 28 29 ** GNU General Public License Usage … … 34 35 ** met: http://www.gnu.org/copyleft/gpl.html. 35 36 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.37 ** If you have questions regarding the use of this file, please contact 38 ** Nokia at qt-info@nokia.com. 38 39 ** $QT_END_LICENSE$ 39 **40 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE41 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.42 40 ** 43 41 *********************************************************************</comment> -
trunk/tools/assistant/compat/profile.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/compat/profile.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/compat/tabbedbrowser.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 ** … … 218 218 opt.shape = tabBar->shape(); 219 219 tabBar->setContextMenuPolicy(Qt::CustomContextMenu); 220 connect(tabBar, SIGNAL(customContextMenuRequested( const QPoint&)), SLOT(openTabMenu(const QPoint&)));220 connect(tabBar, SIGNAL(customContextMenuRequested(QPoint)), SLOT(openTabMenu(QPoint))); 221 221 } 222 222 … … 249 249 QObject::connect(ui.toolNext, SIGNAL(clicked()), this, SLOT(findNext())); 250 250 QObject::connect(ui.editFind, SIGNAL(returnPressed()), this, SLOT(findNext())); 251 QObject::connect(ui.editFind, SIGNAL(textEdited( const QString&)),251 QObject::connect(ui.editFind, SIGNAL(textEdited(QString)), 252 252 this, SLOT(find(QString))); 253 253 ui.frameFind->setVisible(false); -
trunk/tools/assistant/compat/tabbedbrowser.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/compat/tabbedbrowser.ui
r2 r561 4 4 ** 5 5 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 6 ** Contact: Qt Software Information (qt-info@nokia.com) 6 ** All rights reserved. 7 ** Contact: Nokia Corporation (qt-info@nokia.com) 7 8 ** 8 9 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 23 24 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 24 25 ** 25 ** In addition, as a special exception, Nokia gives you certain 26 ** additional rights. These rights are described in the Nokia Qt LGPL 27 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 28 ** package. 26 ** In addition, as a special exception, Nokia gives you certain additional 27 ** rights. These rights are described in the Nokia Qt LGPL Exception 28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 29 29 ** 30 30 ** GNU General Public License Usage … … 36 36 ** met: http://www.gnu.org/copyleft/gpl.html. 37 37 ** 38 ** If you are unsure which license is appropriate for your use, please39 ** contact the sales department at qt-sales@nokia.com.38 ** If you have questions regarding the use of this file, please contact 39 ** Nokia at qt-info@nokia.com. 40 40 ** $QT_END_LICENSE$ 41 41 ** -
trunk/tools/assistant/compat/topicchooser.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/compat/topicchooser.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/compat/topicchooser.ui
r2 r561 3 3 ** 4 4 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 5 ** Contact: Qt Software Information (qt-info@nokia.com) 5 ** All rights reserved. 6 ** Contact: Nokia Corporation (qt-info@nokia.com) 6 7 ** 7 8 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 22 23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 23 24 ** 24 ** In addition, as a special exception, Nokia gives you certain 25 ** additional rights. These rights are described in the Nokia Qt LGPL 26 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 27 ** package. 25 ** In addition, as a special exception, Nokia gives you certain additional 26 ** rights. These rights are described in the Nokia Qt LGPL Exception 27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 28 28 ** 29 29 ** GNU General Public License Usage … … 35 35 ** met: http://www.gnu.org/copyleft/gpl.html. 36 36 ** 37 ** If you are unsure which license is appropriate for your use, please38 ** contact the sales department at qt-sales@nokia.com.37 ** If you have questions regarding the use of this file, please contact 38 ** Nokia at qt-info@nokia.com. 39 39 ** $QT_END_LICENSE$ 40 40 ** -
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 ** -
trunk/tools/assistant/tools/assistant/aboutdialog.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/tools/assistant/aboutdialog.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/tools/assistant/assistant.pro
r385 r561 4 4 LANGUAGE = C++ 5 5 TARGET = assistant 6 7 DEFINES += QT_CLUCENE_SUPPORT8 6 9 7 contains(QT_CONFIG, webkit) { -
trunk/tools/assistant/tools/assistant/assistant.rc
r2 r561 1 #include "winver.h" 2 1 3 IDI_ICON1 ICON DISCARDABLE "assistant.ico" 4 5 VS_VERSION_INFO VERSIONINFO 6 FILEVERSION 1,0,0,0 7 PRODUCTVERSION 1,0,0,0 8 FILEFLAGS 0x0L 9 FILEFLAGSMASK 0x3fL 10 FILEOS 0x00040004L 11 FILETYPE 0x1L 12 FILESUBTYPE 0x0L 13 BEGIN 14 BLOCK "StringFileInfo" 15 BEGIN 16 BLOCK "000004b0" 17 BEGIN 18 VALUE "CompanyName", "Nokia Corporation and/or its subsidiary(-ies)" 19 VALUE "FileDescription", "Qt Assistant" 20 VALUE "FileVersion", "1.0.0.0" 21 VALUE "LegalCopyright", "Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)." 22 VALUE "InternalName", "assistant.exe" 23 VALUE "OriginalFilename", "assistant.exe" 24 VALUE "ProductName", "Qt Assistant" 25 VALUE "ProductVersion", "1.0.0.0" 26 END 27 END 28 BLOCK "VarFileInfo" 29 BEGIN 30 VALUE "Translation", 0x0, 1200 31 END 32 END -
trunk/tools/assistant/tools/assistant/bookmarkmanager.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 ** … … 64 64 65 65 BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title, 66 66 const QString &url, QWidget *parent) 67 67 : QDialog(parent) 68 68 , m_url(url) … … 70 70 , bookmarkManager(manager) 71 71 { 72 ui.setupUi(this); 73 72 74 installEventFilter(this); 73 74 ui.setupUi(this); 75 ui.treeView->installEventFilter(this); 76 ui.treeView->viewport()->installEventFilter(this); 77 75 78 ui.bookmarkEdit->setText(title); 76 79 ui.newFolderButton->setVisible(false); … … 96 99 connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addNewFolder())); 97 100 connect(ui.toolButton, SIGNAL(clicked()), this, SLOT(toolButtonClicked())); 98 connect(ui.bookmarkEdit, SIGNAL(textChanged(const QString&)), this, 99 SLOT(textChanged(const QString&))); 100 101 connect(bookmarkManager->treeBookmarkModel(), SIGNAL(itemChanged(QStandardItem*)), 101 connect(ui.bookmarkEdit, SIGNAL(textChanged(QString)), this, 102 SLOT(textChanged(QString))); 103 104 connect(bookmarkManager->treeBookmarkModel(), 105 SIGNAL(itemChanged(QStandardItem*)), 102 106 this, SLOT(itemChanged(QStandardItem*))); 103 107 104 connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(const QString&)), this, 105 SLOT(selectBookmarkFolder(const QString&))); 106 107 connect(ui.treeView, SIGNAL(customContextMenuRequested(const QPoint&)), this, 108 SLOT(customContextMenuRequested(const QPoint&))); 109 110 connect(ui.treeView->selectionModel(), 111 SIGNAL(currentChanged(const QModelIndex&, const QModelIndex&)), 112 this, SLOT(currentChanged(const QModelIndex&, const QModelIndex&))); 108 connect(ui.bookmarkFolders, SIGNAL(currentIndexChanged(QString)), this, 109 SLOT(selectBookmarkFolder(QString))); 110 111 connect(ui.treeView, SIGNAL(customContextMenuRequested(QPoint)), this, 112 SLOT(customContextMenuRequested(QPoint))); 113 114 connect(ui.treeView->selectionModel(), SIGNAL(currentChanged(QModelIndex, 115 QModelIndex)), this, SLOT(currentChanged(QModelIndex))); 113 116 } 114 117 … … 119 122 void BookmarkDialog::addAccepted() 120 123 { 121 const QItemSelection selection = ui.treeView->selectionModel()->selection();122 const QModelIndexList list = selection.indexes();124 QItemSelectionModel *model = ui.treeView->selectionModel(); 125 const QModelIndexList &list = model->selection().indexes(); 123 126 124 127 QModelIndex index; … … 132 135 void BookmarkDialog::addNewFolder() 133 136 { 134 const QItemSelection selection = ui.treeView->selectionModel()->selection();135 const QModelIndexList list = selection.indexes();137 QItemSelectionModel *model = ui.treeView->selectionModel(); 138 const QModelIndexList &list = model->selection().indexes(); 136 139 137 140 QModelIndex index; … … 144 147 ui.treeView->expand(index); 145 148 const QModelIndex &index = proxyModel->mapFromSource(newFolder); 146 ui.treeView->selectionModel()->setCurrentIndex(index, 147 QItemSelectionModel::ClearAndSelect); 149 model->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect); 148 150 149 151 ui.bookmarkFolders->clear(); 150 152 ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); 151 153 152 const QString name = index.data().toString();154 const QString &name = index.data().toString(); 153 155 ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); 154 156 } … … 184 186 185 187 QString name = tr("Bookmarks"); 186 const QModelIndex &index = ui.treeView->currentIndex();188 const QModelIndex &index = ui.treeView->currentIndex(); 187 189 if (index.isValid()) 188 190 name = index.data().toString(); … … 191 193 } 192 194 193 void BookmarkDialog::textChanged(const QString &string)195 void BookmarkDialog::textChanged(const QString &string) 194 196 { 195 197 ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty()); … … 210 212 Qt::MatchCaseSensitive | Qt::MatchRecursive, 0); 211 213 if (!list.isEmpty()) { 212 QModelIndex index = model->indexFromItem(list.at(0)); 213 ui.treeView->selectionModel()->setCurrentIndex( 214 proxyModel->mapFromSource(index), QItemSelectionModel::ClearAndSelect); 214 const QModelIndex &index = model->indexFromItem(list.at(0)); 215 QItemSelectionModel *model = ui.treeView->selectionModel(); 216 if (model) { 217 model->setCurrentIndex(proxyModel->mapFromSource(index), 218 QItemSelectionModel::ClearAndSelect); 219 } 215 220 } 216 221 } … … 227 232 QAction *renameItem = menu.addAction(tr("Rename Folder")); 228 233 229 QAction *picked _action= menu.exec(ui.treeView->mapToGlobal(point));230 if (!picked _action)234 QAction *picked = menu.exec(ui.treeView->mapToGlobal(point)); 235 if (!picked) 231 236 return; 232 237 233 if (picked_action == removeItem) {234 bookmarkManager->removeBookmarkItem(ui.treeView,235 proxyModel->mapToSource(index));238 const QModelIndex &proxyIndex = proxyModel->mapToSource(index); 239 if (picked == removeItem) { 240 bookmarkManager->removeBookmarkItem(ui.treeView, proxyIndex); 236 241 ui.bookmarkFolders->clear(); 237 242 ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders()); … … 243 248 ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name)); 244 249 } 245 else if (picked_action == renameItem) { 246 QStandardItem *item = bookmarkManager->treeBookmarkModel()-> 247 itemFromIndex(proxyModel->mapToSource(index)); 248 if (item) { 250 else if (picked == renameItem) { 251 BookmarkModel *model = bookmarkManager->treeBookmarkModel(); 252 if (QStandardItem *item = model->itemFromIndex(proxyIndex)) { 249 253 item->setEditable(true); 250 254 ui.treeView->edit(index); … … 254 258 } 255 259 256 void BookmarkDialog::currentChanged(const QModelIndex& current, 257 const QModelIndex& previous) 258 { 259 Q_UNUSED(previous) 260 261 if (!current.isValid()) { 262 ui.bookmarkFolders->setCurrentIndex( 263 ui.bookmarkFolders->findText(tr("Bookmarks"))); 264 return; 265 } 266 267 ui.bookmarkFolders->setCurrentIndex( 268 ui.bookmarkFolders->findText(current.data().toString())); 260 void BookmarkDialog::currentChanged(const QModelIndex ¤t) 261 { 262 QString text = tr("Bookmarks"); 263 if (current.isValid()) 264 text = current.data().toString(); 265 ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(text)); 269 266 } 270 267 271 268 bool BookmarkDialog::eventFilter(QObject *object, QEvent *e) 272 269 { 273 if (object == this && e->type() == QEvent::KeyPress) { 270 if (object != ui.treeView && object != ui.treeView->viewport()) 271 return QWidget::eventFilter(object, e); 272 273 if (e->type() == QEvent::KeyPress) { 274 274 QKeyEvent *ke = static_cast<QKeyEvent*>(e); 275 276 QModelIndex index = ui.treeView->currentIndex();277 275 switch (ke->key()) { 278 276 case Qt::Key_F2: { 279 const QModelIndex& source = proxyModel->mapToSource(index); 277 const QModelIndex &index = ui.treeView->currentIndex(); 278 const QModelIndex &source = proxyModel->mapToSource(index); 280 279 QStandardItem *item = 281 280 bookmarkManager->treeBookmarkModel()->itemFromIndex(source); … … 288 287 289 288 case Qt::Key_Delete: { 289 const QModelIndex &index = ui.treeView->currentIndex(); 290 290 bookmarkManager->removeBookmarkItem(ui.treeView, 291 291 proxyModel->mapToSource(index)); … … 294 294 295 295 QString name = tr("Bookmarks"); 296 index = ui.treeView->currentIndex();297 296 if (index.isValid()) 298 297 name = index.data().toString(); … … 304 303 } 305 304 } 305 306 306 return QObject::eventFilter(object, e); 307 307 } 308 308 309 309 310 // #pragma mark -- BookmarkWidget 310 311 311 312 312 313 BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent, 313 314 bool showButtons) 314 315 : QWidget(parent) 315 316 , addButton(0) … … 318 319 { 319 320 setup(showButtons); 321 320 322 installEventFilter(this); 323 treeView->installEventFilter(this); 324 treeView->viewport()->installEventFilter(this); 321 325 } 322 326 … … 327 331 void BookmarkWidget::removeClicked() 328 332 { 329 const QModelIndex &index = treeView->currentIndex();333 const QModelIndex &index = treeView->currentIndex(); 330 334 if (searchField->text().isEmpty()) { 331 335 bookmarkManager->removeBookmarkItem(treeView, … … 353 357 filterBookmarkModel->setFilterRegExp(regExp); 354 358 355 QModelIndexindex = treeView->indexAt(QPoint(1, 1));359 const QModelIndex &index = treeView->indexAt(QPoint(1, 1)); 356 360 if (index.isValid()) 357 361 treeView->setCurrentIndex(index); … … 361 365 } 362 366 363 void BookmarkWidget::expand(const QModelIndex& index) 364 { 365 const QModelIndex& source = filterBookmarkModel->mapToSource(index); 366 QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source); 367 void BookmarkWidget::expand(const QModelIndex &index) 368 { 369 const QModelIndex &source = filterBookmarkModel->mapToSource(index); 370 QStandardItem *item = 371 bookmarkManager->treeBookmarkModel()->itemFromIndex(source); 367 372 if (item) 368 373 item->setData(treeView->isExpanded(index), Qt::UserRole + 11); … … 405 410 } 406 411 407 QAction *picked _action = menu.exec(treeView->mapToGlobal(point));408 if (!picked _action)412 QAction *pickedAction = menu.exec(treeView->mapToGlobal(point)); 413 if (!pickedAction) 409 414 return; 410 415 411 if (picked _action == showItem) {416 if (pickedAction == showItem) { 412 417 emit requestShowLink(data); 413 418 } 414 else if (picked _action == showItemNewTab) {419 else if (pickedAction == showItemNewTab) { 415 420 CentralWidget::instance()->setSourceInNewTab(data); 416 421 } 417 else if (picked _action == removeItem) {422 else if (pickedAction == removeItem) { 418 423 bookmarkManager->removeBookmarkItem(treeView, 419 424 filterBookmarkModel->mapToSource(index)); 420 425 } 421 else if (picked _action == renameItem) {422 const QModelIndex &source = filterBookmarkModel->mapToSource(index);426 else if (pickedAction == renameItem) { 427 const QModelIndex &source = filterBookmarkModel->mapToSource(index); 423 428 QStandardItem *item = 424 429 bookmarkManager->treeBookmarkModel()->itemFromIndex(source); … … 444 449 searchField = new QLineEdit(this); 445 450 vlayout->addWidget(searchField); 446 connect(searchField, SIGNAL(textChanged( const QString &)), this,451 connect(searchField, SIGNAL(textChanged(QString)), this, 447 452 SLOT(filterChanged())); 448 453 … … 450 455 vlayout->addWidget(treeView); 451 456 452 QString system = QLatin1String("win");453 457 #ifdef Q_OS_MAC 454 system = QLatin1String("mac"); 458 # define SYSTEM "mac" 459 #else 460 # define SYSTEM "win" 455 461 #endif 456 462 … … 463 469 addButton = new QToolButton(this); 464 470 addButton->setText(tr("Add")); 465 addButton->setIcon(QIcon(Q String::fromUtf8(466 ":/trolltech/assistant/images/%1/addtab.png").arg(system)));471 addButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/" 472 SYSTEM "/addtab.png"))); 467 473 addButton->setAutoRaise(true); 468 474 addButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); … … 472 478 removeButton = new QToolButton(this); 473 479 removeButton->setText(tr("Remove")); 474 removeButton->setIcon(QIcon(Q String::fromUtf8(475 ":/trolltech/assistant/images/%1/closetab.png").arg(system)));480 removeButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/" 481 SYSTEM "/closetab.png"))); 476 482 removeButton->setAutoRaise(true); 477 483 removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); … … 488 494 treeView->setDropIndicatorShown(true); 489 495 treeView->header()->setVisible(false); 490 treeView->viewport()->installEventFilter(this);491 496 treeView->setContextMenuPolicy(Qt::CustomContextMenu); 492 497 493 connect(treeView, SIGNAL(expanded(const QModelIndex&)), this, 494 SLOT(expand(const QModelIndex&))); 495 496 connect(treeView, SIGNAL(collapsed(const QModelIndex&)), this, 497 SLOT(expand(const QModelIndex&))); 498 499 connect(treeView, SIGNAL(activated(const QModelIndex&)), this, 500 SLOT(activated(const QModelIndex&))); 501 502 connect(treeView, SIGNAL(customContextMenuRequested(const QPoint&)), 503 this, SLOT(customContextMenuRequested(const QPoint&))); 498 connect(treeView, SIGNAL(expanded(QModelIndex)), this, 499 SLOT(expand(QModelIndex))); 500 connect(treeView, SIGNAL(collapsed(QModelIndex)), this, 501 SLOT(expand(QModelIndex))); 502 connect(treeView, SIGNAL(activated(QModelIndex)), this, 503 SLOT(activated(QModelIndex))); 504 connect(treeView, SIGNAL(customContextMenuRequested(QPoint)), 505 this, SLOT(customContextMenuRequested(QPoint))); 504 506 505 507 filterBookmarkModel->setFilterKeyColumn(0); … … 515 517 QList<QStandardItem*>list = model->findItems(QLatin1String("*"), 516 518 Qt::MatchWildcard | Qt::MatchRecursive, 0); 517 foreach (const QStandardItem *item, list) {518 const QModelIndex &index = model->indexFromItem(item);519 foreach (const QStandardItem *item, list) { 520 const QModelIndex &index = model->indexFromItem(item); 519 521 treeView->setExpanded(filterBookmarkModel->mapFromSource(index), 520 522 item->data(Qt::UserRole + 11).toBool()); … … 537 539 bool BookmarkWidget::eventFilter(QObject *object, QEvent *e) 538 540 { 539 if (object == this && e->type() == QEvent::KeyPress) { 541 if (object != this && object != treeView 542 && object != treeView->viewport()) { 543 return QWidget::eventFilter(object, e); 544 } 545 546 if (e->type() == QEvent::KeyPress) { 540 547 QKeyEvent *ke = static_cast<QKeyEvent*>(e); 541 QModelIndex index = treeView->currentIndex();548 const bool tree = object == treeView || object == treeView->viewport(); 542 549 switch (ke->key()) { 543 if (index.isValid() && searchField->text().isEmpty()){544 c ase Qt::Key_F2: {545 const QModelIndex& source= filterBookmarkModel->mapToSource(index);546 QStandardItem *item =547 bookmarkManager->treeBookmarkModel()->itemFromIndex(source);548 if (item) {550 case Qt::Key_F2: { 551 const QModelIndex &index = treeView->currentIndex(); 552 const QModelIndex &src = filterBookmarkModel->mapToSource(index); 553 if (tree && searchField->text().isEmpty()) { 554 if (QStandardItem *item = bookmarkManager->treeBookmarkModel() 555 ->itemFromIndex(src)) { 549 556 item->setEditable(true); 550 557 treeView->edit(index); 551 558 item->setEditable(false); 552 559 } 553 } break; 554 555 case Qt::Key_Delete: { 556 bookmarkManager->removeBookmarkItem(treeView, 557 filterBookmarkModel->mapToSource(index)); 558 } break; 559 } 560 561 case Qt::Key_Up: 562 case Qt::Key_Down: 563 treeView->subclassKeyPressEvent(ke); 564 break; 560 } 561 } break; 565 562 566 563 case Qt::Key_Enter: { 567 564 case Qt::Key_Return: 568 i ndex = treeView->selectionModel()->currentIndex();569 if (index.isValid()) {570 QString data = index.data(Qt::UserRole + 10).toString();565 if (tree) { 566 const QString &data = treeView->selectionModel()->currentIndex() 567 .data(Qt::UserRole + 10).toString(); 571 568 if (!data.isEmpty() && data != QLatin1String("Folder")) 572 569 emit requestShowLink(data); … … 574 571 } break; 575 572 576 case Qt::Key_Escape: 573 case Qt::Key_Delete: { 574 const QModelIndex &index = treeView->currentIndex(); 575 const QModelIndex &src = filterBookmarkModel->mapToSource(index); 576 if (tree && searchField->text().isEmpty()) 577 bookmarkManager->removeBookmarkItem(treeView, src); 578 } break; 579 580 case Qt::Key_Up: { 581 case Qt::Key_Down: 582 if (!tree) 583 treeView->subclassKeyPressEvent(ke); 584 } break; 585 586 case Qt::Key_Escape: { 577 587 emit escapePressed(); 578 break; 579 580 default: 581 break; 582 } 583 } 584 else if (object == treeView->viewport() && e->type() == QEvent::MouseButtonRelease) { 585 const QModelIndex& index = treeView->currentIndex(); 588 } break; 589 590 default: break; 591 } 592 } 593 594 if (e->type() == QEvent::MouseButtonRelease) { 586 595 QMouseEvent *me = static_cast<QMouseEvent*>(e); 587 if (index.isValid() && (me->button() == Qt::MidButton)) { 588 QString data = index.data(Qt::UserRole + 10).toString(); 589 if (!data.isEmpty() && data != QLatin1String("Folder")) 590 CentralWidget::instance()->setSourceInNewTab(data); 591 } 592 } 596 bool controlPressed = me->modifiers() & Qt::ControlModifier; 597 if(((me->button() == Qt::LeftButton) && controlPressed) 598 || (me->button() == Qt::MidButton)) { 599 const QModelIndex &index = treeView->currentIndex(); 600 const QString &data = index.data(Qt::UserRole + 10).toString(); 601 if (!data.isEmpty() && data != QLatin1String("Folder")) 602 CentralWidget::instance()->setSourceInNewTab(data); 603 } 604 } 605 593 606 return QWidget::eventFilter(object, e); 594 607 } 595 608 596 609 597 598 599 BookmarkModel::BookmarkModel(int rows, int columns, QObject * parent) 610 // #pragma mark -- BookmarkModel 611 612 613 BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent) 600 614 : QStandardItemModel(rows, columns, parent) 601 615 { … … 614 628 { 615 629 Qt::ItemFlags defaultFlags = QStandardItemModel::flags(index); 616 if (index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) 630 if ((!index.isValid()) // can only happen for the invisible root item 631 || index.data(Qt::UserRole + 10).toString() == QLatin1String("Folder")) 617 632 return (Qt::ItemIsDropEnabled | defaultFlags) &~ Qt::ItemIsDragEnabled; 618 633 … … 621 636 622 637 623 624 625 BookmarkManager::BookmarkManager(QHelpEngineCore* _helpEngine) 638 // #pragma mark -- BookmarkManager 639 640 641 BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine) 626 642 : treeModel(new BookmarkModel(0, 1, this)) 627 643 , listModel(new BookmarkModel(0, 1, this)) 644 , renameItem(0) 628 645 , helpEngine(_helpEngine) 629 646 { 630 647 folderIcon = QApplication::style()->standardIcon(QStyle::SP_DirClosedIcon); 631 treeModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Bookmark"));632 listModel->setHeaderData(0, Qt::Horizontal, QObject::tr("Bookmark"));633 648 634 649 connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, 635 650 SLOT(itemChanged(QStandardItem*))); 651 connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this, 652 SIGNAL(bookmarksChanged())); 653 connect(treeModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), 654 this, SIGNAL(bookmarksChanged())); 636 655 } 637 656 … … 654 673 void BookmarkManager::saveBookmarks() 655 674 { 656 qint32 depth = 0;657 675 QByteArray bookmarks; 658 676 QDataStream stream(&bookmarks, QIODevice::WriteOnly); 659 QStandardItem *root = treeModel->invisibleRootItem(); 660 661 for (int i = 0; i < root->rowCount(); ++i) { 662 const QStandardItem *item = root->child(i); 663 stream << depth; // root 664 stream << item->data(Qt::DisplayRole).toString(); 665 stream << item->data(Qt::UserRole + 10).toString(); 666 stream << item->data(Qt::UserRole + 11).toBool(); 667 668 if (item->rowCount() > 0) { 669 readBookmarksRecursive(item, stream, (depth +1)); 670 } 671 } 677 678 readBookmarksRecursive(treeModel->invisibleRootItem(), stream, 0); 672 679 helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks); 673 680 } … … 689 696 } 690 697 691 QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index)698 QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index) 692 699 { 693 700 QStandardItem *item = new QStandardItem(uniqueFolderName()); … … 705 712 } 706 713 707 void BookmarkManager::removeBookmarkItem(QTreeView *treeView, const QModelIndex& index) 714 void BookmarkManager::removeBookmarkItem(QTreeView *treeView, 715 const QModelIndex &index) 708 716 { 709 717 QStandardItem *item = treeModel->itemFromIndex(index); … … 712 720 if (data == QLatin1String("Folder") && item->rowCount() > 0) { 713 721 int value = QMessageBox::question(treeView, tr("Remove"), 714 715 716 722 tr("You are going to delete a Folder, this will also<br>" 723 "remove it's content. Are you sure to continue?"), 724 QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); 717 725 718 726 if (value == QMessageBox::Cancel) … … 735 743 } 736 744 737 void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name,738 745 void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name, 746 const QString &url) 739 747 { 740 748 BookmarkDialog dialog(this, name, url, parent); … … 742 750 } 743 751 744 void BookmarkManager::addNewBookmark(const QModelIndex &index,745 752 void BookmarkManager::addNewBookmark(const QModelIndex &index, 753 const QString &name, const QString &url) 746 754 { 747 755 QStandardItem *item = new QStandardItem(name); … … 750 758 item->setData(url, Qt::UserRole + 10); 751 759 752 if (index.isValid()) {760 if (index.isValid()) 753 761 treeModel->itemFromIndex(index)->appendRow(item); 754 listModel->appendRow(item->clone()); 755 } else { 762 else 756 763 treeModel->appendRow(item); 757 listModel->appendRow(item->clone()); 758 } 764 listModel->appendRow(item->clone()); 765 emit bookmarksChanged(); 766 } 767 768 void BookmarkManager::fillBookmarkMenu(QMenu *menu) 769 { 770 if (!menu || !treeModel) 771 return; 772 773 map.clear(); 774 fillBookmarkMenu(menu, treeModel->invisibleRootItem()); 775 } 776 777 void BookmarkManager::fillBookmarkMenu(QMenu *menu, QStandardItem *root) 778 { 779 for (int i = 0; i < root->rowCount(); ++i) { 780 QStandardItem *item = root->child(i); 781 if (item && item->data(Qt::UserRole + 10) 782 .toString() == QLatin1String("Folder")) { 783 QMenu* newMenu = menu->addMenu(folderIcon, item->text()); 784 if (item->rowCount() > 0) 785 fillBookmarkMenu(newMenu, item); 786 } else { 787 map.insert(menu->addAction(item->text()), item->index()); 788 } 789 } 790 } 791 792 QUrl BookmarkManager::urlForAction(QAction* action) const 793 { 794 if (map.contains(action)) { 795 const QModelIndex &index = map.value(action); 796 if (QStandardItem* item = treeModel->itemFromIndex(index)) 797 return QUrl(item->data(Qt::UserRole + 10).toString()); 798 } 799 return QUrl(); 759 800 } 760 801 … … 787 828 QList<QStandardItem*> parents; 788 829 789 QByteArray ba = helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray(); 830 QByteArray ba = 831 helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray(); 790 832 QDataStream stream(ba); 791 833 while (!stream.atEnd()) { … … 857 899 858 900 void BookmarkManager::readBookmarksRecursive(const QStandardItem *item, 859 QDataStream &stream, 860 const qint32 depth) const 901 QDataStream &stream, const qint32 depth) const 861 902 { 862 903 for (int j = 0; j < item->rowCount(); ++j) { -
trunk/tools/assistant/tools/assistant/bookmarkmanager.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 ** … … 75 75 76 76 public: 77 BookmarkDialog(BookmarkManager *manager, const QString &title, 77 BookmarkDialog(BookmarkManager *manager, const QString &title, 78 78 const QString &url, QWidget *parent = 0); 79 79 ~BookmarkDialog(); … … 87 87 void selectBookmarkFolder(const QString &folderName); 88 88 void customContextMenuRequested(const QPoint &point); 89 void currentChanged(const QModelIndex& current , const QModelIndex& previous);90 89 void currentChanged(const QModelIndex& current); 90 91 91 private: 92 92 bool eventFilter(QObject *object, QEvent *e); … … 178 178 QModelIndex addNewFolder(const QModelIndex& index); 179 179 void removeBookmarkItem(QTreeView *treeView, const QModelIndex& index); 180 void showBookmarkDialog(QWidget* parent, const QString &name, const QString &url); 181 void addNewBookmark(const QModelIndex& index, const QString &name, const QString &url); 180 void showBookmarkDialog(QWidget* parent, const QString &name, 181 const QString &url); 182 void addNewBookmark(const QModelIndex& index, const QString &name, 183 const QString &url); 182 184 void setupBookmarkModels(); 185 186 void fillBookmarkMenu(QMenu *menu); 187 QUrl urlForAction(QAction* action) const; 188 189 signals: 190 void bookmarksChanged(); 183 191 184 192 private slots: 185 193 void itemChanged(QStandardItem *item); 186 194 187 private: 195 private: 188 196 QString uniqueFolderName() const; 189 197 void removeBookmarkFolderItems(QStandardItem *item); 190 198 void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream, 191 199 const qint32 depth) const; 200 void fillBookmarkMenu(QMenu *menu, QStandardItem *root); 192 201 193 202 private: 194 203 QString oldText; 195 204 QIcon folderIcon; 196 205 197 206 BookmarkModel *treeModel; 198 207 BookmarkModel *listModel; 199 208 QStandardItem *renameItem; 200 209 QHelpEngineCore *helpEngine; 210 QMap<QAction*, QModelIndex> map; 201 211 }; 202 212 -
trunk/tools/assistant/tools/assistant/centralwidget.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 "searchwidget.h" 45 45 #include "mainwindow.h" 46 #include "preferencesdialog.h" 46 47 47 48 #include <QtCore/QDir> … … 73 74 74 75 namespace { 75 HelpViewer* helpViewerFromTabPosition(const QTabWidget *widget, const QPoint &point) 76 HelpViewer* helpViewerFromTabPosition(const QTabWidget *widget, 77 const QPoint &point) 76 78 { 77 79 QTabBar *tabBar = qFindChild<QTabBar*>(widget); … … 87 89 FindWidget::FindWidget(QWidget *parent) 88 90 : QWidget(parent) 89 { 90 QString system = QLatin1String("win"); 91 , appPalette(qApp->palette()) 92 { 91 93 QHBoxLayout *hboxLayout = new QHBoxLayout(this); 92 #ifdef Q_OS_MAC 93 system = QLatin1String("mac"); 94 QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); 95 96 #ifndef Q_OS_MAC 97 hboxLayout->setMargin(0); 98 hboxLayout->setSpacing(6); 99 resourcePath.append(QLatin1String("win")); 94 100 #else 95 hboxLayout->setSpacing(6); 96 hboxLayout->setMargin(0); 97 #endif 98 99 toolClose = new QToolButton(this); 100 toolClose->setIcon(QIcon(QString::fromUtf8(":/trolltech/assistant/images/%1/closetab.png").arg(system))); 101 toolClose->setAutoRaise(true); 101 resourcePath.append(QLatin1String("mac")); 102 #endif 103 104 toolClose = setupToolButton(QLatin1String(""), 105 resourcePath + QLatin1String("/closetab.png")); 102 106 hboxLayout->addWidget(toolClose); 103 107 104 108 editFind = new QLineEdit(this); 109 hboxLayout->addWidget(editFind); 105 110 editFind->setMinimumSize(QSize(150, 0)); 106 connect(editFind, SIGNAL(textChanged(const QString&)), 107 this, SLOT(updateButtons())); 108 hboxLayout->addWidget(editFind); 109 110 toolPrevious = new QToolButton(this); 111 toolPrevious->setAutoRaise(true); 112 toolPrevious->setText(tr("Previous")); 113 toolPrevious->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 114 toolPrevious->setIcon(QIcon(QString::fromUtf8(":/trolltech/assistant/images/%1/previous.png").arg(system))); 111 connect(editFind, SIGNAL(textChanged(QString)), this, SLOT(updateButtons())); 112 113 toolPrevious = setupToolButton(tr("Previous"), 114 resourcePath + QLatin1String("/previous.png")); 115 115 hboxLayout->addWidget(toolPrevious); 116 116 117 toolNext = new QToolButton(this); 118 toolNext->setAutoRaise(true); 119 toolNext->setText(tr("Next")); 120 toolNext->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 121 toolNext->setIcon(QIcon(QString::fromUtf8(":/trolltech/assistant/images/%1/next.png").arg(system))); 117 toolNext = setupToolButton(tr("Next"), 118 resourcePath + QLatin1String("/next.png")); 122 119 hboxLayout->addWidget(toolNext); 123 120 … … 132 129 133 130 labelWrapped = new QLabel(this); 131 labelWrapped->setScaledContents(true); 132 labelWrapped->setTextFormat(Qt::RichText); 134 133 labelWrapped->setMinimumSize(QSize(0, 20)); 135 134 labelWrapped->setMaximumSize(QSize(105, 20)); 136 labelWrapped->setTextFormat(Qt::RichText); 137 labelWrapped->setScaledContents(true); 138 labelWrapped->setAlignment(Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter); 139 labelWrapped->setText(tr("<img src=\":/trolltech/assistant/images/wrap.png\"> Search wrapped")); 135 labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter); 136 labelWrapped->setText(tr("<img src=\":/trolltech/assistant/images/wrap.png\"" 137 "> Search wrapped")); 140 138 hboxLayout->addWidget(labelWrapped); 141 139 142 QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); 140 QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, 141 QSizePolicy::Minimum); 143 142 hboxLayout->addItem(spacerItem); 144 143 setMinimumWidth(minimumSizeHint().width()); … … 150 149 FindWidget::~FindWidget() 151 150 { 151 } 152 153 void FindWidget::hideEvent(QHideEvent* event) 154 { 155 #if !defined(QT_NO_WEBKIT) 156 // TODO: remove this once webkit supports setting the palette 157 if (!event->spontaneous()) 158 qApp->setPalette(appPalette); 159 #else 160 Q_UNUSED(event); 161 #endif 162 } 163 164 void FindWidget::showEvent(QShowEvent* event) 165 { 166 #if !defined(QT_NO_WEBKIT) 167 // TODO: remove this once webkit supports setting the palette 168 if (!event->spontaneous()) { 169 QPalette p = appPalette; 170 p.setColor(QPalette::Inactive, QPalette::Highlight, 171 p.color(QPalette::Active, QPalette::Highlight)); 172 p.setColor(QPalette::Inactive, QPalette::HighlightedText, 173 p.color(QPalette::Active, QPalette::HighlightedText)); 174 qApp->setPalette(p); 175 } 176 #else 177 Q_UNUSED(event); 178 #endif 152 179 } 153 180 … … 163 190 } 164 191 192 QToolButton* FindWidget::setupToolButton(const QString &text, const QString &icon) 193 { 194 QToolButton *toolButton = new QToolButton(this); 195 196 toolButton->setText(text); 197 toolButton->setAutoRaise(true); 198 toolButton->setIcon(QIcon(icon)); 199 toolButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); 200 201 return toolButton; 202 } 203 204 205 // -- 206 165 207 166 208 CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent) 167 209 : QWidget(parent) 210 , lastTabPage(0) 211 , collectionFile(engine->collectionFile()) 168 212 , findBar(0) 169 213 , tabWidget(0) 214 , findWidget(0) 170 215 , helpEngine(engine) 171 216 , printer(0) 217 , usesDefaultCollection(parent->usesDefaultCollection()) 172 218 , m_searchWidget(0) 173 219 { 220 globalActionList.clear(); 174 221 staticCentralWidget = this; 175 176 lastTabPage = 0;177 globalActionList.clear();178 collectionFile = helpEngine->collectionFile();179 usesDefaultCollection = parent->usesDefaultCollection();180 181 QString system = QLatin1String("win");182 222 QVBoxLayout *vboxLayout = new QVBoxLayout(this); 183 184 #ifdef Q_OS_MAC 185 system = QLatin1String("mac"); 223 QString resourcePath = QLatin1String(":/trolltech/assistant/images/"); 224 225 vboxLayout->setMargin(0); 226 tabWidget = new QTabWidget(this); 227 #ifndef Q_OS_MAC 228 resourcePath.append(QLatin1String("win")); 186 229 #else 187 vboxLayout->setMargin(0); 188 #endif 189 190 tabWidget = new QTabWidget(this); 191 connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(currentPageChanged(int))); 230 resourcePath.append(QLatin1String("mac")); 231 tabWidget->setDocumentMode(true); 232 #endif 233 234 connect(tabWidget, SIGNAL(currentChanged(int)), this, 235 SLOT(currentPageChanged(int))); 192 236 193 237 QToolButton *newTabButton = new QToolButton(this); 194 238 newTabButton->setAutoRaise(true); 195 239 newTabButton->setToolTip(tr("Add new page")); 196 newTabButton->setIcon(QIcon( QString::fromUtf8(":/trolltech/assistant/images/%1/addtab.png").arg(system)));240 newTabButton->setIcon(QIcon(resourcePath + QLatin1String("/addtab.png"))); 197 241 198 242 tabWidget->setCornerWidget(newTabButton, Qt::TopLeftCorner); … … 203 247 closeTabButton->setAutoRaise(true); 204 248 closeTabButton->setToolTip(tr("Close current page")); 205 closeTabButton->setIcon(QIcon( QString::fromUtf8(":/trolltech/assistant/images/%1/closetab.png").arg(system)));249 closeTabButton->setIcon(QIcon(resourcePath + QLatin1String("/closetab.png"))); 206 250 207 251 tabWidget->setCornerWidget(closeTabButton, Qt::TopRightCorner); … … 217 261 findBar->hide(); 218 262 findWidget->editFind->installEventFilter(this); 263 219 264 connect(findWidget->toolClose, SIGNAL(clicked()), findBar, SLOT(hide())); 220 221 265 connect(findWidget->toolNext, SIGNAL(clicked()), this, SLOT(findNext())); 222 266 connect(findWidget->editFind, SIGNAL(returnPressed()), this, SLOT(findNext())); 223 connect(findWidget->editFind, SIGNAL(textChanged(const QString&)), this, SLOT(findCurrentText(const QString&))); 267 connect(findWidget->editFind, SIGNAL(textChanged(QString)), this, 268 SLOT(findCurrentText(QString))); 224 269 connect(findWidget->toolPrevious, SIGNAL(clicked()), this, SLOT(findPrevious())); 225 270 … … 228 273 tabBar->installEventFilter(this); 229 274 tabBar->setContextMenuPolicy(Qt::CustomContextMenu); 230 connect(tabBar, SIGNAL(customContextMenuRequested(const QPoint&)), 231 this, SLOT(showTabBarContextMenu(const QPoint&))); 232 } 233 234 QPalette p = qApp->palette(); 275 connect(tabBar, SIGNAL(customContextMenuRequested(QPoint)), this, 276 SLOT(showTabBarContextMenu(QPoint))); 277 } 278 279 #if defined(QT_NO_WEBKIT) 280 QPalette p = palette(); 235 281 p.setColor(QPalette::Inactive, QPalette::Highlight, 236 282 p.color(QPalette::Active, QPalette::Highlight)); 237 283 p.setColor(QPalette::Inactive, QPalette::HighlightedText, 238 284 p.color(QPalette::Active, QPalette::HighlightedText)); 239 qApp->setPalette(p); 285 setPalette(p); 286 #endif 240 287 } 241 288 242 289 CentralWidget::~CentralWidget() 243 290 { 291 #ifndef QT_NO_PRINTER 292 delete printer; 293 #endif 294 244 295 QHelpEngineCore engine(collectionFile, 0); 245 296 if (!engine.setupData()) … … 248 299 QString zoomCount; 249 300 QString currentPages; 250 QLatin1Char sep('|'); 251 for (int i = 1; i < tabWidget->count(); ++i) { 301 QLatin1Char separator('|'); 302 bool searchAttached = m_searchWidget->isAttached(); 303 304 int i = searchAttached ? 1 : 0; 305 for (; i < tabWidget->count(); ++i) { 252 306 HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i)); 253 307 if (viewer && viewer->source().isValid()) { 254 currentPages.append(viewer->source().toString()).append(sep); 255 #if !defined(QT_NO_WEBKIT) 256 zoomCount.append(QString::number(viewer->textSizeMultiplier())). 257 append(sep); 258 #else 259 zoomCount.append(QString::number(viewer->zoom())).append(sep); 260 #endif 308 currentPages += viewer->source().toString() + separator; 309 zoomCount += QString::number(viewer->zoom()) + separator; 261 310 } 262 311 } 312 263 313 engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage); 264 314 engine.setCustomValue(QLatin1String("LastShownPages"), currentPages); 315 engine.setCustomValue(QLatin1String("SearchWasAttached"), searchAttached); 265 316 #if !defined(QT_NO_WEBKIT) 266 317 engine.setCustomValue(QLatin1String("LastPagesZoomWebView"), zoomCount); … … 277 328 void CentralWidget::newTab() 278 329 { 279 HelpViewer* viewer = currentHelpViewer(); 280 if (viewer) 330 HelpViewer *viewer = currentHelpViewer(); 331 #if !defined(QT_NO_WEBKIT) 332 if (viewer && viewer->hasLoadFinished()) 333 #else 334 if (viewer) 335 #endif 281 336 setSourceInNewTab(viewer->source()); 282 337 } … … 284 339 void CentralWidget::zoomIn() 285 340 { 286 HelpViewer *viewer = currentHelpViewer();341 HelpViewer *viewer = currentHelpViewer(); 287 342 if (viewer) 288 343 viewer->zoomIn(); … … 294 349 void CentralWidget::zoomOut() 295 350 { 296 HelpViewer *viewer = currentHelpViewer();351 HelpViewer *viewer = currentHelpViewer(); 297 352 if (viewer) 298 353 viewer->zoomOut(); … … 309 364 void CentralWidget::nextPage() 310 365 { 311 i f(tabWidget->currentIndex() < tabWidget->count() -1)312 tabWidget->setCurrentIndex(tabWidget->currentIndex() +1);313 else314 tabWidget->setCurrentIndex(0);366 int index = tabWidget->currentIndex() + 1; 367 if (index >= tabWidget->count()) 368 index = 0; 369 tabWidget->setCurrentIndex(index); 315 370 } 316 371 317 372 void CentralWidget::resetZoom() 318 373 { 319 HelpViewer *viewer = currentHelpViewer();374 HelpViewer *viewer = currentHelpViewer(); 320 375 if (viewer) 321 376 viewer->resetZoom(); … … 328 383 { 329 384 int index = tabWidget->currentIndex() -1; 330 if(index >= 0) 331 tabWidget->setCurrentIndex(index); 332 else 333 tabWidget->setCurrentIndex(tabWidget->count() -1); 385 if (index < 0) 386 index = tabWidget->count() -1; 387 tabWidget->setCurrentIndex(index); 334 388 } 335 389 … … 341 395 void CentralWidget::closeTab() 342 396 { 343 HelpViewer *viewer = currentHelpViewer();397 HelpViewer *viewer = currentHelpViewer(); 344 398 if (!viewer|| tabWidget->count() == 1) 345 399 return; … … 351 405 void CentralWidget::setSource(const QUrl &url) 352 406 { 353 HelpViewer* viewer = currentHelpViewer(); 354 HelpViewer* lastViewer = qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage)); 407 HelpViewer *viewer = currentHelpViewer(); 408 HelpViewer *lastViewer = 409 qobject_cast<HelpViewer*>(tabWidget->widget(lastTabPage)); 355 410 356 411 if (!viewer && !lastViewer) { … … 360 415 tabWidget->setCurrentIndex(lastTabPage); 361 416 connectSignals(); 362 } else 417 } else { 363 418 viewer = lastViewer; 419 } 364 420 365 421 viewer->setSource(url); … … 370 426 } 371 427 428 void CentralWidget::setupWidget() 429 { 430 int option = helpEngine->customValue(QLatin1String("StartOption"), 431 ShowLastPages).toInt(); 432 433 if (option != ShowLastPages) { 434 QString homePage; 435 if (option == ShowHomePage) { 436 homePage = helpEngine->customValue(QLatin1String("defaultHomepage"), 437 QLatin1String("help")).toString(); 438 homePage = helpEngine->customValue(QLatin1String("homepage"), 439 homePage).toString(); 440 } 441 if (option == ShowBlankPage) 442 homePage = QLatin1String("about:blank"); 443 setSource(homePage); 444 } else { 445 setLastShownPages(); 446 } 447 } 448 372 449 void CentralWidget::setLastShownPages() 373 450 { 374 #if !defined(QT_NO_WEBKIT) 375 QLatin1String zoom("LastPagesZoomWebView"); 376 #else 377 QLatin1String zoom("LastPagesZoomTextBrowser"); 378 #endif 379 380 const QStringList lastShownPageList = 381 helpEngine->customValue(QLatin1String("LastShownPages")).toString(). 382 split(QLatin1Char('|'), QString::SkipEmptyParts); 383 384 if (!lastShownPageList.isEmpty()) { 385 QVector<QString>zoomList = helpEngine->customValue(zoom).toString(). 386 split(QLatin1Char('|'), QString::SkipEmptyParts).toVector(); 387 if (zoomList.isEmpty()) 388 zoomList.fill(QLatin1String("0.0"), lastShownPageList.size()); 389 else if(zoomList.count() < lastShownPageList.count()) { 390 zoomList.insert(zoomList.count(), 391 lastShownPageList.count() - zoomList.count(), QLatin1String("0.0")); 392 } 393 394 QVector<QString>::const_iterator zIt = zoomList.constBegin(); 395 QStringList::const_iterator it = lastShownPageList.constBegin(); 396 for (; it != lastShownPageList.constEnd(); ++it, ++zIt) 397 setSourceInNewTab((*it), (*zIt).toFloat()); 398 399 tabWidget->setCurrentIndex(helpEngine->customValue( 400 QLatin1String("LastTabPage"), 1).toInt()); 401 } else { 451 const QLatin1String key("LastShownPages"); 452 QString value = helpEngine->customValue(key, QString()).toString(); 453 const QStringList lastShownPageList = value.split(QLatin1Char('|'), 454 QString::SkipEmptyParts); 455 456 const int pageCount = lastShownPageList.count(); 457 if (pageCount == 0) { 402 458 if (usesDefaultCollection) 403 459 setSource(QUrl(QLatin1String("help"))); 404 } 460 else 461 setSource(QUrl(QLatin1String("about:blank"))); 462 return; 463 } 464 465 #if !defined(QT_NO_WEBKIT) 466 const QLatin1String zoom("LastPagesZoomWebView"); 467 #else 468 const QLatin1String zoom("LastPagesZoomTextBrowser"); 469 #endif 470 471 value = helpEngine->customValue(zoom, QString()).toString(); 472 QVector<QString> zoomVector = value.split(QLatin1Char('|'), 473 QString::SkipEmptyParts).toVector(); 474 475 const int zoomCount = zoomVector.count(); 476 zoomVector.insert(zoomCount, pageCount - zoomCount, QLatin1String("0.0")); 477 478 QVector<QString>::const_iterator zIt = zoomVector.constBegin(); 479 QStringList::const_iterator it = lastShownPageList.constBegin(); 480 for (; it != lastShownPageList.constEnd(); ++it, ++zIt) 481 setSourceInNewTab((*it), (*zIt).toFloat()); 482 483 const QLatin1String lastTab("LastTabPage"); 484 int tab = helpEngine->customValue(lastTab, 1).toInt(); 485 486 const QLatin1String searchKey("SearchWasAttached"); 487 const bool searchIsAttached = m_searchWidget->isAttached(); 488 const bool searchWasAttached = helpEngine->customValue(searchKey).toBool(); 489 490 if (searchWasAttached && !searchIsAttached) 491 tabWidget->setCurrentIndex(--tab); 492 else if (!searchWasAttached && searchIsAttached) 493 tabWidget->setCurrentIndex(++tab); 494 else 495 tabWidget->setCurrentIndex(tab); 405 496 } 406 497 407 498 bool CentralWidget::hasSelection() const 408 499 { 409 const HelpViewer *viewer = currentHelpViewer();500 const HelpViewer *viewer = currentHelpViewer(); 410 501 return viewer ? viewer->hasSelection() : false; 411 502 } … … 413 504 QUrl CentralWidget::currentSource() const 414 505 { 415 const HelpViewer *viewer = currentHelpViewer();506 const HelpViewer *viewer = currentHelpViewer(); 416 507 if (viewer) 417 508 return viewer->source(); … … 422 513 QString CentralWidget::currentTitle() const 423 514 { 424 const HelpViewer *viewer = currentHelpViewer();515 const HelpViewer *viewer = currentHelpViewer(); 425 516 if (viewer) 426 517 return viewer->documentTitle(); … … 431 522 void CentralWidget::copySelection() 432 523 { 433 HelpViewer *viewer = currentHelpViewer();524 HelpViewer *viewer = currentHelpViewer(); 434 525 if (viewer) 435 526 viewer->copy(); … … 454 545 { 455 546 #ifndef QT_NO_PRINTER 456 HelpViewer *viewer = currentHelpViewer();547 HelpViewer *viewer = currentHelpViewer(); 457 548 if (!viewer) 458 549 return; … … 480 571 initPrinter(); 481 572 QPrintPreviewDialog preview(printer, this); 482 connect(&preview, SIGNAL(paintRequested(QPrinter *)), SLOT(printPreview(QPrinter *))); 573 connect(&preview, SIGNAL(paintRequested(QPrinter*)), 574 SLOT(printPreview(QPrinter*))); 483 575 preview.exec(); 484 576 #endif … … 510 602 void CentralWidget::home() 511 603 { 512 HelpViewer *viewer = currentHelpViewer();604 HelpViewer *viewer = currentHelpViewer(); 513 605 if (viewer) 514 606 viewer->home(); … … 517 609 bool CentralWidget::isForwardAvailable() const 518 610 { 519 const HelpViewer *viewer = currentHelpViewer();611 const HelpViewer *viewer = currentHelpViewer(); 520 612 if (viewer) 521 613 return viewer->isForwardAvailable(); … … 526 618 void CentralWidget::forward() 527 619 { 528 HelpViewer *viewer = currentHelpViewer();620 HelpViewer *viewer = currentHelpViewer(); 529 621 if (viewer) 530 622 viewer->forward(); … … 533 625 bool CentralWidget::isBackwardAvailable() const 534 626 { 535 const HelpViewer *viewer = currentHelpViewer();627 const HelpViewer *viewer = currentHelpViewer(); 536 628 if (viewer) 537 629 return viewer->isBackwardAvailable(); … … 542 634 void CentralWidget::backward() 543 635 { 544 HelpViewer *viewer = currentHelpViewer();636 HelpViewer *viewer = currentHelpViewer(); 545 637 if (viewer) 546 638 viewer->backward(); … … 560 652 void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom) 561 653 { 562 HelpViewer *viewer;654 HelpViewer *viewer; 563 655 564 656 #if defined(QT_NO_WEBKIT) … … 575 667 quoteTabTitle(viewer->documentTitle()))); 576 668 577 QFont font = qApp->font(); 578 bool userFont = helpEngine->customValue(QLatin1String("useBrowserFont")).toBool(); 579 if (userFont) { 580 font = qVariantValue<QFont>(helpEngine->customValue( 581 QLatin1String("browserFont"))); 582 } 583 584 #if !defined(QT_NO_WEBKIT) 585 QWebSettings* settings = QWebSettings::globalSettings(); 586 if (!userFont) { 587 int fontSize = settings->fontSize(QWebSettings::DefaultFontSize); 588 QString fontFamily = settings->fontFamily(QWebSettings::StandardFont); 589 font = QFont(fontFamily, fontSize); 590 } 591 592 QWebView* view = qobject_cast<QWebView*> (viewer); 593 if (view) { 594 settings = view->settings(); 595 settings->setFontFamily(QWebSettings::StandardFont, font.family()); 596 settings->setFontSize(QWebSettings::DefaultFontSize, font.pointSize()); 597 } else if (viewer) { 598 viewer->setFont(font); 599 } 669 QFont font; 670 getBrowserFontFor(viewer, &font); 671 672 #if defined(QT_NO_WEBKIT) 673 font.setPointSize((int)(font.pointSize() + zoom)); 674 setBrowserFontFor(viewer, font); 675 viewer->setZoom((int)zoom); 676 #else 677 setBrowserFontFor(viewer, font); 600 678 viewer->setTextSizeMultiplier(zoom == 0.0 ? 1.0 : zoom); 601 #else602 font.setPointSize((int)(font.pointSize() + zoom));603 viewer->setFont(font);604 viewer->setZoom((int)zoom);605 679 #endif 606 680 … … 610 684 HelpViewer *CentralWidget::newEmptyTab() 611 685 { 612 HelpViewer *viewer = new HelpViewer(helpEngine, this);686 HelpViewer *viewer = new HelpViewer(helpEngine, this); 613 687 viewer->installEventFilter(this); 614 688 viewer->setFocus(Qt::OtherFocusReason); … … 629 703 void CentralWidget::connectSignals() 630 704 { 631 const HelpViewer *viewer = currentHelpViewer();705 const HelpViewer *viewer = currentHelpViewer(); 632 706 if (viewer) { 633 connect(viewer, SIGNAL(copyAvailable(bool)), this, SIGNAL(copyAvailable(bool))); 634 connect(viewer, SIGNAL(forwardAvailable(bool)), this, SIGNAL(forwardAvailable(bool))); 635 connect(viewer, SIGNAL(backwardAvailable(bool)), this, SIGNAL(backwardAvailable(bool))); 636 connect(viewer, SIGNAL(sourceChanged(const QUrl&)), this, SIGNAL(sourceChanged(const QUrl&))); 637 connect(viewer, SIGNAL(highlighted(const QString&)), this, SIGNAL(highlighted(const QString&))); 638 639 connect(viewer, SIGNAL(sourceChanged(const QUrl&)), this, SLOT(setTabTitle(const QUrl&))); 707 connect(viewer, SIGNAL(copyAvailable(bool)), this, 708 SIGNAL(copyAvailable(bool))); 709 connect(viewer, SIGNAL(forwardAvailable(bool)), this, 710 SIGNAL(forwardAvailable(bool))); 711 connect(viewer, SIGNAL(backwardAvailable(bool)), this, 712 SIGNAL(backwardAvailable(bool))); 713 connect(viewer, SIGNAL(sourceChanged(QUrl)), this, 714 SIGNAL(sourceChanged(QUrl))); 715 connect(viewer, SIGNAL(highlighted(QString)), this, 716 SIGNAL(highlighted(QString))); 717 connect(viewer, SIGNAL(sourceChanged(QUrl)), this, 718 SLOT(setTabTitle(QUrl))); 640 719 } 641 720 } … … 659 738 } 660 739 661 void CentralWidget::setTabTitle(const QUrl& url) 662 { 663 int tab = lastTabPage; 664 HelpViewer* viewer = currentHelpViewer(); 665 740 void CentralWidget::setTabTitle(const QUrl &url) 741 { 742 Q_UNUSED(url) 666 743 #if !defined(QT_NO_WEBKIT) 667 if (!viewer || viewer->source() != url) {668 QTabBar *tabBar = qFindChild<QTabBar*>(tabWidget);669 for (tab = 0; tab < tabBar->count(); ++tab) {670 viewer = qobject_cast<HelpViewer*>(tabWidget->widget(tab));671 if (viewer && viewer->source() == url)672 break;744 QTabBar *tabBar = qFindChild<QTabBar*>(tabWidget); 745 for (int tab = 0; tab < tabBar->count(); ++tab) { 746 HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(tab)); 747 if (viewer) { 748 tabWidget->setTabText(tab, 749 quoteTabTitle(viewer->documentTitle().trimmed())); 673 750 } 674 751 } 675 752 #else 676 Q_UNUSED(url) 677 #endif 678 753 HelpViewer *viewer = currentHelpViewer(); 679 754 if (viewer) { 680 tabWidget->setTabText( tab,755 tabWidget->setTabText(lastTabPage, 681 756 quoteTabTitle(viewer->documentTitle().trimmed())); 682 757 } 758 #endif 683 759 } 684 760 … … 686 762 { 687 763 const HelpViewer *viewer = currentHelpViewer(); 688 689 if (viewer || tabWidget->count() == 1) 764 if (viewer) 690 765 lastTabPage = index; 691 766 692 bool enabled = false; 693 if (viewer) { 694 enabled = true; 695 if (!m_searchWidget) 696 enabled = tabWidget->count() > 1; 697 } 698 699 tabWidget->cornerWidget(Qt::TopRightCorner)->setEnabled(enabled); 700 tabWidget->cornerWidget(Qt::TopLeftCorner)->setEnabled(m_searchWidget ? enabled : true); 701 702 emit currentViewerChanged(); 767 QWidget *widget = tabWidget->cornerWidget(Qt::TopRightCorner); 768 widget->setEnabled(viewer && enableTabCloseAction()); 769 770 widget = tabWidget->cornerWidget(Qt::TopLeftCorner); 771 widget->setEnabled(viewer ? true : false); 772 773 emit currentViewerChanged(); 703 774 } 704 775 705 776 void CentralWidget::showTabBarContextMenu(const QPoint &point) 706 777 { 707 HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, point);778 HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, point); 708 779 if (!viewer) 709 780 return; … … 712 783 713 784 QMenu menu(QLatin1String(""), tabBar); 714 QAction *new_page = menu.addAction(tr("Add New Page")); 715 QAction *close_page = menu.addAction(tr("Close This Page")); 716 QAction *close_pages = menu.addAction(tr("Close Other Pages")); 785 QAction *newPage = menu.addAction(tr("Add New Page")); 786 787 bool enableAction = enableTabCloseAction(); 788 QAction *closePage = menu.addAction(tr("Close This Page")); 789 closePage->setEnabled(enableAction); 790 791 QAction *closePages = menu.addAction(tr("Close Other Pages")); 792 closePages->setEnabled(enableAction); 793 717 794 menu.addSeparator(); 795 718 796 QAction *newBookmark = menu.addAction(tr("Add Bookmark for this Page...")); 719 720 if (tabBar->count() == 1) { 721 close_page->setEnabled(false); 722 close_pages->setEnabled(false); 723 } else if (m_searchWidget && tabBar->count() == 2) { 724 close_pages->setEnabled(false); 725 } 726 727 QAction *picked_action = menu.exec(tabBar->mapToGlobal(point)); 728 if (!picked_action) 729 return; 730 731 if (picked_action == new_page) 797 const QString &url = viewer->source().toString(); 798 if (url.isEmpty() || url == QLatin1String("about:blank")) 799 newBookmark->setEnabled(false); 800 801 QAction *pickedAction = menu.exec(tabBar->mapToGlobal(point)); 802 if (pickedAction == newPage) 732 803 setSourceInNewTab(viewer->source()); 733 804 734 if (picked _action == close_page) {805 if (pickedAction == closePage) { 735 806 tabWidget->removeTab(tabWidget->indexOf(viewer)); 736 807 QTimer::singleShot(0, viewer, SLOT(deleteLater())); 737 808 } 738 809 739 if (picked _action == close_pages) {810 if (pickedAction == closePages) { 740 811 int currentPage = tabWidget->indexOf(viewer); 741 812 for (int i = tabBar->count() -1; i >= 0; --i) { … … 751 822 } 752 823 753 if (picked _action == newBookmark)824 if (pickedAction == newBookmark) 754 825 emit addNewBookmark(viewer->documentTitle(), viewer->source().toString()); 755 826 } … … 757 828 bool CentralWidget::eventFilter(QObject *object, QEvent *e) 758 829 { 759 if ( currentHelpViewer() == object && e->type() == QEvent::KeyPress){830 if (e->type() == QEvent::KeyPress) { 760 831 QKeyEvent *ke = static_cast<QKeyEvent*>(e); 761 if (ke->key() == Qt::Key_Backspace) { 762 HelpViewer *viewer = currentHelpViewer(); 832 switch (ke->key()) { 833 default: { 834 return QWidget::eventFilter(object, e); 835 } break; 836 837 case Qt::Key_Escape: { 838 if (findWidget->editFind == object) { 839 findBar->hide(); 840 if (HelpViewer *viewer = currentHelpViewer()) 841 viewer->setFocus(); 842 } 843 } break; 844 845 case Qt::Key_Backspace: { 846 HelpViewer *viewer = currentHelpViewer(); 847 if (viewer == object) { 763 848 #if defined(QT_NO_WEBKIT) 764 if (viewer &&viewer->isBackwardAvailable()) {849 if (viewer->isBackwardAvailable()) { 765 850 #else 766 if (viewer && viewer->isBackwardAvailable() && !viewer->hasFocus()) { 767 #endif 768 viewer->backward(); 769 return true; 851 if (viewer->isBackwardAvailable() && !viewer->hasFocus()) { 852 #endif 853 viewer->backward(); 854 return true; 855 } 856 } 857 } break; 858 } 859 } 860 861 if (qobject_cast<QTabBar*>(object)) { 862 const bool dblClick = e->type() == QEvent::MouseButtonDblClick; 863 if ((e->type() == QEvent::MouseButtonRelease) || dblClick) { 864 QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(e); 865 HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, 866 mouseEvent->pos()); 867 if (viewer) { 868 if ((mouseEvent->button() == Qt::MidButton) || dblClick) { 869 if (availableHelpViewer() > 1) { 870 tabWidget->removeTab(tabWidget->indexOf(viewer)); 871 QTimer::singleShot(0, viewer, SLOT(deleteLater())); 872 currentPageChanged(tabWidget->currentIndex()); 873 return true; 874 } 875 } 770 876 } 771 877 } 772 878 } 773 879 774 QTabBar *tabBar = qobject_cast<QTabBar*>(object);775 bool mousRel = e->type() == QEvent::MouseButtonRelease;776 bool dblClick = e->type() == QEvent::MouseButtonDblClick;777 778 if (tabBar && (mousRel || dblClick)) {779 QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(e);780 HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, mouseEvent->pos());781 if (!m_searchWidget && tabWidget->count() <= 1)782 return QWidget::eventFilter(object, e);783 784 if (viewer && (mouseEvent->button() == Qt::MidButton || dblClick)) {785 tabWidget->removeTab(tabWidget->indexOf(viewer));786 QTimer::singleShot(0, viewer, SLOT(deleteLater()));787 currentPageChanged(tabWidget->currentIndex());788 return true;789 }790 } else if (object == findWidget->editFind && e->type() == QEvent::KeyPress) {791 QKeyEvent *ke = static_cast<QKeyEvent*>(e);792 if (ke->key() == Qt::Key_Escape) {793 findBar->hide();794 HelpViewer *hv = currentHelpViewer();795 if (hv)796 hv->setFocus();797 }798 }799 880 return QWidget::eventFilter(object, e); 800 881 } … … 802 883 void CentralWidget::keyPressEvent(QKeyEvent *e) 803 884 { 804 QStringtext = e->text();885 const QString &text = e->text(); 805 886 if (text.startsWith(QLatin1Char('/'))) { 806 887 if (!findBar->isVisible()) { … … 816 897 } 817 898 818 void CentralWidget::find(QString ttf, bool forward, bool backward) 819 { 820 QTextCursor cursor; 821 QTextDocument *doc = 0; 822 QTextBrowser *browser = 0; 823 824 HelpViewer* viewer = currentHelpViewer(); 899 void CentralWidget::find(const QString &ttf, bool forward, bool backward) 900 { 825 901 QPalette p = findWidget->editFind->palette(); 826 902 p.setColor(QPalette::Active, QPalette::Base, Qt::white); 827 903 904 if (!ttf.isEmpty()) { 905 HelpViewer *viewer = currentHelpViewer(); 906 907 bool found = false; 828 908 #if !defined(QT_NO_WEBKIT) 829 Q_UNUSED(forward) 830 Q_UNUSED(doc) 831 Q_UNUSED(browser) 832 833 if (viewer) { 834 QWebPage::FindFlags options; 835 if (backward) 836 options |= QWebPage::FindBackward; 837 838 if (findWidget->checkCase->isChecked()) 839 options |= QWebPage::FindCaseSensitively; 840 841 bool found = viewer->findText(ttf, options); 842 findWidget->labelWrapped->hide(); 843 844 if (!found) { 845 options |= QWebPage::FindWrapsAroundDocument; 909 if (viewer) { 910 QWebPage::FindFlags options; 911 if (backward) 912 options |= QWebPage::FindBackward; 913 914 if (findWidget->checkCase->isChecked()) 915 options |= QWebPage::FindCaseSensitively; 916 846 917 found = viewer->findText(ttf, options); 918 findWidget->labelWrapped->hide(); 847 919 848 920 if (!found) { 849 p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); 850 } else { 851 findWidget->labelWrapped->show(); 921 options |= QWebPage::FindWrapsAroundDocument; 922 found = viewer->findText(ttf, options); 923 if (found) 924 findWidget->labelWrapped->show(); 852 925 } 926 } else if (tabWidget->currentWidget() == m_searchWidget) { 927 QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget); 928 found = findInTextBrowser(browser, ttf, forward, backward); 853 929 } 854 }855 930 #else 856 if (viewer) { 857 doc = viewer->document(); 858 cursor = viewer->textCursor(); 859 browser = qobject_cast<QTextBrowser*>(viewer); 860 } 861 862 if (tabWidget->currentWidget() == m_searchWidget) { 863 QTextBrowser* browser = qFindChild<QTextBrowser*>(m_searchWidget); 864 if (browser) { 865 doc = browser->document(); 866 cursor = browser->textCursor(); 867 } 868 } 869 870 if (!browser || !doc || cursor.isNull()) 871 return; 872 873 QTextDocument::FindFlags options; 874 875 if (cursor.hasSelection()) 876 cursor.setPosition(forward ? cursor.position() : cursor.anchor(), QTextCursor::MoveAnchor); 877 878 QTextCursor newCursor = cursor; 879 880 if (!ttf.isEmpty()) { 881 if (backward) 882 options |= QTextDocument::FindBackward; 883 884 if (findWidget->checkCase->isChecked()) 885 options |= QTextDocument::FindCaseSensitively; 886 887 if (findWidget->checkWholeWords->isChecked()) 888 options |= QTextDocument::FindWholeWords; 889 890 newCursor = doc->find(ttf, cursor, options); 891 findWidget->labelWrapped->hide(); 892 893 if (newCursor.isNull()) { 894 QTextCursor ac(doc); 895 ac.movePosition(options & QTextDocument::FindBackward 896 ? QTextCursor::End : QTextCursor::Start); 897 newCursor = doc->find(ttf, ac, options); 898 if (newCursor.isNull()) { 899 p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); 900 newCursor = cursor; 901 } else { 902 findWidget->labelWrapped->show(); 903 } 904 } 905 } 906 #endif 931 QTextBrowser *browser = qobject_cast<QTextBrowser*>(viewer); 932 if (tabWidget->currentWidget() == m_searchWidget) 933 browser = qFindChild<QTextBrowser*>(m_searchWidget); 934 found = findInTextBrowser(browser, ttf, forward, backward); 935 #endif 936 937 if (!found) 938 p.setColor(QPalette::Active, QPalette::Base, QColor(255, 102, 102)); 939 } 907 940 908 941 if (!findWidget->isVisible()) 909 942 findWidget->show(); 910 911 #if defined(QT_NO_WEBKIT)912 if (browser)913 browser->setTextCursor(newCursor);914 #endif915 943 findWidget->editFind->setPalette(p); 916 944 } 917 945 918 void CentralWidget::activateSearch() 919 { 920 if (tabWidget->widget(0) != m_searchWidget) 946 bool CentralWidget::findInTextBrowser(QTextBrowser* browser, const QString &ttf, 947 bool forward, bool backward) 948 { 949 if (!browser) 950 return false; 951 952 QTextDocument *doc = browser->document(); 953 QTextCursor cursor = browser->textCursor(); 954 955 if (!doc || cursor.isNull()) 956 return false; 957 958 QTextDocument::FindFlags options; 959 960 if (cursor.hasSelection()) { 961 cursor.setPosition(forward ? cursor.position() : cursor.anchor(), 962 QTextCursor::MoveAnchor); 963 } 964 965 if (backward) 966 options |= QTextDocument::FindBackward; 967 968 if (findWidget->checkCase->isChecked()) 969 options |= QTextDocument::FindCaseSensitively; 970 971 if (findWidget->checkWholeWords->isChecked()) 972 options |= QTextDocument::FindWholeWords; 973 974 findWidget->labelWrapped->hide(); 975 976 bool found = true; 977 QTextCursor newCursor = doc->find(ttf, cursor, options); 978 if (newCursor.isNull()) { 979 QTextCursor ac(doc); 980 ac.movePosition(options & QTextDocument::FindBackward 981 ? QTextCursor::End : QTextCursor::Start); 982 newCursor = doc->find(ttf, ac, options); 983 if (newCursor.isNull()) { 984 found = false; 985 newCursor = cursor; 986 } else { 987 findWidget->labelWrapped->show(); 988 } 989 } 990 browser->setTextCursor(newCursor); 991 return found; 992 } 993 994 void CentralWidget::updateBrowserFont() 995 { 996 QFont font; 997 bool searchAttached = searchWidgetAttached(); 998 if (searchAttached) { 999 getBrowserFontFor(m_searchWidget, &font); 1000 setBrowserFontFor(m_searchWidget, font); 1001 } 1002 1003 int i = searchAttached ? 1 : 0; 1004 getBrowserFontFor(tabWidget->widget(i), &font); 1005 for (i; i < tabWidget->count(); ++i) 1006 setBrowserFontFor(tabWidget->widget(i), font); 1007 } 1008 1009 void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine) 1010 { 1011 if (m_searchWidget) 1012 return; 1013 1014 m_searchWidget = new SearchWidget(searchEngine, this); 1015 connect(m_searchWidget, SIGNAL(requestShowLink(QUrl)), this, 1016 SLOT(setSourceFromSearch(QUrl))); 1017 connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(QUrl)), this, 1018 SLOT(setSourceFromSearchInNewTab(QUrl))); 1019 1020 QFont font; 1021 getBrowserFontFor(m_searchWidget, &font); 1022 setBrowserFontFor(m_searchWidget, font); 1023 } 1024 1025 void CentralWidget::activateSearchWidget(bool updateLastTabPage) 1026 { 1027 if (!m_searchWidget) 921 1028 createSearchWidget(helpEngine->searchEngine()); 1029 1030 if (!m_searchWidget->isAttached()) { 1031 tabWidget->insertTab(0, m_searchWidget, tr("Search")); 1032 m_searchWidget->setAttached(true); 1033 1034 if (updateLastTabPage) 1035 lastTabPage++; 1036 } 922 1037 923 1038 tabWidget->setCurrentWidget(m_searchWidget); … … 925 1040 } 926 1041 927 void CentralWidget::updateBrowserFont()928 {929 QFont font = qApp->font();930 bool userFont = helpEngine->customValue(QLatin1String("useBrowserFont")).toBool();931 if (userFont) {932 font = qVariantValue<QFont>(helpEngine->customValue(933 QLatin1String("browserFont")));934 }935 936 #if !defined(QT_NO_WEBKIT)937 QWebSettings* settings = QWebSettings::globalSettings();938 if (!userFont) {939 int fontSize = settings->fontSize(QWebSettings::DefaultFontSize);940 QString fontFamily = settings->fontFamily(QWebSettings::StandardFont);941 font = QFont(fontFamily, fontSize);942 }943 #endif944 945 QWidget* widget = 0;946 for (int i = 0; i < tabWidget->count(); ++i) {947 widget = tabWidget->widget(i);948 #if !defined(QT_NO_WEBKIT)949 QWebView* view = qobject_cast<QWebView*> (widget);950 if (view) {951 settings = view->settings();952 settings->setFontFamily(QWebSettings::StandardFont, font.family());953 settings->setFontSize(QWebSettings::DefaultFontSize, font.pointSize());954 } else if (widget) {955 if (!userFont)956 font = qApp->font();957 widget->setFont(font);958 }959 #else960 if (widget && widget->font() != font)961 widget->setFont(font);962 #endif963 }964 }965 966 void CentralWidget::createSearchWidget(QHelpSearchEngine *searchEngine)967 {968 if (!m_searchWidget) {969 m_searchWidget = new SearchWidget(searchEngine, this);970 connect(m_searchWidget, SIGNAL(requestShowLink(const QUrl&)), this,971 SLOT(setSourceFromSearch(const QUrl&)));972 connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(const QUrl&)), this,973 SLOT(setSourceFromSearchInNewTab(const QUrl&)));974 }975 tabWidget->insertTab(0, m_searchWidget, tr("Search"));976 }977 978 1042 void CentralWidget::removeSearchWidget() 979 1043 { 980 tabWidget->removeTab(0); 1044 if (searchWidgetAttached()) { 1045 tabWidget->removeTab(0); 1046 m_searchWidget->setAttached(false); 1047 } 1048 } 1049 1050 int CentralWidget::availableHelpViewer() const 1051 { 1052 int count = tabWidget->count(); 1053 if (searchWidgetAttached()) 1054 count--; 1055 return count; 1056 } 1057 1058 bool CentralWidget::enableTabCloseAction() const 1059 { 1060 int minTabCount = 1; 1061 if (searchWidgetAttached()) 1062 minTabCount = 2; 1063 1064 return (tabWidget->count() > minTabCount); 981 1065 } 982 1066 … … 1009 1093 return; 1010 1094 1011 QHelpSearchEngine *searchEngine = helpEngine->searchEngine();1095 QHelpSearchEngine *searchEngine = helpEngine->searchEngine(); 1012 1096 QList<QHelpSearchQuery> queryList = searchEngine->query(); 1013 1097 … … 1078 1162 } 1079 1163 1164 void CentralWidget::getBrowserFontFor(QWidget *viewer, QFont *font) 1165 { 1166 const QLatin1String key("useBrowserFont"); 1167 if (!helpEngine->customValue(key, false).toBool()) { 1168 *font = qApp->font(); // case for QTextBrowser and SearchWidget 1169 #if !defined(QT_NO_WEBKIT) 1170 QWebView *view = qobject_cast<QWebView*> (viewer); 1171 if (view) { 1172 QWebSettings *settings = QWebSettings::globalSettings(); 1173 *font = QFont(settings->fontFamily(QWebSettings::StandardFont), 1174 settings->fontSize(QWebSettings::DefaultFontSize)); 1175 } 1176 #endif 1177 } else { 1178 *font = qVariantValue<QFont>(helpEngine->customValue( 1179 QLatin1String("browserFont"))); 1180 } 1181 } 1182 1183 void CentralWidget::setBrowserFontFor(QWidget *widget, const QFont &font) 1184 { 1185 #if !defined(QT_NO_WEBKIT) 1186 QWebView *view = qobject_cast<QWebView*> (widget); 1187 if (view) { 1188 QWebSettings *settings = view->settings(); 1189 settings->setFontFamily(QWebSettings::StandardFont, font.family()); 1190 settings->setFontSize(QWebSettings::DefaultFontSize, font.pointSize()); 1191 } else if (widget && widget->font() != font) { 1192 widget->setFont(font); 1193 } 1194 #else 1195 if (widget && widget->font() != font) 1196 widget->setFont(font); 1197 #endif 1198 } 1199 1080 1200 QT_END_NAMESPACE -
trunk/tools/assistant/tools/assistant/centralwidget.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 ** … … 48 48 49 49 #include <QtGui/QWidget> 50 51 #include "searchwidget.h" 50 52 51 53 QT_BEGIN_NAMESPACE … … 56 58 class QCheckBox; 57 59 class QLineEdit; 60 class QTextBrowser; 58 61 class QToolButton; 59 62 … … 65 68 class MainWindow; 66 69 67 class SearchWidget;68 70 class QHelpSearchEngine; 69 71 … … 80 82 void findPrevious(); 81 83 84 protected: 85 void hideEvent(QHideEvent* event); 86 void showEvent(QShowEvent * event); 87 82 88 private slots: 83 89 void updateButtons(); 90 91 private: 92 QToolButton* setupToolButton(const QString &text, const QString &icon); 84 93 85 94 private: … … 92 101 QCheckBox *checkWholeWords; 93 102 103 QPalette appPalette; 94 104 friend class CentralWidget; 95 105 }; … … 103 113 ~CentralWidget(); 104 114 105 void set LastShownPages();115 void setupWidget(); 106 116 bool hasSelection() const; 107 117 QUrl currentSource() const; … … 114 124 HelpViewer *currentHelpViewer() const; 115 125 void activateTab(bool onlyHelpViewer = false); 116 void activateSearch(); 126 127 bool searchWidgetAttached() const { 128 return m_searchWidget && m_searchWidget->isAttached(); 129 } 117 130 void createSearchWidget(QHelpSearchEngine *searchEngine); 131 void activateSearchWidget(bool updateLastTabPage = false); 118 132 void removeSearchWidget(); 133 134 int availableHelpViewer() const; 135 bool enableTabCloseAction() const; 119 136 120 137 void closeTabAt(int index); … … 168 185 169 186 private: 170 void connectSignals(); 187 void connectSignals(); 171 188 bool eventFilter(QObject *object, QEvent *e); 172 void find(QString ttf, bool forward, bool backward); 189 void find(const QString &ttf, bool forward, bool backward); 190 bool findInTextBrowser(QTextBrowser* browser, const QString &ttf, 191 bool forward, bool backward); 173 192 void initPrinter(); 174 193 QString quoteTabTitle(const QString &title) const; 175 194 void highlightSearchTerms(); 195 void setLastShownPages(); 196 197 void getBrowserFontFor(QWidget* viewer, QFont *font); 198 void setBrowserFontFor(QWidget *widget, const QFont &font); 176 199 177 200 private: … … 181 204 182 205 QWidget *findBar; 183 QTabWidget *tabWidget;206 QTabWidget *tabWidget; 184 207 FindWidget *findWidget; 185 208 QHelpEngine *helpEngine; 186 209 QPrinter *printer; 187 210 bool usesDefaultCollection; 188 189 SearchWidget *m_searchWidget;211 212 SearchWidget *m_searchWidget; 190 213 }; 191 214 -
trunk/tools/assistant/tools/assistant/cmdlineparser.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 ** … … 57 57 m_search(Untouched), 58 58 m_register(None), 59 m_removeSearchIndex(false), 59 60 m_copy(false), 60 61 m_quiet(false) … … 84 85 " file.\n" 85 86 "-setCurrentFilter filter Set the filter as the active filter.\n" 87 "-remove-search-index Removes the full text search index.\n" 86 88 "-quiet Does not display any error or\n" 87 89 " status message.\n" … … 218 220 break; 219 221 } 222 } else if (arg == QLatin1String("-remove-search-index")) { 223 m_removeSearchIndex = true; 220 224 } else if (arg == QLatin1String("-quiet")) { 221 225 continue; … … 308 312 } 309 313 314 bool CmdLineParser::removeSearchIndex() const 315 { 316 return m_removeSearchIndex; 317 } 318 310 319 CmdLineParser::RegisterState CmdLineParser::registerRequest() const 311 320 { -
trunk/tools/assistant/tools/assistant/cmdlineparser.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 ** … … 68 68 ShowState search() const; 69 69 QString currentFilter() const; 70 bool removeSearchIndex() const; 70 71 RegisterState registerRequest() const; 71 72 QString helpFile() const; … … 91 92 RegisterState m_register; 92 93 QString m_currentFilter; 94 bool m_removeSearchIndex; 93 95 bool m_copy; 94 96 bool m_quiet; -
trunk/tools/assistant/tools/assistant/contentwindow.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 ** … … 125 125 QItemSelectionModel *sm = m_contentWidget->selectionModel(); 126 126 127 Qt::MouseButtons button = me->button(); 127 128 if (index.isValid() && (sm && sm->isSelected(index))) { 128 if (me->button() == Qt::LeftButton) { 129 itemClicked(index); 130 } else if (me->button() == Qt::MidButton) { 129 if ((button == Qt::LeftButton && (me->modifiers() & Qt::ControlModifier)) 130 || (button == Qt::MidButton)) { 131 131 QHelpContentModel *contentModel = 132 132 qobject_cast<QHelpContentModel*>(m_contentWidget->model()); … … 136 136 CentralWidget::instance()->setSourceInNewTab(itm->url()); 137 137 } 138 } else if (button == Qt::LeftButton) { 139 itemClicked(index); 138 140 } 139 141 } … … 141 143 return QWidget::eventFilter(o, e); 142 144 } 145 143 146 144 147 void ContentWindow::showContextMenu(const QPoint &pos) -
trunk/tools/assistant/tools/assistant/contentwindow.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/tools/assistant/doc/HOWTO
r2 r561 1 1 How to build/ update a new assistant.qch for Assistant internal help 2 2 3 - in case ofupdate:3 - update: 4 4 - open assistant.qdocconf, update year and qt version 5 5 6 - all other cases:7 6 - ..\..\..\..\qdoc3\debug\qdoc3.exe assistant.qdocconf 8 7 will generate an folder html containing all required stuff … … 13 12 - rebuild assistant 14 13 15 - to test you changes:14 - to test your changes: 16 15 - remove assistant.qch in your cache directory 17 16 - restart assistant -
trunk/tools/assistant/tools/assistant/doc/assistant.qdoc
r2 r561 1 /**************************************************************************** 2 ** 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 6 ** 7 ** This file is part of the documentation of the Qt Toolkit. 8 ** 9 ** $QT_BEGIN_LICENSE:LGPL$ 10 ** Commercial Usage 11 ** Licensees holding valid Qt Commercial licenses may use this file in 12 ** accordance with the Qt Commercial License Agreement provided with the 13 ** Software or, alternatively, in accordance with the terms contained in 14 ** a written agreement between you and Nokia. 15 ** 16 ** GNU Lesser General Public License Usage 17 ** Alternatively, this file may be used under the terms of the GNU Lesser 18 ** General Public License version 2.1 as published by the Free Software 19 ** Foundation and appearing in the file LICENSE.LGPL included in the 20 ** packaging of this file. Please review the following information to 21 ** ensure the GNU Lesser General Public License version 2.1 requirements 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 23 ** 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 ** 28 ** GNU General Public License Usage 29 ** Alternatively, this file may be used under the terms of the GNU 30 ** General Public License version 3.0 as published by the Free Software 31 ** Foundation and appearing in the file LICENSE.GPL included in the 32 ** packaging of this file. Please review the following information to 33 ** ensure the GNU General Public License version 3.0 requirements will be 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 ** 36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 ** $QT_END_LICENSE$ 39 ** 40 ****************************************************************************/ 41 1 42 /*! 2 43 \page assistant.html -
trunk/tools/assistant/tools/assistant/doc/assistant.qdocconf
r2 r561 11 11 HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \ 12 12 "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \ 13 "<td width=\"30%\" align=\"left\">Copyright © 2009 Nokia Corporation " \ 14 "and/or its subsidiary(-ies)</td>\n" \ 13 "<td width=\"30%\" align=\"left\">Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ 15 14 "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ 16 "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4. 5.1</div></td>\n" \15 "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.1</div></td>\n" \ 17 16 "</tr></table></div></address>" -
trunk/tools/assistant/tools/assistant/doc/assistant.qhp
r2 r561 2 2 <QtHelpProject version="1.0"> 3 3 <virtualFolder>assistant</virtualFolder> 4 <namespace>com.trolltech.com.assistantinternal _1.0.0</namespace>4 <namespace>com.trolltech.com.assistantinternal-1.0.0</namespace> 5 5 <filterSection> 6 6 <files> -
trunk/tools/assistant/tools/assistant/filternamedialog.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/tools/assistant/filternamedialog.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/tools/assistant/helpviewer.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 ** … … 134 134 } 135 135 136 QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op, 137 const QNetworkRequest &request, QIODevice *outgoingData) 138 { 139 const QString& scheme = request.url().scheme(); 140 if (scheme == QLatin1String("qthelp") || scheme == QLatin1String("about")) { 141 const QUrl& url = request.url(); 142 QString mimeType = url.toString(); 143 if (mimeType.endsWith(QLatin1String(".svg")) 144 || mimeType.endsWith(QLatin1String(".svgz"))) { 145 mimeType = QLatin1String("image/svg+xml"); 146 } 147 else if (mimeType.endsWith(QLatin1String(".css"))) { 148 mimeType = QLatin1String("text/css"); 149 } 150 else if (mimeType.endsWith(QLatin1String(".js"))) { 151 mimeType = QLatin1String("text/javascript"); 152 } else { 153 mimeType = QLatin1String("text/html"); 154 } 155 return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType); 156 } 157 return QNetworkAccessManager::createRequest(op, request, outgoingData); 136 QNetworkReply *HelpNetworkAccessManager::createRequest(Operation /*op*/, 137 const QNetworkRequest &request, QIODevice* /*outgoingData*/) 138 { 139 const QUrl& url = request.url(); 140 QString mimeType = url.toString(); 141 if (mimeType.endsWith(QLatin1String(".svg")) 142 || mimeType.endsWith(QLatin1String(".svgz"))) { 143 mimeType = QLatin1String("image/svg+xml"); 144 } 145 else if (mimeType.endsWith(QLatin1String(".css"))) { 146 mimeType = QLatin1String("text/css"); 147 } 148 else if (mimeType.endsWith(QLatin1String(".js"))) { 149 mimeType = QLatin1String("text/javascript"); 150 } else { 151 mimeType = QLatin1String("text/html"); 152 } 153 154 return new HelpNetworkReply(request, helpEngine->fileData(url), mimeType); 158 155 } 159 156 … … 270 267 271 268 HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent) 272 : QWebView(parent), helpEngine(engine), parentWidget(parent) 269 : QWebView(parent) 270 , helpEngine(engine) 271 , parentWidget(parent) 272 , loadFinished(false) 273 273 { 274 274 setAcceptDrops(false); … … 293 293 connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this, 294 294 SLOT(actionChanged())); 295 connect(page(), SIGNAL(linkHovered(QString, QString,QString)), this,295 connect(page(), SIGNAL(linkHovered(QString,QString,QString)), this, 296 296 SIGNAL(highlighted(QString))); 297 297 connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl))); 298 connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool))); 298 299 } 299 300 300 301 void HelpViewer::setSource(const QUrl &url) 301 302 { 303 loadFinished = false; 302 304 if (url.toString() == QLatin1String("help")) { 303 305 load(QUrl(QLatin1String("qthelp://com.trolltech.com." 304 "assistantinternal _1.0.0/assistant/assistant.html")));306 "assistantinternal-1.0.0/assistant/assistant.html"))); 305 307 } else { 306 308 load(url); … … 386 388 } 387 389 390 void HelpViewer::setLoadFinished(bool ok) 391 { 392 loadFinished = ok; 393 emit sourceChanged(url()); 394 } 395 388 396 #else // !defined(QT_NO_WEBKIT) 389 397 … … 415 423 if (help) { 416 424 QTextBrowser::setSource(QUrl(QLatin1String("qthelp://com.trolltech.com." 417 "assistantinternal _1.0.0/assistant/assistant.html")));425 "assistantinternal-1.0.0/assistant/assistant.html"))); 418 426 } else { 419 427 QTextBrowser::setSource(url); -
trunk/tools/assistant/tools/assistant/helpviewer.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 ** … … 93 93 inline bool isBackwardAvailable() const 94 94 { return pageAction(QWebPage::Back)->isEnabled(); } 95 inline bool hasLoadFinished() const 96 { return loadFinished; } 97 inline qreal zoom() const 98 { return textSizeMultiplier(); } 95 99 96 100 public Q_SLOTS: … … 112 116 private Q_SLOTS: 113 117 void actionChanged(); 118 void setLoadFinished(bool ok); 114 119 115 120 private: 116 121 QHelpEngine *helpEngine; 117 122 CentralWidget* parentWidget; 123 bool loadFinished; 118 124 }; 119 125 -
trunk/tools/assistant/tools/assistant/indexwindow.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(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, 82 82 SLOT(enableSearchLineEdit())); 83 connect(m_indexWidget, SIGNAL(linkActivated(QUrl, 83 connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this, 84 84 SIGNAL(linkActivated(QUrl))); 85 connect(m_indexWidget, SIGNAL(linksActivated(QMap<QString, QUrl>,QString)),86 this, SIGNAL(linksActivated(QMap<QString, QUrl>,QString)));85 connect(m_indexWidget, SIGNAL(linksActivated(QMap<QString,QUrl>,QString)), 86 this, SIGNAL(linksActivated(QMap<QString,QUrl>,QString))); 87 87 connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget, 88 88 SLOT(activateCurrentItem())); … … 113 113 idx = m_indexWidget->model()->index(idx.row()-1, 114 114 idx.column(), idx.parent()); 115 if (idx.isValid()) 115 if (idx.isValid()) { 116 116 m_indexWidget->setCurrentIndex(idx); 117 return true; 118 } 117 119 break; 118 120 case Qt::Key_Down: 119 121 idx = m_indexWidget->model()->index(idx.row()+1, 120 122 idx.column(), idx.parent()); 121 if (idx.isValid()) 123 if (idx.isValid()) { 122 124 m_indexWidget->setCurrentIndex(idx); 125 return true; 126 } 123 127 break; 124 128 case Qt::Key_Escape: 125 129 emit escapePressed(); 126 break;130 return true; 127 131 default: ; // stop complaining 128 132 } … … 147 151 QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(e); 148 152 QModelIndex idx = m_indexWidget->indexAt(mouseEvent->pos()); 149 if (idx.isValid() && mouseEvent->button()==Qt::MidButton) 150 open(m_indexWidget, idx); 153 if (idx.isValid()) { 154 Qt::MouseButtons button = mouseEvent->button(); 155 if (((button == Qt::LeftButton) && (mouseEvent->modifiers() & Qt::ControlModifier)) 156 || (button == Qt::MidButton)) { 157 open(m_indexWidget, idx); 158 } 159 } 151 160 } 152 161 #ifdef Q_OS_MAC … … 198 207 } else if (links.count() == 1) { 199 208 url = links.constBegin().value(); 209 } else { 210 return; 200 211 } 201 212 -
trunk/tools/assistant/tools/assistant/indexwindow.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/tools/assistant/installdialog.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 ** … … 57 57 58 58 QT_BEGIN_NAMESPACE 59 #ifndef QT_NO_HTTP 59 60 60 61 #define QCH_FILENAME 92943 … … 76 77 77 78 m_http = new QHttp(this); 78 connect(m_http, SIGNAL(requestFinished(int, 79 this, SLOT(httpRequestFinished(int, 80 connect(m_http, SIGNAL(dataReadProgress(int, 81 this, SLOT(updateDataReadProgress(int, 82 connect(m_http, SIGNAL(responseHeaderReceived( const QHttpResponseHeader &)),83 this, SLOT(readResponseHeader( const QHttpResponseHeader &)));79 connect(m_http, SIGNAL(requestFinished(int,bool)), 80 this, SLOT(httpRequestFinished(int,bool))); 81 connect(m_http, SIGNAL(dataReadProgress(int,int)), 82 this, SLOT(updateDataReadProgress(int,int))); 83 connect(m_http, SIGNAL(responseHeaderReceived(QHttpResponseHeader)), 84 this, SLOT(readResponseHeader(QHttpResponseHeader))); 84 85 connect(m_ui.installButton, SIGNAL(clicked()), this, SLOT(install())); 85 86 connect(m_ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelDownload())); … … 106 107 m_ui.progressBar->show(); 107 108 108 QUrl url(QLatin1String("http:// doc.trolltech.com/assistantdocs/docs.txt"));109 QUrl url(QLatin1String("http://qt.nokia.com/doc/assistantdocs/docs.txt")); 109 110 m_buffer = new QBuffer(); 110 111 m_buffer->open(QBuffer::ReadWrite); … … 214 215 m_ui.progressBar->show(); 215 216 216 QLatin1String urlStr("http:// doc.trolltech.com/assistantdocs/%1");217 QLatin1String urlStr("http://qt.nokia.com/doc/assistantdocs/%1"); 217 218 QUrl url(QString(urlStr).arg(fileName)); 218 219 … … 336 337 } 337 338 339 #endif 338 340 QT_END_NAMESPACE -
trunk/tools/assistant/tools/assistant/installdialog.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 ** … … 47 47 #include <QtNetwork/QHttpResponseHeader> 48 48 #include "ui_installdialog.h" 49 50 #ifndef QT_NO_HTTP 49 51 50 52 QT_BEGIN_NAMESPACE … … 99 101 QT_END_NAMESPACE 100 102 103 #endif 104 101 105 #endif // INSTALLDIALOG_H -
trunk/tools/assistant/tools/assistant/main.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 ** … … 52 52 53 53 #include <QtHelp/QHelpEngineCore> 54 55 #include <QtNetwork/QLocalSocket> 54 56 55 57 #include <QtSql/QSqlDatabase> … … 114 116 customValue(QLatin1String("CreationTime"), 1).toUInt(); 115 117 116 if (callerCollectionCreationTime == userCollectionCreationTime)118 if (callerCollectionCreationTime <= userCollectionCreationTime) 117 119 return false; 118 120 … … 123 125 user.setCustomValue(QLatin1String("LastShownPages"), 124 126 caller.customValue(QLatin1String("LastShownPages"))); 127 #if !defined(QT_NO_WEBKIT) 128 const QLatin1String zoomKey("LastPagesZoomWebView"); 129 #else 130 const QLatin1String zoomKey("LastPagesZoomTextBrowser"); 131 #endif 132 user.setCustomValue(zoomKey, caller.customValue(zoomKey)); 125 133 user.setCustomValue(QLatin1String("CurrentFilter"), 126 134 caller.customValue(QLatin1String("CurrentFilter"))); … … 147 155 user.setCustomValue(QLatin1String("AboutImages"), 148 156 caller.customValue(QLatin1String("AboutImages"))); 157 user.setCustomValue(QLatin1String("defaultHomepage"), 158 caller.customValue(QLatin1String("defaultHomepage"))); 149 159 150 160 return true; … … 167 177 } 168 178 179 QString indexFilesFolder(const QString &collectionFile) 180 { 181 QString indexFilesFolder = QLatin1String(".fulltextsearch"); 182 if (!collectionFile.isEmpty()) { 183 QFileInfo fi(collectionFile); 184 indexFilesFolder = QLatin1Char('.') + 185 fi.fileName().left(fi.fileName().lastIndexOf(QLatin1String(".qhc"))); 186 } 187 return indexFilesFolder; 188 } 189 169 190 int main(int argc, char *argv[]) 170 191 { 192 #ifndef Q_OS_WIN 193 // First do a quick search for arguments that imply command-line mode. 194 const char * cmdModeArgs[] = { 195 "-help", "-register", "-unregister", "-remove-search-index" 196 }; 197 bool useGui = true; 198 for (int i = 1; i < argc; ++i) { 199 for (size_t j = 0; j < sizeof cmdModeArgs/sizeof *cmdModeArgs; ++j) { 200 if(strcmp(argv[i], cmdModeArgs[j]) == 0) { 201 useGui = false; 202 break; 203 } 204 } 205 } 206 QApplication a(argc, argv, useGui); 207 #else 171 208 QApplication a(argc, argv); 209 #endif 172 210 a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins")); 173 211 … … 213 251 } 214 252 253 if (cmd.removeSearchIndex()) { 254 QString file = cmdCollectionFile; 255 if (file.isEmpty()) 256 file = MainWindow::defaultHelpCollectionFileName(); 257 QString path = QFileInfo(file).path(); 258 path += QLatin1Char('/') + indexFilesFolder(file); 259 260 QLocalSocket localSocket; 261 localSocket.connectToServer(QString(QLatin1String("QtAssistant%1")) 262 .arg(QLatin1String(QT_VERSION_STR))); 263 264 QDir dir(path); // check if there is no other instance ruinning 265 if (!localSocket.waitForConnected() && dir.exists()) { 266 QStringList lst = dir.entryList(QDir::Files | QDir::Hidden); 267 foreach (const QString &item, lst) 268 dir.remove(item); 269 return 0; 270 } else { 271 return -1; 272 } 273 } 274 215 275 { 216 276 QSqlDatabase db; … … 272 332 } 273 333 274 QLatin1String intern("com.trolltech.com.assistantinternal _");334 QLatin1String intern("com.trolltech.com.assistantinternal-"); 275 335 foreach (const QString &doc, userDocs) { 276 336 if (!callerDocs.contains(doc) && !doc.startsWith(intern)) -
trunk/tools/assistant/tools/assistant/mainwindow.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 ** … … 87 87 MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent) 88 88 : QMainWindow(parent) 89 , m_filterCombo(0) 89 90 , m_toolBarMenu(0) 90 91 , m_cmdLine(cmdLine) 91 , m_searchWidget(0)92 92 , m_progressWidget(0) 93 93 , m_qtDocInstaller(0) 94 94 , m_connectedInitSignals(false) 95 95 { 96 setToolButtonStyle(Qt::ToolButtonFollowStyle); 97 96 98 if (usesDefaultCollection()) { 97 99 MainWindow::collectionFileDirectory(true); … … 126 128 connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished())); 127 129 128 #ifdef QT_CLUCENE_SUPPORT129 130 m_centralWidget->createSearchWidget(searchEngine); 130 #else 131 QDockWidget *dock = new QDockWidget(tr("Search"), this); 132 dock->setObjectName(QLatin1String("SearchWindow")); 133 m_searchWidget = new SearchWidget(searchEngine, this); 134 dock->setWidget(m_searchWidget); 135 addDockWidget(Qt::LeftDockWidgetArea, dock); 136 137 connect(m_searchWidget, SIGNAL(requestShowLink(const QUrl&)), 138 m_centralWidget, SLOT(setSource(const QUrl&))); 139 connect(m_searchWidget, SIGNAL(requestShowLinkInNewTab(const QUrl&)), 140 m_centralWidget, SLOT(setSourceInNewTab(const QUrl&))); 141 #endif 131 m_centralWidget->activateSearchWidget(); 142 132 143 133 QString defWindowTitle = tr("Qt Assistant"); … … 150 140 setupFilterToolbar(); 151 141 setupAddressToolbar(); 142 152 143 m_bookmarkManager->setupBookmarkModels(); 144 m_bookmarkMenu->addSeparator(); 145 m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); 146 connect(m_bookmarkMenu, SIGNAL(triggered(QAction*)), this, 147 SLOT(showBookmark(QAction*))); 148 connect(m_bookmarkManager, SIGNAL(bookmarksChanged()), this, 149 SLOT(updateBookmarkMenu())); 153 150 154 151 setWindowTitle(m_helpEngine->customValue(QLatin1String("WindowTitle"), … … 229 226 showBookmarks(); 230 227 228 if (!m_cmdLine->currentFilter().isEmpty()) { 229 const QString &curFilter = m_cmdLine->currentFilter(); 230 if (m_helpEngine->customFilters().contains(curFilter)) 231 m_helpEngine->setCurrentFilter(curFilter); 232 } 233 231 234 if (usesDefaultCollection()) 232 235 QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation())); … … 234 237 checkInitState(); 235 238 } 239 setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North); 236 240 } 237 241 … … 263 267 264 268 bool assistantInternalDocRegistered = false; 265 QString intern(QLatin1String("com.trolltech.com.assistantinternal _"));269 QString intern(QLatin1String("com.trolltech.com.assistantinternal-")); 266 270 foreach (const QString &ns, m_helpEngine->registeredDocumentations()) { 267 271 if (ns.startsWith(intern)) { … … 305 309 hc.setCustomValue(unfiltered, 1); 306 310 } 311 307 312 m_helpEngine->blockSignals(true); 308 313 m_helpEngine->setCurrentFilter(tr("Unfiltered")); … … 319 324 { 320 325 m_qtDocInstaller = new QtDocInstaller(m_helpEngine->collectionFile()); 321 connect(m_qtDocInstaller, SIGNAL(errorMessage( const QString&)),322 this, SLOT(displayInstallationError(const QString&)));323 connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), 324 this,SLOT(qtDocumentationInstalled(bool)));326 connect(m_qtDocInstaller, SIGNAL(errorMessage(QString)), this, 327 SLOT(displayInstallationError(QString))); 328 connect(m_qtDocInstaller, SIGNAL(docsInstalled(bool)), this, 329 SLOT(qtDocumentationInstalled(bool))); 325 330 326 331 QString versionKey = QString(QLatin1String("qtVersion%1$$$qt")). … … 354 359 connect(m_helpEngine->contentModel(), SIGNAL(contentsCreated()), 355 360 this, SLOT(checkInitState())); 356 connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), 357 this,SLOT(checkInitState()));361 connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this, 362 SLOT(checkInitState())); 358 363 m_connectedInitSignals = true; 359 364 } … … 367 372 } 368 373 374 void MainWindow::updateBookmarkMenu() 375 { 376 if (m_bookmarkManager) { 377 m_bookmarkMenu->removeAction(m_bookmarkMenuAction); 378 379 m_bookmarkMenu->clear(); 380 381 m_bookmarkMenu->addAction(m_bookmarkMenuAction); 382 m_bookmarkMenu->addSeparator(); 383 384 m_bookmarkManager->fillBookmarkMenu(m_bookmarkMenu); 385 } 386 } 387 388 void MainWindow::showBookmark(QAction *action) 389 { 390 if (m_bookmarkManager) { 391 const QUrl &url = m_bookmarkManager->urlForAction(action); 392 if (url.isValid()) 393 m_centralWidget->setSource(url); 394 } 395 } 396 369 397 void MainWindow::insertLastPages() 370 398 { … … 372 400 m_centralWidget->setSource(m_cmdLine->url()); 373 401 else 374 m_centralWidget->set LastShownPages();402 m_centralWidget->setupWidget(); 375 403 376 404 if (m_cmdLine->search() == CmdLineParser::Activate) … … 396 424 397 425 m_printAction = menu->addAction(tr("&Print..."), m_centralWidget, SLOT(print())); 426 m_printAction->setPriority(QAction::LowPriority); 398 427 m_printAction->setIcon(QIcon(resourcePath + QLatin1String("/print.png"))); 399 428 m_printAction->setShortcut(QKeySequence::Print); … … 409 438 410 439 QAction *tmp = menu->addAction(tr("&Quit"), this, SLOT(close())); 411 tmp->setShortcut( tr("CTRL+Q"));440 tmp->setShortcut(QKeySequence::Quit); 412 441 tmp->setMenuRole(QAction::QuitRole); 413 442 … … 415 444 m_copyAction = menu->addAction(tr("&Copy selected Text"), m_centralWidget, 416 445 SLOT(copySelection())); 446 m_copyAction->setPriority(QAction::LowPriority); 447 m_copyAction->setIconText("&Copy"); 417 448 m_copyAction->setIcon(QIcon(resourcePath + QLatin1String("/editcopy.png"))); 418 449 m_copyAction->setShortcuts(QKeySequence::Copy); … … 421 452 m_findAction = menu->addAction(tr("&Find in Text..."), m_centralWidget, 422 453 SLOT(showTextSearch())); 454 m_findAction->setIconText(tr("&Find")); 423 455 m_findAction->setIcon(QIcon(resourcePath + QLatin1String("/find.png"))); 424 456 m_findAction->setShortcuts(QKeySequence::Find); … … 439 471 m_zoomInAction = m_viewMenu->addAction(tr("Zoom &in"), m_centralWidget, 440 472 SLOT(zoomIn())); 473 m_zoomInAction->setPriority(QAction::LowPriority); 441 474 m_zoomInAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomin.png"))); 442 475 m_zoomInAction->setShortcut(QKeySequence::ZoomIn); … … 444 477 m_zoomOutAction = m_viewMenu->addAction(tr("Zoom &out"), m_centralWidget, 445 478 SLOT(zoomOut())); 479 m_zoomOutAction->setPriority(QAction::LowPriority); 446 480 m_zoomOutAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomout.png"))); 447 481 m_zoomOutAction->setShortcut(QKeySequence::ZoomOut); … … 449 483 m_resetZoomAction = m_viewMenu->addAction(tr("Normal &Size"), m_centralWidget, 450 484 SLOT(resetZoom())); 485 m_resetZoomAction->setPriority(QAction::LowPriority); 451 486 m_resetZoomAction->setIcon(QIcon(resourcePath + QLatin1String("/resetzoom.png"))); 452 487 m_resetZoomAction->setShortcut(tr("Ctrl+0")); … … 460 495 m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarks()), 461 496 QKeySequence(tr("ALT+O"))); 462 m_viewMenu->addAction(tr("Search"), this, SLOT(showSearch ()),497 m_viewMenu->addAction(tr("Search"), this, SLOT(showSearchWidget()), 463 498 QKeySequence(tr("ALT+S"))); 464 499 465 500 menu = menuBar()->addMenu(tr("&Go")); 466 501 m_homeAction = menu->addAction(tr("&Home"), m_centralWidget, SLOT(home())); 467 m_homeAction->setShortcut(tr(" Ctrl+Home"));502 m_homeAction->setShortcut(tr("ALT+Home")); 468 503 m_homeAction->setIcon(QIcon(resourcePath + QLatin1String("/home.png"))); 469 504 … … 474 509 475 510 m_nextAction = menu->addAction(tr("&Forward"), m_centralWidget, SLOT(forward())); 511 m_nextAction->setPriority(QAction::LowPriority); 476 512 m_nextAction->setEnabled(false); 477 513 m_nextAction->setShortcuts(QKeySequence::Forward); … … 480 516 m_syncAction = menu->addAction(tr("Sync with Table of Contents"), this, 481 517 SLOT(syncContents())); 518 m_syncAction->setIconText(tr("Sync")); 482 519 m_syncAction->setIcon(QIcon(resourcePath + QLatin1String("/synctoc.png"))); 483 520 … … 492 529 << QKeySequence(Qt::CTRL + Qt::Key_PageUp)); 493 530 494 menu = menuBar()->addMenu(tr("&Bookmarks")); 495 tmp = menu->addAction(tr("Add Bookmark..."), this, SLOT(addBookmark())); 496 tmp->setShortcut(tr("CTRL+D")); 531 m_bookmarkMenu = menuBar()->addMenu(tr("&Bookmarks")); 532 m_bookmarkMenuAction = m_bookmarkMenu->addAction(tr("Add Bookmark..."), 533 this, SLOT(addBookmark())); 534 m_bookmarkMenuAction->setShortcut(tr("CTRL+D")); 497 535 498 536 menu = menuBar()->addMenu(tr("&Help")); 499 537 m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog())); 500 538 m_aboutAction->setMenuRole(QAction::AboutRole); 539 540 #ifdef Q_WS_X11 541 m_backAction->setIcon(QIcon::fromTheme("go-previous" , m_backAction->icon())); 542 m_nextAction->setIcon(QIcon::fromTheme("go-next" , m_nextAction->icon())); 543 m_zoomInAction->setIcon(QIcon::fromTheme("zoom-in" , m_zoomInAction->icon())); 544 m_zoomOutAction->setIcon(QIcon::fromTheme("zoom-out" , m_zoomOutAction->icon())); 545 m_resetZoomAction->setIcon(QIcon::fromTheme("zoom-original" , m_resetZoomAction->icon())); 546 m_syncAction->setIcon(QIcon::fromTheme("view-refresh" , m_syncAction->icon())); 547 m_copyAction->setIcon(QIcon::fromTheme("edit-copy" , m_copyAction->icon())); 548 m_findAction->setIcon(QIcon::fromTheme("edit-find" , m_findAction->icon())); 549 m_homeAction->setIcon(QIcon::fromTheme("go-home" , m_homeAction->icon())); 550 m_printAction->setIcon(QIcon::fromTheme("document-print" , m_printAction->icon())); 551 #endif 501 552 502 553 QToolBar *navigationBar = addToolBar(tr("Navigation Toolbar")); … … 534 585 connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, 535 586 SLOT(updateNavigationItems())); 587 connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, 588 SLOT(updateTabCloseAction())); 536 589 connect(m_centralWidget, SIGNAL(forwardAvailable(bool)), this, 537 590 SLOT(updateNavigationItems())); … … 540 593 connect(m_centralWidget, SIGNAL(highlighted(QString)), statusBar(), 541 594 SLOT(showMessage(QString))); 542 connect(m_centralWidget, SIGNAL(addNewBookmark(QString, 543 SLOT(addNewBookmark(QString, 595 connect(m_centralWidget, SIGNAL(addNewBookmark(QString,QString)), this, 596 SLOT(addNewBookmark(QString,QString))); 544 597 545 598 // bookmarks … … 552 605 connect(m_indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget, 553 606 SLOT(setSource(QUrl))); 554 connect(m_indexWindow, SIGNAL(linksActivated(QMap<QString, QUrl>,QString)),555 this, SLOT(showTopicChooser(QMap<QString, QUrl>,QString)));607 connect(m_indexWindow, SIGNAL(linksActivated(QMap<QString,QUrl>,QString)), 608 this, SLOT(showTopicChooser(QMap<QString,QUrl>,QString))); 556 609 connect(m_indexWindow, SIGNAL(escapePressed()), this, 557 610 SLOT(activateCurrentCentralWidgetTab())); … … 602 655 connect(m_helpEngine, SIGNAL(setupFinished()), this, 603 656 SLOT(setupFilterCombo())); 604 connect(m_filterCombo, SIGNAL(activated(const QString&)), this, 605 SLOT(filterDocumentation(const QString&))); 657 connect(m_filterCombo, SIGNAL(activated(QString)), this, 658 SLOT(filterDocumentation(QString))); 659 connect(m_helpEngine, SIGNAL(currentFilterChanged(QString)), this, 660 SLOT(currentFilterChanged(QString))); 606 661 607 662 setupFilterCombo(); … … 627 682 628 683 // address lineedit 629 connect(m_addressLineEdit, SIGNAL(returnPressed()), 630 this,SLOT(gotoAddress()));631 connect(m_centralWidget, SIGNAL(currentViewerChanged()), 632 this,SLOT(showNewAddress()));633 connect(m_centralWidget, SIGNAL(sourceChanged( const QUrl&)),634 this, SLOT(showNewAddress(const QUrl&)));684 connect(m_addressLineEdit, SIGNAL(returnPressed()), this, 685 SLOT(gotoAddress())); 686 connect(m_centralWidget, SIGNAL(currentViewerChanged()), this, 687 SLOT(showNewAddress())); 688 connect(m_centralWidget, SIGNAL(sourceChanged(QUrl)), this, 689 SLOT(showNewAddress(QUrl))); 635 690 } 636 691 … … 696 751 m_nextAction->setEnabled(m_centralWidget->isForwardAvailable()); 697 752 m_backAction->setEnabled(m_centralWidget->isBackwardAvailable()); 698 m_closeTabAction->setEnabled(hasCurrentViewer);699 753 m_newTabAction->setEnabled(hasCurrentViewer); 754 } 755 756 void MainWindow::updateTabCloseAction() 757 { 758 m_closeTabAction->setEnabled(m_centralWidget->enableTabCloseAction()); 700 759 } 701 760 … … 713 772 PreferencesDialog dia(m_helpEngine, this); 714 773 715 connect(&dia, SIGNAL(updateApplicationFont()), 716 this,SLOT(updateApplicationFont()));717 connect(&dia, SIGNAL(updateBrowserFont()), 718 m_centralWidget,SLOT(updateBrowserFont()));774 connect(&dia, SIGNAL(updateApplicationFont()), this, 775 SLOT(updateApplicationFont())); 776 connect(&dia, SIGNAL(updateBrowserFont()), m_centralWidget, 777 SLOT(updateBrowserFont())); 719 778 720 779 dia.showDialog(); … … 739 798 void MainWindow::addNewBookmark(const QString &title, const QString &url) 740 799 { 741 if (url.isEmpty() )800 if (url.isEmpty() || url == QLatin1String("about:blank")) 742 801 return; 743 802 … … 788 847 aboutDia.setWindowTitle(aboutDia.documentTitle()); 789 848 } else { 790 // TODO: Remove these variables for 4.6.0. Must keep this way for 4.5.x due to string freeze.791 QString edition;792 QString info;793 QString moreInfo;794 795 849 QByteArray resources; 796 850 aboutDia.setText(QString::fromLatin1("<center>" 797 851 "<h3>%1</h3>" 798 "<p>Version %2 %3</p></center>" 799 "<p>%4</p>" 800 "<p>%5</p>" 801 "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)" 802 ".</p><p>The program is provided AS IS with NO WARRANTY OF ANY KIND," 803 " INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A" 804 " PARTICULAR PURPOSE.<p/>") 805 .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)) 806 .arg(edition).arg(info).arg(moreInfo), resources); 852 "<p>Version %2</p></center>" 853 "<p>Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).</p>") 854 .arg(tr("Qt Assistant")).arg(QLatin1String(QT_VERSION_STR)), 855 resources); 807 856 QLatin1String path(":/trolltech/assistant/images/assistant-128.png"); 808 857 aboutDia.setPixmap(QString(path)); … … 870 919 void MainWindow::showSearch() 871 920 { 872 if (m_searchWidget) 873 activateDockWidget(m_searchWidget); 874 else 875 m_centralWidget->activateSearch(); 921 m_centralWidget->activateSearchWidget(); 922 } 923 924 void MainWindow::showSearchWidget() 925 { 926 m_centralWidget->activateSearchWidget(true); 876 927 } 877 928 878 929 void MainWindow::hideSearch() 879 930 { 880 if (m_searchWidget) { 881 m_searchWidget->parentWidget()->parentWidget()->hide(); 882 } else { 883 m_centralWidget->removeSearchWidget(); 884 } 931 m_centralWidget->removeSearchWidget(); 885 932 } 886 933 … … 919 966 void MainWindow::indexingStarted() 920 967 { 921 m_progressWidget = new QWidget(); 922 QLayout* hlayout = new QHBoxLayout(m_progressWidget); 923 924 QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 925 926 QLabel *label = new QLabel(tr("Updating search index")); 927 label->setSizePolicy(sizePolicy); 928 hlayout->addWidget(label); 929 930 QProgressBar *progressBar = new QProgressBar(); 931 progressBar->setRange(0, 0); 932 progressBar->setTextVisible(false); 933 progressBar->setSizePolicy(sizePolicy); 934 935 hlayout->setSpacing(6); 936 hlayout->setMargin(0); 937 hlayout->addWidget(progressBar); 938 939 statusBar()->addPermanentWidget(m_progressWidget); 968 if (!m_progressWidget) { 969 m_progressWidget = new QWidget(); 970 QLayout* hlayout = new QHBoxLayout(m_progressWidget); 971 972 QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum); 973 974 QLabel *label = new QLabel(tr("Updating search index")); 975 label->setSizePolicy(sizePolicy); 976 hlayout->addWidget(label); 977 978 QProgressBar *progressBar = new QProgressBar(); 979 progressBar->setRange(0, 0); 980 progressBar->setTextVisible(false); 981 progressBar->setSizePolicy(sizePolicy); 982 983 hlayout->setSpacing(6); 984 hlayout->setMargin(0); 985 hlayout->addWidget(progressBar); 986 987 statusBar()->addPermanentWidget(m_progressWidget); 988 } 940 989 } 941 990 … … 951 1000 m_bookmarkManager = new BookmarkManager(m_helpEngine); 952 1001 m_bookmarkWidget = new BookmarkWidget(m_bookmarkManager, this); 953 connect(m_bookmarkWidget, SIGNAL(addBookmark()), 954 this, SLOT(addBookmark())); 1002 connect(m_bookmarkWidget, SIGNAL(addBookmark()), this, SLOT(addBookmark())); 955 1003 return m_bookmarkWidget; 956 1004 } … … 988 1036 } 989 1037 1038 void MainWindow::currentFilterChanged(const QString &filter) 1039 { 1040 const int index = m_filterCombo->findText(filter); 1041 Q_ASSERT(index != -1); 1042 m_filterCombo->setCurrentIndex(index); 1043 } 1044 990 1045 QT_END_NAMESPACE -
trunk/tools/assistant/tools/assistant/mainwindow.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 ** … … 62 62 class CmdLineParser; 63 63 class QtDocInstaller; 64 65 class SearchWidget;66 64 67 65 class MainWindow : public QMainWindow … … 95 93 void showBookmarks(); 96 94 void showSearch(); 95 void showSearchWidget(); 97 96 void syncContents(); 98 97 void activateCurrentCentralWidgetTab(); 98 void currentFilterChanged(const QString &filter); 99 99 100 100 private slots: … … 107 107 void copyAvailable(bool yes); 108 108 void updateNavigationItems(); 109 void updateTabCloseAction(); 109 110 void showNewAddress(const QUrl &url); 110 111 void addNewBookmark(const QString &title, const QString &url); … … 119 120 void qtDocumentationInstalled(bool newDocsInstalled); 120 121 void checkInitState(); 122 123 void updateBookmarkMenu(); 124 void showBookmark(QAction *action); 121 125 122 126 private: … … 158 162 QMenu *m_viewMenu; 159 163 QMenu *m_toolBarMenu; 164 QMenu *m_bookmarkMenu; 165 QAction *m_bookmarkMenuAction; 160 166 161 167 CmdLineParser *m_cmdLine; 162 SearchWidget *m_searchWidget;163 168 164 169 QWidget *m_progressWidget; -
trunk/tools/assistant/tools/assistant/preferencesdialog.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 "fontpanel.h" 46 46 #include "centralwidget.h" 47 #include "aboutdialog.h" 47 48 48 49 #include <QtAlgorithms> … … 53 54 #include <QtGui/QMenu> 54 55 #include <QtGui/QFontDatabase> 56 #include <QtGui/QApplication> 57 #include <QtGui/QDesktopWidget> 55 58 56 59 #include <QtHelp/QHelpEngineCore> … … 60 63 PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent) 61 64 : QDialog(parent) 65 , m_helpEngine(helpEngine) 62 66 , m_appFontChanged(false) 63 67 , m_browserFontChanged(false) 64 68 { 65 m_helpEngine = helpEngine;66 69 m_ui.setupUi(this); 67 70 68 connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), 69 SIGNAL(clicked()), this, SLOT(applyChanges())); 70 connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), 71 SIGNAL(clicked()), this, SLOT(reject())); 72 73 m_hideFiltersTab = !m_helpEngine->customValue(QLatin1String("EnableFilterFunctionality"), 74 true).toBool(); 75 m_hideDocsTab = !m_helpEngine->customValue(QLatin1String("EnableDocumentationManager"), 76 true).toBool(); 71 connect(m_ui.buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), 72 this, SLOT(applyChanges())); 73 connect(m_ui.buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), 74 this, SLOT(reject())); 75 76 QLatin1String key("EnableFilterFunctionality"); 77 m_hideFiltersTab = !m_helpEngine->customValue(key, true).toBool(); 78 79 key = QLatin1String("EnableDocumentationManager"); 80 m_hideDocsTab = !m_helpEngine->customValue(key, true).toBool(); 77 81 78 82 if (!m_hideFiltersTab) { 79 83 m_ui.attributeWidget->header()->hide(); 80 84 m_ui.attributeWidget->setRootIsDecorated(false); 81 connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)), 85 86 connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), 82 87 this, SLOT(updateFilterMap())); 83 88 84 89 connect(m_ui.filterWidget, 85 SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)),86 this,SLOT(updateAttributes(QListWidgetItem*)));87 88 connect(m_ui.filterAddButton, SIGNAL(clicked()), 89 this,SLOT(addFilter()));90 connect(m_ui.filterRemoveButton, SIGNAL(clicked()), 91 this,SLOT(removeFilter()));90 SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, 91 SLOT(updateAttributes(QListWidgetItem*))); 92 93 connect(m_ui.filterAddButton, SIGNAL(clicked()), this, 94 SLOT(addFilter())); 95 connect(m_ui.filterRemoveButton, SIGNAL(clicked()), this, 96 SLOT(removeFilter())); 92 97 93 98 updateFilterPage(); … … 107 112 m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab)); 108 113 } 114 109 115 updateFontSettingsPage(); 110 116 updateOptionsPage(); … … 113 119 PreferencesDialog::~PreferencesDialog() 114 120 { 121 QLatin1String key(""); 115 122 if (m_appFontChanged) { 116 m_helpEngine->setCustomValue(QLatin1String("appFont"), m_appFontPanel->selectedFont()); 117 m_helpEngine->setCustomValue(QLatin1String("useAppFont"), m_appFontPanel->isChecked()); 118 m_helpEngine->setCustomValue(QLatin1String("appWritingSystem"), m_appFontPanel->writingSystem()); 123 key = QLatin1String("appFont"); 124 m_helpEngine->setCustomValue(key, m_appFontPanel->selectedFont()); 125 126 key = QLatin1String("useAppFont"); 127 m_helpEngine->setCustomValue(key, m_appFontPanel->isChecked()); 128 129 key = QLatin1String("appWritingSystem"); 130 m_helpEngine->setCustomValue(key, m_appFontPanel->writingSystem()); 119 131 } 120 132 121 133 if (m_browserFontChanged) { 122 m_helpEngine->setCustomValue(QLatin1String("browserFont"), m_browserFontPanel->selectedFont()); 123 m_helpEngine->setCustomValue(QLatin1String("useBrowserFont"), m_browserFontPanel->isChecked()); 124 m_helpEngine->setCustomValue(QLatin1String("browserWritingSystem"), m_browserFontPanel->writingSystem()); 134 key = QLatin1String("browserFont"); 135 m_helpEngine->setCustomValue(key, m_browserFontPanel->selectedFont()); 136 137 key = QLatin1String("useBrowserFont"); 138 m_helpEngine->setCustomValue(key, m_browserFontPanel->isChecked()); 139 140 key = QLatin1String("browserWritingSystem"); 141 m_helpEngine->setCustomValue(key, m_browserFontPanel->writingSystem()); 125 142 } 126 143 … … 130 147 } 131 148 132 if (!m_ui.homePageLineEdit->text().isEmpty()) 133 m_helpEngine->setCustomValue(QLatin1String("homepage"), m_ui.homePageLineEdit->text()); 149 QString homePage = m_ui.homePageLineEdit->text(); 150 if (homePage.isEmpty()) 151 homePage = QLatin1String("help"); 152 m_helpEngine->setCustomValue(QLatin1String("homepage"), homePage); 153 154 int option = m_ui.helpStartComboBox->currentIndex(); 155 m_helpEngine->setCustomValue(QLatin1String("StartOption"), option); 134 156 } 135 157 … … 174 196 checkedList = m_filterMap.value(item->text()); 175 197 QTreeWidgetItem *itm; 176 for (int i =0; i<m_ui.attributeWidget->topLevelItemCount(); ++i) {198 for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { 177 199 itm = m_ui.attributeWidget->topLevelItem(i); 178 200 if (checkedList.contains(itm->text(0))) … … 193 215 QStringList newAtts; 194 216 QTreeWidgetItem *itm = 0; 195 for (int i =0; i<m_ui.attributeWidget->topLevelItemCount(); ++i) {217 for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) { 196 218 itm = m_ui.attributeWidget->topLevelItem(i); 197 219 if (itm->checkState(0) == Qt::Checked) … … 220 242 void PreferencesDialog::removeFilter() 221 243 { 222 QListWidgetItem *item = m_ui.filterWidget223 ->takeItem(m_ui.filterWidget->currentRow());244 QListWidgetItem *item = 245 m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow()); 224 246 if (!item) 225 247 return; … … 239 261 return; 240 262 263 QStringList invalidFiles; 264 QStringList alreadyRegistered; 241 265 foreach (const QString &fileName, fileNames) { 242 const QString ns = QHelpEngineCore::namespaceName(fileName); 243 if (ns.isEmpty()) { 244 QMessageBox::warning(this, tr("Add Documentation"), 245 tr("The specified file is not a valid Qt Help File!")); 266 const QString nameSpace = QHelpEngineCore::namespaceName(fileName); 267 if (nameSpace.isEmpty()) { 268 invalidFiles.append(fileName); 246 269 continue; 247 270 } 248 271 249 if (m_ui.registeredDocsListWidget->findItems(n s, Qt::MatchFixedString).count()) {250 Q MessageBox::warning(this, tr("Add Documentation"),251 tr("The namespace %1 is already registered!").arg(ns));252 continue;272 if (m_ui.registeredDocsListWidget->findItems(nameSpace, 273 Qt::MatchFixedString).count()) { 274 alreadyRegistered.append(nameSpace); 275 continue; 253 276 } 254 277 255 278 m_helpEngine->registerDocumentation(fileName); 256 m_ui.registeredDocsListWidget->addItem(ns); 257 m_regDocs.append(ns); 258 m_unregDocs.removeAll(ns); 259 } 279 m_ui.registeredDocsListWidget->addItem(nameSpace); 280 m_regDocs.append(nameSpace); 281 m_unregDocs.removeAll(nameSpace); 282 } 283 284 if (!invalidFiles.isEmpty() || !alreadyRegistered.isEmpty()) { 285 QString message; 286 if (!alreadyRegistered.isEmpty()) { 287 foreach (const QString &ns, alreadyRegistered) { 288 message += tr("The namespace %1 is already registered!") 289 .arg(QString("<b>%1</b>").arg(ns)) + QLatin1String("<br>"); 290 } 291 if (!invalidFiles.isEmpty()) 292 message.append(QLatin1String("<br>")); 293 } 294 295 if (!invalidFiles.isEmpty()) { 296 message += tr("The specified file is not a valid Qt Help File!"); 297 message.append(QLatin1String("<ul>")); 298 foreach (const QString &file, invalidFiles) 299 message += QLatin1String("<li>") + file + QLatin1String("</li>"); 300 message.append(QLatin1String("</ul>")); 301 } 302 QMessageBox::warning(this, tr("Add Documentation"), message); 303 } 304 260 305 updateFilterPage(); 261 306 } … … 338 383 for (int i = m_TabsToClose.count(); --i >= 0;) 339 384 widget->closeTabAt(m_TabsToClose.at(i)); 385 if (widget->availableHelpViewer()== 0) 386 widget->setSource(QUrl(QLatin1String("about:blank"))); 340 387 341 388 if (m_unregDocs.count()) { … … 363 410 364 411 const QString customSettings(tr("Use custom settings")); 365 QFont font = qVariantValue<QFont>(m_helpEngine->customValue(QLatin1String("appFont")));366 QFontDatabase::WritingSystem writingSystem = static_cast<QFontDatabase::WritingSystem>367 (m_helpEngine->customValue(QLatin1String("appWritingSystem")).toInt());368 369 412 m_appFontPanel->setTitle(customSettings); 413 414 QLatin1String key = QLatin1String("appFont"); 415 QFont font = qVariantValue<QFont>(m_helpEngine->customValue(key)); 370 416 m_appFontPanel->setSelectedFont(font); 371 m_appFontPanel->setWritingSystem(writingSystem); 372 m_appFontPanel->setChecked(m_helpEngine->customValue(QLatin1String("useAppFont")).toBool()); 373 374 QFont font2 = qVariantValue<QFont>(m_helpEngine->customValue(QLatin1String("browserFont"))); 375 writingSystem = static_cast<QFontDatabase::WritingSystem> 376 (m_helpEngine->customValue(QLatin1String("browserWritingSystem")).toInt()); 417 418 key = QLatin1String("appWritingSystem"); 419 QFontDatabase::WritingSystem system = static_cast<QFontDatabase::WritingSystem> 420 (m_helpEngine->customValue(key).toInt()); 421 m_appFontPanel->setWritingSystem(system); 422 423 key = QLatin1String("useAppFont"); 424 m_appFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); 377 425 378 426 m_browserFontPanel->setTitle(customSettings); 379 m_browserFontPanel->setSelectedFont(font2); 380 m_browserFontPanel->setWritingSystem(writingSystem); 381 m_browserFontPanel->setChecked(m_helpEngine->customValue(QLatin1String("useBrowserFont")).toBool()); 382 383 connect(m_appFontPanel, SIGNAL(toggled(bool)), this, SLOT(appFontSettingToggled(bool))); 384 connect(m_browserFontPanel, SIGNAL(toggled(bool)), this, SLOT(browserFontSettingToggled(bool))); 427 428 key = QLatin1String("browserFont"); 429 font = qVariantValue<QFont>(m_helpEngine->customValue(key)); 430 m_browserFontPanel->setSelectedFont(font); 431 432 key = QLatin1String("browserWritingSystem"); 433 system = static_cast<QFontDatabase::WritingSystem> 434 (m_helpEngine->customValue(key).toInt()); 435 m_browserFontPanel->setWritingSystem(system); 436 437 key = QLatin1String("useBrowserFont"); 438 m_browserFontPanel->setChecked(m_helpEngine->customValue(key).toBool()); 439 440 connect(m_appFontPanel, SIGNAL(toggled(bool)), this, 441 SLOT(appFontSettingToggled(bool))); 442 connect(m_browserFontPanel, SIGNAL(toggled(bool)), this, 443 SLOT(browserFontSettingToggled(bool))); 385 444 386 445 QList<QComboBox*> allCombos = qFindChildren<QComboBox*>(m_appFontPanel); 387 foreach (QComboBox* box, allCombos) 388 connect(box, SIGNAL(currentIndexChanged(int)), this, SLOT(appFontSettingChanged(int))); 389 390 allCombos.clear(); 446 foreach (QComboBox* box, allCombos) { 447 connect(box, SIGNAL(currentIndexChanged(int)), this, 448 SLOT(appFontSettingChanged(int))); 449 } 450 391 451 allCombos = qFindChildren<QComboBox*>(m_browserFontPanel); 392 foreach (QComboBox* box, allCombos) 393 connect(box, SIGNAL(currentIndexChanged(int)), this, SLOT(browserFontSettingChanged(int))); 452 foreach (QComboBox* box, allCombos) { 453 connect(box, SIGNAL(currentIndexChanged(int)), this, 454 SLOT(browserFontSettingChanged(int))); 455 } 394 456 } 395 457 … … 427 489 QLatin1String("help")).toString(); 428 490 } 429 430 491 m_ui.homePageLineEdit->setText(homepage); 431 connect(m_ui.currentPageButton, SIGNAL(pressed()), this, 432 SLOT(currentHomepageChanged())); 433 connect(m_ui.restoreDefaultHomePageButton, SIGNAL(pressed()), this, 434 SLOT(restoreDefaultHomepage())); 435 } 436 437 void PreferencesDialog::restoreDefaultHomepage() 438 { 439 QString homepage = m_helpEngine->customValue( 440 QLatin1String("defaultHomepage"), QLatin1String("help")).toString(); 441 m_ui.homePageLineEdit->setText(homepage); 442 } 443 444 void PreferencesDialog::currentHomepageChanged() 492 493 int option = m_helpEngine->customValue(QLatin1String("StartOption"), 494 ShowLastPages).toInt(); 495 m_ui.helpStartComboBox->setCurrentIndex(option); 496 497 connect(m_ui.blankPageButton, SIGNAL(clicked()), this, SLOT(setBlankPage())); 498 connect(m_ui.currentPageButton, SIGNAL(clicked()), this, SLOT(setCurrentPage())); 499 connect(m_ui.defaultPageButton, SIGNAL(clicked()), this, SLOT(setDefaultPage())); 500 } 501 502 void PreferencesDialog::setBlankPage() 503 { 504 m_ui.homePageLineEdit->setText(QLatin1String("about:blank")); 505 } 506 507 void PreferencesDialog::setCurrentPage() 445 508 { 446 509 QString homepage = CentralWidget::instance()->currentSource().toString(); … … 451 514 } 452 515 516 void PreferencesDialog::setDefaultPage() 517 { 518 QString homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"), 519 QLatin1String("help")).toString(); 520 m_ui.homePageLineEdit->setText(homepage); 521 } 522 453 523 QT_END_NAMESPACE -
trunk/tools/assistant/tools/assistant/preferencesdialog.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 ** … … 50 50 class FontPanel; 51 51 class QHelpEngineCore; 52 53 enum { 54 ShowHomePage = 0, 55 ShowBlankPage = 1, 56 ShowLastPages = 2 57 }; 52 58 53 59 class PreferencesDialog : public QDialog … … 73 79 void browserFontSettingToggled(bool on); 74 80 void browserFontSettingChanged(int index); 75 void restoreDefaultHomepage(); 76 void currentHomepageChanged(); 81 82 void setBlankPage(); 83 void setCurrentPage(); 84 void setDefaultPage(); 77 85 78 86 signals: -
trunk/tools/assistant/tools/assistant/preferencesdialog.ui
r2 r561 7 7 <x>0</x> 8 8 <y>0</y> 9 <width>3 59</width>9 <width>375</width> 10 10 <height>266</height> 11 11 </rect> … … 188 188 <string>Options</string> 189 189 </attribute> 190 <layout class="QVBoxLayout" name="verticalLayout_3"> 190 <layout class="QVBoxLayout" name="verticalLayout_2"> 191 <item> 192 <widget class="QGroupBox" name="groupBox_2"> 193 <property name="title"> 194 <string/> 195 </property> 196 <layout class="QHBoxLayout" name="horizontalLayout_3"> 197 <item> 198 <widget class="QLabel" name="label_5"> 199 <property name="sizePolicy"> 200 <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> 201 <horstretch>0</horstretch> 202 <verstretch>0</verstretch> 203 </sizepolicy> 204 </property> 205 <property name="text"> 206 <string>On help start:</string> 207 </property> 208 </widget> 209 </item> 210 <item> 211 <widget class="QComboBox" name="helpStartComboBox"> 212 <property name="sizePolicy"> 213 <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> 214 <horstretch>0</horstretch> 215 <verstretch>0</verstretch> 216 </sizepolicy> 217 </property> 218 <item> 219 <property name="text"> 220 <string>Show my home page</string> 221 </property> 222 </item> 223 <item> 224 <property name="text"> 225 <string>Show a blank page</string> 226 </property> 227 </item> 228 <item> 229 <property name="text"> 230 <string>Show my tabs from last session</string> 231 </property> 232 </item> 233 </widget> 234 </item> 235 <item> 236 <spacer name="horizontalSpacer_3"> 237 <property name="orientation"> 238 <enum>Qt::Horizontal</enum> 239 </property> 240 <property name="sizeHint" stdset="0"> 241 <size> 242 <width>54</width> 243 <height>20</height> 244 </size> 245 </property> 246 </spacer> 247 </item> 248 </layout> 249 </widget> 250 </item> 191 251 <item> 192 252 <widget class="QGroupBox" name="groupBox"> 193 253 <property name="title"> 194 <string>Homepage</string> 195 </property> 196 <layout class="QVBoxLayout" name="verticalLayout_2"> 197 <item> 198 <widget class="QLineEdit" name="homePageLineEdit"/> 199 </item> 254 <string/> 255 </property> 256 <layout class="QVBoxLayout" name="verticalLayout"> 200 257 <item> 201 258 <layout class="QHBoxLayout" name="horizontalLayout_2"> 259 <item> 260 <widget class="QLabel" name="label_4"> 261 <property name="text"> 262 <string>Homepage</string> 263 </property> 264 </widget> 265 </item> 266 <item> 267 <widget class="QLineEdit" name="homePageLineEdit"/> 268 </item> 269 </layout> 270 </item> 271 <item> 272 <layout class="QHBoxLayout" name="horizontalLayout"> 202 273 <item> 203 274 <spacer name="horizontalSpacer"> … … 214 285 </item> 215 286 <item> 216 <layout class="QHBoxLayout" name="horizontalLayout"> 217 <item> 218 <widget class="QPushButton" name="currentPageButton"> 219 <property name="text"> 220 <string>Current Page</string> 221 </property> 222 </widget> 223 </item> 224 <item> 225 <widget class="QPushButton" name="restoreDefaultHomePageButton"> 226 <property name="text"> 227 <string>Restore to default</string> 228 </property> 229 </widget> 230 </item> 231 </layout> 287 <widget class="QPushButton" name="currentPageButton"> 288 <property name="text"> 289 <string>Current Page</string> 290 </property> 291 </widget> 292 </item> 293 <item> 294 <widget class="QPushButton" name="blankPageButton"> 295 <property name="text"> 296 <string>Blank Page</string> 297 </property> 298 </widget> 299 </item> 300 <item> 301 <widget class="QPushButton" name="defaultPageButton"> 302 <property name="text"> 303 <string>Restore to default</string> 304 </property> 305 </widget> 232 306 </item> 233 307 </layout> -
trunk/tools/assistant/tools/assistant/qtdocinstaller.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/tools/assistant/qtdocinstaller.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/tools/assistant/remotecontrol.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 ** … … 79 79 char chBuf[4096]; 80 80 DWORD dwRead; 81 82 #ifndef Q_WS_WINCE 81 83 HANDLE hStdin, hStdinDup; 82 84 … … 90 92 91 93 CloseHandle(hStdin); 94 #else 95 HANDLE hStdinDup; 96 hStdinDup = stdin; 97 #endif 92 98 93 99 while (ok) { … … 112 118 #ifdef Q_OS_WIN 113 119 StdInListenerWin *l = new StdInListenerWin(this); 114 connect(l, SIGNAL(receivedCommand( const QString&)),115 this, SLOT(handleCommandString( const QString&)));120 connect(l, SIGNAL(receivedCommand(QString)), 121 this, SLOT(handleCommandString(QString))); 116 122 l->start(); 117 123 #else … … 232 238 m_mainWindow->expandTOC(depth); 233 239 } else if (cmd == QLatin1String("setcurrentfilter")) { 240 if (!m_helpEngine->customFilters().contains(arg)) 241 return; 234 242 if (m_caching) { 235 243 clearCache(); -
trunk/tools/assistant/tools/assistant/remotecontrol.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/tools/assistant/remotecontrol_win.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/tools/assistant/searchwidget.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 ** … … 63 63 : QWidget(parent) 64 64 , zoomCount(0) 65 , attached(false) 65 66 , searchEngine(engine) 66 67 { … … 71 72 72 73 vLayout->addWidget(queryWidget); 73 vLayout->addWidget(resultWidget); 74 74 vLayout->addWidget(resultWidget); 75 75 76 setFocusProxy(queryWidget); 76 77 77 78 connect(queryWidget, SIGNAL(search()), this, SLOT(search())); 78 connect(resultWidget, SIGNAL(requestShowLink(const QUrl&)), 79 this, SIGNAL(requestShowLink(const QUrl&))); 80 81 connect(searchEngine, SIGNAL(searchingStarted()), this, SLOT(searchingStarted())); 82 connect(searchEngine, SIGNAL(searchingFinished(int)), this, SLOT(searchingFinished(int))); 83 84 QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); 85 browser->viewport()->installEventFilter(this); 79 connect(resultWidget, SIGNAL(requestShowLink(QUrl)), this, 80 SIGNAL(requestShowLink(QUrl))); 81 82 connect(searchEngine, SIGNAL(searchingStarted()), this, 83 SLOT(searchingStarted())); 84 connect(searchEngine, SIGNAL(searchingFinished(int)), this, 85 SLOT(searchingFinished(int))); 86 87 QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); 88 if (browser) // Will be null if lib was configured not to use CLucene. 89 browser->viewport()->installEventFilter(this); 86 90 } 87 91 … … 93 97 void SearchWidget::zoomIn() 94 98 { 95 #ifndef QT_CLUCENE_SUPPORT96 return;97 #endif98 99 99 QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); 100 100 if (browser && zoomCount != 10) { … … 106 106 void SearchWidget::zoomOut() 107 107 { 108 #ifndef QT_CLUCENE_SUPPORT109 return;110 #endif111 112 108 QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); 113 109 if (browser && zoomCount != -5) { … … 119 115 void SearchWidget::resetZoom() 120 116 { 121 #ifndef QT_CLUCENE_SUPPORT122 return;123 #endif124 125 117 if (zoomCount == 0) 126 118 return; … … 133 125 } 134 126 127 bool SearchWidget::isAttached() const 128 { 129 return attached; 130 } 131 132 void SearchWidget::setAttached(bool state) 133 { 134 attached = state; 135 } 136 135 137 void SearchWidget::search() const 136 138 { … … 153 155 { 154 156 QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); 155 if (browser && o == browser->viewport() && e->type() == QEvent::MouseButtonRelease){ 157 if (browser && o == browser->viewport() 158 && e->type() == QEvent::MouseButtonRelease){ 156 159 QMouseEvent *me = static_cast<QMouseEvent*>(e); 157 160 QUrl link = resultWidget->linkAt(me->pos()); … … 180 183 QPoint point = contextMenuEvent->globalPos(); 181 184 182 #ifdef QT_CLUCENE_SUPPORT183 185 QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget); 184 186 if (!browser) … … 191 193 QUrl link = browser->anchorAt(point); 192 194 193 QAction *copyAction = menu.addAction(tr("&Copy") + 194 QString(QLatin1String("\t") + QString(QKeySequence(Qt::CTRL | Qt::Key_C)))); 195 QKeySequence keySeq(QKeySequence::Copy); 196 QAction *copyAction = menu.addAction(tr("&Copy") + QLatin1String("\t") + 197 keySeq.toString(QKeySequence::NativeText)); 195 198 copyAction->setEnabled(QTextCursor(browser->textCursor()).hasSelection()); 196 199 … … 198 201 copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid()); 199 202 200 QAction *newTabAction = menu.addAction(tr("Open Link in New Tab") + 201 QString(QLatin1String("\t") + QString(QKeySequence(Qt::CTRL))) + 203 keySeq = QKeySequence(Qt::CTRL); 204 QAction *newTabAction = menu.addAction(tr("Open Link in New Tab") + 205 QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText) + 202 206 QLatin1String("LMB")); 203 207 newTabAction->setEnabled(!link.isEmpty() && link.isValid()); … … 205 209 menu.addSeparator(); 206 210 207 QAction *selectAllAction = menu.addAction(tr("Select All") + 208 QString(QLatin1String("\t") + QString(QKeySequence(Qt::CTRL | Qt::Key_A)))); 211 keySeq = QKeySequence::SelectAll; 212 QAction *selectAllAction = menu.addAction(tr("Select All") + 213 QLatin1String("\t") + keySeq.toString(QKeySequence::NativeText)); 209 214 210 215 QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos())); … … 223 228 else if (usedAction == newTabAction) { 224 229 emit requestShowLinkInNewTab(link); 225 } 230 } 226 231 else if (usedAction == selectAllAction) { 227 232 browser->selectAll(); 228 233 } 229 #else230 point = resultWidget->mapFromGlobal(point);231 QUrl link = resultWidget->linkAt(point);232 if (link.isEmpty() || !link.isValid())233 return;234 235 QAction *curTab = menu.addAction(tr("Open Link"));236 QAction *newTab = menu.addAction(tr("Open Link in New Tab"));237 238 QAction *action = menu.exec(mapToGlobal(contextMenuEvent->pos()));239 if (curTab == action)240 emit requestShowLink(link);241 else if (newTab == action)242 emit requestShowLinkInNewTab(link);243 #endif244 234 } 245 235 -
trunk/tools/assistant/tools/assistant/searchwidget.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 ** … … 66 66 void resetZoom(); 67 67 68 bool isAttached() const; 69 void setAttached(bool state); 70 68 71 signals: 69 72 void requestShowLink(const QUrl &url); … … 82 85 private: 83 86 int zoomCount; 87 bool attached; 84 88 QHelpSearchEngine *searchEngine; 85 89 QHelpSearchResultWidget *resultWidget; -
trunk/tools/assistant/tools/assistant/topicchooser.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/tools/assistant/topicchooser.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/tools/qcollectiongenerator/main.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/tools/qhelpconverter/adpreader.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 ** 40 40 ****************************************************************************/ 41 41 42 #include <QRegExp> 43 42 44 #include "adpreader.h" 45 46 static bool versionIsAtLeast320(const QString &version) 47 { 48 return QRegExp("\\d.\\d\\.\\d").exactMatch(version) 49 && (version[0] > '3' || (version[0] == '3' && version[2] >= '2')); 50 } 43 51 44 52 QT_BEGIN_NAMESPACE … … 52 60 m_files.clear(); 53 61 addData(contents); 54 55 56 62 while (!atEnd()) { 63 readNext(); 64 if (isStartElement()) { 57 65 if (name().toString().toLower() == QLatin1String("assistantconfig") 58 && attributes().value(QLatin1String("version")) == QLatin1String("3.2.0")) {66 && versionIsAtLeast320(attributes().value(QLatin1String("version")).toString())) { 59 67 readProject(); 60 68 } else if (name().toString().toLower() == QLatin1String("dcf")) { … … 67 75 raiseError(); 68 76 } 69 70 77 } 78 } 71 79 } 72 80 -
trunk/tools/assistant/tools/qhelpconverter/adpreader.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 ** … … 51 51 struct ContentItem { 52 52 ContentItem(const QString &t, const QString &r, int d) 53 53 : title(t), reference(r), depth(d) {} 54 54 QString title; 55 55 QString reference; 56 int depth; 56 int depth; 57 57 }; 58 58 59 59 struct KeywordItem { 60 60 KeywordItem(const QString &k, const QString &r) 61 61 : keyword(k), reference(r) {} 62 62 QString keyword; 63 63 QString reference; -
trunk/tools/assistant/tools/qhelpconverter/conversionwizard.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/tools/qhelpconverter/conversionwizard.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/tools/qhelpconverter/filespage.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/tools/qhelpconverter/filespage.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/tools/qhelpconverter/filterpage.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/tools/qhelpconverter/filterpage.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/tools/qhelpconverter/finishpage.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/tools/qhelpconverter/finishpage.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/tools/qhelpconverter/generalpage.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 ** … … 53 53 54 54 m_ui.setupUi(this); 55 connect(m_ui.namespaceLineEdit, SIGNAL(textChanged( const QString&)),55 connect(m_ui.namespaceLineEdit, SIGNAL(textChanged(QString)), 56 56 this, SIGNAL(completeChanged())); 57 connect(m_ui.folderLineEdit, SIGNAL(textChanged( const QString&)),57 connect(m_ui.folderLineEdit, SIGNAL(textChanged(QString)), 58 58 this, SIGNAL(completeChanged())); 59 59 -
trunk/tools/assistant/tools/qhelpconverter/generalpage.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/tools/qhelpconverter/helpwindow.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/tools/qhelpconverter/helpwindow.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/tools/qhelpconverter/identifierpage.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/tools/qhelpconverter/identifierpage.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/tools/qhelpconverter/inputpage.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/tools/qhelpconverter/inputpage.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/tools/qhelpconverter/main.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/tools/qhelpconverter/outputpage.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 ** … … 56 56 57 57 m_ui.setupUi(this); 58 connect(m_ui.projectLineEdit, SIGNAL(textChanged( const QString&)),58 connect(m_ui.projectLineEdit, SIGNAL(textChanged(QString)), 59 59 this, SIGNAL(completeChanged())); 60 connect(m_ui.collectionLineEdit, SIGNAL(textChanged( const QString&)),60 connect(m_ui.collectionLineEdit, SIGNAL(textChanged(QString)), 61 61 this, SIGNAL(completeChanged())); 62 62 -
trunk/tools/assistant/tools/qhelpconverter/outputpage.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/tools/qhelpconverter/pathpage.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/tools/qhelpconverter/pathpage.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/tools/qhelpconverter/qhcpwriter.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/tools/qhelpconverter/qhcpwriter.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/tools/qhelpconverter/qhpwriter.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/tools/qhelpconverter/qhpwriter.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/tools/qhelpgenerator/main.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/tools/shared/helpgenerator.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 ** … … 50 50 { 51 51 generator = new QHelpGenerator(this); 52 connect(generator, SIGNAL(statusChanged( const QString&)),53 this, SLOT(printStatus( const QString&)));54 connect(generator, SIGNAL(warning( const QString&)),55 this, SLOT(printWarning( const QString&)));52 connect(generator, SIGNAL(statusChanged(QString)), 53 this, SLOT(printStatus(QString))); 54 connect(generator, SIGNAL(warning(QString)), 55 this, SLOT(printWarning(QString))); 56 56 } 57 57 -
trunk/tools/assistant/tools/shared/helpgenerator.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.