From b2924aa66b98fbab3d55c475f0be688ba93f81ec Mon Sep 17 00:00:00 2001
From: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Date: Mon, 12 Oct 2009 12:33:12 +0200
Subject: [PATCH] I18n: Tr()-fixes

---
 src/plugins/coreplugin/generalsettings.ui     | 18 +++--------
 .../debugger/gdb/abstractgdbadapter.cpp       | 30 +++++++++++++++++++
 src/plugins/debugger/gdb/abstractgdbadapter.h |  7 +++++
 src/plugins/debugger/gdb/attachgdbadapter.cpp |  8 ++---
 src/plugins/debugger/gdb/coregdbadapter.cpp   |  3 +-
 src/plugins/debugger/gdb/plaingdbadapter.cpp  |  8 ++---
 src/plugins/debugger/gdb/remotegdbadapter.cpp | 11 +++----
 src/plugins/debugger/gdb/trkgdbadapter.cpp    | 12 +++-----
 src/plugins/find/searchresultwindow.cpp       |  4 +--
 .../qt4projectmanager/qt4runconfiguration.cpp |  8 ++---
 10 files changed, 62 insertions(+), 47 deletions(-)

diff --git a/src/plugins/coreplugin/generalsettings.ui b/src/plugins/coreplugin/generalsettings.ui
index dd680aa10cf..b33497825c7 100644
--- a/src/plugins/coreplugin/generalsettings.ui
+++ b/src/plugins/coreplugin/generalsettings.ui
@@ -59,7 +59,7 @@
             <height>0</height>
            </size>
           </property>
-          <property name="alphaAllowed" stdset="0">
+          <property name="alphaAllowed">
            <bool>false</bool>
           </property>
          </widget>
@@ -163,6 +163,9 @@
           <property name="text">
            <string>When files are externally modified:</string>
           </property>
+          <property name="wordWrap">
+           <bool>true</bool>
+          </property>
          </widget>
         </item>
         <item>
@@ -193,19 +196,6 @@
           </item>
          </widget>
         </item>
-        <item>
-         <spacer name="horizontalSpacer_3">
-          <property name="orientation">
-           <enum>Qt::Horizontal</enum>
-          </property>
-          <property name="sizeHint" stdset="0">
-           <size>
-            <width>40</width>
-            <height>20</height>
-           </size>
-          </property>
-         </spacer>
-        </item>
        </layout>
       </item>
      </layout>
diff --git a/src/plugins/debugger/gdb/abstractgdbadapter.cpp b/src/plugins/debugger/gdb/abstractgdbadapter.cpp
index 1a523f8d1ca..52c76107606 100644
--- a/src/plugins/debugger/gdb/abstractgdbadapter.cpp
+++ b/src/plugins/debugger/gdb/abstractgdbadapter.cpp
@@ -83,5 +83,35 @@ bool AbstractGdbAdapter::isTrkAdapter() const
     return false;
 }
 
+QString AbstractGdbAdapter::msgGdbStopFailed(const QString &why)
+{
+    return tr("The Gdb process could not be stopped:\n%1").arg(why);
+}
+
+QString AbstractGdbAdapter::msgInferiorStopFailed(const QString &why)
+{
+    return tr("Inferior process could not be stopped:\n%1").arg(why);
+}
+
+QString AbstractGdbAdapter::msgInferiorStarted()
+{
+    return tr("Inferior started.");
+}
+
+QString AbstractGdbAdapter::msgInferiorRunning()
+{
+    return tr("Inferior running.");
+}
+
+QString AbstractGdbAdapter::msgAttachedToStoppedInferior()
+{
+    return tr("Attached to stopped inferior.");
+}
+
+QString AbstractGdbAdapter::msgConnectRemoteServerFailed(const QString &why)
+{
+    return tr("Connecting to remote server failed:\n%1").arg(why);
+}
+
 } // namespace Internal
 } // namespace Debugger
diff --git a/src/plugins/debugger/gdb/abstractgdbadapter.h b/src/plugins/debugger/gdb/abstractgdbadapter.h
index cafc03d491d..ecb52f9316e 100644
--- a/src/plugins/debugger/gdb/abstractgdbadapter.h
+++ b/src/plugins/debugger/gdb/abstractgdbadapter.h
@@ -93,6 +93,13 @@ protected:
     void showStatusMessage(const QString &msg) const
         { m_engine->showStatusMessage(msg); }
 
+    static QString msgGdbStopFailed(const QString &why);
+    static QString msgInferiorStopFailed(const QString &why);
+    static QString msgAttachedToStoppedInferior();
+    static QString msgInferiorStarted();
+    static QString msgInferiorRunning();
+    static QString msgConnectRemoteServerFailed(const QString &why);
+
     GdbEngine * const m_engine;
 
     QProcess m_gdbProc;
