diff options
author | hjk <[email protected]> | 2022-07-13 10:43:31 +0200 |
---|---|---|
committer | hjk <[email protected]> | 2022-07-14 12:40:57 +0000 |
commit | 57ce33bc4e3c1855bf457eeef02f12cbbca21d3e (patch) | |
tree | 0089d410561ab029da53f3bb0e4c61edef28b8b7 | |
parent | 4ca769afb1f7c1fb3a5c8c4ada270ac442f7826e (diff) |
Docker: Move to Tr::tr
There were no strings in the .ts files yet.
Change-Id: I86e7edace45db796fc3cc80d2735d1a80b897c85
Reviewed-by: Eike Ziller <[email protected]>
-rw-r--r-- | src/plugins/docker/dockerapi.cpp | 12 | ||||
-rw-r--r-- | src/plugins/docker/dockerapi.h | 13 | ||||
-rw-r--r-- | src/plugins/docker/dockerconstants.h | 11 | ||||
-rw-r--r-- | src/plugins/docker/dockerdevice.cpp | 48 | ||||
-rw-r--r-- | src/plugins/docker/dockerdevice.h | 8 | ||||
-rw-r--r-- | src/plugins/docker/dockerdevicewidget.cpp | 70 | ||||
-rw-r--r-- | src/plugins/docker/dockerdevicewidget.h | 18 | ||||
-rw-r--r-- | src/plugins/docker/dockerplugin.cpp | 6 | ||||
-rw-r--r-- | src/plugins/docker/dockerplugin.h | 6 | ||||
-rw-r--r-- | src/plugins/docker/dockersettings.cpp | 15 | ||||
-rw-r--r-- | src/plugins/docker/dockersettings.h | 11 | ||||
-rw-r--r-- | src/plugins/docker/kitdetector.cpp | 55 | ||||
-rw-r--r-- | src/plugins/docker/kitdetector.h | 6 |
13 files changed, 127 insertions, 152 deletions
diff --git a/src/plugins/docker/dockerapi.cpp b/src/plugins/docker/dockerapi.cpp index af9dc79661f..ca43fce0e99 100644 --- a/src/plugins/docker/dockerapi.cpp +++ b/src/plugins/docker/dockerapi.cpp @@ -25,6 +25,8 @@ #include "dockerapi.h" +#include "dockertr.h" + #include <coreplugin/progressmanager/progressmanager.h> #include <utils/qtcassert.h> #include <utils/qtcprocess.h> @@ -36,11 +38,10 @@ Q_LOGGING_CATEGORY(dockerApiLog, "qtc.docker.api", QtDebugMsg); -namespace Docker { -namespace Internal { - using namespace Utils; +namespace Docker::Internal { + DockerApi *s_instance{nullptr}; DockerApi::DockerApi(DockerSettings *settings) @@ -91,7 +92,7 @@ void DockerApi::checkCanConnect(bool async) emit dockerDaemonAvailableChanged(); }); - Core::ProgressManager::addTask(future, tr("Checking docker daemon"), "DockerPlugin"); + Core::ProgressManager::addTask(future, Tr::tr("Checking docker daemon"), "DockerPlugin"); return; } @@ -127,5 +128,4 @@ FilePath DockerApi::dockerClient() return FilePath::fromString(m_settings->dockerBinaryPath.value()); } -} // namespace Internal -} // namespace Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockerapi.h b/src/plugins/docker/dockerapi.h index 815caff2ecb..7f08bfa0dbb 100644 --- a/src/plugins/docker/dockerapi.h +++ b/src/plugins/docker/dockerapi.h @@ -27,15 +27,14 @@ #include "dockersettings.h" -#include <QMutex> -#include <QObject> - #include <utils/filepath.h> #include <utils/guard.h> #include <utils/optional.h> -namespace Docker { -namespace Internal { +#include <QMutex> +#include <QObject> + +namespace Docker::Internal { class DockerApi : public QObject { @@ -60,11 +59,9 @@ public: private: Utils::FilePath dockerClient(); -private: Utils::optional<bool> m_dockerDaemonAvailable; QMutex m_daemonCheckGuard; DockerSettings *m_settings; }; -} // namespace Internal -} // namespace Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockerconstants.h b/src/plugins/docker/dockerconstants.h index 8c52da4b6ae..8dc823a65ba 100644 --- a/src/plugins/docker/dockerconstants.h +++ b/src/plugins/docker/dockerconstants.h @@ -23,18 +23,13 @@ ** ****************************************************************************/ -#ifndef DOCKERCONSTANTS_H -#define DOCKERCONSTANTS_H +#pragma once -namespace Docker { -namespace Constants { +namespace Docker::Constants { const char DOCKER[] = "docker"; const char DOCKER_SETTINGS_ID[] = "Docker.Settings"; const char DOCKER_DEVICE_TYPE[] = "DockerDeviceType"; -} // namespace Constants -} // namespace Docker - -#endif // DOCKERCONSTANTS_H +} // Docker::Constants diff --git a/src/plugins/docker/dockerdevice.cpp b/src/plugins/docker/dockerdevice.cpp index f7a1e71795c..a3e157ad68a 100644 --- a/src/plugins/docker/dockerdevice.cpp +++ b/src/plugins/docker/dockerdevice.cpp @@ -25,8 +25,10 @@ #include "dockerdevice.h" +#include "dockerapi.h" #include "dockerconstants.h" #include "dockerdevicewidget.h" +#include "dockertr.h" #include "kitdetector.h" #include <extensionsystem/pluginmanager.h> @@ -95,8 +97,7 @@ using namespace ProjectExplorer; using namespace QtSupport; using namespace Utils; -namespace Docker { -namespace Internal { +namespace Docker::Internal { const QString s_pidMarker = "__qtc$$qtc__"; @@ -125,8 +126,6 @@ private: class DockerDevicePrivate : public QObject { - Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerDevice) - public: DockerDevicePrivate(DockerDevice *parent, DockerSettings *settings) : q(parent) @@ -298,8 +297,8 @@ Tasks DockerDevice::validate() const Tasks result; if (d->m_data.mounts.isEmpty()) { result << Task(Task::Error, - tr("The docker device has not set up shared directories." - "This will not work for building."), + Tr::tr("The docker device has not set up shared directories." + "This will not work for building."), {}, -1, {}); } return result; @@ -325,17 +324,17 @@ DockerDevice::DockerDevice(DockerSettings *settings, const DockerDeviceData &dat { d->m_data = data; - setDisplayType(tr("Docker")); + setDisplayType(Tr::tr("Docker")); setOsType(OsTypeOtherUnix); - setDefaultDisplayName(tr("Docker Image"));; - setDisplayName(tr("Docker Image \"%1\" (%2)").arg(data.repoAndTag()).arg(data.imageId)); + setDefaultDisplayName(Tr::tr("Docker Image"));; + setDisplayName(Tr::tr("Docker Image \"%1\" (%2)").arg(data.repoAndTag()).arg(data.imageId)); setAllowEmptyCommand(true); setOpenTerminal([this, settings](const Environment &env, const FilePath &workingDir) { Q_UNUSED(env); // TODO: That's the runnable's environment in general. Use it via -e below. updateContainerAccess(); if (d->m_container.isEmpty()) { - MessageManager::writeDisrupting(tr("Error starting remote shell. No container.")); + MessageManager::writeDisrupting(Tr::tr("Error starting remote shell. No container.")); return; } @@ -344,7 +343,7 @@ DockerDevice::DockerDevice(DockerSettings *settings, const DockerDeviceData &dat QObject::connect(proc, &QtcProcess::done, [proc] { if (proc->error() != QProcess::UnknownError && MessageManager::instance()) - MessageManager::writeDisrupting(tr("Error starting remote shell.")); + MessageManager::writeDisrupting(Tr::tr("Error starting remote shell.")); proc->deleteLater(); }); @@ -354,7 +353,7 @@ DockerDevice::DockerDevice(DockerSettings *settings, const DockerDeviceData &dat proc->start(); }); - addDeviceAction({tr("Open Shell in Container"), [](const IDevice::Ptr &device, QWidget *) { + addDeviceAction({Tr::tr("Open Shell in Container"), [](const IDevice::Ptr &device, QWidget *) { device->openTerminal(device->systemEnvironment(), FilePath()); }}); } @@ -472,10 +471,10 @@ void DockerDevicePrivate::startContainer() m_shell.reset(); DockerApi::recheckDockerDaemon(); - MessageManager::writeFlashing(tr("Docker daemon appears to be not running. " - "Verify daemon is up and running and reset the " - "docker daemon on the docker device settings page " - "or restart Qt Creator.")); + MessageManager::writeFlashing(Tr::tr("Docker daemon appears to be not running. " + "Verify daemon is up and running and reset the " + "docker daemon on the docker device settings page " + "or restart Qt Creator.")); }); if (!m_shell->start()) { @@ -1085,7 +1084,7 @@ public: : QDialog(ICore::dialogParent()) , m_settings(settings) { - setWindowTitle(DockerDevice::tr("Docker Image Selection")); + setWindowTitle(Tr::tr("Docker Image Selection")); resize(800, 600); m_model.setHeader({"Repository", "Tag", "Image", "Size"}); @@ -1120,7 +1119,7 @@ public: m_buttons->button(QDialogButtonBox::Ok)->setEnabled(false); CommandLine cmd{m_settings->dockerBinaryPath.filePath(), {"images", "--format", "{{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.Size}}"}}; - m_log->append(DockerDevice::tr("Running \"%1\"\n").arg(cmd.toUserOutput())); + m_log->append(Tr::tr("Running \"%1\"\n").arg(cmd.toUserOutput())); m_process = new QtcProcess(this); m_process->setCommand(cmd); @@ -1131,7 +1130,7 @@ public: for (const QString &line : out.split('\n')) { const QStringList parts = line.trimmed().split('\t'); if (parts.size() != 4) { - m_log->append(DockerDevice::tr("Unexpected result: %1").arg(line) + '\n'); + m_log->append(Tr::tr("Unexpected result: %1").arg(line) + '\n'); continue; } auto item = new DockerImageItem; @@ -1141,12 +1140,12 @@ public: item->size = parts.at(3); m_model.rootItem()->appendChild(item); } - m_log->append(DockerDevice::tr("Done.")); + m_log->append(Tr::tr("Done.")); }); connect(m_process, &Utils::QtcProcess::readyReadStandardError, this, [this] { - const QString out = DockerDevice::tr("Error: %1").arg(m_process->cleanedStdErr()); - m_log->append(DockerDevice::tr("Error: %1").arg(out)); + const QString out = Tr::tr("Error: %1").arg(m_process->cleanedStdErr()); + m_log->append(Tr::tr("Error: %1").arg(out)); }); connect(m_process, &QtcProcess::done, errorLabel, [errorLabel, this] { @@ -1193,7 +1192,7 @@ public: DockerDeviceFactory::DockerDeviceFactory(DockerSettings *settings) : IDeviceFactory(Constants::DOCKER_DEVICE_TYPE) { - setDisplayName(DockerDevice::tr("Docker Device")); + setDisplayName(Tr::tr("Docker Device")); setIcon(QIcon()); setCreator([settings] { DockerDeviceSetupWizard wizard(settings); @@ -1218,5 +1217,4 @@ void DockerDeviceFactory::shutdownExistingDevices() } } -} // Internal -} // Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockerdevice.h b/src/plugins/docker/dockerdevice.h index 16fe4ef9dc7..aead51456a6 100644 --- a/src/plugins/docker/dockerdevice.h +++ b/src/plugins/docker/dockerdevice.h @@ -35,8 +35,7 @@ #include <QMutex> -namespace Docker { -namespace Internal { +namespace Docker::Internal { class DockerDeviceData { @@ -54,8 +53,6 @@ public: class DockerDevice : public ProjectExplorer::IDevice { - Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerDevice) - public: using Ptr = QSharedPointer<DockerDevice>; using ConstPtr = QSharedPointer<const DockerDevice>; @@ -148,7 +145,6 @@ private: std::vector<QWeakPointer<DockerDevice> > m_existingDevices; }; -} // Internal -} // Docker +} // Docker::Internal Q_DECLARE_METATYPE(Docker::Internal::DockerDeviceData) diff --git a/src/plugins/docker/dockerdevicewidget.cpp b/src/plugins/docker/dockerdevicewidget.cpp index 0c1e6840538..b2e92999eb3 100644 --- a/src/plugins/docker/dockerdevicewidget.cpp +++ b/src/plugins/docker/dockerdevicewidget.cpp @@ -25,6 +25,10 @@ #include "dockerdevicewidget.h" +#include "dockerapi.h" +#include "dockerdevice.h" +#include "dockertr.h" + #include <utils/algorithm.h> #include <utils/environment.h> #include <utils/hostosinfo.h> @@ -32,17 +36,16 @@ #include <utils/qtcassert.h> #include <utils/utilsicons.h> -#include <QCoreApplication> -#include <QToolButton> -#include <QTextBrowser> -#include <QPushButton> +#include <QCheckBox> #include <QComboBox> +#include <QPushButton> +#include <QTextBrowser> +#include <QToolButton> using namespace ProjectExplorer; using namespace Utils; -namespace Docker { -namespace Internal { +namespace Docker::Internal { DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) : IDeviceWidget(device), m_kitItemDetector(device) @@ -52,24 +55,24 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) DockerDeviceData &data = dockerDevice->data(); - auto repoLabel = new QLabel(tr("Repository:")); + auto repoLabel = new QLabel(Tr::tr("Repository:")); m_repoLineEdit = new QLineEdit; m_repoLineEdit->setText(data.repo); m_repoLineEdit->setEnabled(false); - auto tagLabel = new QLabel(tr("Tag:")); + auto tagLabel = new QLabel(Tr::tr("Tag:")); m_tagLineEdit = new QLineEdit; m_tagLineEdit->setText(data.tag); m_tagLineEdit->setEnabled(false); - auto idLabel = new QLabel(tr("Image ID:")); + auto idLabel = new QLabel(Tr::tr("Image ID:")); m_idLineEdit = new QLineEdit; m_idLineEdit->setText(data.imageId); m_idLineEdit->setEnabled(false); - auto daemonStateLabel = new QLabel(tr("Daemon state:")); + auto daemonStateLabel = new QLabel(Tr::tr("Daemon state:")); m_daemonReset = new QToolButton; - m_daemonReset->setToolTip(tr("Clears detected daemon state. " + m_daemonReset->setToolTip(Tr::tr("Clears detected daemon state. " "It will be automatically re-evaluated next time access is needed.")); m_daemonState = new QLabel; @@ -84,9 +87,9 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) DockerApi::recheckDockerDaemon(); }); - m_runAsOutsideUser = new QCheckBox(tr("Run as outside user")); - m_runAsOutsideUser->setToolTip(tr("Uses user ID and group ID of the user running Qt Creator " - "in the docker container.")); + m_runAsOutsideUser = new QCheckBox(Tr::tr("Run as outside user")); + m_runAsOutsideUser->setToolTip(Tr::tr("Uses user ID and group ID of the user running Qt Creator " + "in the docker container.")); m_runAsOutsideUser->setChecked(data.useLocalUidGid); m_runAsOutsideUser->setEnabled(HostOsInfo::isLinuxHost()); @@ -94,13 +97,13 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) data.useLocalUidGid = on; }); - auto pathListLabel = new InfoLabel(tr("Paths to mount:")); - pathListLabel->setAdditionalToolTip(tr("Source directory list should not be empty.")); + auto pathListLabel = new InfoLabel(Tr::tr("Paths to mount:")); + pathListLabel->setAdditionalToolTip(Tr::tr("Source directory list should not be empty.")); m_pathsListEdit = new PathListEditor; - m_pathsListEdit->setPlaceholderText(tr("Host directories to mount into the container")); - m_pathsListEdit->setToolTip(tr("Maps paths in this list one-to-one to the " - "docker container.")); + m_pathsListEdit->setPlaceholderText(Tr::tr("Host directories to mount into the container")); + m_pathsListEdit->setToolTip(Tr::tr("Maps paths in this list one-to-one to the " + "docker container.")); m_pathsListEdit->setPathList(data.mounts); auto markupMounts = [this, pathListLabel] { @@ -118,19 +121,19 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) connect(&m_kitItemDetector, &KitDetector::logOutput, logView, &QTextBrowser::append); - auto autoDetectButton = new QPushButton(tr("Auto-detect Kit Items")); - auto undoAutoDetectButton = new QPushButton(tr("Remove Auto-Detected Kit Items")); - auto listAutoDetectedButton = new QPushButton(tr("List Auto-Detected Kit Items")); + auto autoDetectButton = new QPushButton(Tr::tr("Auto-detect Kit Items")); + auto undoAutoDetectButton = new QPushButton(Tr::tr("Remove Auto-Detected Kit Items")); + auto listAutoDetectedButton = new QPushButton(Tr::tr("List Auto-Detected Kit Items")); auto searchDirsComboBox = new QComboBox; - searchDirsComboBox->addItem(tr("Search in PATH")); - searchDirsComboBox->addItem(tr("Search in Selected Directories")); + searchDirsComboBox->addItem(Tr::tr("Search in PATH")); + searchDirsComboBox->addItem(Tr::tr("Search in Selected Directories")); auto searchDirsLineEdit = new FancyLineEdit; - searchDirsLineEdit->setPlaceholderText(tr("Semicolon-separated list of directories")); + searchDirsLineEdit->setPlaceholderText(Tr::tr("Semicolon-separated list of directories")); searchDirsLineEdit->setToolTip( - tr("Select the paths in the docker image that should be scanned for kit entries.")); + Tr::tr("Select the paths in the docker image that should be scanned for kit entries.")); searchDirsLineEdit->setHistoryCompleter("DockerMounts", true); auto searchPaths = [searchDirsComboBox, searchDirsLineEdit, dockerDevice] { @@ -155,9 +158,9 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) m_kitItemDetector.autoDetect(dockerDevice->id().toString(), searchPaths()); if (DockerApi::instance()->dockerDaemonAvailable().value_or(false) == false) - logView->append(tr("Docker daemon appears to be not running.")); + logView->append(Tr::tr("Docker daemon appears to be not running.")); else - logView->append(tr("Docker daemon appears to be running.")); + logView->append(Tr::tr("Docker daemon appears to be running.")); updateDaemonStateTexts(); }); @@ -195,7 +198,7 @@ DockerDeviceWidget::DockerDeviceWidget(const IDevice::Ptr &device) listAutoDetectedButton, Stretch(), }, - new QLabel(tr("Detection log:")), + new QLabel(Tr::tr("Detection log:")), logView } }.attachTo(this); @@ -215,15 +218,14 @@ void DockerDeviceWidget::updateDaemonStateTexts() Utils::optional<bool> daemonState = DockerApi::instance()->dockerDaemonAvailable(); if (!daemonState.has_value()) { m_daemonReset->setIcon(Icons::INFO.icon()); - m_daemonState->setText(tr("Daemon state not evaluated.")); + m_daemonState->setText(Tr::tr("Daemon state not evaluated.")); } else if (daemonState.value()) { m_daemonReset->setIcon(Icons::OK.icon()); - m_daemonState->setText(tr("Docker daemon running.")); + m_daemonState->setText(Tr::tr("Docker daemon running.")); } else { m_daemonReset->setIcon(Icons::CRITICAL.icon()); - m_daemonState->setText(tr("Docker daemon not running.")); + m_daemonState->setText(Tr::tr("Docker daemon not running.")); } } -} // Internal -} // Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockerdevicewidget.h b/src/plugins/docker/dockerdevicewidget.h index f63a5cfc84b..e73569af895 100644 --- a/src/plugins/docker/dockerdevicewidget.h +++ b/src/plugins/docker/dockerdevicewidget.h @@ -25,23 +25,24 @@ #pragma once -#include "dockerplugin.h" -#include "dockerdevice.h" #include "kitdetector.h" +#include <projectexplorer/devicesupport/idevice.h> #include <projectexplorer/devicesupport/idevicewidget.h> #include <utils/pathlisteditor.h> -#include <QCheckBox> +QT_BEGIN_NAMESPACE +class QCheckBox; +class QLabel; +class QLineEdit; +class QToolButton; +QT_END_NAMESPACE -namespace Docker { -namespace Internal { +namespace Docker::Internal { class DockerDeviceWidget final : public ProjectExplorer::IDeviceWidget { - Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerDevice) - public: explicit DockerDeviceWidget(const ProjectExplorer::IDevice::Ptr &device); @@ -59,5 +60,4 @@ private: KitDetector m_kitItemDetector; }; -} // Internal -} // Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockerplugin.cpp b/src/plugins/docker/dockerplugin.cpp index 71e9837a4fb..9e6a33789ba 100644 --- a/src/plugins/docker/dockerplugin.cpp +++ b/src/plugins/docker/dockerplugin.cpp @@ -37,8 +37,7 @@ using namespace Core; using namespace ProjectExplorer; using namespace Utils; -namespace Docker { -namespace Internal { +namespace Docker::Internal { class DockerPluginPrivate { @@ -82,5 +81,4 @@ bool DockerPlugin::initialize(const QStringList &arguments, QString *errorString return true; } -} // namespace Internal -} // namespace Docker +} // Docker::Interanl diff --git a/src/plugins/docker/dockerplugin.h b/src/plugins/docker/dockerplugin.h index 7eb1d3b10b4..8f5ecc86820 100644 --- a/src/plugins/docker/dockerplugin.h +++ b/src/plugins/docker/dockerplugin.h @@ -31,8 +31,7 @@ #include <utils/optional.h> -namespace Docker { -namespace Internal { +namespace Docker::Internal { class DockerPlugin final : public ExtensionSystem::IPlugin { @@ -52,5 +51,4 @@ private: class DockerPluginPrivate *d = nullptr; }; -} // namespace Internal -} // namespace Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockersettings.cpp b/src/plugins/docker/dockersettings.cpp index 06e1397e5b6..bd5c5d9e8b4 100644 --- a/src/plugins/docker/dockersettings.cpp +++ b/src/plugins/docker/dockersettings.cpp @@ -26,6 +26,7 @@ #include "dockersettings.h" #include "dockerconstants.h" +#include "dockertr.h" #include <coreplugin/icore.h> @@ -36,8 +37,7 @@ using namespace Utils; -namespace Docker { -namespace Internal { +namespace Docker::Internal { DockerSettings::DockerSettings() { @@ -48,9 +48,9 @@ DockerSettings::DockerSettings() dockerBinaryPath.setDisplayStyle(StringAspect::PathChooserDisplay); dockerBinaryPath.setExpectedKind(PathChooser::ExistingCommand); dockerBinaryPath.setDefaultFilePath(FilePath::fromString("docker").searchInPath({"/usr/local/bin"})); - dockerBinaryPath.setDisplayName(tr("Docker CLI")); + dockerBinaryPath.setDisplayName(Tr::tr("Docker CLI")); dockerBinaryPath.setHistoryCompleter("Docker.Command.History"); - dockerBinaryPath.setLabelText(tr("Command:")); + dockerBinaryPath.setLabelText(Tr::tr("Command:")); dockerBinaryPath.setSettingsKey("cli"); readSettings(Core::ICore::settings()); @@ -61,7 +61,7 @@ DockerSettings::DockerSettings() DockerSettingsPage::DockerSettingsPage(DockerSettings *settings) { setId(Docker::Constants::DOCKER_SETTINGS_ID); - setDisplayName(DockerSettings::tr("Docker")); + setDisplayName(Tr::tr("Docker")); setCategory(ProjectExplorer::Constants::DEVICE_SETTINGS_CATEGORY); setSettings(settings); @@ -72,7 +72,7 @@ DockerSettingsPage::DockerSettingsPage(DockerSettings *settings) // clang-format off Column { Group { - Title(DockerSettings::tr("Configuration")), + Title(Tr::tr("Configuration")), Row { s.dockerBinaryPath } }, Stretch() @@ -81,5 +81,4 @@ DockerSettingsPage::DockerSettingsPage(DockerSettings *settings) }); } -} // namespace Internal -} // namespace Docker +} // Docker::Internal diff --git a/src/plugins/docker/dockersettings.h b/src/plugins/docker/dockersettings.h index f5c535c5678..4cecbf92393 100644 --- a/src/plugins/docker/dockersettings.h +++ b/src/plugins/docker/dockersettings.h @@ -25,16 +25,14 @@ #pragma once -#include "coreplugin/dialogs/ioptionspage.h" +#include <coreplugin/dialogs/ioptionspage.h> + #include <utils/aspects.h> -namespace Docker { -namespace Internal { +namespace Docker::Internal { class DockerSettings final : public Utils::AspectContainer { - Q_DECLARE_TR_FUNCTIONS(Docker::Internal::DockerSettings) - public: DockerSettings(); @@ -47,5 +45,4 @@ public: explicit DockerSettingsPage(DockerSettings *settings); }; -} // namespace Internal -} // namespace Docker +} // Docker::Internal diff --git a/src/plugins/docker/kitdetector.cpp b/src/plugins/docker/kitdetector.cpp index 5e0c2e86598..de568287343 100644 --- a/src/plugins/docker/kitdetector.cpp +++ b/src/plugins/docker/kitdetector.cpp @@ -30,6 +30,7 @@ #include <extensionsystem/pluginmanager.h> #include <projectexplorer/devicesupport/idevice.h> +#include <projectexplorer/projectexplorertr.h> #include <projectexplorer/toolchain.h> #include <projectexplorer/toolchainmanager.h> @@ -48,13 +49,10 @@ using namespace ProjectExplorer; using namespace QtSupport; using namespace Utils; -namespace Docker { -namespace Internal { +namespace Docker::Internal { class KitDetectorPrivate { - Q_DECLARE_TR_FUNCTIONS(ProjectExplorer::KitItemDetector) - public: KitDetectorPrivate(KitDetector *parent, const IDevice::ConstPtr &device) : q(parent) @@ -110,29 +108,29 @@ void KitDetector::listAutoDetected(const QString &sharedId) const void KitDetectorPrivate::undoAutoDetect() const { - emit q->logOutput(tr("Start removing auto-detected items associated with this docker image.")); + emit q->logOutput(ProjectExplorer::Tr::tr("Start removing auto-detected items associated with this docker image.")); - emit q->logOutput('\n' + tr("Removing kits...")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Removing kits...")); for (Kit *kit : KitManager::kits()) { if (kit->autoDetectionSource() == m_sharedId) { - emit q->logOutput(tr("Removed \"%1\"").arg(kit->displayName())); + emit q->logOutput(ProjectExplorer::Tr::tr("Removed \"%1\"").arg(kit->displayName())); KitManager::deregisterKit(kit); } }; - emit q->logOutput('\n' + tr("Removing Qt version entries...")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Removing Qt version entries...")); for (QtVersion *qtVersion : QtVersionManager::versions()) { if (qtVersion->detectionSource() == m_sharedId) { - emit q->logOutput(tr("Removed \"%1\"").arg(qtVersion->displayName())); + emit q->logOutput(ProjectExplorer::Tr::tr("Removed \"%1\"").arg(qtVersion->displayName())); QtVersionManager::removeVersion(qtVersion); } }; - emit q->logOutput('\n' + tr("Removing toolchain entries...")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Removing toolchain entries...")); const Toolchains toolchains = ToolChainManager::toolchains(); for (ToolChain *toolChain : toolchains) { if (toolChain && toolChain->detectionSource() == m_sharedId) { - emit q->logOutput(tr("Removed \"%1\"").arg(toolChain->displayName())); + emit q->logOutput(ProjectExplorer::Tr::tr("Removed \"%1\"").arg(toolChain->displayName())); ToolChainManager::deregisterToolChain(toolChain); } }; @@ -157,26 +155,26 @@ void KitDetectorPrivate::undoAutoDetect() const emit q->logOutput('\n' + logMessage); } - emit q->logOutput('\n' + tr("Removal of previously auto-detected kit items finished.") + "\n\n"); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Removal of previously auto-detected kit items finished.") + "\n\n"); } void KitDetectorPrivate::listAutoDetected() const { - emit q->logOutput(tr("Start listing auto-detected items associated with this docker image.")); + emit q->logOutput(ProjectExplorer::Tr::tr("Start listing auto-detected items associated with this docker image.")); - emit q->logOutput('\n' + tr("Kits:")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Kits:")); for (Kit *kit : KitManager::kits()) { if (kit->autoDetectionSource() == m_sharedId) emit q->logOutput(kit->displayName()); } - emit q->logOutput('\n' + tr("Qt versions:")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Qt versions:")); for (QtVersion *qtVersion : QtVersionManager::versions()) { if (qtVersion->detectionSource() == m_sharedId) emit q->logOutput(qtVersion->displayName()); } - emit q->logOutput('\n' + tr("Toolchains:")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Toolchains:")); for (ToolChain *toolChain : ToolChainManager::toolchains()) { if (toolChain->detectionSource() == m_sharedId) emit q->logOutput(toolChain->displayName()); @@ -204,7 +202,7 @@ void KitDetectorPrivate::listAutoDetected() const emit q->logOutput('\n' + logMessage); } - emit q->logOutput('\n' + tr("Listing of previously auto-detected kit items finished.") + "\n\n"); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Listing of previously auto-detected kit items finished.") + "\n\n"); } QtVersions KitDetectorPrivate::autoDetectQtVersions() const @@ -227,14 +225,14 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const qtVersions.append(qtVersion); QtVersionManager::addVersion(qtVersion); emit q->logOutput( - tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput())); + ProjectExplorer::Tr::tr("Found \"%1\"").arg(qtVersion->qmakeFilePath().toUserOutput())); } } } return true; }; - emit q->logOutput(tr("Searching for qmake executables...")); + emit q->logOutput(ProjectExplorer::Tr::tr("Searching for qmake executables...")); const QStringList candidates = {"qmake-qt6", "qmake-qt5", "qmake"}; for (const FilePath &searchPath : m_searchPaths) { @@ -245,9 +243,9 @@ QtVersions KitDetectorPrivate::autoDetectQtVersions() const } if (!error.isEmpty()) - emit q->logOutput(tr("Error: %1.").arg(error)); + emit q->logOutput(ProjectExplorer::Tr::tr("Error: %1.").arg(error)); if (qtVersions.isEmpty()) - emit q->logOutput(tr("No Qt installation found.")); + emit q->logOutput(ProjectExplorer::Tr::tr("No Qt installation found.")); return qtVersions; } @@ -258,20 +256,20 @@ Toolchains KitDetectorPrivate::autoDetectToolChains() Toolchains alreadyKnown = ToolChainManager::toolchains(); Toolchains allNewToolChains; QApplication::processEvents(); - emit q->logOutput('\n' + tr("Searching toolchains...")); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Searching toolchains...")); for (ToolChainFactory *factory : factories) { - emit q->logOutput(tr("Searching toolchains of type %1").arg(factory->displayName())); + emit q->logOutput(ProjectExplorer::Tr::tr("Searching toolchains of type %1").arg(factory->displayName())); const ToolchainDetector detector(alreadyKnown, m_device, m_searchPaths); const Toolchains newToolChains = factory->autoDetect(detector); for (ToolChain *toolChain : newToolChains) { - emit q->logOutput(tr("Found \"%1\"").arg(toolChain->compilerCommand().toUserOutput())); + emit q->logOutput(ProjectExplorer::Tr::tr("Found \"%1\"").arg(toolChain->compilerCommand().toUserOutput())); toolChain->setDetectionSource(m_sharedId); ToolChainManager::registerToolChain(toolChain); alreadyKnown.append(toolChain); } allNewToolChains.append(newToolChains); } - emit q->logOutput(tr("%1 new toolchains found.").arg(allNewToolChains.size())); + emit q->logOutput(ProjectExplorer::Tr::tr("%1 new toolchains found.").arg(allNewToolChains.size())); return allNewToolChains; } @@ -318,7 +316,7 @@ void KitDetectorPrivate::autoDetect() undoAutoDetect(); - emit q->logOutput(tr("Starting auto-detection. This will take a while...")); + emit q->logOutput(ProjectExplorer::Tr::tr("Starting auto-detection. This will take a while...")); const Toolchains toolchains = autoDetectToolChains(); const QtVersions qtVersions = autoDetectQtVersions(); @@ -363,10 +361,9 @@ void KitDetectorPrivate::autoDetect() }; Kit *kit = KitManager::registerKit(initializeKit); - emit q->logOutput('\n' + tr("Registered kit %1").arg(kit->displayName())); + emit q->logOutput('\n' + ProjectExplorer::Tr::tr("Registered kit %1").arg(kit->displayName())); QApplication::restoreOverrideCursor(); } -} // namespace Internal -} // namespace Docker +} // Docker::Internal diff --git a/src/plugins/docker/kitdetector.h b/src/plugins/docker/kitdetector.h index 6e19d6f9597..43b6f1b46bd 100644 --- a/src/plugins/docker/kitdetector.h +++ b/src/plugins/docker/kitdetector.h @@ -30,8 +30,7 @@ #include <QObject> -namespace Docker { -namespace Internal { +namespace Docker::Internal { class KitDetector : public QObject { @@ -52,5 +51,4 @@ private: class KitDetectorPrivate *d = nullptr; }; -} // Internal -} // Docker +} // Docker::Internal |