summaryrefslogtreecommitdiffstats
path: root/tests/auto/linguist/lupdate
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-08-17 19:13:58 +0200
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2009-08-17 21:15:13 +0200
commit33e1639ba798a5726d322139770dc771d03cae72 (patch)
tree62477e6c91156ed75182fc0178c6e714c0def6ff /tests/auto/linguist/lupdate
parent725d3a60c62468553c63a0269282ebdb821c650c (diff)
cut down on real code
remove all c++ code which is not part of the critical test data. as a result, remove the license headers where the remaining text cannot be reasonably considered copyright-worthy any more. this is a somewhat persistent solution to the ever-changing license headers screwing up the tests.
Diffstat (limited to 'tests/auto/linguist/lupdate')
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp108
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp137
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result6
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result22
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result4
-rw-r--r--tests/auto/linguist/lupdate/testdata/good/parseui/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result8
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result12
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/project.ui40
-rw-r--r--tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp139
14 files changed, 37 insertions, 541 deletions
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp
index 7958055388..7215ebeaa3 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/finddialog.cpp
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "finddialog.h"
#include "mainwindow.h"
#include "tabbedbrowser.h"
@@ -51,83 +10,18 @@
#include <QDateTime>
#include <QGridLayout>
-CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent)
- : QStandardItemModel(rows, columns, parent)
-{}
-QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value,
- int hits, Qt::MatchFlags flags) const
-{
- if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap))
- flags |= Qt::MatchCaseSensitive;
-
- return QStandardItemModel::match(start, role, value, hits, flags);
-}
-
FindDialog::FindDialog(MainWindow *parent)
: QDialog(parent)
{
- contentsWidget = new QWidget(this);
- ui.setupUi(contentsWidget);
- ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind));
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setMargin(0);
- l->setSpacing(0);
- l->addWidget(contentsWidget);
-
- lastBrowser = 0;
- onceFound = false;
- findExpr.clear();
-
sb = new QStatusBar(this);
l->addWidget(sb);
sb->showMessage(tr("Enter the text you want to find."));
- connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked()));
- connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-FindDialog::~FindDialog()
-{
-}
-
-void FindDialog::findButtonClicked()
-{
- doFind(ui.radioForward->isChecked());
}
void FindDialog::doFind(bool forward)
{
- QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser());
- sb->clearMessage();
-
- if (ui.comboFind->currentText() != findExpr || lastBrowser != browser)
- onceFound = false;
- findExpr = ui.comboFind->currentText();
-
- QTextDocument::FindFlags flags = 0;
-
- if (ui.checkCase->isChecked())
- flags |= QTextDocument::FindCaseSensitively;
-
- if (ui.checkWords->isChecked())
- flags |= QTextDocument::FindWholeWords;
-
- QTextCursor c = browser->textCursor();
- if (!c.hasSelection()) {
- if (forward)
- c.movePosition(QTextCursor::Start);
- else
- c.movePosition(QTextCursor::End);
-
- browser->setTextCursor(c);
- }
-
- QTextDocument::FindFlags options;
- if (forward == false)
- flags |= QTextDocument::FindBackward;
-
QTextCursor found = browser->document()->find(findExpr, c, flags);
if (found.isNull()) {
if (onceFound) {
@@ -141,8 +35,6 @@ void FindDialog::doFind(bool forward)
} else {
browser->setTextCursor(found);
}
- onceFound |= !found.isNull();
- lastBrowser = browser;
}
bool FindDialog::hasFindExpression() const
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result
index 21d1ca0db4..de2c45af14 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_noobsolete/project.ts.result
@@ -4,22 +4,22 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="finddialog.cpp" line="57"/>
+ <location filename="finddialog.cpp" line="19"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="107"/>
+ <location filename="finddialog.cpp" line="29"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="109"/>
+ <location filename="finddialog.cpp" line="31"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="111"/>
+ <location filename="finddialog.cpp" line="33"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp
index 045fab1e85..756c9a3a89 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/finddialog.cpp
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "finddialog.h"
#include "mainwindow.h"
#include "tabbedbrowser.h"
@@ -51,86 +10,17 @@
#include <QDateTime>
#include <QGridLayout>
-CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent)
- : QStandardItemModel(rows, columns, parent)
-{}
-QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value,
- int hits, Qt::MatchFlags flags) const
-{
- if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap))
- flags |= Qt::MatchCaseSensitive;
-
- return QStandardItemModel::match(start, role, value, hits, flags);
-}
-
FindDialog::FindDialog(MainWindow *parent)
: QDialog(parent)
{
- contentsWidget = new QWidget(this);
- ui.setupUi(contentsWidget);
- ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind));
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setMargin(0);
- l->setSpacing(0);
- l->addWidget(contentsWidget);
-
- lastBrowser = 0;
- onceFound = false;
- findExpr.clear();
-
- sb = new QStatusBar(this);
- l->addWidget(sb);
-
-
// Move it to another line and change the text,
// then lupdate should add this one as a new one, and mark the old one as obsolete.
sb->showMessage(tr("Enter the text you want to find."));
- connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked()));
- connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-FindDialog::~FindDialog()
-{
-}
-
-void FindDialog::findButtonClicked()
-{
- doFind(ui.radioForward->isChecked());
}
void FindDialog::doFind(bool forward)
{
- QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser());
- sb->clearMessage();
-
- if (ui.comboFind->currentText() != findExpr || lastBrowser != browser)
- onceFound = false;
- findExpr = ui.comboFind->currentText();
-
- QTextDocument::FindFlags flags = 0;
-
- if (ui.checkCase->isChecked())
- flags |= QTextDocument::FindCaseSensitively;
-
- if (ui.checkWords->isChecked())
- flags |= QTextDocument::FindWholeWords;
-
- QTextCursor c = browser->textCursor();
- if (!c.hasSelection()) {
- if (forward)
- c.movePosition(QTextCursor::Start);
- else
- c.movePosition(QTextCursor::End);
-
- browser->setTextCursor(c);
- }
-
- QTextDocument::FindFlags options;
- if (forward == false)
- flags |= QTextDocument::FindBackward;
-
QTextCursor found = browser->document()->find(findExpr, c, flags);
if (found.isNull()) {
if (onceFound) {
@@ -144,31 +34,4 @@ void FindDialog::doFind(bool forward)
} else {
browser->setTextCursor(found);
}
- onceFound |= !found.isNull();
- lastBrowser = browser;
-}
-
-bool FindDialog::hasFindExpression() const
-{
- return !findExpr.isEmpty();
-}
-
-void FindDialog::statusMessage(const QString &message)
-{
- if (isVisible())
- sb->showMessage(message);
- else
- static_cast<MainWindow*>(parent())->statusBar()->showMessage(message, 2000);
-}
-
-MainWindow *FindDialog::mainWindow() const
-{
- return static_cast<MainWindow*>(parentWidget());
-}
-
-void FindDialog::reset()
-{
- ui.comboFind->setFocus();
- ui.comboFind->lineEdit()->setSelection(
- 0, ui.comboFind->lineEdit()->text().length());
}
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result
index b7074fea7c..4012182de5 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/mergecpp_obsolete/project.ts.result
@@ -8,22 +8,22 @@
<translation type="obsolete">Skriv inn teksten du soker etter</translation>
</message>
<message>
- <location filename="finddialog.cpp" line="60"/>
+ <location filename="finddialog.cpp" line="18"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="110"/>
+ <location filename="finddialog.cpp" line="28"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="112"/>
+ <location filename="finddialog.cpp" line="30"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="114"/>
+ <location filename="finddialog.cpp" line="32"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
index 076520ab31..1ad6ec8266 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.before
@@ -3,18 +3,18 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Find text</source>
<!--should be changed to unfinished, since we are changing the sourcetext in the UI file-->
<translation>Qt Assistant - Finn tekst</translation>
</message>
<message>
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>300px</source>
<translation>300px</translation>
</message>
<message>
- <location filename="project.ui" line="33"/>
+ <location filename="project.ui" line="21"/>
<source>400px</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result
index b21f58379c..4c5f74d6e5 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ts.result
@@ -4,18 +4,18 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Find Text</source>
<oldsource>Qt Assistant - Find text</oldsource>
<translation type="unfinished">Qt Assistant - Finn tekst</translation>
</message>
<message>
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>300px</source>
<translation>300px</translation>
</message>
<message>
- <location filename="project.ui" line="33"/>
+ <location filename="project.ui" line="21"/>
<source>401 pixels</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui
index 2a0bb707d0..d332eeb354 100644
--- a/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui
+++ b/tests/auto/linguist/lupdate/testdata/good/mergeui/project.ui
@@ -1,45 +1,5 @@
<ui version="4.0" >
<author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
<exportmacro></exportmacro>
<class>FindDialog</class>
<widget class="QWidget" name="FindDialog" >
diff --git a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
index 97d3bce668..8c4824579f 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parsecpp/project.ts.result
@@ -79,27 +79,27 @@ backslashed \ stuff.</source>
<context>
<name>FindDialog</name>
<message>
- <location filename="finddialog.cpp" line="57"/>
+ <location filename="finddialog.cpp" line="85"/>
<source>Enter the text you are looking for.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="107"/>
+ <location filename="finddialog.cpp" line="135"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="109"/>
+ <location filename="finddialog.cpp" line="137"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="111"/>
+ <location filename="finddialog.cpp" line="139"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="147"/>
+ <location filename="finddialog.cpp" line="175"/>
<source>null comment</source>
<translation type="unfinished"></translation>
</message>
@@ -107,7 +107,7 @@ backslashed \ stuff.</source>
<context>
<name>Kåntekst</name>
<message utf8="true">
- <location filename="finddialog.cpp" line="152"/>
+ <location filename="finddialog.cpp" line="180"/>
<source>encoding, using QApplication</source>
<translation type="unfinished"></translation>
</message>
@@ -151,28 +151,28 @@ backslashed \ stuff.</source>
<context>
<name>QCoreApplication</name>
<message>
- <location filename="finddialog.cpp" line="144"/>
+ <location filename="finddialog.cpp" line="172"/>
<source>with comment</source>
<comment>comment</comment>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="145"/>
+ <location filename="finddialog.cpp" line="173"/>
<source>empty comment</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="146"/>
+ <location filename="finddialog.cpp" line="174"/>
<source>null comment</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="149"/>
+ <location filename="finddialog.cpp" line="177"/>
<source>encoding, using QCoreApplication</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="finddialog.cpp" line="150"/>
+ <location filename="finddialog.cpp" line="178"/>
<source>encoding, using QApplication</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
index ddf58c3639..7f665f4d9c 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ts.result
@@ -4,12 +4,12 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Finn text</source>
<translation type="unfinished"></translation>
</message>
<message utf8="true">
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>Finn tekst - Der Bjørn möchte auch mal.</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui
index 9beb8d56aa..65a00c71d5 100644
--- a/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui
+++ b/tests/auto/linguist/lupdate/testdata/good/parseui/project.ui
@@ -1,45 +1,5 @@
<ui version="4.0" >
<author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
<exportmacro></exportmacro>
<class>FindDialog</class>
<widget class="QWidget" name="FindDialog" >
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
index e132342a13..f6415bfb86 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/bar.ts.result
@@ -4,22 +4,22 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="sub/finddialog.cpp" line="57"/>
+ <location filename="sub/finddialog.cpp" line="16"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="107"/>
+ <location filename="sub/finddialog.cpp" line="25"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="109"/>
+ <location filename="sub/finddialog.cpp" line="27"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="111"/>
+ <location filename="sub/finddialog.cpp" line="29"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
index 6646014632..581e4b6b36 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/foo.ts.result
@@ -4,32 +4,32 @@
<context>
<name>FindDialog</name>
<message>
- <location filename="project.ui" line="27"/>
+ <location filename="project.ui" line="15"/>
<source>Qt Assistant - Finn text</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="project.ui" line="30"/>
+ <location filename="project.ui" line="18"/>
<source>Finn tekst</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="57"/>
+ <location filename="sub/finddialog.cpp" line="16"/>
<source>Enter the text you want to find.</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="107"/>
+ <location filename="sub/finddialog.cpp" line="25"/>
<source>Search reached end of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="109"/>
+ <location filename="sub/finddialog.cpp" line="27"/>
<source>Search reached start of the document</source>
<translation type="unfinished"></translation>
</message>
<message>
- <location filename="sub/finddialog.cpp" line="111"/>
+ <location filename="sub/finddialog.cpp" line="29"/>
<source>Text not found</source>
<translation type="unfinished"></translation>
</message>
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui b/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
index 97553db40b..8dea10b803 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/project.ui
@@ -1,45 +1,5 @@
<ui version="4.0" >
<author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
<exportmacro></exportmacro>
<class>FindDialog</class>
<widget class="QWidget" name="FindDialog" >
diff --git a/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp b/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
index 3800ee7c6b..38754739c2 100644
--- a/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
+++ b/tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp
@@ -1,44 +1,3 @@
-/****************************************************************************
-**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the autotests of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the either Technology Preview License Agreement or the
-** Beta Release License Agreement.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain
-** additional rights. These rights are described in the Nokia Qt LGPL
-** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
-** package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://qt.nokia.com/contact.
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
#include "finddialog.h"
#include "mainwindow.h"
#include "tabbedbrowser.h"
@@ -51,83 +10,14 @@
#include <QDateTime>
#include <QGridLayout>
-CaseSensitiveModel::CaseSensitiveModel(int rows, int columns, QObject *parent)
- : QStandardItemModel(rows, columns, parent)
-{}
-QModelIndexList CaseSensitiveModel::match(const QModelIndex &start, int role, const QVariant &value,
- int hits, Qt::MatchFlags flags) const
-{
- if (flags == Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap))
- flags |= Qt::MatchCaseSensitive;
-
- return QStandardItemModel::match(start, role, value, hits, flags);
-}
-
FindDialog::FindDialog(MainWindow *parent)
: QDialog(parent)
{
- contentsWidget = new QWidget(this);
- ui.setupUi(contentsWidget);
- ui.comboFind->setModel(new CaseSensitiveModel(0, 1, ui.comboFind));
-
- QVBoxLayout *l = new QVBoxLayout(this);
- l->setMargin(0);
- l->setSpacing(0);
- l->addWidget(contentsWidget);
-
- lastBrowser = 0;
- onceFound = false;
- findExpr.clear();
-
- sb = new QStatusBar(this);
- l->addWidget(sb);
-
sb->showMessage(tr("Enter the text you want to find."));
-
- connect(ui.findButton, SIGNAL(clicked()), this, SLOT(findButtonClicked()));
- connect(ui.closeButton, SIGNAL(clicked()), this, SLOT(reject()));
-}
-
-FindDialog::~FindDialog()
-{
-}
-
-void FindDialog::findButtonClicked()
-{
- doFind(ui.radioForward->isChecked());
}
void FindDialog::doFind(bool forward)
{
- QTextBrowser *browser = static_cast<QTextBrowser*>(mainWindow()->browsers()->currentBrowser());
- sb->clearMessage();
-
- if (ui.comboFind->currentText() != findExpr || lastBrowser != browser)
- onceFound = false;
- findExpr = ui.comboFind->currentText();
-
- QTextDocument::FindFlags flags = 0;
-
- if (ui.checkCase->isChecked())
- flags |= QTextDocument::FindCaseSensitively;
-
- if (ui.checkWords->isChecked())
- flags |= QTextDocument::FindWholeWords;
-
- QTextCursor c = browser->textCursor();
- if (!c.hasSelection()) {
- if (forward)
- c.movePosition(QTextCursor::Start);
- else
- c.movePosition(QTextCursor::End);
-
- browser->setTextCursor(c);
- }
-
- QTextDocument::FindFlags options;
- if (forward == false)
- flags |= QTextDocument::FindBackward;
-
QTextCursor found = browser->document()->find(findExpr, c, flags);
if (found.isNull()) {
if (onceFound) {
@@ -138,34 +28,5 @@ void FindDialog::doFind(bool forward)
} else {
statusMessage(tr( "Text not found" ));
}
- } else {
- browser->setTextCursor(found);
}
- onceFound |= !found.isNull();
- lastBrowser = browser;
-}
-
-bool FindDialog::hasFindExpression() const
-{
- return !findExpr.isEmpty();
-}
-
-void FindDialog::statusMessage(const QString &message)
-{
- if (isVisible())
- sb->showMessage(message);
- else
- static_cast<MainWindow*>(parent())->statusBar()->showMessage(message, 2000);
-}
-
-MainWindow *FindDialog::mainWindow() const
-{
- return static_cast<MainWindow*>(parentWidget());
-}
-
-void FindDialog::reset()
-{
- ui.comboFind->setFocus();
- ui.comboFind->lineEdit()->setSelection(
- 0, ui.comboFind->lineEdit()->text().length());
}