diff --git a/src/plugins/debugger/gdb/attachgdbadapter.cpp b/src/plugins/debugger/gdb/attachgdbadapter.cpp
index a43947129b7..e06790e0ab4 100644
--- a/src/plugins/debugger/gdb/attachgdbadapter.cpp
+++ b/src/plugins/debugger/gdb/attachgdbadapter.cpp
@@ -107,7 +107,7 @@ void AttachGdbAdapter::handleAttach(const GdbResponse &response)
     if (response.resultClass == GdbResultDone) {
         setState(InferiorStopped);
         debugMessage(_("INFERIOR STARTED"));
-        showStatusMessage(tr("Attached to stopped inferior."));
+        showStatusMessage(msgAttachedToStoppedInferior());
         m_engine->updateAll();
     } else if (response.resultClass == GdbResultError) {
         QString msg = __(response.data.findChild("msg").data());
@@ -155,8 +155,7 @@ void AttachGdbAdapter::handleDetach(const GdbResponse &response)
         emit inferiorShutDown();
         shutdown(); // re-iterate...
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Inferior process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
         setState(InferiorShutdownFailed);
         emit inferiorShutdownFailed(msg);
     }
@@ -167,8 +166,7 @@ void AttachGdbAdapter::handleExit(const GdbResponse &response)
     if (response.resultClass == GdbResultDone) {
         // don't set state here, this will be handled in handleGdbFinished()
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Gdb process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
         emit adapterShutdownFailed(msg);
     }
 }
diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp
index d51963606e3..dd4d5725e8e 100644
--- a/src/plugins/debugger/gdb/coregdbadapter.cpp
+++ b/src/plugins/debugger/gdb/coregdbadapter.cpp
@@ -221,8 +221,7 @@ void CoreGdbAdapter::handleExit(const GdbResponse &response)
     if (response.resultClass == GdbResultDone) {
         // don't set state here, this will be handled in handleGdbFinished()
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Gdb process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
         emit adapterShutdownFailed(msg);
     }
 }
diff --git a/src/plugins/debugger/gdb/plaingdbadapter.cpp b/src/plugins/debugger/gdb/plaingdbadapter.cpp
index 5d679527aa4..c0fdea89487 100644
--- a/src/plugins/debugger/gdb/plaingdbadapter.cpp
+++ b/src/plugins/debugger/gdb/plaingdbadapter.cpp
@@ -135,7 +135,7 @@ void PlainGdbAdapter::handleExecRun(const GdbResponse &response)
     if (response.resultClass == GdbResultRunning) {
         QTC_ASSERT(state() == InferiorRunning, qDebug() << state());
         debugMessage(_("INFERIOR STARTED"));
-        showStatusMessage(tr("Inferior started."));
+        showStatusMessage(msgInferiorStarted());
     } else {
         QTC_ASSERT(state() == InferiorRunningRequested, qDebug() << state());
         QTC_ASSERT(response.resultClass == GdbResultError, /**/);
@@ -219,8 +219,7 @@ void PlainGdbAdapter::handleKill(const GdbResponse &response)
         emit inferiorShutDown();
         shutdown(); // re-iterate...
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Inferior process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
         setState(InferiorShutdownFailed);
         emit inferiorShutdownFailed(msg);
     }
@@ -231,8 +230,7 @@ void PlainGdbAdapter::handleExit(const GdbResponse &response)
     if (response.resultClass == GdbResultDone) {
         // don't set state here, this will be handled in handleGdbFinished()
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Gdb process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
         emit adapterShutdownFailed(msg);
     }
 }
diff --git a/src/plugins/debugger/gdb/remotegdbadapter.cpp b/src/plugins/debugger/gdb/remotegdbadapter.cpp
index 71ee7852b27..0b386f8b0f6 100644
--- a/src/plugins/debugger/gdb/remotegdbadapter.cpp
+++ b/src/plugins/debugger/gdb/remotegdbadapter.cpp
@@ -212,13 +212,12 @@ void RemoteGdbAdapter::handleTargetRemote(const GdbResponse &record)
     if (record.resultClass == GdbResultDone) {
         // gdb server will stop the remote application itself.
         debugMessage(_("INFERIOR STARTED"));
-        showStatusMessage(tr("Attached to stopped inferior."));
+        showStatusMessage(msgAttachedToStoppedInferior());
         setState(InferiorStopped);
         m_engine->continueInferior();
     } else if (record.resultClass == GdbResultError) {
         // 16^error,msg="hd:5555: Connection timed out."
-        QString msg = tr("Connecting to remote server failed:\n");
-        msg += __(record.data.findChild("msg").data());
+        QString msg = msgConnectRemoteServerFailed(__(record.data.findChild("msg").data()));
         setState(InferiorPreparationFailed);
         emit inferiorStartFailed(msg);
     }
@@ -273,8 +272,7 @@ void RemoteGdbAdapter::handleKill(const GdbResponse &response)
         emit inferiorShutDown();
         shutdown(); // re-iterate...
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Inferior process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
         setState(InferiorShutdownFailed);
         emit inferiorShutdownFailed(msg);
     }
