Skip to content

Commit

Permalink
Lint! Glorious Lint!
Browse files Browse the repository at this point in the history
  • Loading branch information
oskirby committed Jan 16, 2024
1 parent 28d1b77 commit b203539
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/eventlistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include <QDir>
#include <QFileInfo>
#include <QLocalSocket>
#include <QRegularExpression>
#include <QUrl>
#ifndef MZ_WINDOWS
# include <QStandardPaths>
# include <QRegularExpression>
#endif

#include "constants.h"
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/linux/linuxdependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <QtDBus/QtDBus>

#ifndef MZ_FLATPAK
# include "dbusclient.h"
# include "dbusclient.h"
#endif
#include "logger.h"

Expand Down
6 changes: 3 additions & 3 deletions src/platforms/linux/linuxsystemtraynotificationhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ void LinuxSystemTrayNotificationHandler::notify(Message type,
uint32_t replacesId = 0; // Don't replace.
QMap<QString, QVariant> hints;

QDBusReply<uint> reply = n.call("Notify", "Mozilla VPN", replacesId,
Constants::LINUX_APP_ID, title, message,
actions, hints, timerMsec);
QDBusReply<uint> reply =
n.call("Notify", "Mozilla VPN", replacesId, Constants::LINUX_APP_ID,
title, message, actions, hints, timerMsec);
if (!reply.isValid()) {
logger.warning() << "Failed to show the notification";
}
Expand Down
18 changes: 9 additions & 9 deletions src/platforms/linux/networkmanagercontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void NetworkManagerController::initialize(const Device* device,
g_object_set(m_wireguard, NM_SETTING_WIREGUARD_PRIVATE_KEY,
qPrintable(keys->privateKey()), NM_SETTING_WIREGUARD_FWMARK,
WG_FIREWALL_MARK, NM_SETTING_WIREGUARD_PEER_ROUTES, false,
NM_SETTING_WIREGUARD_IP4_AUTO_DEFAULT_ROUTE, true,
NM_SETTING_WIREGUARD_IP4_AUTO_DEFAULT_ROUTE, true,
NM_SETTING_WIREGUARD_IP6_AUTO_DEFAULT_ROUTE, true, NULL);

// Check if the connection already exists.
Expand Down Expand Up @@ -375,9 +375,9 @@ void NetworkManagerController::setActiveConnection(NMActiveConnection* active) {
if (m_active != nullptr) {
QString oldPath(nm_object_get_path(NM_OBJECT(m_active)));
QDBusConnection::systemBus().disconnect(
"org.freedesktop.NetworkManager", oldPath,
"org.freedesktop.NetworkManager.Connection.Active",
"StateChanged", this, SLOT(stateChanged(uint, uint)));
"org.freedesktop.NetworkManager", oldPath,
"org.freedesktop.NetworkManager.Connection.Active", "StateChanged",
this, SLOT(stateChanged(uint, uint)));
g_object_unref(m_active);
m_active = nullptr;
}
Expand All @@ -387,10 +387,10 @@ void NetworkManagerController::setActiveConnection(NMActiveConnection* active) {
if (m_active) {
QString newPath(nm_object_get_path(NM_OBJECT(m_active)));
QDBusConnection::systemBus().connect(
"org.freedesktop.NetworkManager", newPath,
"org.freedesktop.NetworkManager.Connection.Active",
"StateChanged", this, SLOT(stateChanged(uint, uint)));
"org.freedesktop.NetworkManager", newPath,
"org.freedesktop.NetworkManager.Connection.Active", "StateChanged",
this, SLOT(stateChanged(uint, uint)));

// Invoke the state changed signal with the current state.
stateChanged(nm_active_connection_get_state(m_active),
nm_active_connection_get_state_reason(m_active));
Expand Down Expand Up @@ -455,7 +455,7 @@ void NetworkManagerController::checkStatus() {

QString txPath =
QString("/sys/class/net/%1/statistics/tx_bytes").arg(WG_INTERFACE_NAME);
QString rxPath =
QString rxPath =
QString("/sys/class/net/%1/statistics/rx_bytes").arg(WG_INTERFACE_NAME);
uint64_t txBytes = readSysfsFile(txPath);
uint64_t rxBytes = readSysfsFile(rxPath);
Expand Down
6 changes: 4 additions & 2 deletions src/tcppingsender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ void TcpPingSender::sendPing(const QHostAddress& dest, quint16 sequence) {

// Cleanup the socket upon completion.
connect(socket, &QAbstractSocket::connected, socket, &QObject::deleteLater);
connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
connect(socket, &QAbstractSocket::errorOccurred, socket, &QObject::deleteLater);
connect(socket, &QAbstractSocket::disconnected, socket,
&QObject::deleteLater);
connect(socket, &QAbstractSocket::errorOccurred, socket,
&QObject::deleteLater);

// Try to connect
socket->connectToHost(dest, m_port);
Expand Down
3 changes: 2 additions & 1 deletion src/tcppingsender.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class TcpPingSender final : public PingSender {
Q_DISABLE_COPY_MOVE(TcpPingSender)

public:
TcpPingSender(const QHostAddress& source, quint16 port = 80, QObject* parent = nullptr);
TcpPingSender(const QHostAddress& source, quint16 port = 80,
QObject* parent = nullptr);
~TcpPingSender();

void sendPing(const QHostAddress& dest, quint16 sequence) override;
Expand Down

0 comments on commit b203539

Please sign in to comment.