Changeset 561 for trunk/tools/assistant


Ignore:
Timestamp:
Feb 11, 2010, 11:19:06 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.1 sources.

Location:
trunk
Files:
2 deleted
172 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/assistant/compat/config.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/config.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/docuparser.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/docuparser.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/fontsettingsdialog.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/fontsettingsdialog.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/helpdialog.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    263263    connect(ui.listBookmarks, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showTreeItemMenu(QPoint)));
    264264
    265     connect(ui.termsEdit, SIGNAL(textChanged(const QString&)), this, SLOT(updateSearchButton(const QString&)));
     265    connect(ui.termsEdit, SIGNAL(textChanged(QString)), this, SLOT(updateSearchButton(QString)));
    266266
    267267    connect(ui.resultBox, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showListItemMenu(QPoint)));
  • trunk/tools/assistant/compat/helpdialog.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/helpdialog.ui

    r2 r561  
    44**
    55** 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)
    78**
    89** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2324** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2425**
    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.
    2929**
    3030** GNU General Public License Usage
     
    3636** met: http://www.gnu.org/copyleft/gpl.html.
    3737**
    38 ** If you are unsure which license is appropriate for your use, please
    39 ** 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.
    4040** $QT_END_LICENSE$
    4141**
     
    270270        <widget class="QLineEdit" name="termsEdit" >
    271271         <property name="toolTip" >
    272           <string>Enter searchword(s).</string>
     272          <string>Enter searchword(s)</string>
    273273         </property>
    274274         <property name="whatsThis" >
     
    308308          <widget class="QPushButton" name="helpButton" >
    309309           <property name="toolTip" >
    310             <string>Display the help page.</string>
     310            <string>Display the help page</string>
    311311           </property>
    312312           <property name="whatsThis" >
     
    337337          <widget class="QPushButton" name="searchButton" >
    338338           <property name="toolTip" >
    339             <string>Start searching.</string>
     339            <string>Start searching</string>
    340340           </property>
    341341           <property name="whatsThis" >
  • trunk/tools/assistant/compat/helpwindow.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/helpwindow.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/index.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/index.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/lib/lib.pro

    r552 r561  
    3333CONFIG += qt_install_headers
    3434HEADERS_PRI = $$QT_BUILD_TREE/include/QtAssistant/headers.pri
    35 include($$HEADERS_PRI)|clear(HEADERS_PRI)
     35include($$HEADERS_PRI, "", true)|clear(HEADERS_PRI)
    3636
    3737#mac frameworks
  • trunk/tools/assistant/compat/lib/qassistantclient.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    7676    Assistant as an application's help tool.
    7777
    78     \inmodule QtAssistant
    7978    \ingroup helpsystem
    8079
  • trunk/tools/assistant/compat/lib/qassistantclient.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/lib/qassistantclient_global.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/main.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/mainwindow.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    141141    ui.actionSyncToc->setIcon(QIcon(MacIconPath + QLatin1String("/synctoc.png")));
    142142    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()));
    143153#endif
    144154}
     
    313323    QMessageBox box(this);
    314324
    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 
    320325    box.setText(QString::fromLatin1("<center><img src=\":/trolltech/assistant/images/assistant-128.png\">"
    321326                                    "<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)));
    330330    box.setWindowTitle(tr("Qt Assistant"));
    331331    box.setIcon(QMessageBox::NoIcon);
     
    399399}
    400400
     401#ifndef QT_NO_PRINTER
    401402class PrintThread : public QThread
    402403{
     
    434435    }
    435436};
     437#endif //QT_NO_PRINTER
    436438
    437439void MainWindow::on_actionFilePrint_triggered()
  • trunk/tools/assistant/compat/mainwindow.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/mainwindow.ui

    r2 r561  
    33**
    44** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     5** All rights reserved.
     6** Contact: Nokia Corporation (qt-info@nokia.com)
    57**
    68** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2123** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2224**
    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.
    2728**
    2829** GNU General Public License Usage
     
    3435** met: http://www.gnu.org/copyleft/gpl.html.
    3536**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3839** $QT_END_LICENSE$
    39 **
    40 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
    41 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
    4240**
    4341*********************************************************************</comment>
  • trunk/tools/assistant/compat/profile.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/profile.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/tabbedbrowser.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    218218        opt.shape = tabBar->shape();
    219219        tabBar->setContextMenuPolicy(Qt::CustomContextMenu);
    220         connect(tabBar, SIGNAL(customContextMenuRequested(const QPoint&)), SLOT(openTabMenu(const QPoint&)));
     220        connect(tabBar, SIGNAL(customContextMenuRequested(QPoint)), SLOT(openTabMenu(QPoint)));
    221221    }
    222222
     
    249249        QObject::connect(ui.toolNext, SIGNAL(clicked()), this, SLOT(findNext()));
    250250        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)),
    252252                                     this, SLOT(find(QString)));
    253253        ui.frameFind->setVisible(false);
  • trunk/tools/assistant/compat/tabbedbrowser.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/tabbedbrowser.ui

    r2 r561  
    44**
    55** 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)
    78**
    89** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2324** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2425**
    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.
    2929**
    3030** GNU General Public License Usage
     
    3636** met: http://www.gnu.org/copyleft/gpl.html.
    3737**
    38 ** If you are unsure which license is appropriate for your use, please
    39 ** 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.
    4040** $QT_END_LICENSE$
    4141**
  • trunk/tools/assistant/compat/topicchooser.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/topicchooser.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/compat/topicchooser.ui

    r2 r561  
    33**
    44** 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)
    67**
    78** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2223** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2324**
    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.
    2828**
    2929** GNU General Public License Usage
     
    3535** met: http://www.gnu.org/copyleft/gpl.html.
    3636**
    37 ** If you are unsure which license is appropriate for your use, please
    38 ** 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.
    3939** $QT_END_LICENSE$
    4040**
  • trunk/tools/assistant/lib/fulltextsearch/qanalyzer.cpp

    r2 r561  
    11/****************************************************************************
    22**
    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.
    815**
    916****************************************************************************/
     
    2835{
    2936    analyzer = _CL_POINTER(other.analyzer);
     37    deleteCLuceneAnalyzer = other.deleteCLuceneAnalyzer;
    3038}
    3139
  • trunk/tools/assistant/lib/fulltextsearch/qanalyzer_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qclucene-config_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qclucene_global_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2936#include <QtCore/QChar>
    3037#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
    3146
    3247QT_BEGIN_HEADER
     
    88103#endif
    89104
    90 #if !defined(_MSC_VER) && defined(_CL_HAVE_WCHAR_H) && defined(_CL_HAVE_WCHAR_T)
    91 #   if !defined(TCHAR)
    92 #       define TCHAR wchar_t
    93 #   endif
    94 #else
    95 #   include <windows.h>
    96 #endif
    97 
    98105namespace {
    99106    TCHAR* QStringToTChar(const QString &str)
  • trunk/tools/assistant/lib/fulltextsearch/qdocument.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    3037{
    3138    document = _CL_POINTER(other.document);
     39    deleteCLuceneDocument = other.deleteCLuceneDocument;
    3240}
    3341
  • trunk/tools/assistant/lib/fulltextsearch/qdocument_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qfield.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2431    deleteCLuceneField = true;
    2532}
    26    
     33
    2734QCLuceneFieldPrivate::QCLuceneFieldPrivate(const QCLuceneFieldPrivate &other)
    2835    : QSharedData()
    2936{
    3037    field = _CL_POINTER(other.field);
     38    deleteCLuceneField = other.deleteCLuceneField;
    3139}
    3240
     
    5159    TCHAR* fieldName = QStringToTChar(name);
    5260    TCHAR* fieldValue = QStringToTChar(value);
    53    
     61
    5462    d->field = new lucene::document::Field(fieldName, fieldValue, configs);
    5563
     
    6775    reader->d->deleteCLuceneReader = false; // clucene takes ownership
    6876    d->field = new lucene::document::Field(fieldName, reader->d->reader, configs);
    69    
     77
    7078    delete [] fieldName;
    7179}
  • trunk/tools/assistant/lib/fulltextsearch/qfield_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qfilter.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2734{
    2835    filter = _CL_POINTER(other.filter);
     36    deleteCLuceneFilter = other.deleteCLuceneFilter;
    2937}
    3038
  • trunk/tools/assistant/lib/fulltextsearch/qfilter_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qhits.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2330    deleteCLuceneHits = true;
    2431}
    25    
     32
    2633QCLuceneHitsPrivate::QCLuceneHitsPrivate(const QCLuceneHitsPrivate &other)
    2734    : QSharedData()
    2835{
    2936    hits = _CL_POINTER(other.hits);
     37    deleteCLuceneHits = other.deleteCLuceneHits;
    3038}
    3139
     
    3745
    3846
    39 QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher, 
     47QCLuceneHits::QCLuceneHits(const QCLuceneSearcher &searcher,
    4048                           const QCLuceneQuery &query, const QCLuceneFilter &filter)
    4149    : d(new QCLuceneHitsPrivate())
  • trunk/tools/assistant/lib/fulltextsearch/qhits_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qindexreader.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2835{
    2936    reader = _CL_POINTER(other.reader);
     37    deleteCLuceneIndexReader = other.deleteCLuceneIndexReader;
    3038}
    3139
  • trunk/tools/assistant/lib/fulltextsearch/qindexreader_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qindexwriter.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2835{
    2936    writer = _CL_POINTER(other.writer);
     37    deleteCLuceneIndexWriter = other.deleteCLuceneIndexWriter;
    3038}
    3139
  • trunk/tools/assistant/lib/fulltextsearch/qindexwriter_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qquery.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2936{
    3037    query = _CL_POINTER(other.query);
     38    deleteCLuceneQuery = other.deleteCLuceneQuery;
    3139}
    3240
  • trunk/tools/assistant/lib/fulltextsearch/qquery_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qqueryparser.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2936{
    3037    queryParser = _CL_POINTER(other.queryParser);
     38    deleteCLuceneQueryParser = other.deleteCLuceneQueryParser;
    3139}
    3240
     
    3846
    3947
    40 QCLuceneQueryParser::QCLuceneQueryParser(const QString &field, 
     48QCLuceneQueryParser::QCLuceneQueryParser(const QString &field,
    4149                                         QCLuceneAnalyzer &analyzer)
    4250    : d(new QCLuceneQueryParserPrivate())
     
    4553{
    4654    TCHAR *fieldName = QStringToTChar(field);
    47    
    48     d->queryParser = new lucene::queryParser::QueryParser(fieldName, 
     55
     56    d->queryParser = new lucene::queryParser::QueryParser(fieldName,
    4957        analyzer.d->analyzer);
    5058
     
    114122}
    115123
    116 QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query, 
     124QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query,
    117125                                                    const QStringList &fieldList,
    118126                                                    QCLuceneAnalyzer &analyzer)
     
    144152            qint32 flag = flags.at(i);
    145153            switch (flag) {
    146                 case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: {   
     154                case QCLuceneMultiFieldQueryParser::REQUIRED_FIELD: {
    147155                    retValue->add(q, true, true, false);
    148156                }   break;
  • trunk/tools/assistant/lib/fulltextsearch/qqueryparser_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qreader.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    1724QT_BEGIN_NAMESPACE
    1825
    19 QCLuceneReaderPrivate::QCLuceneReaderPrivate() 
     26QCLuceneReaderPrivate::QCLuceneReaderPrivate()
    2027    : QSharedData()
    21 { 
    22     reader = 0; 
     28{
     29    reader = 0;
    2330    deleteCLuceneReader = true;
    2431}
     
    2633QCLuceneReaderPrivate::QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other)
    2734    : QSharedData()
    28 {
    29     reader = _CL_POINTER(other.reader);
     35{
     36    reader = _CL_POINTER(other.reader);
     37    deleteCLuceneReader = other.deleteCLuceneReader;
    3038}
    3139
    32 QCLuceneReaderPrivate::~QCLuceneReaderPrivate() 
    33 { 
     40QCLuceneReaderPrivate::~QCLuceneReaderPrivate()
     41{
    3442    if (deleteCLuceneReader)
    3543        _CLDECDELETE(reader);
    3644}
    37    
    3845
    3946QCLuceneReader::QCLuceneReader()
     
    6370}
    6471
    65 QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length, 
     72QCLuceneStringReader::QCLuceneStringReader(const QString &value, qint32 length,
    6673                                           bool copyData)
    6774    : QCLuceneReader()
  • trunk/tools/assistant/lib/fulltextsearch/qreader_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    4552{
    4653public:
    47     QCLuceneReaderPrivate(); 
     54    QCLuceneReaderPrivate();
    4855    QCLuceneReaderPrivate(const QCLuceneReaderPrivate &other);
    49    
     56
    5057    ~QCLuceneReaderPrivate();
    51    
     58
    5259    Reader* reader;
    5360    bool deleteCLuceneReader;
  • trunk/tools/assistant/lib/fulltextsearch/qsearchable.cpp

    r2 r561  
    11/****************************************************************************
    22**
    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.
    815**
    916****************************************************************************/
     
    2734{
    2835    searchable = _CL_POINTER(other.searchable);
     36    deleteCLuceneSearchable = other.deleteCLuceneSearchable;
    2937}
    3038
     
    6472}
    6573
    66 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 
     74QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query,
    6775                                      const QCLuceneFilter &filter)
    6876{
     
    7078}
    7179
    72 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 
     80QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query,
    7381                                      const QCLuceneSort &sort)
    7482{
     
    7684}
    7785
    78 QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query, 
     86QCLuceneHits QCLuceneSearcher::search(const QCLuceneQuery &query,
    7987                                      const QCLuceneFilter &filter,
    8088                                      const QCLuceneSort &sort)
     
    8795    : QCLuceneSearcher()
    8896{
    89     lucene::search::IndexSearcher *searcher = 
     97    lucene::search::IndexSearcher *searcher =
    9098        new lucene::search::IndexSearcher(path);
    9199
     
    132140: QCLuceneSearcher()
    133141{
    134     lucene::search::Searchable** list= 
     142    lucene::search::Searchable** list=
    135143        _CL_NEWARRAY(lucene::search::Searchable*, searchables.count());
    136144
     
    162170    if (searcher == 0)
    163171        return 0;
    164    
     172
    165173    return qint32(searcher->subDoc(int32_t(index)));
    166174}
     
    173181    if (searcher == 0)
    174182        return 0;
    175    
     183
    176184    return qint32(searcher->subSearcher(int32_t(index)));
    177185}
     
    184192    if (searcher == 0)
    185193        return 0;
    186    
     194
    187195    return qint32(searcher->searcherIndex(int32_t(index)));
    188196}
  • trunk/tools/assistant/lib/fulltextsearch/qsearchable_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qsort.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2835{
    2936    sort = _CL_POINTER(other.sort);
     37    deleteCLuceneSort = other.deleteCLuceneSort;
    3038}
    3139
  • trunk/tools/assistant/lib/fulltextsearch/qsort_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qterm.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2835{
    2936    term = _CL_POINTER(other.term);
     37    deleteCLuceneTerm = other.deleteCLuceneTerm;
    3038}
    3139
  • trunk/tools/assistant/lib/fulltextsearch/qterm_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qtoken.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2835{
    2936    token = _CL_POINTER(other.token);
     37    deleteCLuceneToken = other.deleteCLuceneToken;
    3038}
    3139
  • trunk/tools/assistant/lib/fulltextsearch/qtoken_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qtokenizer.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qtokenizer_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/fulltextsearch/qtokenstream.cpp

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
     
    2734{
    2835    tokenStream = _CL_POINTER(other.tokenStream);
     36    deleteCLuceneTokenStream = other.deleteCLuceneTokenStream;
    2937}
    3038
  • trunk/tools/assistant/lib/fulltextsearch/qtokenstream_p.h

    r2 r561  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 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.
    55**
    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.
    815**
    916****************************************************************************/
  • trunk/tools/assistant/lib/lib.pro

    r552 r561  
    1 QT += sql xml network
     1QT += sql \
     2    xml \
     3    network
    24TEMPLATE = lib
    35TARGET = QtHelp
    4 DEFINES += QHELP_LIB QT_CLUCENE_SUPPORT
    5 CONFIG += qt warn_on
    6 
     6DEFINES += QHELP_LIB \
     7    QT_CLUCENE_SUPPORT
     8CONFIG += qt \
     9    warn_on
    710include(../../../src/qbase.pri)
    8 
    911QMAKE_TARGET_PRODUCT = Help
    10 QMAKE_TARGET_DESCRIPTION = Help application framework.
     12QMAKE_TARGET_DESCRIPTION = Help \
     13    application \
     14    framework.
    1115DEFINES -= QT_ASCII_CAST_WARNINGS
    12 
    1316qclucene = QtCLucene$${QT_LIBINFIX}
    14 if(!debug_and_release|build_pass):CONFIG(debug, debug|release) {
     17if(!debug_and_release|build_pass):CONFIG(debug, debug|release) { 
    1518    mac:qclucene = $${qclucene}_debug
    1619    win32|os2:qclucene = $${qclucene}d
    1720}
    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
     21linux-lsb-g++:LIBS_PRIVATE += --lsb-shared-libs=$$qclucene
     22unix:QMAKE_PKGCONFIG_REQUIRES += QtNetwork \
     23    QtSql \
     24    QtXml
     25LIBS_PRIVATE += -l$$qclucene
    2226
    2327RESOURCES += helpsystem.qrc
    24 
    2528SOURCES += 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
    4045
    4146# access to clucene
    4247SOURCES += qhelpsearchindexwriter_clucene.cpp \
    43            qhelpsearchindexreader_clucene.cpp
    44 
     48    qhelpsearchindexreader_clucene.cpp
    4549HEADERS += 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
    6267
    6368# access to clucene
    6469HEADERS += qhelpsearchindexwriter_clucene_p.h \
    65            qhelpsearchindexreader_clucene_p.h
     70    qhelpsearchindexreader_clucene_p.h
  • trunk/tools/assistant/lib/qhelp_global.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4646#include <QtCore/QString>
    4747#include <QtCore/QObject>
    48 #include <QtCore/QRegExp>
    49 #include <QtCore/QMutexLocker>
    50 #include <QtGui/QTextDocument>
    5148
    5249QT_BEGIN_HEADER
     
    6663class QHelpGlobal {
    6764public:
    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);
    7268
    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     }
     69private:
     70    static QString codecFromHtmlData(const QByteArray &data);
     71    static QString codecFromXmlData(const QByteArray &data);
    11872};
    11973
  • trunk/tools/assistant/lib/qhelpcollectionhandler.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    7777    if (m_dbOpened)
    7878        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));
    8081    return false;
    8182}
     
    135136    QFileInfo fi(fileName);
    136137    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));
    138140        return false;
    139141    }
     
    282284
    283285    if (filterNameId < 0) {
    284         emit error(tr("Unknown filter!"));
     286        emit error(tr("Unknown filter '%1'!").arg(filterName));
    285287        return false;
    286288    }
     
    387389    QString ns = reader.namespaceName();
    388390    if (ns.isEmpty()) {
    389         emit error(tr("Invalid documentation file!"));
     391        emit error(tr("Invalid documentation file '%1'!").arg(fileName));
    390392        return false;
    391393    }
     
    554556        namespaceId = m_query.lastInsertId().toInt();
    555557    if (namespaceId < 1) {
    556         emit error(tr("Cannot register namespace!"));
     558        emit error(tr("Cannot register namespace '%1'!").arg(nspace));
    557559        return -1;
    558560    }
     
    578580        if (!db.open()) {
    579581            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));
    581583            return;
    582584        }
  • trunk/tools/assistant/lib/qhelpcollectionhandler_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpcontentwidget.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    519519    header()->hide();
    520520    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)));
    523523}
    524524
  • trunk/tools/assistant/lib/qhelpcontentwidget.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpdatainterface.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpdatainterface_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpdbreader.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    9393    db.setDatabaseName(m_dbName);
    9494    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 */
    9598        m_error = tr("Cannot open database '%1' '%2': %3").arg(m_dbName, m_uniqueId, db.lastError().text());
    9699        QSqlDatabase::removeDatabase(m_uniqueId);
  • trunk/tools/assistant/lib/qhelpdbreader_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpengine.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    8181    connect(helpEngineCore, SIGNAL(setupFinished()),
    8282        this, SLOT(applyCurrentFilter()));
    83     connect(helpEngineCore, SIGNAL(currentFilterChanged(const QString&)),
     83    connect(helpEngineCore, SIGNAL(currentFilterChanged(QString)),
    8484        this, SLOT(applyCurrentFilter()));
    8585
  • trunk/tools/assistant/lib/qhelpengine.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpengine_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpenginecore.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6767    q = helpEngineCore;
    6868    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)));
    7171    needsSetup = true;
    7272}
     
    176176    indices or contents. If you need one of those use QHelpEngine
    177177    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.
    178185*/
    179186
     
    353360QString QHelpEngineCore::documentationFileName(const QString &namespaceName)
    354361{
    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            }
    365374        }
    366375    }
    367     return res;
     376    return QString();
    368377}
    369378
  • trunk/tools/assistant/lib/qhelpenginecore.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpgenerator.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    468468    emit statusChanged(tr("Insert files..."));
    469469    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=?"));
    472473        d->query->bindValue(0, filterAtt);
    473474        d->query->exec();
     
    483484        return false;
    484485    ++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(?, ?)"));
    487489        d->query->bindValue(0, filterSetId);
    488490        d->query->bindValue(1, attId);
    489491        d->query->exec();
    490492    }
    491 
    492     QString title;
    493     QString charSet;
    494     QMap<int, QSet<int> > tmpFileFilterMap;
    495     QList<FileNameTableData> fileNameDataList;
    496     QList<QByteArray> fileDataList;
    497493
    498494    int tableFileId = 1;
     
    501497        tableFileId = d->query->value(0).toInt() + 1;
    502498
     499    QString title;
     500    QString charSet;
    503501    FileNameTableData fileNameData;
     502    QList<QByteArray> fileDataList;
     503    QMap<int, QSet<int> > tmpFileFilterMap;
     504    QList<FileNameTableData> fileNameDataList;
    504505
    505506    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);
    508516        if (!fi.exists()) {
    509517            emit warning(tr("The file %1 does not exist! Skipping it.")
    510                 .arg(fi.absoluteFilePath()));
     518                .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName)));
    511519            continue;
    512520        }
    513521
    514         QFile f(fi.absoluteFilePath());
    515         if (!f.open(QIODevice::ReadOnly)) {
     522        if (!fi.open(QIODevice::ReadOnly)) {
    516523            emit warning(tr("Cannot open file %1! Skipping it.")
    517                 .arg(fi.absoluteFilePath()));
     524                .arg(QDir::cleanPath(rootPath + QDir::separator() + fileName)));
    518525            continue;
    519526        }
    520527
    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());
    530535        } 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        }
    537538
    538539        int fileId = -1;
    539         if (!d->fileMap.contains(fName)) {
     540        if (!d->fileMap.contains(fileName)) {
    540541            fileDataList.append(qCompress(data));
    541542
    542             fileNameData.name = fName;
     543            fileNameData.name = fileName;
    543544            fileNameData.fileId = tableFileId;
    544545            fileNameData.title = title;
    545546            fileNameDataList.append(fileNameData);
    546547
    547             d->fileMap.insert(fName, tableFileId);
     548            d->fileMap.insert(fileName, tableFileId);
    548549            d->fileFilterMap.insert(tableFileId, filterAtts.toSet());
    549550            tmpFileFilterMap.insert(tableFileId, filterAtts.toSet());
     
    551552            ++tableFileId;
    552553        } else {
    553             fileId = d->fileMap.value(fName);
    554             foreach (int filter, filterAtts) {
     554            fileId = d->fileMap.value(fileName);
     555            foreach (const int &filter, filterAtts) {
    555556                if (!d->fileFilterMap.value(fileId).contains(filter)
    556557                    && !tmpFileFilterMap.value(fileId).contains(filter)) {
     
    566567        QMap<int, QSet<int> >::const_iterator it = tmpFileFilterMap.constBegin();
    567568        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);
    572574                d->query->bindValue(1, it.key());
    573575                d->query->exec();
    574                 ++i;
     576                ++si;
    575577            }
    576578            ++it;
     
    579581        QList<QByteArray>::const_iterator fileIt = fileDataList.constBegin();
    580582        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, ?)"));
    582585            d->query->bindValue(0, *fileIt);
    583586            d->query->exec();
     
    587590        }
    588591
    589         QList<FileNameTableData>::const_iterator fileNameIt = fileNameDataList.constBegin();
     592        QList<FileNameTableData>::const_iterator fileNameIt =
     593                                                  fileNameDataList.constBegin();
    590594        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 (?, ?, ?, ?)"));
    593597            d->query->bindValue(0, 1);
    594598            d->query->bindValue(1, (*fileNameIt).name);
     
    610614}
    611615
    612 bool QHelpGenerator::registerCustomFilter(const QString &filterName, const QStringList &filterAttribs,
    613                                           bool forceUpdate)
     616bool QHelpGenerator::registerCustomFilter(const QString &filterName,
     617    const QStringList &filterAttribs, bool forceUpdate)
    614618{
    615619    if (!d->query)
  • trunk/tools/assistant/lib/qhelpgenerator_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpindexwidget.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    131131    m_mutex.unlock();
    132132    wait();
     133    m_abort = false;
    133134}
    134135
     
    165166        m_mutex.lock();
    166167        if (m_abort) {
    167             m_abort = false;
    168168            m_mutex.unlock();
    169169            return;
     
    182182                indicesSet.insert(s);
    183183            if (m_abort) {
    184                 m_abort = false;
    185184                m_mutex.unlock();
    186185                return;
     
    195194    m_indices = indicesSet.values();
    196195    qSort(m_indices.begin(), m_indices.end(), caseInsensitiveLessThan);
    197     m_abort = false;
    198196    m_mutex.unlock();
    199197}
     
    392390    setEditTriggers(QAbstractItemView::NoEditTriggers);
    393391    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)));
    396394}
    397395
  • trunk/tools/assistant/lib/qhelpindexwidget.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpprojectdata.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4242#include "qhelpprojectdata_p.h"
    4343
     44#include <QtCore/QDir>
    4445#include <QtCore/QFileInfo>
    4546#include <QtCore/QStack>
    4647#include <QtCore/QMap>
     48#include <QtCore/QRegExp>
    4749#include <QtCore/QVariant>
    4850#include <QtXml/QXmlStreamReader>
     
    7476    void readFiles();
    7577    void raiseUnknownTokenError();
     78    void addMatchingFiles(const QString &pattern);
     79
     80    QMap<QString, QStringList> dirEntriesCache;
    7681};
    7782
     
    162167        if (isStartElement()) {
    163168            if (name() == QLatin1String("filterAttribute"))
    164                 filterSectionList.last().addFilterAttribute(readElementText());                         
     169                filterSectionList.last().addFilterAttribute(readElementText());
    165170            else if (name() == QLatin1String("toc"))
    166171                readTOC();
     
    245250        if (isStartElement()) {
    246251            if (name() == QLatin1String("file"))
    247                 filterSectionList.last().addFile(readElementText());
     252                addMatchingFiles(readElementText());
    248253            else
    249254                raiseUnknownTokenError();
     
    259264}
    260265
    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.
     269void 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}
    262307
    263308/*!
     
    325370
    326371/*!
    327     \reimp
     372    \internal
    328373*/
    329374QString QHelpProjectData::namespaceName() const
     
    333378
    334379/*!
    335     \reimp
     380    \internal
    336381*/
    337382QString QHelpProjectData::virtualFolder() const
     
    341386
    342387/*!
    343     \reimp
     388    \internal
    344389*/
    345390QList<QHelpDataCustomFilter> QHelpProjectData::customFilters() const
     
    349394
    350395/*!
    351     \reimp
     396    \internal
    352397*/
    353398QList<QHelpDataFilterSection> QHelpProjectData::filterSections() const
     
    357402
    358403/*!
    359     \reimp
     404    \internal
    360405*/
    361406QMap<QString, QVariant> QHelpProjectData::metaData() const
     
    365410
    366411/*!
    367     \reimp
     412    \internal
    368413*/
    369414QString QHelpProjectData::rootPath() const
  • trunk/tools/assistant/lib/qhelpprojectdata_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpsearchengine.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4545#include "qhelpsearchresultwidget.h"
    4646
     47#include "qhelpsearchindexreader_p.h"
    4748#if defined(QT_CLUCENE_SUPPORT)
    4849#   include "qhelpsearchindexreader_clucene_p.h"
     
    8586        , helpEngine(helpEngine)
    8687    {
    87         hitList.clear();
    8888        indexReader = 0;
    8989        indexWriter = 0;
     
    9292    ~QHelpSearchEnginePrivate()
    9393    {
    94         hitList.clear();
    9594        delete indexReader;
    9695        delete indexWriter;
    9796    }
    9897
    99     int hitsCount() const
     98    int hitCount() const
    10099    {
    101100        int count = 0;
    102101        if (indexReader)
    103             count = indexReader->hitsCount();
     102            count = indexReader->hitCount();
    104103
    105104        return count;
     
    108107    QList<QHelpSearchEngine::SearchHit> hits(int start, int end) const
    109108    {
    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>();
    116112    }
    117113
     
    132128        }
    133129
    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);
    139133    }
    140134
     
    154148
    155149        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
    158155            connect(indexReader, SIGNAL(searchingStarted()), this, SIGNAL(searchingStarted()));
    159156            connect(indexReader, SIGNAL(searchingFinished(int)), this, SIGNAL(searchingFinished(int)));
    160157        }
    161158
    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);
    167162    }
    168163
     
    190185#if defined(QT_CLUCENE_SUPPORT)
    191186        if (indexWriter && !helpEngine.isNull()) {
    192             indexWriter->optimizeIndex();           
     187            indexWriter->optimizeIndex();
    193188        }
    194189#endif
     
    201196    QHelpSearchResultWidget *resultWidget;
    202197
    203     QHelpSearchIndexReader *indexReader;
     198    qt::fulltextsearch::QHelpSearchIndexReader *indexReader;
    204199    QHelpSearchIndexWriter *indexWriter;
    205200
    206201    QPointer<QHelpEngineCore> helpEngine;
    207     QList<QHelpSearchEngine::SearchHit> hitList;
    208202
    209203    QList<QHelpSearchQuery> m_queryList;
     
    244238
    245239    \value DEFAULT  the default field provided by the search widget, several terms should be
    246                     splitted 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.
    247241    \value FUZZY    a field only provided in use with clucene. Terms should be split in seperate
    248242                    words and passed to the search engine.
     
    331325{
    332326    d = new QHelpSearchEnginePrivate(helpEngine);
    333    
     327
    334328    connect(helpEngine, SIGNAL(setupFinished()), this, SLOT(indexDocumentation()));
    335329
     
    372366
    373367/*!
     368    \obsolete
    374369    Returns the amount of hits the search engine found.
     370    \sa hitCount()
    375371*/
    376372int QHelpSearchEngine::hitsCount() const
    377373{
    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*/
     381int QHelpSearchEngine::hitCount() const
     382{
     383    return d->hitCount();
    379384}
    380385
  • trunk/tools/assistant/lib/qhelpsearchengine.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    8787    QHelpSearchResultWidget* resultWidget();
    8888
    89     int hitsCount() const;
     89#ifdef QT_DEPRECATED
     90    QT_DEPRECATED int hitsCount() const;
     91#endif
     92    int hitCount() const;
    9093
    9194    typedef QPair<QString, QString> SearchHit;
  • trunk/tools/assistant/lib/qhelpsearchindex_default.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpsearchindex_default_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6060        namespace clucene {
    6161
    62 QHelpSearchIndexReader::QHelpSearchIndexReader()
    63     : QThread()
    64     , m_cancel(false)
     62QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene()
     63    : QHelpSearchIndexReader()
    6564{
    6665    // nothing todo
    6766}
    6867
    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()
     68QHelpSearchIndexReaderClucene::~QHelpSearchIndexReaderClucene()
     69{
     70}
     71
     72
     73void QHelpSearchIndexReaderClucene::run()
    11174{
    11275    mutex.lock();
     
    214177#if !defined(QT_NO_EXCEPTIONS)
    215178        } catch(...) {
     179            mutex.lock();
    216180            hitList.clear();
     181            mutex.unlock();
    217182            emit searchingFinished(0);
    218183        }
     
    221186}
    222187
    223 bool QHelpSearchIndexReader::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery,
     188bool QHelpSearchIndexReaderClucene::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery,
    224189    QCLuceneStandardAnalyzer &analyzer)
    225190{
     
    238203}
    239204
    240 bool QHelpSearchIndexReader::buildQuery(QCLuceneBooleanQuery &booleanQuery,
     205bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuery,
    241206    const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer)
    242207{
     
    338303}
    339304
    340 bool QHelpSearchIndexReader::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery,
     305bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery,
    341306    const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer)
    342307{
     
    361326}
    362327
    363 void QHelpSearchIndexReader::boostSearchHits(const QHelpEngineCore &engine,
     328void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine,
    364329    QList<QHelpSearchEngine::SearchHit> &hitList, const QList<QHelpSearchQuery> &queryList)
    365330{
     
    417382        } while (it != hitMap.constBegin());
    418383        boostedList += hitList.mid(count, hitList.count());
    419 
     384        mutex.lock();
    420385        hitList = boostedList;
     386        mutex.unlock();
    421387    }
    422388}
  • trunk/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5454//
    5555
    56 #include "qhelpsearchengine.h"
     56#include "qhelpsearchindexreader_p.h"
    5757
    5858#include "fulltextsearch/qanalyzer_p.h"
    5959#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;
    6960
    7061QT_BEGIN_NAMESPACE
     
    7465        namespace clucene {
    7566
    76 class QHelpSearchIndexReader : public QThread
     67class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader
    7768{
    7869    Q_OBJECT
    7970
    8071public:
    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();
    9574
    9675private:
     
    10483    void boostSearchHits(const QHelpEngineCore &engine, QList<QHelpSearchEngine::SearchHit> &hitList,
    10584        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;
    11685};
    11786
  • trunk/tools/assistant/lib/qhelpsearchindexreader_default.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    493493
    494494
    495 QHelpSearchIndexReader::QHelpSearchIndexReader()
    496     : QThread()
    497     , m_cancel(false)
     495QHelpSearchIndexReaderDefault::QHelpSearchIndexReaderDefault()
     496    : QHelpSearchIndexReader()
    498497{
    499498    // nothing todo
    500499}
    501500
    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()
     501QHelpSearchIndexReaderDefault::~QHelpSearchIndexReaderDefault()
     502{
     503}
     504
     505void QHelpSearchIndexReaderDefault::run()
    545506{
    546507    mutex.lock();
     
    572533    if (!engine.setupData())
    573534        return;
    574    
     535
    575536    const QStringList registeredDocs = engine.registeredDocumentations();
    576537    const QStringList indexedNamespaces = engine.customValue(key).toString().
  • trunk/tools/assistant/lib/qhelpsearchindexreader_default_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5555
    5656#include "qhelpsearchindex_default_p.h"
    57 #include "qhelpsearchengine.h"
     57#include "qhelpsearchindexreader_p.h"
    5858
    5959#include <QtCore/QHash>
    6060#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>
    7061
    7162QT_BEGIN_NAMESPACE
     
    122113
    123114
    124 class QHelpSearchIndexReader : public QThread
     115class QHelpSearchIndexReaderDefault : public QHelpSearchIndexReader
    125116{
    126117    Q_OBJECT
    127118
    128119public:
    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();
    143122
    144123private:
     
    146125
    147126private:
    148     QMutex mutex;
    149127    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;
    157128};
    158129
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    431431    {
    432432        QTextStream textStream(data);
    433         QByteArray charSet = QHelpGlobal::charsetFromData(data).toLatin1();
    434         textStream.setCodec(QTextCodec::codecForName(charSet.constData()));
     433        const QByteArray &codec = QHelpGlobal::codecFromData(data).toLatin1();
     434        textStream.setCodec(QTextCodec::codecForName(codec.constData()));
    435435
    436436        QString stream = textStream.readAll();
     
    579579    const QString &indexFilesFolder, bool reindex)
    580580{
     581    wait();
    581582    mutex.lock();
    582583    this->m_cancel = false;
     
    591592void QHelpSearchIndexWriter::optimizeIndex()
    592593{
    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
    602612}
    603613
     
    640650    QFileInfo fInfo(indexPath);
    641651    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));
    643653        return;
    644654    }
     
    721731#if !defined(QT_NO_EXCEPTIONS)
    722732    } 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));
    724735        return;
    725736    }
    726737#endif
    727738
    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
    731751
    732752    QStringList namespaces;
     
    734754        mutexLocker.relock();
    735755        if (m_cancel) {
    736             writer->close();
    737             delete writer;
     756            closeIndexWriter(writer);
    738757            emit indexingFinished();
    739758            return;
     
    778797    }
    779798
    780     writer->close();
    781     delete writer;
     799    closeIndexWriter(writer);
    782800
    783801    mutexLocker.relock();
     
    814832        QCLuceneDocument document;
    815833        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        }
    819846        locker.relock();
    820847        if (m_cancel)
     
    822849        locker.unlock();
    823850    }
    824 
    825851    return true;
    826852}
     
    862888}
    863889
     890void 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}
    864903
    865904        }   // namespace clucene
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    105105        const QString &namespaceName, const QStringList &attributes) const;
    106106
     107    void closeIndexWriter(QCLuceneIndexWriter *writer);
     108
    107109private:
    108110    QMutex mutex;
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_default.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    185185                                         bool reindex)
    186186{
     187    wait();
    187188    QMutexLocker lock(&mutex);
    188189
     
    275276
    276277                QTextStream s(data);
    277                 QString en = QHelpGlobal::charsetFromData(data);
     278                QString en = QHelpGlobal::codecFromData(data);
    278279                s.setCodec(QTextCodec::codecForName(en.toLatin1().constData()));
    279280
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_default_p.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4444#include <QtCore/QDebug>
    4545
     46#include <QtCore/QAbstractListModel>
    4647#include <QtCore/QObject>
    4748#include <QtCore/QStringList>
    48 
     49#include <QtCore/QtGlobal>
     50
     51#include <QtGui/QCompleter>
    4952#include <QtGui/QLabel>
    5053#include <QtGui/QLayout>
     
    6164
    6265private:
     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
    63103    QHelpSearchQueryWidgetPrivate()
    64         : QObject()
     104        : QObject(), simpleSearch(true),
     105          searchCompleter(new CompleterModel(this), this)
    65106    {
    66107        searchButton = 0;
     
    137178    }
    138179
     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
    139272private slots:
    140273    void showHideAdvancedSearch()
    141274    {
    142         bool hidden = advancedSearchWidget->isHidden();
    143         if (hidden) {
     275        if (simpleSearch) {
    144276            advancedSearchWidget->show();
    145277            showHideAdvancedSearchButton->setText((QLatin1String("-")));
     
    149281        }
    150282
    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);
    152357    }
    153358
     
    155360    friend class QHelpSearchQueryWidget;
    156361
     362    bool simpleSearch;
    157363    QPushButton *searchButton;
    158364    QWidget* advancedSearchWidget;
     
    164370    QLineEdit *allQuery;
    165371    QLineEdit *atLeastQuery;
     372    QToolButton *nextQueryButton;
     373    QToolButton *prevQueryButton;
     374    QueryHistory simpleQueries;
     375    QueryHistory complexQueries;
     376    QCompleter searchCompleter;
    166377};
    167378
     
    200411    QLabel *label = new QLabel(tr("Search for:"), this);
    201412    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);
    202422    d->searchButton = new QPushButton(tr("Search"), this);
    203423    hBoxLayout->addWidget(label);
    204424    hBoxLayout->addWidget(d->defaultQuery);
     425    hBoxLayout->addWidget(d->prevQueryButton);
     426    hBoxLayout->addWidget(d->nextQueryButton);
    205427    hBoxLayout->addWidget(d->searchButton);
    206428
    207429    vLayout->addLayout(hBoxLayout);
    208430
     431    connect(d->prevQueryButton, SIGNAL(clicked()), d, SLOT(prevQuery()));
     432    connect(d->nextQueryButton, SIGNAL(clicked()), d, SLOT(nextQuery()));
    209433    connect(d->searchButton, SIGNAL(clicked()), this, SIGNAL(search()));
    210434    connect(d->defaultQuery, SIGNAL(returnPressed()), this, SIGNAL(search()));
     
    237461    gLayout->addWidget(label, 0, 0);
    238462    d->similarQuery = new QLineEdit(this);
     463    d->similarQuery->setCompleter(&d->searchCompleter);
    239464    gLayout->addWidget(d->similarQuery, 0, 1);
    240465
     
    242467    gLayout->addWidget(label, 1, 0);
    243468    d->withoutQuery = new QLineEdit(this);
     469    d->withoutQuery->setCompleter(&d->searchCompleter);
    244470    gLayout->addWidget(d->withoutQuery, 1, 1);
    245471
     
    247473    gLayout->addWidget(label, 2, 0);
    248474    d->exactQuery = new QLineEdit(this);
     475    d->exactQuery->setCompleter(&d->searchCompleter);
    249476    gLayout->addWidget(d->exactQuery, 2, 1);
    250477
     
    252479    gLayout->addWidget(label, 3, 0);
    253480    d->allQuery = new QLineEdit(this);
     481    d->allQuery->setCompleter(&d->searchCompleter);
    254482    gLayout->addWidget(d->allQuery, 3, 1);
    255483
     
    257485    gLayout->addWidget(label, 4, 0);
    258486    d->atLeastQuery = new QLineEdit(this);
     487    d->atLeastQuery->setCompleter(&d->searchCompleter);
    259488    gLayout->addWidget(d->atLeastQuery, 4, 1);
    260489
     
    270499        d, SLOT(showHideAdvancedSearch()));
    271500#endif
     501    connect(this, SIGNAL(search()), d, SLOT(searchRequested()));
    272502}
    273503
     
    286516QList<QHelpSearchQuery> QHelpSearchQueryWidget::query() const
    287517{
    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();
    341522}
    342523
  • trunk/tools/assistant/lib/qhelpsearchquerywidget.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/lib/qhelpsearchresultwidget.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6868    {
    6969        header()->hide();
    70         connect(this, SIGNAL(itemActivated(QTreeWidgetItem*, int)),
    71             this, SLOT(itemActivated(QTreeWidgetItem*, int)));
     70        connect(this, SIGNAL(itemActivated(QTreeWidgetItem*,int)),
     71            this, SLOT(itemActivated(QTreeWidgetItem*,int)));
    7272    }
    7373
     
    100100        : QTextBrowser(parent)
    101101    {
    102         connect(this, SIGNAL(anchorClicked(const QUrl&)),
    103             this, SIGNAL(requestShowLink(const QUrl&)));
     102        connect(this, SIGNAL(anchorClicked(QUrl)),
     103            this, SIGNAL(requestShowLink(QUrl)));
    104104        setContextMenuPolicy(Qt::NoContextMenu);
    105105    }
     
    170170    {
    171171        if (!searchEngine.isNull()
    172             && resultLastToShow < searchEngine->hitsCount()) {
     172            && resultLastToShow < searchEngine->hitCount()) {
    173173            resultLastToShow += 20;
    174174            resultFirstToShow += 20;
     
    176176            resultTextBrowser->showResultPage(searchEngine->hits(resultFirstToShow,
    177177                resultLastToShow), isIndexing);
    178             if (resultLastToShow >= searchEngine->hitsCount())
     178            if (resultLastToShow >= searchEngine->hitCount())
    179179                updateNextButtonState(false);
    180180        }
     
    185185    {
    186186        if (!searchEngine.isNull()) {
    187             resultLastToShow = searchEngine->hitsCount();
     187            resultLastToShow = searchEngine->hitCount();
    188188            resultFirstToShow = resultLastToShow - (resultLastToShow % 20);
    189189
     
    215215        if (!searchEngine.isNull()) {
    216216            int count = resultLastToShow % 20;
    217             if (count == 0 || resultLastToShow != searchEngine->hitsCount())
     217            if (count == 0 || resultLastToShow != searchEngine->hitCount())
    218218                count = 20;
    219219
     
    299299
    300300        if (!searchEngine.isNull()) {
    301             count = searchEngine->hitsCount();
     301            count = searchEngine->hitCount();
    302302            if (count > 0) {
    303303                first = resultFirstToShow +1;
     
    386386    vLayout->addWidget(d->resultTextBrowser);
    387387
    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)));
    390390
    391391    connect(d->nextResultPage, SIGNAL(clicked()), d, SLOT(showNextResultPage()));
     
    402402    d->resultTreeWidget = new QDefaultResultWidget(this);
    403403    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)));
    406406#endif
    407407
  • trunk/tools/assistant/lib/qhelpsearchresultwidget.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/aboutdialog.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/aboutdialog.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/assistant.pro

    r385 r561  
    44LANGUAGE = C++
    55TARGET = assistant
    6 
    7 DEFINES += QT_CLUCENE_SUPPORT
    86
    97contains(QT_CONFIG, webkit) {
  • trunk/tools/assistant/tools/assistant/assistant.rc

    r2 r561  
     1#include "winver.h"
     2
    13IDI_ICON1               ICON            DISCARDABLE     "assistant.ico"
     4
     5VS_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
     13BEGIN
     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
     32END
  • trunk/tools/assistant/tools/assistant/bookmarkmanager.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6464
    6565BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
    66                                const QString &url, QWidget *parent)
     66        const QString &url, QWidget *parent)
    6767    : QDialog(parent)
    6868    , m_url(url)
     
    7070    , bookmarkManager(manager)
    7171{
     72    ui.setupUi(this);
     73
    7274    installEventFilter(this);
    73 
    74     ui.setupUi(this);
     75    ui.treeView->installEventFilter(this);
     76    ui.treeView->viewport()->installEventFilter(this);
     77
    7578    ui.bookmarkEdit->setText(title);
    7679    ui.newFolderButton->setVisible(false);
     
    9699    connect(ui.newFolderButton, SIGNAL(clicked()), this, SLOT(addNewFolder()));
    97100    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*)),
    102106        this, SLOT(itemChanged(QStandardItem*)));
    103107
    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)));
    113116}
    114117
     
    119122void BookmarkDialog::addAccepted()
    120123{
    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();
    123126
    124127    QModelIndex index;
     
    132135void BookmarkDialog::addNewFolder()
    133136{
    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();
    136139
    137140    QModelIndex index;
     
    144147        ui.treeView->expand(index);
    145148        const QModelIndex &index = proxyModel->mapFromSource(newFolder);
    146         ui.treeView->selectionModel()->setCurrentIndex(index,
    147             QItemSelectionModel::ClearAndSelect);
     149        model->setCurrentIndex(index, QItemSelectionModel::ClearAndSelect);
    148150
    149151        ui.bookmarkFolders->clear();
    150152        ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
    151153
    152         const QString name = index.data().toString();
     154        const QString &name = index.data().toString();
    153155        ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name));
    154156    }
     
    184186
    185187        QString name = tr("Bookmarks");
    186         const QModelIndex& index = ui.treeView->currentIndex();
     188        const QModelIndex &index = ui.treeView->currentIndex();
    187189        if (index.isValid())
    188190            name = index.data().toString();
     
    191193}
    192194
    193 void BookmarkDialog::textChanged(const QString& string)
     195void BookmarkDialog::textChanged(const QString &string)
    194196{
    195197    ui.buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!string.isEmpty());
     
    210212        Qt::MatchCaseSensitive | Qt::MatchRecursive, 0);
    211213    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        }
    215220    }
    216221}
     
    227232    QAction *renameItem = menu.addAction(tr("Rename Folder"));
    228233
    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)
    231236        return;
    232237
    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);
    236241        ui.bookmarkFolders->clear();
    237242        ui.bookmarkFolders->addItems(bookmarkManager->bookmarkFolders());
     
    243248        ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(name));
    244249    }
    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)) {
    249253            item->setEditable(true);
    250254            ui.treeView->edit(index);
     
    254258}
    255259
    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()));
     260void BookmarkDialog::currentChanged(const QModelIndex &current)
     261{
     262    QString text = tr("Bookmarks");
     263    if (current.isValid())
     264        text = current.data().toString();
     265    ui.bookmarkFolders->setCurrentIndex(ui.bookmarkFolders->findText(text));
    269266}
    270267
    271268bool BookmarkDialog::eventFilter(QObject *object, QEvent *e)
    272269{
    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) {
    274274        QKeyEvent *ke = static_cast<QKeyEvent*>(e);
    275 
    276         QModelIndex index = ui.treeView->currentIndex();
    277275        switch (ke->key()) {
    278276            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);
    280279                QStandardItem *item =
    281280                    bookmarkManager->treeBookmarkModel()->itemFromIndex(source);
     
    288287
    289288            case Qt::Key_Delete: {
     289                const QModelIndex &index = ui.treeView->currentIndex();
    290290                bookmarkManager->removeBookmarkItem(ui.treeView,
    291291                    proxyModel->mapToSource(index));
     
    294294
    295295                QString name = tr("Bookmarks");
    296                 index = ui.treeView->currentIndex();
    297296                if (index.isValid())
    298297                    name = index.data().toString();
     
    304303        }
    305304    }
     305
    306306    return QObject::eventFilter(object, e);
    307307}
    308308
    309309
     310// #pragma mark -- BookmarkWidget
    310311
    311312
    312313BookmarkWidget::BookmarkWidget(BookmarkManager *manager, QWidget *parent,
    313                                bool showButtons)
     314        bool showButtons)
    314315    : QWidget(parent)
    315316    , addButton(0)
     
    318319{
    319320    setup(showButtons);
     321
    320322    installEventFilter(this);
     323    treeView->installEventFilter(this);
     324    treeView->viewport()->installEventFilter(this);
    321325}
    322326
     
    327331void BookmarkWidget::removeClicked()
    328332{
    329     const QModelIndex& index = treeView->currentIndex();
     333    const QModelIndex &index = treeView->currentIndex();
    330334    if (searchField->text().isEmpty()) {
    331335        bookmarkManager->removeBookmarkItem(treeView,
     
    353357    filterBookmarkModel->setFilterRegExp(regExp);
    354358
    355     QModelIndex index = treeView->indexAt(QPoint(1, 1));
     359    const QModelIndex &index = treeView->indexAt(QPoint(1, 1));
    356360    if (index.isValid())
    357361        treeView->setCurrentIndex(index);
     
    361365}
    362366
    363 void BookmarkWidget::expand(const QModelIndex& index)
    364 {
    365     const QModelIndex& source = filterBookmarkModel->mapToSource(index);
    366     QStandardItem *item = bookmarkManager->treeBookmarkModel()->itemFromIndex(source);
     367void BookmarkWidget::expand(const QModelIndex &index)
     368{
     369    const QModelIndex &source = filterBookmarkModel->mapToSource(index);
     370    QStandardItem *item =
     371        bookmarkManager->treeBookmarkModel()->itemFromIndex(source);
    367372    if (item)
    368373        item->setData(treeView->isExpanded(index), Qt::UserRole + 11);
     
    405410    }
    406411
    407     QAction *picked_action = menu.exec(treeView->mapToGlobal(point));
    408     if (!picked_action)
     412    QAction *pickedAction = menu.exec(treeView->mapToGlobal(point));
     413    if (!pickedAction)
    409414        return;
    410415
    411     if (picked_action == showItem) {
     416    if (pickedAction == showItem) {
    412417        emit requestShowLink(data);
    413418    }
    414     else if (picked_action == showItemNewTab) {
     419    else if (pickedAction == showItemNewTab) {
    415420        CentralWidget::instance()->setSourceInNewTab(data);
    416421    }
    417     else if (picked_action == removeItem) {
     422    else if (pickedAction == removeItem) {
    418423        bookmarkManager->removeBookmarkItem(treeView,
    419424            filterBookmarkModel->mapToSource(index));
    420425    }
    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);
    423428        QStandardItem *item =
    424429            bookmarkManager->treeBookmarkModel()->itemFromIndex(source);
     
    444449    searchField = new QLineEdit(this);
    445450    vlayout->addWidget(searchField);
    446     connect(searchField, SIGNAL(textChanged(const QString &)), this,
     451    connect(searchField, SIGNAL(textChanged(QString)), this,
    447452        SLOT(filterChanged()));
    448453
     
    450455    vlayout->addWidget(treeView);
    451456
    452     QString system = QLatin1String("win");
    453457#ifdef Q_OS_MAC
    454     system = QLatin1String("mac");
     458#   define SYSTEM "mac"
     459#else
     460#   define SYSTEM "win"
    455461#endif
    456462
     
    463469        addButton = new QToolButton(this);
    464470        addButton->setText(tr("Add"));
    465         addButton->setIcon(QIcon(QString::fromUtf8(
    466             ":/trolltech/assistant/images/%1/addtab.png").arg(system)));
     471        addButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/"
     472            SYSTEM "/addtab.png")));
    467473        addButton->setAutoRaise(true);
    468474        addButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
     
    472478        removeButton = new QToolButton(this);
    473479        removeButton->setText(tr("Remove"));
    474         removeButton->setIcon(QIcon(QString::fromUtf8(
    475             ":/trolltech/assistant/images/%1/closetab.png").arg(system)));
     480        removeButton->setIcon(QIcon(QLatin1String(":/trolltech/assistant/images/"
     481            SYSTEM "/closetab.png")));
    476482        removeButton->setAutoRaise(true);
    477483        removeButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
     
    488494    treeView->setDropIndicatorShown(true);
    489495    treeView->header()->setVisible(false);
    490     treeView->viewport()->installEventFilter(this);
    491496    treeView->setContextMenuPolicy(Qt::CustomContextMenu);
    492497
    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)));
    504506
    505507    filterBookmarkModel->setFilterKeyColumn(0);
     
    515517    QList<QStandardItem*>list = model->findItems(QLatin1String("*"),
    516518        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);
    519521        treeView->setExpanded(filterBookmarkModel->mapFromSource(index),
    520522            item->data(Qt::UserRole + 11).toBool());
     
    537539bool BookmarkWidget::eventFilter(QObject *object, QEvent *e)
    538540{
    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) {
    540547        QKeyEvent *ke = static_cast<QKeyEvent*>(e);
    541         QModelIndex index = treeView->currentIndex();
     548        const bool tree = object == treeView || object == treeView->viewport();
    542549        switch (ke->key()) {
    543             if (index.isValid() && searchField->text().isEmpty()) {
    544                 case 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)) {
    549556                        item->setEditable(true);
    550557                        treeView->edit(index);
    551558                        item->setEditable(false);
    552559                    }
    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;
    565562
    566563            case Qt::Key_Enter: {
    567564            case Qt::Key_Return:
    568                 index = 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();
    571568                    if (!data.isEmpty() && data != QLatin1String("Folder"))
    572569                        emit requestShowLink(data);
     
    574571            }   break;
    575572
    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: {
    577587                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) {
    586595        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
    593606    return QWidget::eventFilter(object, e);
    594607}
    595608
    596609
    597 
    598 
    599 BookmarkModel::BookmarkModel(int rows, int columns, QObject * parent)
     610// #pragma mark -- BookmarkModel
     611
     612
     613BookmarkModel::BookmarkModel(int rows, int columns, QObject *parent)
    600614    : QStandardItemModel(rows, columns, parent)
    601615{
     
    614628{
    615629    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"))
    617632        return (Qt::ItemIsDropEnabled | defaultFlags) &~ Qt::ItemIsDragEnabled;
    618633
     
    621636
    622637
    623 
    624 
    625 BookmarkManager::BookmarkManager(QHelpEngineCore* _helpEngine)
     638// #pragma mark -- BookmarkManager
     639
     640
     641BookmarkManager::BookmarkManager(QHelpEngineCore *_helpEngine)
    626642    : treeModel(new BookmarkModel(0, 1, this))
    627643    , listModel(new BookmarkModel(0, 1, this))
     644    , renameItem(0)
    628645    , helpEngine(_helpEngine)
    629646{
    630647    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"));
    633648
    634649    connect(treeModel, SIGNAL(itemChanged(QStandardItem*)), this,
    635650        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()));
    636655}
    637656
     
    654673void BookmarkManager::saveBookmarks()
    655674{
    656     qint32 depth = 0;
    657675    QByteArray bookmarks;
    658676    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);
    672679    helpEngine->setCustomValue(QLatin1String("Bookmarks"), bookmarks);
    673680}
     
    689696}
    690697
    691 QModelIndex BookmarkManager::addNewFolder(const QModelIndex& index)
     698QModelIndex BookmarkManager::addNewFolder(const QModelIndex &index)
    692699{
    693700    QStandardItem *item = new QStandardItem(uniqueFolderName());
     
    705712}
    706713
    707 void BookmarkManager::removeBookmarkItem(QTreeView *treeView, const QModelIndex& index)
     714void BookmarkManager::removeBookmarkItem(QTreeView *treeView,
     715    const QModelIndex &index)
    708716{
    709717    QStandardItem *item = treeModel->itemFromIndex(index);
     
    712720        if (data == QLatin1String("Folder") && item->rowCount() > 0) {
    713721            int value = QMessageBox::question(treeView, tr("Remove"),
    714                         tr("You are going to delete a Folder, this will also<br>"
    715                         "remove it's content. Are you sure to continue?"),
    716                         QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel);
     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);
    717725
    718726            if (value == QMessageBox::Cancel)
     
    735743}
    736744
    737 void BookmarkManager::showBookmarkDialog(QWidget* parent, const QString &name,
    738                                          const QString &url)
     745void BookmarkManager::showBookmarkDialog(QWidget *parent, const QString &name,
     746    const QString &url)
    739747{
    740748    BookmarkDialog dialog(this, name, url, parent);
     
    742750}
    743751
    744 void BookmarkManager::addNewBookmark(const QModelIndex& index,
    745                                      const QString &name, const QString &url)
     752void BookmarkManager::addNewBookmark(const QModelIndex &index,
     753    const QString &name, const QString &url)
    746754{
    747755    QStandardItem *item = new QStandardItem(name);
     
    750758    item->setData(url, Qt::UserRole + 10);
    751759
    752     if (index.isValid()) {
     760    if (index.isValid())
    753761        treeModel->itemFromIndex(index)->appendRow(item);
    754         listModel->appendRow(item->clone());
    755     } else {
     762    else
    756763        treeModel->appendRow(item);
    757         listModel->appendRow(item->clone());
    758     }
     764    listModel->appendRow(item->clone());
     765    emit bookmarksChanged();
     766}
     767
     768void BookmarkManager::fillBookmarkMenu(QMenu *menu)
     769{
     770    if (!menu || !treeModel)
     771        return;
     772
     773    map.clear();
     774    fillBookmarkMenu(menu, treeModel->invisibleRootItem());
     775}
     776
     777void 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
     792QUrl 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();
    759800}
    760801
     
    787828    QList<QStandardItem*> parents;
    788829
    789     QByteArray ba = helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray();
     830    QByteArray ba =
     831        helpEngine->customValue(QLatin1String("Bookmarks")).toByteArray();
    790832    QDataStream stream(ba);
    791833    while (!stream.atEnd()) {
     
    857899
    858900void BookmarkManager::readBookmarksRecursive(const QStandardItem *item,
    859                                              QDataStream &stream,
    860                                              const qint32 depth) const
     901    QDataStream &stream, const qint32 depth) const
    861902{
    862903    for (int j = 0; j < item->rowCount(); ++j) {
  • trunk/tools/assistant/tools/assistant/bookmarkmanager.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    7575
    7676public:
    77     BookmarkDialog(BookmarkManager *manager, const QString &title, 
     77    BookmarkDialog(BookmarkManager *manager, const QString &title,
    7878        const QString &url, QWidget *parent = 0);
    7979    ~BookmarkDialog();
     
    8787    void selectBookmarkFolder(const QString &folderName);
    8888    void customContextMenuRequested(const QPoint &point);
    89     void currentChanged(const QModelIndex& current, const QModelIndex& previous);
    90    
     89    void currentChanged(const QModelIndex& current);
     90
    9191private:
    9292    bool eventFilter(QObject *object, QEvent *e);
     
    178178    QModelIndex addNewFolder(const QModelIndex& index);
    179179    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);
    182184    void setupBookmarkModels();
     185
     186    void fillBookmarkMenu(QMenu *menu);
     187    QUrl urlForAction(QAction* action) const;
     188
     189signals:
     190    void bookmarksChanged();
    183191
    184192private slots:
    185193    void itemChanged(QStandardItem *item);
    186194
    187 private:   
     195private:
    188196    QString uniqueFolderName() const;
    189197    void removeBookmarkFolderItems(QStandardItem *item);
    190198    void readBookmarksRecursive(const QStandardItem *item, QDataStream &stream,
    191199        const qint32 depth) const;
     200    void fillBookmarkMenu(QMenu *menu, QStandardItem *root);
    192201
    193202private:
    194203    QString oldText;
    195204    QIcon folderIcon;
    196    
     205
    197206    BookmarkModel *treeModel;
    198207    BookmarkModel *listModel;
    199208    QStandardItem *renameItem;
    200209    QHelpEngineCore *helpEngine;
     210    QMap<QAction*, QModelIndex> map;
    201211};
    202212
  • trunk/tools/assistant/tools/assistant/centralwidget.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4444#include "searchwidget.h"
    4545#include "mainwindow.h"
     46#include "preferencesdialog.h"
    4647
    4748#include <QtCore/QDir>
     
    7374
    7475namespace {
    75     HelpViewer* helpViewerFromTabPosition(const QTabWidget *widget, const QPoint &point)
     76    HelpViewer* helpViewerFromTabPosition(const QTabWidget *widget,
     77        const QPoint &point)
    7678    {
    7779        QTabBar *tabBar = qFindChild<QTabBar*>(widget);
     
    8789FindWidget::FindWidget(QWidget *parent)
    8890    : QWidget(parent)
    89 {
    90     QString system = QLatin1String("win");
     91    , appPalette(qApp->palette())
     92{
    9193    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"));
    94100#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"));
    102106    hboxLayout->addWidget(toolClose);
    103107
    104108    editFind = new QLineEdit(this);
     109    hboxLayout->addWidget(editFind);
    105110    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"));
    115115    hboxLayout->addWidget(toolPrevious);
    116116
    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"));
    122119    hboxLayout->addWidget(toolNext);
    123120
     
    132129
    133130    labelWrapped = new QLabel(this);
     131    labelWrapped->setScaledContents(true);
     132    labelWrapped->setTextFormat(Qt::RichText);
    134133    labelWrapped->setMinimumSize(QSize(0, 20));
    135134    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\">&nbsp;Search wrapped"));
     135    labelWrapped->setAlignment(Qt::AlignLeading | Qt::AlignLeft | Qt::AlignVCenter);
     136    labelWrapped->setText(tr("<img src=\":/trolltech/assistant/images/wrap.png\""
     137        ">&nbsp;Search wrapped"));
    140138    hboxLayout->addWidget(labelWrapped);
    141139
    142     QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
     140    QSpacerItem *spacerItem = new QSpacerItem(20, 20, QSizePolicy::Expanding,
     141        QSizePolicy::Minimum);
    143142    hboxLayout->addItem(spacerItem);
    144143    setMinimumWidth(minimumSizeHint().width());
     
    150149FindWidget::~FindWidget()
    151150{
     151}
     152
     153void 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
     164void 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
    152179}
    153180
     
    163190}
    164191
     192QToolButton* 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
    165207
    166208CentralWidget::CentralWidget(QHelpEngine *engine, MainWindow *parent)
    167209    : QWidget(parent)
     210    , lastTabPage(0)
     211    , collectionFile(engine->collectionFile())
    168212    , findBar(0)
    169213    , tabWidget(0)
     214    , findWidget(0)
    170215    , helpEngine(engine)
    171216    , printer(0)
     217    , usesDefaultCollection(parent->usesDefaultCollection())
    172218    , m_searchWidget(0)
    173219{
     220    globalActionList.clear();
    174221    staticCentralWidget = this;
    175 
    176     lastTabPage = 0;
    177     globalActionList.clear();
    178     collectionFile = helpEngine->collectionFile();
    179     usesDefaultCollection = parent->usesDefaultCollection();
    180 
    181     QString system = QLatin1String("win");
    182222    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"));
    186229#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)));
    192236
    193237    QToolButton *newTabButton = new QToolButton(this);
    194238    newTabButton->setAutoRaise(true);
    195239    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")));
    197241
    198242    tabWidget->setCornerWidget(newTabButton, Qt::TopLeftCorner);
     
    203247    closeTabButton->setAutoRaise(true);
    204248    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")));
    206250
    207251    tabWidget->setCornerWidget(closeTabButton, Qt::TopRightCorner);
     
    217261    findBar->hide();
    218262    findWidget->editFind->installEventFilter(this);
     263
    219264    connect(findWidget->toolClose, SIGNAL(clicked()), findBar, SLOT(hide()));
    220 
    221265    connect(findWidget->toolNext, SIGNAL(clicked()), this, SLOT(findNext()));
    222266    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)));
    224269    connect(findWidget->toolPrevious, SIGNAL(clicked()), this, SLOT(findPrevious()));
    225270
     
    228273        tabBar->installEventFilter(this);
    229274        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();
    235281    p.setColor(QPalette::Inactive, QPalette::Highlight,
    236282        p.color(QPalette::Active, QPalette::Highlight));
    237283    p.setColor(QPalette::Inactive, QPalette::HighlightedText,
    238284        p.color(QPalette::Active, QPalette::HighlightedText));
    239     qApp->setPalette(p);
     285    setPalette(p);
     286#endif
    240287}
    241288
    242289CentralWidget::~CentralWidget()
    243290{
     291#ifndef QT_NO_PRINTER
     292    delete printer;
     293#endif
     294
    244295    QHelpEngineCore engine(collectionFile, 0);
    245296    if (!engine.setupData())
     
    248299    QString zoomCount;
    249300    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) {
    252306        HelpViewer *viewer = qobject_cast<HelpViewer*>(tabWidget->widget(i));
    253307        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;
    261310        }
    262311    }
     312
    263313    engine.setCustomValue(QLatin1String("LastTabPage"), lastTabPage);
    264314    engine.setCustomValue(QLatin1String("LastShownPages"), currentPages);
     315    engine.setCustomValue(QLatin1String("SearchWasAttached"), searchAttached);
    265316#if !defined(QT_NO_WEBKIT)
    266317    engine.setCustomValue(QLatin1String("LastPagesZoomWebView"), zoomCount);
     
    277328void CentralWidget::newTab()
    278329{
    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
    281336        setSourceInNewTab(viewer->source());
    282337}
     
    284339void CentralWidget::zoomIn()
    285340{
    286     HelpViewer* viewer = currentHelpViewer();
     341    HelpViewer *viewer = currentHelpViewer();
    287342    if (viewer)
    288343        viewer->zoomIn();
     
    294349void CentralWidget::zoomOut()
    295350{
    296     HelpViewer* viewer = currentHelpViewer();
     351    HelpViewer *viewer = currentHelpViewer();
    297352    if (viewer)
    298353        viewer->zoomOut();
     
    309364void CentralWidget::nextPage()
    310365{
    311     if(tabWidget->currentIndex() < tabWidget->count() -1)
    312         tabWidget->setCurrentIndex(tabWidget->currentIndex() +1);
    313     else
    314         tabWidget->setCurrentIndex(0);
     366    int index = tabWidget->currentIndex() + 1;
     367    if (index >= tabWidget->count())
     368        index = 0;
     369    tabWidget->setCurrentIndex(index);
    315370}
    316371
    317372void CentralWidget::resetZoom()
    318373{
    319     HelpViewer* viewer = currentHelpViewer();
     374    HelpViewer *viewer = currentHelpViewer();
    320375    if (viewer)
    321376        viewer->resetZoom();
     
    328383{
    329384    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);
    334388}
    335389
     
    341395void CentralWidget::closeTab()
    342396{
    343     HelpViewer* viewer = currentHelpViewer();
     397    HelpViewer *viewer = currentHelpViewer();
    344398    if (!viewer|| tabWidget->count() == 1)
    345399        return;
     
    351405void CentralWidget::setSource(const QUrl &url)
    352406{
    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));
    355410
    356411    if (!viewer && !lastViewer) {
     
    360415        tabWidget->setCurrentIndex(lastTabPage);
    361416        connectSignals();
    362     } else
     417    } else {
    363418        viewer = lastViewer;
     419    }
    364420
    365421    viewer->setSource(url);
     
    370426}
    371427
     428void 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
    372449void CentralWidget::setLastShownPages()
    373450{
    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) {
    402458        if (usesDefaultCollection)
    403459            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);
    405496}
    406497
    407498bool CentralWidget::hasSelection() const
    408499{
    409     const HelpViewer* viewer = currentHelpViewer();
     500    const HelpViewer *viewer = currentHelpViewer();
    410501    return viewer ? viewer->hasSelection() : false;
    411502}
     
    413504QUrl CentralWidget::currentSource() const
    414505{
    415     const HelpViewer* viewer = currentHelpViewer();
     506    const HelpViewer *viewer = currentHelpViewer();
    416507    if (viewer)
    417508        return viewer->source();
     
    422513QString CentralWidget::currentTitle() const
    423514{
    424     const HelpViewer* viewer = currentHelpViewer();
     515    const HelpViewer *viewer = currentHelpViewer();
    425516    if (viewer)
    426517        return viewer->documentTitle();
     
    431522void CentralWidget::copySelection()
    432523{
    433     HelpViewer* viewer = currentHelpViewer();
     524    HelpViewer *viewer = currentHelpViewer();
    434525    if (viewer)
    435526        viewer->copy();
     
    454545{
    455546#ifndef QT_NO_PRINTER
    456     HelpViewer* viewer = currentHelpViewer();
     547    HelpViewer *viewer = currentHelpViewer();
    457548    if (!viewer)
    458549        return;
     
    480571    initPrinter();
    481572    QPrintPreviewDialog preview(printer, this);
    482     connect(&preview, SIGNAL(paintRequested(QPrinter *)), SLOT(printPreview(QPrinter *)));
     573    connect(&preview, SIGNAL(paintRequested(QPrinter*)),
     574        SLOT(printPreview(QPrinter*)));
    483575    preview.exec();
    484576#endif
     
    510602void CentralWidget::home()
    511603{
    512     HelpViewer* viewer = currentHelpViewer();
     604    HelpViewer *viewer = currentHelpViewer();
    513605    if (viewer)
    514606        viewer->home();
     
    517609bool CentralWidget::isForwardAvailable() const
    518610{
    519     const HelpViewer* viewer = currentHelpViewer();
     611    const HelpViewer *viewer = currentHelpViewer();
    520612    if (viewer)
    521613        return viewer->isForwardAvailable();
     
    526618void CentralWidget::forward()
    527619{
    528     HelpViewer* viewer = currentHelpViewer();
     620    HelpViewer *viewer = currentHelpViewer();
    529621    if (viewer)
    530622        viewer->forward();
     
    533625bool CentralWidget::isBackwardAvailable() const
    534626{
    535     const HelpViewer* viewer = currentHelpViewer();
     627    const HelpViewer *viewer = currentHelpViewer();
    536628    if (viewer)
    537629        return viewer->isBackwardAvailable();
     
    542634void CentralWidget::backward()
    543635{
    544     HelpViewer* viewer = currentHelpViewer();
     636    HelpViewer *viewer = currentHelpViewer();
    545637    if (viewer)
    546638        viewer->backward();
     
    560652void CentralWidget::setSourceInNewTab(const QUrl &url, qreal zoom)
    561653{
    562     HelpViewer* viewer;
     654    HelpViewer *viewer;
    563655
    564656#if defined(QT_NO_WEBKIT)
     
    575667        quoteTabTitle(viewer->documentTitle())));
    576668
    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);
    600678    viewer->setTextSizeMultiplier(zoom == 0.0 ? 1.0 : zoom);
    601 #else
    602     font.setPointSize((int)(font.pointSize() + zoom));
    603     viewer->setFont(font);
    604     viewer->setZoom((int)zoom);
    605679#endif
    606680
     
    610684HelpViewer *CentralWidget::newEmptyTab()
    611685{
    612     HelpViewer* viewer = new HelpViewer(helpEngine, this);
     686    HelpViewer *viewer = new HelpViewer(helpEngine, this);
    613687    viewer->installEventFilter(this);
    614688    viewer->setFocus(Qt::OtherFocusReason);
     
    629703void CentralWidget::connectSignals()
    630704{
    631     const HelpViewer* viewer = currentHelpViewer();
     705    const HelpViewer *viewer = currentHelpViewer();
    632706    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)));
    640719    }
    641720}
     
    659738}
    660739
    661 void CentralWidget::setTabTitle(const QUrl& url)
    662 {
    663     int tab = lastTabPage;
    664     HelpViewer* viewer = currentHelpViewer();
    665 
     740void CentralWidget::setTabTitle(const QUrl &url)
     741{
     742    Q_UNUSED(url)
    666743#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()));
    673750        }
    674751    }
    675752#else
    676     Q_UNUSED(url)
    677 #endif
    678 
     753    HelpViewer *viewer = currentHelpViewer();
    679754    if (viewer) {
    680         tabWidget->setTabText(tab,
     755        tabWidget->setTabText(lastTabPage,
    681756            quoteTabTitle(viewer->documentTitle().trimmed()));
    682757    }
     758#endif
    683759}
    684760
     
    686762{
    687763    const HelpViewer *viewer = currentHelpViewer();
    688 
    689     if (viewer || tabWidget->count() == 1)
     764    if (viewer)
    690765        lastTabPage = index;
    691766
    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();
    703774}
    704775
    705776void CentralWidget::showTabBarContextMenu(const QPoint &point)
    706777{
    707     HelpViewer* viewer = helpViewerFromTabPosition(tabWidget, point);
     778    HelpViewer *viewer = helpViewerFromTabPosition(tabWidget, point);
    708779    if (!viewer)
    709780        return;
     
    712783
    713784    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
    717794    menu.addSeparator();
     795
    718796    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)
    732803        setSourceInNewTab(viewer->source());
    733804
    734     if (picked_action == close_page) {
     805    if (pickedAction == closePage) {
    735806        tabWidget->removeTab(tabWidget->indexOf(viewer));
    736807        QTimer::singleShot(0, viewer, SLOT(deleteLater()));
    737808    }
    738809
    739     if (picked_action == close_pages) {
     810    if (pickedAction == closePages) {
    740811        int currentPage = tabWidget->indexOf(viewer);
    741812        for (int i = tabBar->count() -1; i >= 0; --i) {
     
    751822    }
    752823
    753     if (picked_action == newBookmark)
     824    if (pickedAction == newBookmark)
    754825        emit addNewBookmark(viewer->documentTitle(), viewer->source().toString());
    755826}
     
    757828bool CentralWidget::eventFilter(QObject *object, QEvent *e)
    758829{
    759     if (currentHelpViewer() == object && e->type() == QEvent::KeyPress){
     830    if (e->type() == QEvent::KeyPress) {
    760831        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) {
    763848#if defined(QT_NO_WEBKIT)
    764             if (viewer && viewer->isBackwardAvailable()) {
     849                    if (viewer->isBackwardAvailable()) {
    765850#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                }
    770876            }
    771877        }
    772878    }
    773879
    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     }
    799880    return QWidget::eventFilter(object, e);
    800881}
     
    802883void CentralWidget::keyPressEvent(QKeyEvent *e)
    803884{
    804     QString text = e->text();
     885    const QString &text = e->text();
    805886    if (text.startsWith(QLatin1Char('/'))) {
    806887        if (!findBar->isVisible()) {
     
    816897}
    817898
    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();
     899void CentralWidget::find(const QString &ttf, bool forward, bool backward)
     900{
    825901    QPalette p = findWidget->editFind->palette();
    826902    p.setColor(QPalette::Active, QPalette::Base, Qt::white);
    827903
     904    if (!ttf.isEmpty()) {
     905        HelpViewer *viewer = currentHelpViewer();
     906
     907        bool found = false;
    828908#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
    846917            found = viewer->findText(ttf, options);
     918            findWidget->labelWrapped->hide();
    847919
    848920            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();
    852925            }
     926        } else if (tabWidget->currentWidget() == m_searchWidget) {
     927            QTextBrowser *browser = qFindChild<QTextBrowser*>(m_searchWidget);
     928            found = findInTextBrowser(browser, ttf, forward, backward);
    853929        }
    854     }
    855930#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    }
    907940
    908941    if (!findWidget->isVisible())
    909942        findWidget->show();
    910 
    911 #if defined(QT_NO_WEBKIT)
    912     if (browser)
    913         browser->setTextCursor(newCursor);
    914 #endif
    915943    findWidget->editFind->setPalette(p);
    916944}
    917945
    918 void CentralWidget::activateSearch()
    919 {
    920     if (tabWidget->widget(0) != m_searchWidget)
     946bool 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
     994void 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
     1009void 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
     1025void CentralWidget::activateSearchWidget(bool updateLastTabPage)
     1026{
     1027    if (!m_searchWidget)
    9211028        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    }
    9221037
    9231038    tabWidget->setCurrentWidget(m_searchWidget);
     
    9251040}
    9261041
    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 #endif
    944 
    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 #else
    960         if (widget && widget->font() != font)
    961             widget->setFont(font);
    962 #endif
    963     }
    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 
    9781042void CentralWidget::removeSearchWidget()
    9791043{
    980     tabWidget->removeTab(0);
     1044    if (searchWidgetAttached()) {
     1045        tabWidget->removeTab(0);
     1046        m_searchWidget->setAttached(false);
     1047    }
     1048}
     1049
     1050int CentralWidget::availableHelpViewer() const
     1051{
     1052    int count = tabWidget->count();
     1053    if (searchWidgetAttached())
     1054        count--;
     1055    return count;
     1056}
     1057
     1058bool CentralWidget::enableTabCloseAction() const
     1059{
     1060    int minTabCount = 1;
     1061    if (searchWidgetAttached())
     1062        minTabCount = 2;
     1063
     1064    return (tabWidget->count() > minTabCount);
    9811065}
    9821066
     
    10091093        return;
    10101094
    1011     QHelpSearchEngine* searchEngine = helpEngine->searchEngine();
     1095    QHelpSearchEngine *searchEngine = helpEngine->searchEngine();
    10121096    QList<QHelpSearchQuery> queryList = searchEngine->query();
    10131097
     
    10781162}
    10791163
     1164void 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
     1183void 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
    10801200QT_END_NAMESPACE
  • trunk/tools/assistant/tools/assistant/centralwidget.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4848
    4949#include <QtGui/QWidget>
     50
     51#include "searchwidget.h"
    5052
    5153QT_BEGIN_NAMESPACE
     
    5658class QCheckBox;
    5759class QLineEdit;
     60class QTextBrowser;
    5861class QToolButton;
    5962
     
    6568class MainWindow;
    6669
    67 class SearchWidget;
    6870class QHelpSearchEngine;
    6971
     
    8082    void findPrevious();
    8183
     84protected:
     85    void hideEvent(QHideEvent* event);
     86    void showEvent(QShowEvent * event);
     87
    8288private slots:
    8389    void updateButtons();
     90
     91private:
     92    QToolButton* setupToolButton(const QString &text, const QString &icon);
    8493
    8594private:
     
    92101    QCheckBox *checkWholeWords;
    93102
     103    QPalette appPalette;
    94104    friend class CentralWidget;
    95105};
     
    103113    ~CentralWidget();
    104114
    105     void setLastShownPages();
     115    void setupWidget();
    106116    bool hasSelection() const;
    107117    QUrl currentSource() const;
     
    114124    HelpViewer *currentHelpViewer() const;
    115125    void activateTab(bool onlyHelpViewer = false);
    116     void activateSearch();
     126
     127    bool searchWidgetAttached() const {
     128        return m_searchWidget && m_searchWidget->isAttached();
     129    }
    117130    void createSearchWidget(QHelpSearchEngine *searchEngine);
     131    void activateSearchWidget(bool updateLastTabPage = false);
    118132    void removeSearchWidget();
     133
     134    int availableHelpViewer() const;
     135    bool enableTabCloseAction() const;
    119136
    120137    void closeTabAt(int index);
     
    168185
    169186private:
    170     void connectSignals();   
     187    void connectSignals();
    171188    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);
    173192    void initPrinter();
    174193    QString quoteTabTitle(const QString &title) const;
    175194    void highlightSearchTerms();
     195    void setLastShownPages();
     196
     197    void getBrowserFontFor(QWidget* viewer, QFont *font);
     198    void setBrowserFontFor(QWidget *widget, const QFont &font);
    176199
    177200private:
     
    181204
    182205    QWidget *findBar;
    183     QTabWidget* tabWidget;
     206    QTabWidget *tabWidget;
    184207    FindWidget *findWidget;
    185208    QHelpEngine *helpEngine;
    186209    QPrinter *printer;
    187210    bool usesDefaultCollection;
    188    
    189     SearchWidget* m_searchWidget;
     211
     212    SearchWidget *m_searchWidget;
    190213};
    191214
  • trunk/tools/assistant/tools/assistant/cmdlineparser.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5757    m_search(Untouched),
    5858    m_register(None),
     59    m_removeSearchIndex(false),
    5960    m_copy(false),
    6061    m_quiet(false)
     
    8485        "                           file.\n"
    8586        "-setCurrentFilter filter   Set the filter as the active filter.\n"
     87        "-remove-search-index       Removes the full text search index.\n"
    8688        "-quiet                     Does not display any error or\n"
    8789        "                           status message.\n"
     
    218220                break;
    219221            }
     222        } else if (arg == QLatin1String("-remove-search-index")) {
     223            m_removeSearchIndex = true;
    220224        } else if (arg == QLatin1String("-quiet")) {
    221225            continue;
     
    308312}
    309313
     314bool CmdLineParser::removeSearchIndex() const
     315{
     316    return m_removeSearchIndex;
     317}
     318
    310319CmdLineParser::RegisterState CmdLineParser::registerRequest() const
    311320{
  • trunk/tools/assistant/tools/assistant/cmdlineparser.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6868    ShowState search() const;
    6969    QString currentFilter() const;
     70    bool removeSearchIndex() const;
    7071    RegisterState registerRequest() const;
    7172    QString helpFile() const;
     
    9192    RegisterState m_register;
    9293    QString m_currentFilter;
     94    bool m_removeSearchIndex;
    9395    bool m_copy;
    9496    bool m_quiet;
  • trunk/tools/assistant/tools/assistant/contentwindow.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    125125        QItemSelectionModel *sm = m_contentWidget->selectionModel();
    126126
     127        Qt::MouseButtons button = me->button();
    127128        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)) {
    131131                QHelpContentModel *contentModel =
    132132                    qobject_cast<QHelpContentModel*>(m_contentWidget->model());
     
    136136                        CentralWidget::instance()->setSourceInNewTab(itm->url());
    137137                }
     138            } else if (button == Qt::LeftButton) {
     139                itemClicked(index);
    138140            }
    139141        }
     
    141143    return QWidget::eventFilter(o, e);
    142144}
     145
    143146
    144147void ContentWindow::showContextMenu(const QPoint &pos)
  • trunk/tools/assistant/tools/assistant/contentwindow.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/doc/HOWTO

    r2 r561  
    11How to build/ update a new assistant.qch for Assistant internal help
    22
    3 - in case of update:
     3- update:
    44    - open assistant.qdocconf, update year and qt version
    55
    6 - all other cases:
    76    - ..\..\..\..\qdoc3\debug\qdoc3.exe assistant.qdocconf
    87        will generate an folder html containing all required stuff
     
    1312    - rebuild assistant
    1413
    15 - to test you changes:
     14- to test your changes:
    1615    - remove assistant.qch in your cache directory
    1716    - 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
    142/*!
    243    \page assistant.html
  • trunk/tools/assistant/tools/assistant/doc/assistant.qdocconf

    r2 r561  
    1111HTML.footer = "<p /><address><hr /><div align=\"center\">\n" \
    1212              "<table width=\"100%\" cellspacing=\"0\" border=\"0\"><tr class=\"address\">\n" \
    13               "<td width=\"30%\" align=\"left\">Copyright &copy; 2009 Nokia Corporation " \
    14               "and/or its subsidiary(-ies)</td>\n" \
     13              "<td width=\"30%\" align=\"left\">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
    1514              "<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" \
    1716              "</tr></table></div></address>"
  • trunk/tools/assistant/tools/assistant/doc/assistant.qhp

    r2 r561  
    22<QtHelpProject version="1.0">
    33    <virtualFolder>assistant</virtualFolder>
    4     <namespace>com.trolltech.com.assistantinternal_1.0.0</namespace>
     4    <namespace>com.trolltech.com.assistantinternal-1.0.0</namespace>
    55      <filterSection>
    66        <files>
  • trunk/tools/assistant/tools/assistant/filternamedialog.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/filternamedialog.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/helpviewer.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    134134}
    135135
    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);
     136QNetworkReply *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);
    158155}
    159156
     
    270267
    271268HelpViewer::HelpViewer(QHelpEngine *engine, CentralWidget *parent)
    272     : QWebView(parent), helpEngine(engine), parentWidget(parent)
     269    : QWebView(parent)
     270    , helpEngine(engine)
     271    , parentWidget(parent)
     272    , loadFinished(false)
    273273{
    274274    setAcceptDrops(false);
     
    293293    connect(pageAction(QWebPage::Forward), SIGNAL(changed()), this,
    294294        SLOT(actionChanged()));
    295     connect(page(), SIGNAL(linkHovered(QString, QString, QString)), this,
     295    connect(page(), SIGNAL(linkHovered(QString,QString,QString)), this,
    296296        SIGNAL(highlighted(QString)));
    297297    connect(this, SIGNAL(urlChanged(QUrl)), this, SIGNAL(sourceChanged(QUrl)));
     298    connect(this, SIGNAL(loadFinished(bool)), this, SLOT(setLoadFinished(bool)));
    298299}
    299300
    300301void HelpViewer::setSource(const QUrl &url)
    301302{
     303    loadFinished = false;
    302304    if (url.toString() == QLatin1String("help")) {
    303305        load(QUrl(QLatin1String("qthelp://com.trolltech.com."
    304             "assistantinternal_1.0.0/assistant/assistant.html")));
     306            "assistantinternal-1.0.0/assistant/assistant.html")));
    305307    } else {
    306308        load(url);
     
    386388}
    387389
     390void HelpViewer::setLoadFinished(bool ok)
     391{
     392    loadFinished = ok;
     393    emit sourceChanged(url());
     394}
     395
    388396#else  // !defined(QT_NO_WEBKIT)
    389397
     
    415423    if (help) {
    416424        QTextBrowser::setSource(QUrl(QLatin1String("qthelp://com.trolltech.com."
    417             "assistantinternal_1.0.0/assistant/assistant.html")));
     425            "assistantinternal-1.0.0/assistant/assistant.html")));
    418426    } else {
    419427        QTextBrowser::setSource(url);
  • trunk/tools/assistant/tools/assistant/helpviewer.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    9393    inline bool isBackwardAvailable() const
    9494    { return pageAction(QWebPage::Back)->isEnabled(); }
     95    inline bool hasLoadFinished() const
     96    { return loadFinished; }
     97    inline qreal zoom() const
     98    { return textSizeMultiplier(); }
    9599
    96100public Q_SLOTS:
     
    112116private Q_SLOTS:
    113117    void actionChanged();
     118    void setLoadFinished(bool ok);
    114119
    115120private:
    116121    QHelpEngine *helpEngine;
    117122    CentralWidget* parentWidget;
     123    bool loadFinished;
    118124};
    119125
  • trunk/tools/assistant/tools/assistant/indexwindow.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    8181    connect(m_helpEngine->indexModel(), SIGNAL(indexCreated()), this,
    8282        SLOT(enableSearchLineEdit()));
    83     connect(m_indexWidget, SIGNAL(linkActivated(QUrl, QString)), this,
     83    connect(m_indexWidget, SIGNAL(linkActivated(QUrl,QString)), this,
    8484        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)));
    8787    connect(m_searchLineEdit, SIGNAL(returnPressed()), m_indexWidget,
    8888        SLOT(activateCurrentItem()));
     
    113113            idx = m_indexWidget->model()->index(idx.row()-1,
    114114                idx.column(), idx.parent());
    115             if (idx.isValid())
     115            if (idx.isValid()) {
    116116                m_indexWidget->setCurrentIndex(idx);
     117                return true;
     118            }
    117119            break;
    118120        case Qt::Key_Down:
    119121            idx = m_indexWidget->model()->index(idx.row()+1,
    120122                idx.column(), idx.parent());
    121             if (idx.isValid())
     123            if (idx.isValid()) {
    122124                m_indexWidget->setCurrentIndex(idx);
     125                return true;
     126            }
    123127            break;
    124128        case Qt::Key_Escape:
    125129            emit escapePressed();
    126             break;
     130            return true;
    127131        default: ; // stop complaining
    128132        }
     
    147151        QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(e);
    148152        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        }
    151160    }
    152161#ifdef Q_OS_MAC
     
    198207        } else if (links.count() == 1) {
    199208            url = links.constBegin().value();
     209        } else {
     210            return;
    200211        }
    201212
  • trunk/tools/assistant/tools/assistant/indexwindow.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/installdialog.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5757
    5858QT_BEGIN_NAMESPACE
     59#ifndef QT_NO_HTTP
    5960
    6061#define QCH_FILENAME  92943
     
    7677
    7778    m_http = new QHttp(this);
    78     connect(m_http, SIGNAL(requestFinished(int, bool)),
    79             this, SLOT(httpRequestFinished(int, bool)));
    80     connect(m_http, SIGNAL(dataReadProgress(int, int)),
    81             this, SLOT(updateDataReadProgress(int, 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)));
    8485    connect(m_ui.installButton, SIGNAL(clicked()), this, SLOT(install()));
    8586    connect(m_ui.cancelButton, SIGNAL(clicked()), this, SLOT(cancelDownload()));
     
    106107    m_ui.progressBar->show();
    107108   
    108     QUrl url(QLatin1String("http://doc.trolltech.com/assistantdocs/docs.txt"));
     109    QUrl url(QLatin1String("http://qt.nokia.com/doc/assistantdocs/docs.txt"));
    109110    m_buffer = new QBuffer();
    110111    m_buffer->open(QBuffer::ReadWrite);
     
    214215    m_ui.progressBar->show();
    215216
    216     QLatin1String urlStr("http://doc.trolltech.com/assistantdocs/%1");
     217    QLatin1String urlStr("http://qt.nokia.com/doc/assistantdocs/%1");
    217218    QUrl url(QString(urlStr).arg(fileName));   
    218219   
     
    336337}
    337338
     339#endif
    338340QT_END_NAMESPACE
  • trunk/tools/assistant/tools/assistant/installdialog.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4747#include <QtNetwork/QHttpResponseHeader>
    4848#include "ui_installdialog.h"
     49
     50#ifndef QT_NO_HTTP
    4951
    5052QT_BEGIN_NAMESPACE
     
    99101QT_END_NAMESPACE
    100102
     103#endif
     104
    101105#endif // INSTALLDIALOG_H
  • trunk/tools/assistant/tools/assistant/main.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5252
    5353#include <QtHelp/QHelpEngineCore>
     54
     55#include <QtNetwork/QLocalSocket>
    5456
    5557#include <QtSql/QSqlDatabase>
     
    114116        customValue(QLatin1String("CreationTime"), 1).toUInt();
    115117
    116     if (callerCollectionCreationTime == userCollectionCreationTime)
     118    if (callerCollectionCreationTime <= userCollectionCreationTime)
    117119        return false;
    118120
     
    123125    user.setCustomValue(QLatin1String("LastShownPages"),
    124126        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));
    125133    user.setCustomValue(QLatin1String("CurrentFilter"),
    126134        caller.customValue(QLatin1String("CurrentFilter")));
     
    147155    user.setCustomValue(QLatin1String("AboutImages"),
    148156        caller.customValue(QLatin1String("AboutImages")));
     157    user.setCustomValue(QLatin1String("defaultHomepage"),
     158        caller.customValue(QLatin1String("defaultHomepage")));
    149159
    150160    return true;
     
    167177}
    168178
     179QString 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
    169190int main(int argc, char *argv[])
    170191{
     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
    171208    QApplication a(argc, argv);
     209#endif
    172210    a.addLibraryPath(a.applicationDirPath() + QLatin1String("/plugins"));
    173211
     
    213251    }
    214252
     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
    215275    {
    216276        QSqlDatabase db;
     
    272332                    }
    273333
    274                     QLatin1String intern("com.trolltech.com.assistantinternal_");
     334                    QLatin1String intern("com.trolltech.com.assistantinternal-");
    275335                    foreach (const QString &doc, userDocs) {
    276336                        if (!callerDocs.contains(doc) && !doc.startsWith(intern))
  • trunk/tools/assistant/tools/assistant/mainwindow.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    8787MainWindow::MainWindow(CmdLineParser *cmdLine, QWidget *parent)
    8888    : QMainWindow(parent)
     89    , m_filterCombo(0)
    8990    , m_toolBarMenu(0)
    9091    , m_cmdLine(cmdLine)
    91     , m_searchWidget(0)
    9292    , m_progressWidget(0)
    9393    , m_qtDocInstaller(0)
    9494    , m_connectedInitSignals(false)
    9595{
     96    setToolButtonStyle(Qt::ToolButtonFollowStyle);
     97
    9698    if (usesDefaultCollection()) {
    9799        MainWindow::collectionFileDirectory(true);
     
    126128    connect(searchEngine, SIGNAL(indexingFinished()), this, SLOT(indexingFinished()));
    127129
    128 #ifdef QT_CLUCENE_SUPPORT
    129130    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();
    142132
    143133    QString defWindowTitle = tr("Qt Assistant");
     
    150140        setupFilterToolbar();
    151141        setupAddressToolbar();
     142
    152143        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()));
    153150
    154151        setWindowTitle(m_helpEngine->customValue(QLatin1String("WindowTitle"),
     
    229226            showBookmarks();
    230227
     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
    231234        if (usesDefaultCollection())
    232235            QTimer::singleShot(0, this, SLOT(lookForNewQtDocumentation()));
     
    234237            checkInitState();
    235238    }
     239    setTabPosition(Qt::AllDockWidgetAreas, QTabWidget::North);
    236240}
    237241
     
    263267
    264268    bool assistantInternalDocRegistered = false;
    265     QString intern(QLatin1String("com.trolltech.com.assistantinternal_"));
     269    QString intern(QLatin1String("com.trolltech.com.assistantinternal-"));
    266270    foreach (const QString &ns, m_helpEngine->registeredDocumentations()) {
    267271        if (ns.startsWith(intern)) {
     
    305309            hc.setCustomValue(unfiltered, 1);
    306310        }
     311
    307312        m_helpEngine->blockSignals(true);
    308313        m_helpEngine->setCurrentFilter(tr("Unfiltered"));
     
    319324{
    320325    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)));
    325330
    326331    QString versionKey = QString(QLatin1String("qtVersion%1$$$qt")).
     
    354359            connect(m_helpEngine->contentModel(), SIGNAL(contentsCreated()),
    355360                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()));
    358363            m_connectedInitSignals = true;
    359364        }
     
    367372}
    368373
     374void 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
     388void 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
    369397void MainWindow::insertLastPages()
    370398{
     
    372400        m_centralWidget->setSource(m_cmdLine->url());
    373401    else
    374         m_centralWidget->setLastShownPages();
     402        m_centralWidget->setupWidget();
    375403
    376404    if (m_cmdLine->search() == CmdLineParser::Activate)
     
    396424
    397425    m_printAction = menu->addAction(tr("&Print..."), m_centralWidget, SLOT(print()));
     426    m_printAction->setPriority(QAction::LowPriority);
    398427    m_printAction->setIcon(QIcon(resourcePath + QLatin1String("/print.png")));
    399428    m_printAction->setShortcut(QKeySequence::Print);
     
    409438
    410439    QAction *tmp = menu->addAction(tr("&Quit"), this, SLOT(close()));
    411     tmp->setShortcut(tr("CTRL+Q"));
     440    tmp->setShortcut(QKeySequence::Quit);
    412441    tmp->setMenuRole(QAction::QuitRole);
    413442
     
    415444    m_copyAction = menu->addAction(tr("&Copy selected Text"), m_centralWidget,
    416445        SLOT(copySelection()));
     446    m_copyAction->setPriority(QAction::LowPriority);
     447    m_copyAction->setIconText("&Copy");
    417448    m_copyAction->setIcon(QIcon(resourcePath + QLatin1String("/editcopy.png")));
    418449    m_copyAction->setShortcuts(QKeySequence::Copy);
     
    421452    m_findAction = menu->addAction(tr("&Find in Text..."), m_centralWidget,
    422453        SLOT(showTextSearch()));
     454    m_findAction->setIconText(tr("&Find"));
    423455    m_findAction->setIcon(QIcon(resourcePath + QLatin1String("/find.png")));
    424456    m_findAction->setShortcuts(QKeySequence::Find);
     
    439471    m_zoomInAction = m_viewMenu->addAction(tr("Zoom &in"), m_centralWidget,
    440472        SLOT(zoomIn()));
     473    m_zoomInAction->setPriority(QAction::LowPriority);
    441474    m_zoomInAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomin.png")));
    442475    m_zoomInAction->setShortcut(QKeySequence::ZoomIn);
     
    444477    m_zoomOutAction = m_viewMenu->addAction(tr("Zoom &out"), m_centralWidget,
    445478        SLOT(zoomOut()));
     479    m_zoomOutAction->setPriority(QAction::LowPriority);
    446480    m_zoomOutAction->setIcon(QIcon(resourcePath + QLatin1String("/zoomout.png")));
    447481    m_zoomOutAction->setShortcut(QKeySequence::ZoomOut);
     
    449483    m_resetZoomAction = m_viewMenu->addAction(tr("Normal &Size"), m_centralWidget,
    450484        SLOT(resetZoom()));
     485    m_resetZoomAction->setPriority(QAction::LowPriority);
    451486    m_resetZoomAction->setIcon(QIcon(resourcePath + QLatin1String("/resetzoom.png")));
    452487    m_resetZoomAction->setShortcut(tr("Ctrl+0"));
     
    460495    m_viewMenu->addAction(tr("Bookmarks"), this, SLOT(showBookmarks()),
    461496        QKeySequence(tr("ALT+O")));
    462     m_viewMenu->addAction(tr("Search"), this, SLOT(showSearch()),
     497    m_viewMenu->addAction(tr("Search"), this, SLOT(showSearchWidget()),
    463498        QKeySequence(tr("ALT+S")));
    464499
    465500    menu = menuBar()->addMenu(tr("&Go"));
    466501    m_homeAction = menu->addAction(tr("&Home"), m_centralWidget, SLOT(home()));
    467     m_homeAction->setShortcut(tr("Ctrl+Home"));
     502    m_homeAction->setShortcut(tr("ALT+Home"));
    468503    m_homeAction->setIcon(QIcon(resourcePath + QLatin1String("/home.png")));
    469504
     
    474509
    475510    m_nextAction = menu->addAction(tr("&Forward"), m_centralWidget, SLOT(forward()));
     511    m_nextAction->setPriority(QAction::LowPriority);
    476512    m_nextAction->setEnabled(false);
    477513    m_nextAction->setShortcuts(QKeySequence::Forward);
     
    480516    m_syncAction = menu->addAction(tr("Sync with Table of Contents"), this,
    481517        SLOT(syncContents()));
     518    m_syncAction->setIconText(tr("Sync"));
    482519    m_syncAction->setIcon(QIcon(resourcePath + QLatin1String("/synctoc.png")));
    483520
     
    492529        << QKeySequence(Qt::CTRL + Qt::Key_PageUp));
    493530
    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"));
    497535
    498536    menu = menuBar()->addMenu(tr("&Help"));
    499537    m_aboutAction = menu->addAction(tr("About..."), this, SLOT(showAboutDialog()));
    500538    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
    501552
    502553    QToolBar *navigationBar = addToolBar(tr("Navigation Toolbar"));
     
    534585    connect(m_centralWidget, SIGNAL(currentViewerChanged()), this,
    535586        SLOT(updateNavigationItems()));
     587    connect(m_centralWidget, SIGNAL(currentViewerChanged()), this,
     588        SLOT(updateTabCloseAction()));
    536589    connect(m_centralWidget, SIGNAL(forwardAvailable(bool)), this,
    537590        SLOT(updateNavigationItems()));
     
    540593    connect(m_centralWidget, SIGNAL(highlighted(QString)), statusBar(),
    541594        SLOT(showMessage(QString)));
    542     connect(m_centralWidget, SIGNAL(addNewBookmark(QString, QString)), this,
    543         SLOT(addNewBookmark(QString, QString)));
     595    connect(m_centralWidget, SIGNAL(addNewBookmark(QString,QString)), this,
     596        SLOT(addNewBookmark(QString,QString)));
    544597
    545598    // bookmarks
     
    552605    connect(m_indexWindow, SIGNAL(linkActivated(QUrl)), m_centralWidget,
    553606        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)));
    556609    connect(m_indexWindow, SIGNAL(escapePressed()), this,
    557610        SLOT(activateCurrentCentralWidgetTab()));
     
    602655    connect(m_helpEngine, SIGNAL(setupFinished()), this,
    603656        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)));
    606661
    607662    setupFilterCombo();
     
    627682
    628683    // 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)));
    635690}
    636691
     
    696751    m_nextAction->setEnabled(m_centralWidget->isForwardAvailable());
    697752    m_backAction->setEnabled(m_centralWidget->isBackwardAvailable());
    698     m_closeTabAction->setEnabled(hasCurrentViewer);
    699753    m_newTabAction->setEnabled(hasCurrentViewer);
     754}
     755
     756void MainWindow::updateTabCloseAction()
     757{
     758    m_closeTabAction->setEnabled(m_centralWidget->enableTabCloseAction());
    700759}
    701760
     
    713772    PreferencesDialog dia(m_helpEngine, this);
    714773
    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()));
    719778
    720779    dia.showDialog();
     
    739798void MainWindow::addNewBookmark(const QString &title, const QString &url)
    740799{
    741     if (url.isEmpty())
     800    if (url.isEmpty() || url == QLatin1String("about:blank"))
    742801        return;
    743802
     
    788847        aboutDia.setWindowTitle(aboutDia.documentTitle());
    789848    } 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 
    795849        QByteArray resources;
    796850        aboutDia.setText(QString::fromLatin1("<center>"
    797851            "<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);
    807856        QLatin1String path(":/trolltech/assistant/images/assistant-128.png");
    808857        aboutDia.setPixmap(QString(path));
     
    870919void MainWindow::showSearch()
    871920{
    872     if (m_searchWidget)
    873         activateDockWidget(m_searchWidget);
    874     else
    875         m_centralWidget->activateSearch();
     921    m_centralWidget->activateSearchWidget();
     922}
     923
     924void MainWindow::showSearchWidget()
     925{
     926    m_centralWidget->activateSearchWidget(true);
    876927}
    877928
    878929void MainWindow::hideSearch()
    879930{
    880     if (m_searchWidget) {
    881         m_searchWidget->parentWidget()->parentWidget()->hide();
    882     } else {
    883         m_centralWidget->removeSearchWidget();
    884     }
     931    m_centralWidget->removeSearchWidget();
    885932}
    886933
     
    919966void MainWindow::indexingStarted()
    920967{
    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    }
    940989}
    941990
     
    9511000    m_bookmarkManager = new BookmarkManager(m_helpEngine);
    9521001    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()));
    9551003    return m_bookmarkWidget;
    9561004}
     
    9881036}
    9891037
     1038void 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
    9901045QT_END_NAMESPACE
  • trunk/tools/assistant/tools/assistant/mainwindow.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6262class CmdLineParser;
    6363class QtDocInstaller;
    64 
    65 class SearchWidget;
    6664
    6765class MainWindow : public QMainWindow
     
    9593    void showBookmarks();
    9694    void showSearch();
     95    void showSearchWidget();
    9796    void syncContents();
    9897    void activateCurrentCentralWidgetTab();
     98    void currentFilterChanged(const QString &filter);
    9999
    100100private slots:
     
    107107    void copyAvailable(bool yes);
    108108    void updateNavigationItems();
     109    void updateTabCloseAction();
    109110    void showNewAddress(const QUrl &url);
    110111    void addNewBookmark(const QString &title, const QString &url);
     
    119120    void qtDocumentationInstalled(bool newDocsInstalled);
    120121    void checkInitState();
     122
     123    void updateBookmarkMenu();
     124    void showBookmark(QAction *action);
    121125
    122126private:
     
    158162    QMenu *m_viewMenu;
    159163    QMenu *m_toolBarMenu;
     164    QMenu *m_bookmarkMenu;
     165    QAction *m_bookmarkMenuAction;
    160166
    161167    CmdLineParser *m_cmdLine;
    162     SearchWidget *m_searchWidget;
    163168
    164169    QWidget *m_progressWidget;
  • trunk/tools/assistant/tools/assistant/preferencesdialog.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    4545#include "fontpanel.h"
    4646#include "centralwidget.h"
     47#include "aboutdialog.h"
    4748
    4849#include <QtAlgorithms>
     
    5354#include <QtGui/QMenu>
    5455#include <QtGui/QFontDatabase>
     56#include <QtGui/QApplication>
     57#include <QtGui/QDesktopWidget>
    5558
    5659#include <QtHelp/QHelpEngineCore>
     
    6063PreferencesDialog::PreferencesDialog(QHelpEngineCore *helpEngine, QWidget *parent)
    6164    : QDialog(parent)
     65    , m_helpEngine(helpEngine)
    6266    , m_appFontChanged(false)
    6367    , m_browserFontChanged(false)
    6468{
    65     m_helpEngine = helpEngine;
    6669    m_ui.setupUi(this);
    6770
    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();
    7781
    7882    if (!m_hideFiltersTab) {
    7983        m_ui.attributeWidget->header()->hide();
    8084        m_ui.attributeWidget->setRootIsDecorated(false);
    81         connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*, int)),
     85
     86        connect(m_ui.attributeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
    8287            this, SLOT(updateFilterMap()));
    8388
    8489        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()));
    9297
    9398        updateFilterPage();
     
    107112        m_ui.tabWidget->removeTab(m_ui.tabWidget->indexOf(m_ui.docsTab));
    108113    }
     114
    109115    updateFontSettingsPage();
    110116    updateOptionsPage();
     
    113119PreferencesDialog::~PreferencesDialog()
    114120{
     121    QLatin1String key("");
    115122    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());
    119131    }
    120132
    121133    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());
    125142    }
    126143
     
    130147    }
    131148
    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);
    134156}
    135157
     
    174196        checkedList = m_filterMap.value(item->text());
    175197    QTreeWidgetItem *itm;
    176     for (int i=0; i<m_ui.attributeWidget->topLevelItemCount(); ++i) {
     198    for (int i = 0; i < m_ui.attributeWidget->topLevelItemCount(); ++i) {
    177199        itm = m_ui.attributeWidget->topLevelItem(i);
    178200        if (checkedList.contains(itm->text(0)))
     
    193215    QStringList newAtts;
    194216    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) {
    196218        itm = m_ui.attributeWidget->topLevelItem(i);
    197219        if (itm->checkState(0) == Qt::Checked)
     
    220242void PreferencesDialog::removeFilter()
    221243{
    222     QListWidgetItem *item = m_ui.filterWidget
    223         ->takeItem(m_ui.filterWidget->currentRow());
     244    QListWidgetItem *item =
     245        m_ui.filterWidget ->takeItem(m_ui.filterWidget->currentRow());
    224246    if (!item)
    225247        return;
     
    239261        return;
    240262
     263    QStringList invalidFiles;
     264    QStringList alreadyRegistered;
    241265    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);
    246269            continue;
    247270        }
    248271
    249         if (m_ui.registeredDocsListWidget->findItems(ns, Qt::MatchFixedString).count()) {
    250             QMessageBox::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;
    253276        }
    254277
    255278        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
    260305    updateFilterPage();
    261306}
     
    338383    for (int i = m_TabsToClose.count(); --i >= 0;)
    339384        widget->closeTabAt(m_TabsToClose.at(i));
     385    if (widget->availableHelpViewer()== 0)
     386        widget->setSource(QUrl(QLatin1String("about:blank")));
    340387
    341388    if (m_unregDocs.count()) {
     
    363410
    364411    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 
    369412    m_appFontPanel->setTitle(customSettings);
     413
     414    QLatin1String key = QLatin1String("appFont");
     415    QFont font = qVariantValue<QFont>(m_helpEngine->customValue(key));
    370416    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());
    377425
    378426    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)));
    385444
    386445    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
    391451    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    }
    394456}
    395457
     
    427489            QLatin1String("help")).toString();
    428490    }
    429 
    430491    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
     502void PreferencesDialog::setBlankPage()
     503{
     504    m_ui.homePageLineEdit->setText(QLatin1String("about:blank"));
     505}
     506
     507void PreferencesDialog::setCurrentPage()
    445508{
    446509    QString homepage = CentralWidget::instance()->currentSource().toString();
     
    451514}
    452515
     516void PreferencesDialog::setDefaultPage()
     517{
     518    QString homepage = m_helpEngine->customValue(QLatin1String("defaultHomepage"),
     519        QLatin1String("help")).toString();
     520    m_ui.homePageLineEdit->setText(homepage);
     521}
     522
    453523QT_END_NAMESPACE
  • trunk/tools/assistant/tools/assistant/preferencesdialog.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5050class FontPanel;
    5151class QHelpEngineCore;
     52
     53enum {
     54    ShowHomePage = 0,
     55    ShowBlankPage = 1,
     56    ShowLastPages = 2
     57};
    5258
    5359class PreferencesDialog : public QDialog
     
    7379    void browserFontSettingToggled(bool on);
    7480    void browserFontSettingChanged(int index);
    75     void restoreDefaultHomepage();
    76     void currentHomepageChanged();
     81   
     82    void setBlankPage();
     83    void setCurrentPage();
     84    void setDefaultPage();
    7785
    7886signals:
  • trunk/tools/assistant/tools/assistant/preferencesdialog.ui

    r2 r561  
    77    <x>0</x>
    88    <y>0</y>
    9     <width>359</width>
     9    <width>375</width>
    1010    <height>266</height>
    1111   </rect>
     
    188188       <string>Options</string>
    189189      </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>
    191251       <item>
    192252        <widget class="QGroupBox" name="groupBox">
    193253         <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">
    200257          <item>
    201258           <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">
    202273            <item>
    203274             <spacer name="horizontalSpacer">
     
    214285            </item>
    215286            <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>
    232306            </item>
    233307           </layout>
  • trunk/tools/assistant/tools/assistant/qtdocinstaller.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/qtdocinstaller.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/remotecontrol.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    7979    char chBuf[4096];
    8080    DWORD dwRead;
     81
     82#ifndef Q_WS_WINCE
    8183    HANDLE hStdin, hStdinDup;
    8284
     
    9092
    9193    CloseHandle(hStdin);
     94#else
     95    HANDLE hStdinDup;
     96    hStdinDup = stdin;
     97#endif
    9298
    9399    while (ok) {
     
    112118#ifdef Q_OS_WIN
    113119    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)));
    116122    l->start();
    117123#else
     
    232238                m_mainWindow->expandTOC(depth);
    233239        } else if (cmd == QLatin1String("setcurrentfilter")) {
     240            if (!m_helpEngine->customFilters().contains(arg))
     241                return;
    234242            if (m_caching) {
    235243                clearCache();
  • trunk/tools/assistant/tools/assistant/remotecontrol.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/remotecontrol_win.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/searchwidget.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6363    : QWidget(parent)
    6464    , zoomCount(0)
     65    , attached(false)
    6566    , searchEngine(engine)
    6667{
     
    7172
    7273    vLayout->addWidget(queryWidget);
    73     vLayout->addWidget(resultWidget);       
    74    
     74    vLayout->addWidget(resultWidget);
     75
    7576    setFocusProxy(queryWidget);
    7677
    7778    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);
    8690}
    8791
     
    9397void SearchWidget::zoomIn()
    9498{
    95 #ifndef QT_CLUCENE_SUPPORT
    96     return;
    97 #endif
    98 
    9999    QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
    100100    if (browser && zoomCount != 10) {
     
    106106void SearchWidget::zoomOut()
    107107{
    108 #ifndef QT_CLUCENE_SUPPORT
    109         return;
    110 #endif
    111 
    112108    QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
    113109    if (browser && zoomCount != -5) {
     
    119115void SearchWidget::resetZoom()
    120116{
    121 #ifndef QT_CLUCENE_SUPPORT
    122     return;
    123 #endif
    124 
    125117    if (zoomCount == 0)
    126118        return;
     
    133125}
    134126
     127bool SearchWidget::isAttached() const
     128{
     129    return attached;
     130}
     131
     132void SearchWidget::setAttached(bool state)
     133{
     134    attached = state;
     135}
     136
    135137void SearchWidget::search() const
    136138{
     
    153155{
    154156    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){
    156159        QMouseEvent *me = static_cast<QMouseEvent*>(e);
    157160        QUrl link = resultWidget->linkAt(me->pos());
     
    180183    QPoint point = contextMenuEvent->globalPos();
    181184
    182 #ifdef QT_CLUCENE_SUPPORT
    183185    QTextBrowser* browser = qFindChild<QTextBrowser*>(resultWidget);
    184186    if (!browser)
     
    191193    QUrl link = browser->anchorAt(point);
    192194
    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));
    195198    copyAction->setEnabled(QTextCursor(browser->textCursor()).hasSelection());
    196199
     
    198201    copyAnchorAction->setEnabled(!link.isEmpty() && link.isValid());
    199202
    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) +
    202206        QLatin1String("LMB"));
    203207    newTabAction->setEnabled(!link.isEmpty() && link.isValid());
     
    205209    menu.addSeparator();
    206210
    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));
    209214
    210215    QAction *usedAction = menu.exec(mapToGlobal(contextMenuEvent->pos()));
     
    223228    else if (usedAction == newTabAction) {
    224229        emit requestShowLinkInNewTab(link);
    225     } 
     230    }
    226231    else if (usedAction == selectAllAction) {
    227232        browser->selectAll();
    228233    }
    229 #else
    230     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 #endif
    244234}
    245235
  • trunk/tools/assistant/tools/assistant/searchwidget.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    6666    void resetZoom();
    6767
     68    bool isAttached() const;
     69    void setAttached(bool state);
     70
    6871signals:
    6972    void requestShowLink(const QUrl &url);
     
    8285private:
    8386    int zoomCount;
     87    bool attached;
    8488    QHelpSearchEngine *searchEngine;
    8589    QHelpSearchResultWidget *resultWidget;
  • trunk/tools/assistant/tools/assistant/topicchooser.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/assistant/topicchooser.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qcollectiongenerator/main.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/adpreader.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
    4040****************************************************************************/
    4141
     42#include <QRegExp>
     43
    4244#include "adpreader.h"
     45
     46static 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}
    4351
    4452QT_BEGIN_NAMESPACE
     
    5260    m_files.clear();
    5361    addData(contents);
    54         while (!atEnd()) {
    55                 readNext();
    56                 if (isStartElement()) {
     62    while (!atEnd()) {
     63        readNext();
     64        if (isStartElement()) {
    5765            if (name().toString().toLower() == QLatin1String("assistantconfig")
    58                 && attributes().value(QLatin1String("version")) == QLatin1String("3.2.0")) {
     66                && versionIsAtLeast320(attributes().value(QLatin1String("version")).toString())) {
    5967                readProject();
    6068            } else if (name().toString().toLower() == QLatin1String("dcf")) {
     
    6775                raiseError();
    6876            }
    69                 }
    70         }
     77        }
     78    }
    7179}
    7280
  • trunk/tools/assistant/tools/qhelpconverter/adpreader.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5151struct ContentItem {
    5252    ContentItem(const QString &t, const QString &r, int d)
    53         : title(t), reference(r), depth(d) {}
     53       : title(t), reference(r), depth(d) {}
    5454    QString title;
    5555    QString reference;
    56     int depth;   
     56    int depth;
    5757};
    5858
    5959struct KeywordItem {
    6060    KeywordItem(const QString &k, const QString &r)
    61         : keyword(k), reference(r) {}
     61       : keyword(k), reference(r) {}
    6262    QString keyword;
    6363    QString reference;
  • trunk/tools/assistant/tools/qhelpconverter/conversionwizard.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/conversionwizard.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/filespage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/filespage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/filterpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/filterpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/finishpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/finishpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/generalpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5353
    5454    m_ui.setupUi(this);
    55     connect(m_ui.namespaceLineEdit, SIGNAL(textChanged(const QString&)),
     55    connect(m_ui.namespaceLineEdit, SIGNAL(textChanged(QString)),
    5656        this, SIGNAL(completeChanged()));
    57     connect(m_ui.folderLineEdit, SIGNAL(textChanged(const QString&)),
     57    connect(m_ui.folderLineEdit, SIGNAL(textChanged(QString)),
    5858        this, SIGNAL(completeChanged()));
    5959
  • trunk/tools/assistant/tools/qhelpconverter/generalpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/helpwindow.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/helpwindow.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/identifierpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/identifierpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/inputpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/inputpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/main.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/outputpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5656
    5757    m_ui.setupUi(this);
    58     connect(m_ui.projectLineEdit, SIGNAL(textChanged(const QString&)),
     58    connect(m_ui.projectLineEdit, SIGNAL(textChanged(QString)),
    5959        this, SIGNAL(completeChanged()));
    60     connect(m_ui.collectionLineEdit, SIGNAL(textChanged(const QString&)),
     60    connect(m_ui.collectionLineEdit, SIGNAL(textChanged(QString)),
    6161        this, SIGNAL(completeChanged()));
    6262
  • trunk/tools/assistant/tools/qhelpconverter/outputpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/pathpage.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/pathpage.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/qhcpwriter.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/qhcpwriter.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/qhpwriter.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpconverter/qhpwriter.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/qhelpgenerator/main.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
  • trunk/tools/assistant/tools/shared/helpgenerator.cpp

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
     
    5050{
    5151    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)));
    5656}
    5757
  • trunk/tools/assistant/tools/shared/helpgenerator.h

    r2 r561  
    22**
    33** 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)
    56**
    67** This file is part of the Qt Assistant of the Qt Toolkit.
     
    2122** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
    2223**
    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.
    2727**
    2828** GNU General Public License Usage
     
    3434** met: http://www.gnu.org/copyleft/gpl.html.
    3535**
    36 ** If you are unsure which license is appropriate for your use, please
    37 ** 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.
    3838** $QT_END_LICENSE$
    3939**
Note: See TracChangeset for help on using the changeset viewer.