enable wshadow (#22756)

* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 5246f0231e6bfa572c0dd89c60e538910817faa2
This commit is contained in:
Mayfield
2021-11-02 12:08:53 -04:00
committed by GitHub
parent 75b9ae0039
commit 43e1903073
20 changed files with 68 additions and 65 deletions
+2 -2
View File
@@ -576,9 +576,9 @@ void MapInstructions::updateDistance(float d) {
distance->setText(distance_str);
}
void MapInstructions::showError(QString error) {
void MapInstructions::showError(QString error_text) {
primary->setText("");
distance->setText(error);
distance->setText(error_text);
distance->setAlignment(Qt::AlignCenter);
secondary->setVisible(false);
-1
View File
@@ -138,7 +138,6 @@ MapPanel::MapPanel(QWidget* parent) : QWidget(parent) {
HttpRequest* deleter = new HttpRequest(this);
QObject::connect(repeater, &RequestRepeater::receivedResponse, [=](QString resp) {
auto params = Params();
if (resp != "null") {
if (params.get("NavDestination").empty()) {
qWarning() << "Setting NavDestination from /next" << resp;
+1 -1
View File
@@ -23,7 +23,7 @@ Networking::Networking(QWidget* parent, bool show_advanced) : QFrame(parent) {
connect(wifi, &WifiManager::refreshSignal, this, &Networking::refresh);
connect(wifi, &WifiManager::wrongPassword, this, &Networking::wrongPassword);
QWidget* wifiScreen = new QWidget(this);
wifiScreen = new QWidget(this);
QVBoxLayout* vlayout = new QVBoxLayout(wifiScreen);
vlayout->setContentsMargins(20, 20, 20, 20);
if (show_advanced) {
+7 -7
View File
@@ -416,19 +416,19 @@ void WifiManager::activateModemConnection(const QDBusObjectPath &path) {
NetworkType WifiManager::currentNetworkType() {
QDBusInterface nm(NM_DBUS_SERVICE, NM_DBUS_PATH, NM_DBUS_INTERFACE_PROPERTIES, bus);
nm.setTimeout(DBUS_TIMEOUT);
const QDBusObjectPath &path = get_response<QDBusObjectPath>(nm.call("Get", NM_DBUS_INTERFACE, "PrimaryConnection"));
const QDBusObjectPath &primary_conn = get_response<QDBusObjectPath>(nm.call("Get", NM_DBUS_INTERFACE, "PrimaryConnection"));
QDBusInterface nm2(NM_DBUS_SERVICE, path.path(), NM_DBUS_INTERFACE_PROPERTIES, bus);
QDBusInterface nm2(NM_DBUS_SERVICE, primary_conn.path(), NM_DBUS_INTERFACE_PROPERTIES, bus);
nm.setTimeout(DBUS_TIMEOUT);
const QString &type = get_response<QString>(nm2.call("Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Type"));
const QString &primary_type = get_response<QString>(nm2.call("Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Type"));
if (type == "802-3-ethernet") {
if (primary_type == "802-3-ethernet") {
return NetworkType::ETHERNET;
} else if (type == "802-11-wireless" && !isTetheringEnabled()) {
} else if (primary_type == "802-11-wireless" && !isTetheringEnabled()) {
return NetworkType::WIFI;
} else {
for (const QDBusObjectPath &path : get_active_connections()) {
QDBusInterface nm3(NM_DBUS_SERVICE, path.path(), NM_DBUS_INTERFACE_PROPERTIES, bus);
for (const QDBusObjectPath &conn : get_active_connections()) {
QDBusInterface nm3(NM_DBUS_SERVICE, conn.path(), NM_DBUS_INTERFACE_PROPERTIES, bus);
nm3.setTimeout(DBUS_TIMEOUT);
const QString &type = get_response<QString>(nm3.call("Get", NM_DBUS_INTERFACE_ACTIVE_CONNECTION, "Type"));
if (type == "gsm") {
+1
View File
@@ -2,6 +2,7 @@
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <QApplication>
#include <QLabel>
+3 -3
View File
@@ -201,9 +201,9 @@ void CameraViewWidget::updateFrameMat(int w, int h) {
}
} else if (vipc_client->connected) {
// fit frame to widget size
float w = (float)width() / height();
float f = (float)vipc_client->buffers[0].width / vipc_client->buffers[0].height;
frame_mat = matmul(device_transform, get_fit_view_transform(w, f));
float widget_aspect_ratio = (float)width() / height();
float frame_aspect_ratio = (float)vipc_client->buffers[0].width / vipc_client->buffers[0].height;
frame_mat = matmul(device_transform, get_fit_view_transform(widget_aspect_ratio, frame_aspect_ratio));
}
}
+4 -4
View File
@@ -30,10 +30,10 @@ AbstractControl::AbstractControl(const QString &title, const QString &desc, cons
// left icon
if (!icon.isEmpty()) {
QPixmap pix(icon);
QLabel *icon = new QLabel();
icon->setPixmap(pix.scaledToWidth(80, Qt::SmoothTransformation));
icon->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
hlayout->addWidget(icon);
QLabel *icon_label = new QLabel();
icon_label->setPixmap(pix.scaledToWidth(80, Qt::SmoothTransformation));
icon_label->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed));
hlayout->addWidget(icon_label);
}
// title
+1 -1
View File
@@ -113,7 +113,7 @@ bool FrameReader::load(const std::string &url, std::atomic<bool> *abort) {
frames_.reserve(60 * 20); // 20fps, one minute
while (!(abort && *abort)) {
Frame &frame = frames_.emplace_back();
int err = av_read_frame(pFormatCtx_, &frame.pkt);
err = av_read_frame(pFormatCtx_, &frame.pkt);
if (err < 0) {
frames_.pop_back();
valid_ = (err == AVERROR_EOF);
+9 -9
View File
@@ -39,7 +39,7 @@ int getch() {
return ch;
}
void keyboardThread(Replay *replay) {
void keyboardThread(Replay *replay_) {
char c;
while (true) {
c = getch();
@@ -51,26 +51,26 @@ void keyboardThread(Replay *replay) {
try {
if (r[0] == '#') {
r.erase(0, 1);
replay->seekTo(std::stoi(r) * 60, false);
replay_->seekTo(std::stoi(r) * 60, false);
} else {
replay->seekTo(std::stoi(r), false);
replay_->seekTo(std::stoi(r), false);
}
} catch (std::invalid_argument) {
qDebug() << "invalid argument";
}
getch(); // remove \n from entering seek
} else if (c == 'm') {
replay->seekTo(+60, true);
replay_->seekTo(+60, true);
} else if (c == 'M') {
replay->seekTo(-60, true);
replay_->seekTo(-60, true);
} else if (c == 's') {
replay->seekTo(+10, true);
replay_->seekTo(+10, true);
} else if (c == 'S') {
replay->seekTo(-10, true);
replay_->seekTo(-10, true);
} else if (c == 'G') {
replay->seekTo(0, true);
replay_->seekTo(0, true);
} else if (c == ' ') {
replay->pause(!replay->isPaused());
replay_->pause(!replay_->isPaused());
}
}
}