Apply clang-format
This commit is contained in:
parent
35eb90e88c
commit
d3a559446f
|
@ -56,9 +56,9 @@
|
|||
#if defined(PLATFORM_LINUX) && !defined(Q_OS_ANDROID)
|
||||
#include <QStandardPaths>
|
||||
#elif defined(PLATFORM_WINDOWS)
|
||||
#include <QSettings>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
#include <QSettings>
|
||||
#elif defined(PLATFORM_MAC)
|
||||
#include <QFileInfo>
|
||||
#endif
|
||||
|
@ -803,7 +803,8 @@ std::optional<QString> configuredAutostartPath()
|
|||
return captured.isNull() ? std::nullopt : std::make_optional(captured);
|
||||
#elif defined(PLATFORM_WINDOWS)
|
||||
return QSettings(QStringLiteral("HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), QSettings::NativeFormat)
|
||||
.value(QStringLiteral(PROJECT_NAME)).toString();
|
||||
.value(QStringLiteral(PROJECT_NAME))
|
||||
.toString();
|
||||
#else
|
||||
return std::nullopt;
|
||||
#endif
|
||||
|
@ -953,7 +954,7 @@ bool setAutostartEnabled(bool enabled, bool force)
|
|||
if (!force && enabled && configuredPath.has_value() && !configuredPath.value().isEmpty() && configuredPath.value() != supposedPath) {
|
||||
return true; // don't touch existing entry
|
||||
}
|
||||
return setAutostartPath(enabled ? supposedPath : QString());
|
||||
return setAutostartPath(enabled ? supposedPath : QString());
|
||||
}
|
||||
|
||||
bool AutostartOptionPage::apply()
|
||||
|
@ -992,8 +993,9 @@ void AutostartOptionPage::reset()
|
|||
ui()->pathWidget->setVisible(pathMismatch);
|
||||
ui()->autostartCheckBox->setEnabled(!pathMismatch);
|
||||
if (pathMismatch) {
|
||||
ui()->pathWarningLabel->setText(QCoreApplication::translate("QtGui::AutostartOptionPage", "There is already an autostart entry for \"%1\". "
|
||||
"It will not be overridden when applying changes unless you delete it first.")
|
||||
ui()->pathWarningLabel->setText(QCoreApplication::translate("QtGui::AutostartOptionPage",
|
||||
"There is already an autostart entry for \"%1\". "
|
||||
"It will not be overridden when applying changes unless you delete it first.")
|
||||
.arg(configuredPath.value()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -932,16 +932,16 @@ void ApplyWizardPage::initializePage()
|
|||
output.append(text);
|
||||
output.append(QStringLiteral("</li></ul>"));
|
||||
};
|
||||
auto addListItem = [&makeListItem, &html](const QString &text) {
|
||||
makeListItem(html, text);
|
||||
};
|
||||
auto logFeature = [&makeNestedListItem, &addListItem](const QString &feature, bool enabled, bool enabledBefore, const QString &remark = QString()) {
|
||||
auto text = enabled == enabledBefore ? (tr("Keep %1 %2").arg(feature, enabled ? tr("enabled") : tr("disabled"))) : (tr("%1 %2").arg(enabled ? tr("Enable") : tr("Disable"), feature));
|
||||
if (!remark.isEmpty()) {
|
||||
makeNestedListItem(text, remark);
|
||||
}
|
||||
addListItem(text);
|
||||
};
|
||||
auto addListItem = [&makeListItem, &html](const QString &text) { makeListItem(html, text); };
|
||||
auto logFeature
|
||||
= [&makeNestedListItem, &addListItem](const QString &feature, bool enabled, bool enabledBefore, const QString &remark = QString()) {
|
||||
auto text = enabled == enabledBefore ? (tr("Keep %1 %2").arg(feature, enabled ? tr("enabled") : tr("disabled")))
|
||||
: (tr("%1 %2").arg(enabled ? tr("Enable") : tr("Disable"), feature));
|
||||
if (!remark.isEmpty()) {
|
||||
makeNestedListItem(text, remark);
|
||||
}
|
||||
addListItem(text);
|
||||
};
|
||||
auto mainConfig = QString();
|
||||
auto extraInfo = QString();
|
||||
switch (wizard->mainConfig()) {
|
||||
|
@ -981,7 +981,8 @@ void ApplyWizardPage::initializePage()
|
|||
if (!currentSettings.isPlasmoid) {
|
||||
auto remark = QString();
|
||||
auto action = QString();
|
||||
if (detection.autostartConfiguredPath.has_value() && !detection.autostartConfiguredPath.value().isEmpty() && detection.autostartConfiguredPath.value() != detection.autostartSupposedPath) {
|
||||
if (detection.autostartConfiguredPath.has_value() && !detection.autostartConfiguredPath.value().isEmpty()
|
||||
&& detection.autostartConfiguredPath.value() != detection.autostartSupposedPath) {
|
||||
action = wizard->autoStart() ? tr("Override") : tr("Delete");
|
||||
remark = tr("%1 existing autostart entry for \"%2\"").arg(action, detection.autostartConfiguredPath.value());
|
||||
}
|
||||
|
|
|
@ -160,7 +160,8 @@ void SingleInstance::readArgs()
|
|||
auto *const socket = static_cast<QLocalSocket *>(sender());
|
||||
const auto argData = socket->readAll();
|
||||
if (argData.size() < 2) {
|
||||
std::cerr << Phrases::Error << "Another application instance sent invalid argument data (payload only " << argData.size() << " bytes)." << Phrases::EndFlush;
|
||||
std::cerr << Phrases::Error << "Another application instance sent invalid argument data (payload only " << argData.size() << " bytes)."
|
||||
<< Phrases::EndFlush;
|
||||
return;
|
||||
}
|
||||
socket->close();
|
||||
|
|
Loading…
Reference in New Issue