summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-08-19 17:41:27 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-27 13:41:48 +0200
commite83e456eaaa482c444a08ad1d314fde9f00239e0 (patch)
tree3a2a4994ea0a5fe40e12208e629997868abce7ab
parent070719e228957ea6a10f3545bf2ddc0288c236ae (diff)
de-duplicate code paths
Change-Id: I368b0adb7cc96f40465d176a01196697eb09db4c Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
-rw-r--r--src/linguist/linguist/mainwindow.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/linguist/linguist/mainwindow.cpp b/src/linguist/linguist/mainwindow.cpp
index 79abaa475..a1762edf0 100644
--- a/src/linguist/linguist/mainwindow.cpp
+++ b/src/linguist/linguist/mainwindow.cpp
@@ -993,29 +993,26 @@ void MainWindow::findAgain()
for (int i = 0; i < m_dataModel->modelCount(); ++i) {
if (MessageItem *m = m_dataModel->messageItem(dataIndex, i)) {
bool found = true;
- // Note: we do not look into plurals on grounds of them not
- // containing anything much different from the singular.
- if (hadMessage) {
- if (!searchItem(DataModel::Translations, m->translation()))
- found = false;
- } else {
- do {
+ do {
+ if (!hadMessage) {
if (searchItem(DataModel::SourceText, m->text()))
break;
if (searchItem(DataModel::SourceText, m->pluralText()))
break;
- if (searchItem(DataModel::Translations, m->translation()))
- break;
if (searchItem(DataModel::Comments, m->comment()))
break;
if (searchItem(DataModel::Comments, m->extraComment()))
break;
if (searchItem(DataModel::Comments, m->translatorComment()))
break;
- found = false;
- // did not find the search string in this message
- } while (0);
- }
+ }
+ // Note: we do not look into plurals on grounds of them not
+ // containing anything much different from the singular.
+ if (searchItem(DataModel::Translations, m->translation()))
+ break;
+ found = false;
+ // did not find the search string in this message
+ } while (0);
if (found) {
setCurrentMessage(realIndex, i);