Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some clazy warnings #973

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion launcher/core/injector/lldbinjector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ bool LldbInjector::selfTest()
const QString output = QString::fromLocal8Bit(process.readAll()).trimmed();
const auto targetMajor = 3;
const auto targetMinor = 6;
const QRegularExpression rx(QStringLiteral("\\b([\\d]+\\.[\\d]+\\.[\\d]+)\\b")); // lldb version 3.7.0 ( revision )
static const QRegularExpression rx(QStringLiteral("\\b([\\d]+\\.[\\d]+\\.[\\d]+)\\b")); // lldb version 3.7.0 ( revision )
const auto match = rx.match(output);

if (!match.hasMatch()) {
Expand Down
2 changes: 1 addition & 1 deletion launcher/core/launcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Launcher::Launcher(const LaunchOptions &options, QObject *parent)
{
Q_ASSERT(options.isValid());

const auto timeout = qgetenv("GAMMARAY_LAUNCHER_TIMEOUT").toInt();
const auto timeout = qEnvironmentVariableIntValue("GAMMARAY_LAUNCHER_TIMEOUT");
d->safetyTimer.setInterval(std::max(60, timeout) * 1000);
d->safetyTimer.setSingleShot(true);
connect(&d->safetyTimer, &QTimer::timeout, this, &Launcher::timeout);
Expand Down
8 changes: 4 additions & 4 deletions launcher/ui/connectpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void ConnectPage::validateHostAddress(const QString &address)
handleLocalAddress(stillToParse, correctSoFar);
handleIPAddress(stillToParse, correctSoFar);

QRegularExpression re(QStringLiteral("^([a-zA-Z][a-zA-Z0-9\\-\\.]+[a-zA-Z0-9](:[0-9]{1,5})?)$"));
static QRegularExpression re(QStringLiteral("^([a-zA-Z][a-zA-Z0-9\\-\\.]+[a-zA-Z0-9](:[0-9]{1,5})?)$"));
if (re.match(stillToParse).hasMatch())
handleHostName(stillToParse);

Expand Down Expand Up @@ -130,13 +130,13 @@ void ConnectPage::handleIPAddress(QString &stillToParse, bool &correctSoFar)
possibleIPv6Address = QHostAddress(stillToParse);

QHostAddress possibleIPv6BracketAddress;
QRegularExpression bracketFormatRE(QStringLiteral(R"(^\[([0-9a-f\:\.]*)\].*$)"));
static QRegularExpression bracketFormatRE(QStringLiteral(R"(^\[([0-9a-f\:\.]*)\].*$)"));
QRegularExpressionMatch bracketMatch = bracketFormatRE.match(stillToParse);
if (bracketMatch.hasMatch())
possibleIPv6BracketAddress = QHostAddress(bracketMatch.captured(1));

QHostAddress possibleIPv6InterfaceAddress;
QRegularExpression interfaceFormatRE(QStringLiteral(R"(^([^\%]*)(\%[^\:]+)(:[0-9]+)?$)"));
static QRegularExpression interfaceFormatRE(QStringLiteral(R"(^([^\%]*)(\%[^\:]+)(:[0-9]+)?$)"));
QRegularExpressionMatch interfaceMatch = interfaceFormatRE.match(stillToParse);
if (interfaceMatch.hasMatch())
possibleIPv6InterfaceAddress = QHostAddress(interfaceMatch.captured(1));
Expand Down Expand Up @@ -220,7 +220,7 @@ void ConnectPage::handleAddressAndPort(QString &stillToParse, bool &correctSoFar

void ConnectPage::handlePortString(QString &stillToParse, bool &correctSoFar)
{
QRegularExpression re(QStringLiteral("\\:[0-9]{1,5}"));
static QRegularExpression re(QStringLiteral("\\:[0-9]{1,5}"));
QRegularExpressionMatch match = re.match(stillToParse);
if (match.hasMatch()) {
auto portString = match.captured(0);
Expand Down
2 changes: 1 addition & 1 deletion plugins/localeinspector/localeaccessormodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ struct LocaleDataAccessor;
class LocaleAccessorModel : public QAbstractTableModel
{
Q_OBJECT
Q_ENUMS(CustomRoles)
public:
enum CustomRoles
{
AccessorRole = UserRole + 1
};
Q_ENUM(CustomRoles)

explicit LocaleAccessorModel(LocaleDataAccessorRegistry *registry, QObject *parent = nullptr);

Expand Down
2 changes: 1 addition & 1 deletion plugins/quickinspector/quickinspectorinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class QuickInspectorInterface : public QObject
VisualizeTraces,
};

Q_ENUMS(RenderMode)
Q_ENUM(RenderMode)
Q_DECLARE_FLAGS(Features, Feature)

explicit QuickInspectorInterface(QObject *parent = nullptr);
Expand Down
Loading