@@ -285,8 +283,7 @@ void RemoteGdbAdapter::handleExit(const GdbResponse &response)
     if (response.resultClass == GdbResultDone) {
         // don't set state here, this will be handled in handleGdbFinished()
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Gdb process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
         emit adapterShutdownFailed(msg);
     }
 }
diff --git a/src/plugins/debugger/gdb/trkgdbadapter.cpp b/src/plugins/debugger/gdb/trkgdbadapter.cpp
index a2b735777c4..1db8f66ff08 100644
--- a/src/plugins/debugger/gdb/trkgdbadapter.cpp
+++ b/src/plugins/debugger/gdb/trkgdbadapter.cpp
@@ -1702,11 +1702,9 @@ void TrkGdbAdapter::handleFirstContinue(const GdbResponse &record)
     QTC_ASSERT(state() == InferiorRunning, qDebug() << state());
     if (record.resultClass == GdbResultDone) {
         debugMessage(_("INFERIOR STARTED"));
-        showStatusMessage(tr("Inferior running."));
+        showStatusMessage(msgInferiorRunning());
     } else if (record.resultClass == GdbResultError) {
-        //QString msg = __(record.data.findChild("msg").data());
-        QString msg1 = tr("Connecting to remote server failed:");
-        emit inferiorStartFailed(msg1 + record.toString());
+        emit inferiorStartFailed(msgConnectRemoteServerFailed(record.toString()));
     }
 }
 
@@ -2083,8 +2081,7 @@ void TrkGdbAdapter::handleKill(const GdbResponse &response)
         emit inferiorShutDown();
         shutdown(); // re-iterate...
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Inferior process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgInferiorStopFailed(__(response.data.findChild("msg").data()));
         setState(InferiorShutdownFailed);
         emit inferiorShutdownFailed(msg);
     }
@@ -2096,8 +2093,7 @@ void TrkGdbAdapter::handleExit(const GdbResponse &response)
         qDebug() << "EXITED, NO MESSAGE...";
         // don't set state here, this will be handled in handleGdbFinished()
     } else if (response.resultClass == GdbResultError) {
-        QString msg = tr("Gdb process could not be stopped:\n") +
-            __(response.data.findChild("msg").data());
+        const QString msg = msgGdbStopFailed(__(response.data.findChild("msg").data()));
         emit adapterShutdownFailed(msg);
     }
 }
diff --git a/src/plugins/find/searchresultwindow.cpp b/src/plugins/find/searchresultwindow.cpp
index a995dfc5b7b..c60e2d6c9ee 100644
--- a/src/plugins/find/searchresultwindow.cpp
+++ b/src/plugins/find/searchresultwindow.cpp
@@ -78,7 +78,7 @@ SearchResultWindow::SearchResultWindow()
     m_replaceLabel->setContentsMargins(12, 0, 5, 0);
     m_replaceTextEdit = new QLineEdit(m_widget);
     m_replaceButton = new QToolButton(m_widget);
-    m_replaceButton->setToolTip(tr("Replace all occurances"));
+    m_replaceButton->setToolTip(tr("Replace all occurrences"));
     m_replaceButton->setText(tr("Replace"));
     m_replaceButton->setToolButtonStyle(Qt::ToolButtonTextOnly);
     m_replaceButton->setAutoRaise(true);
@@ -234,7 +234,7 @@ void SearchResultWindow::setTextEditorFont(const QFont &font)
     m_searchResultTreeView->setTextEditorFont(font);
 }
 
-void SearchResultWindow::handleJumpToSearchResult(int index, bool checked)
+void SearchResultWindow::handleJumpToSearchResult(int index, bool /* checked */)
 {
     QTC_ASSERT(m_currentSearch, return);
     m_currentSearch->activated(m_items.at(index));
diff --git a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
index 2c4083ad46f..4c7a31e13bc 100644
--- a/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
+++ b/src/plugins/qt4projectmanager/qt4runconfiguration.cpp
@@ -241,10 +241,10 @@ void Qt4RunConfigurationWidget::updateSummary()
 {
     const QString &filename = QFileInfo(m_qt4RunConfiguration->executable()).fileName();
     const QString &arguments = ProjectExplorer::Environment::joinArgumentList(m_qt4RunConfiguration->commandLineArguments());
-    QString text = tr("Running executable: <b>%1</b> %2 %3").arg(
-            filename,
-            arguments,
-            m_qt4RunConfiguration->runMode() == LocalApplicationRunConfiguration::Console ? tr("(in terminal)") : "");
+    const bool terminal = m_qt4RunConfiguration->runMode() == LocalApplicationRunConfiguration::Console;
+    const QString text = terminal ?
+                         tr("Running executable: <b>%1</b> %2 (in terminal)").arg(filename, arguments) :
+                         tr("Running executable: <b>%1</b> %2").arg(filename, arguments);
     m_detailsContainer->setSummaryText(text);
 }
 
-- 
GitLab