Make parameter names for declarations and implementations consistent - DolphinQt

This commit is contained in:
Dr. Dystopia 2024-08-18 23:07:23 +02:00
parent e2c2337a61
commit cfc206d315
16 changed files with 52 additions and 51 deletions

View File

@ -120,9 +120,9 @@ void BalloonTip::paintEvent(QPaintEvent*)
} }
void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position, void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
const ShowArrow show_arrow, const int border_full_width) const ShowArrow show_arrow, const int border_width)
{ {
const float border_half_width = border_full_width / 2.0; const float border_half_width = border_width / 2.0;
// This should be odd so that the arrow tip is a single pixel wide. // This should be odd so that the arrow tip is a single pixel wide.
const int arrow_full_width = 35; const int arrow_full_width = 35;
@ -138,7 +138,7 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
// larger border sizes. // larger border sizes.
const int rounded_corner_margin = border_half_width / 4; const int rounded_corner_margin = border_half_width / 4;
const int horizontal_margin = const int horizontal_margin =
border_full_width + rounded_corner_margin + balloon_interior_padding; border_width + rounded_corner_margin + balloon_interior_padding;
const int vertical_margin = horizontal_margin + arrow_height; const int vertical_margin = horizontal_margin + arrow_height;
// Create enough space around the layout containing the title and message to draw the balloon and // Create enough space around the layout containing the title and message to draw the balloon and
@ -149,8 +149,8 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
QSize size_hint = sizeHint(); QSize size_hint = sizeHint();
// These positions represent the middle of each edge of the BalloonTip's rounded rectangle // These positions represent the middle of each edge of the BalloonTip's rounded rectangle
const float rect_width = size_hint.width() - border_full_width; const float rect_width = size_hint.width() - border_width;
const float rect_height = size_hint.height() - border_full_width - 2 * arrow_height; const float rect_height = size_hint.height() - border_width - 2 * arrow_height;
const float rect_top = border_half_width + arrow_height; const float rect_top = border_half_width + arrow_height;
const float rect_bottom = rect_top + rect_height; const float rect_bottom = rect_top + rect_height;
const float rect_left = border_half_width; const float rect_left = border_half_width;
@ -160,14 +160,14 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
// corner". Unlike the rectangle's edges this corresponds to the outside of the rounded curve // corner". Unlike the rectangle's edges this corresponds to the outside of the rounded curve
// instead of its middle, so we add the full width to the inner radius instead of the half width // instead of its middle, so we add the full width to the inner radius instead of the half width
const float corner_base_inner_radius = 7.0; const float corner_base_inner_radius = 7.0;
const float corner_outer_radius = corner_base_inner_radius + border_full_width; const float corner_outer_radius = corner_base_inner_radius + border_width;
// This value is arbitrary but works well. // This value is arbitrary but works well.
const int base_arrow_x_offset = 34; const int base_arrow_x_offset = 34;
// Adjust the offset inward to compensate for the border and rounded corner widths. This ensures // Adjust the offset inward to compensate for the border and rounded corner widths. This ensures
// the arrow is on the flat part of the top/bottom border. // the arrow is on the flat part of the top/bottom border.
const int adjusted_arrow_x_offset = const int adjusted_arrow_x_offset =
base_arrow_x_offset + border_full_width + static_cast<int>(border_half_width); base_arrow_x_offset + border_width + static_cast<int>(border_half_width);
// If the border is wide enough (or the BalloonTip small enough) the offset might end up past the // If the border is wide enough (or the BalloonTip small enough) the offset might end up past the
// midpoint; if that happens just use the midpoint instead // midpoint; if that happens just use the midpoint instead
const int centered_arrow_x_offset = (size_hint.width() - arrow_full_width) / 2; const int centered_arrow_x_offset = (size_hint.width() - arrow_full_width) / 2;
@ -206,7 +206,7 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
m_pixmap = QPixmap(size_hint); m_pixmap = QPixmap(size_hint);
QPen border_pen(m_border_color, border_full_width); QPen border_pen(m_border_color, border_width);
border_pen.setCapStyle(Qt::FlatCap); border_pen.setCapStyle(Qt::FlatCap);
QPainter balloon_painter(&m_pixmap); QPainter balloon_painter(&m_pixmap);
@ -217,7 +217,7 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
QBitmap mask_bitmap(size_hint); QBitmap mask_bitmap(size_hint);
mask_bitmap.fill(Qt::color0); mask_bitmap.fill(Qt::color0);
QPen mask_pen(Qt::color1, border_full_width); QPen mask_pen(Qt::color1, border_width);
mask_pen.setCapStyle(Qt::FlatCap); mask_pen.setCapStyle(Qt::FlatCap);
QPainter mask_painter(&mask_bitmap); QPainter mask_painter(&mask_bitmap);
@ -236,7 +236,7 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
const float arrow_tip_vertical_offset = arrow_at_bottom ? arrow_height : -arrow_height; const float arrow_tip_vertical_offset = arrow_at_bottom ? arrow_height : -arrow_height;
const float arrow_tip_interior_y = arrow_base_y + arrow_tip_vertical_offset; const float arrow_tip_interior_y = arrow_base_y + arrow_tip_vertical_offset;
const float arrow_tip_exterior_y = const float arrow_tip_exterior_y =
arrow_tip_interior_y + (arrow_at_bottom ? border_full_width : -border_full_width); arrow_tip_interior_y + (arrow_at_bottom ? border_width : -border_width);
const float arrow_base_left_edge_x = const float arrow_base_left_edge_x =
arrow_at_left ? arrow_nearest_edge_x_offset : arrow_at_left ? arrow_nearest_edge_x_offset :
size_hint.width() - arrow_nearest_edge_x_offset - arrow_full_width; size_hint.width() - arrow_nearest_edge_x_offset - arrow_full_width;
@ -259,7 +259,7 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position,
QPainterPath arrow_border_path; QPainterPath arrow_border_path;
QPainterPath arrow_interior_fill_path; QPainterPath arrow_interior_fill_path;
const float y_end_offset = arrow_at_bottom ? border_full_width : -border_full_width; const float y_end_offset = arrow_at_bottom ? border_width : -border_width;
// Draw the arrow border and interior lines from the outside inward. Each loop iteration draws // Draw the arrow border and interior lines from the outside inward. Each loop iteration draws
// one pair of border lines and one pair of interior lines. // one pair of border lines and one pair of interior lines.

View File

@ -72,7 +72,7 @@ private:
int AllocateTabNum(); int AllocateTabNum();
void FreeTabNum(int num); void FreeTabNum(int num);
void UpdateTabText(AsmEditor* editor); void UpdateTabText(AsmEditor* editor);
void DisambiguateTabTitles(AsmEditor* editor); void DisambiguateTabTitles(AsmEditor* new_tab);
void UpdateIcons(); void UpdateIcons();
void ZoomAllEditors(int amount); void ZoomAllEditors(int amount);

View File

@ -203,9 +203,9 @@ int AsmEditor::CharWidth() const
return fontMetrics().horizontalAdvance(QLatin1Char(' ')); return fontMetrics().horizontalAdvance(QLatin1Char(' '));
} }
void AsmEditor::resizeEvent(QResizeEvent* e) void AsmEditor::resizeEvent(QResizeEvent* event)
{ {
QPlainTextEdit::resizeEvent(e); QPlainTextEdit::resizeEvent(event);
const QRect cr = contentsRect(); const QRect cr = contentsRect();
m_line_number_area->setGeometry(QRect(cr.left(), cr.top(), LineNumberAreaWidth(), cr.height())); m_line_number_area->setGeometry(QRect(cr.left(), cr.top(), LineNumberAreaWidth(), cr.height()));

View File

@ -18,7 +18,7 @@ class AsmEditor : public QPlainTextEdit
Q_OBJECT; Q_OBJECT;
public: public:
AsmEditor(const QString& file_path, int editor_num, bool dark_scheme, QWidget* parent = nullptr); AsmEditor(const QString& path, int editor_num, bool dark_scheme, QWidget* parent = nullptr);
void LineNumberAreaPaintEvent(QPaintEvent* event); void LineNumberAreaPaintEvent(QPaintEvent* event);
int LineNumberAreaWidth(); int LineNumberAreaWidth();
const QString& Path() const { return m_path; } const QString& Path() const { return m_path; }

View File

@ -677,7 +677,7 @@ void BreakpointWidget::AddAddressMBP(u32 addr, bool on_read, bool on_write, bool
Update(); Update();
} }
void BreakpointWidget::AddRangedMBP(u32 from, u32 to, bool on_read, bool on_write, bool do_log, void BreakpointWidget::AddRangedMBP(u32 from, u32 to, bool do_read, bool do_write, bool do_log,
bool do_break, const QString& condition) bool do_break, const QString& condition)
{ {
TMemCheck check; TMemCheck check;
@ -685,8 +685,8 @@ void BreakpointWidget::AddRangedMBP(u32 from, u32 to, bool on_read, bool on_writ
check.start_address = from; check.start_address = from;
check.end_address = to; check.end_address = to;
check.is_ranged = true; check.is_ranged = true;
check.is_break_on_read = on_read; check.is_break_on_read = do_read;
check.is_break_on_write = on_write; check.is_break_on_write = do_write;
check.log_on_hit = do_log; check.log_on_hit = do_log;
check.break_on_hit = do_break; check.break_on_hit = do_break;
check.condition = check.condition =

View File

@ -135,7 +135,7 @@ private:
}; };
} // namespace } // namespace
void GekkoSyntaxHighlight::highlightBlock(const QString& text) void GekkoSyntaxHighlight::highlightBlock(const QString& line)
{ {
BlockInfo* info = static_cast<BlockInfo*>(currentBlockUserData()); BlockInfo* info = static_cast<BlockInfo*>(currentBlockUserData());
if (info == nullptr) if (info == nullptr)
@ -144,16 +144,16 @@ void GekkoSyntaxHighlight::highlightBlock(const QString& text)
setCurrentBlockUserData(info); setCurrentBlockUserData(info);
} }
qsizetype comment_idx = text.indexOf(QLatin1Char('#')); qsizetype comment_idx = line.indexOf(QLatin1Char('#'));
if (comment_idx != -1) if (comment_idx != -1)
{ {
HighlightSubstr(comment_idx, text.length() - comment_idx, HighlightFormat::Comment); HighlightSubstr(comment_idx, line.length() - comment_idx, HighlightFormat::Comment);
} }
if (m_mode == 0) if (m_mode == 0)
{ {
HighlightParsePlugin plugin; HighlightParsePlugin plugin;
ParseWithPlugin(&plugin, text.toStdString()); ParseWithPlugin(&plugin, line.toStdString());
info->block_format = plugin.MoveFormatting(); info->block_format = plugin.MoveFormatting();
info->parens = plugin.MoveParens(); info->parens = plugin.MoveParens();

View File

@ -165,22 +165,22 @@ void GameTracker::StartInternal()
QueueOnObject(this, [] { Settings::Instance().NotifyRefreshGameListComplete(); }); QueueOnObject(this, [] { Settings::Instance().NotifyRefreshGameListComplete(); });
} }
bool GameTracker::AddPath(const QString& dir) bool GameTracker::AddPath(const QString& path)
{ {
if (Settings::Instance().IsAutoRefreshEnabled()) if (Settings::Instance().IsAutoRefreshEnabled())
QueueOnObject(this, [this, dir] { return addPath(dir); }); QueueOnObject(this, [this, path] { return addPath(path); });
m_tracked_paths.push_back(dir); m_tracked_paths.push_back(path);
return true; return true;
} }
bool GameTracker::RemovePath(const QString& dir) bool GameTracker::RemovePath(const QString& path)
{ {
if (Settings::Instance().IsAutoRefreshEnabled()) if (Settings::Instance().IsAutoRefreshEnabled())
QueueOnObject(this, [this, dir] { return removePath(dir); }); QueueOnObject(this, [this, path] { return removePath(path); });
const auto index = m_tracked_paths.indexOf(dir); const auto index = m_tracked_paths.indexOf(path);
if (index == -1) if (index == -1)
return false; return false;
@ -228,9 +228,9 @@ void GameTracker::UpdateDirectory(const QString& dir)
m_load_thread.EmplaceItem(Command{CommandType::UpdateDirectory, dir}); m_load_thread.EmplaceItem(Command{CommandType::UpdateDirectory, dir});
} }
void GameTracker::UpdateFile(const QString& dir) void GameTracker::UpdateFile(const QString& path)
{ {
m_load_thread.EmplaceItem(Command{CommandType::UpdateFile, dir}); m_load_thread.EmplaceItem(Command{CommandType::UpdateFile, path});
} }
void GameTracker::AddDirectoryInternal(const QString& dir) void GameTracker::AddDirectoryInternal(const QString& dir)
@ -308,20 +308,20 @@ void GameTracker::UpdateDirectoryInternal(const QString& dir)
} }
} }
void GameTracker::UpdateFileInternal(const QString& file) void GameTracker::UpdateFileInternal(const QString& path)
{ {
if (QFileInfo(file).exists()) if (QFileInfo(path).exists())
{ {
if (m_started) if (m_started)
GameRemoved(file.toStdString()); GameRemoved(path.toStdString());
AddPath(file); AddPath(path);
LoadGame(file); LoadGame(path);
} }
else if (RemovePath(file)) else if (RemovePath(path))
{ {
m_tracked_files.remove(file); m_tracked_files.remove(path);
if (m_started) if (m_started)
emit GameRemoved(file.toStdString()); emit GameRemoved(path.toStdString());
} }
} }

View File

@ -22,9 +22,9 @@ GridProxyModel::GridProxyModel(QObject* parent) : QSortFilterProxyModel(parent)
sort(static_cast<int>(GameListModel::Column::Title)); sort(static_cast<int>(GameListModel::Column::Title));
} }
QVariant GridProxyModel::data(const QModelIndex& i, int role) const QVariant GridProxyModel::data(const QModelIndex& index, int role) const
{ {
QModelIndex source_index = mapToSource(i); QModelIndex source_index = mapToSource(index);
if (role == Qt::DisplayRole) if (role == Qt::DisplayRole)
{ {
return sourceModel()->data( return sourceModel()->data(

View File

@ -268,9 +268,9 @@ void Host_UpdateMainFrame()
{ {
} }
void Host_RequestRenderWindowSize(int w, int h) void Host_RequestRenderWindowSize(int width, int height)
{ {
emit Host::GetInstance()->RequestRenderSize(w, h); emit Host::GetInstance()->RequestRenderSize(width, height);
} }
bool Host_UIBlocksControllerState() bool Host_UIBlocksControllerState()

View File

@ -428,12 +428,13 @@ void NetPlayDialog::ConnectWidgets()
connect(m_hide_remote_gbas_action, &QAction::toggled, this, &NetPlayDialog::SaveSettings); connect(m_hide_remote_gbas_action, &QAction::toggled, this, &NetPlayDialog::SaveSettings);
} }
void NetPlayDialog::SendMessage(const std::string& msg) void NetPlayDialog::SendMessage(const std::string& message)
{ {
Settings::Instance().GetNetPlayClient()->SendChatMessage(msg); Settings::Instance().GetNetPlayClient()->SendChatMessage(message);
DisplayMessage( DisplayMessage(
QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname), QString::fromStdString(msg)), QStringLiteral("%1: %2").arg(QString::fromStdString(m_nickname),
QString::fromStdString(message)),
""); "");
} }

View File

@ -21,7 +21,7 @@ class PadMappingDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit PadMappingDialog(QWidget* widget); explicit PadMappingDialog(QWidget* parent);
int exec() override; int exec() override;

View File

@ -17,7 +17,7 @@
#include "DolphinQt/QtUtils/SetWindowDecorations.h" #include "DolphinQt/QtUtils/SetWindowDecorations.h"
#include "UICommon/ResourcePack/Manager.h" #include "UICommon/ResourcePack/Manager.h"
ResourcePackManager::ResourcePackManager(QWidget* widget) : QDialog(widget) ResourcePackManager::ResourcePackManager(QWidget* parent) : QDialog(parent)
{ {
CreateWidgets(); CreateWidgets();
ConnectWidgets(); ConnectWidgets();

View File

@ -88,7 +88,7 @@ public:
void SetLogConfigVisible(bool visible); void SetLogConfigVisible(bool visible);
void SetToolBarVisible(bool visible); void SetToolBarVisible(bool visible);
bool IsToolBarVisible() const; bool IsToolBarVisible() const;
void SetWidgetsLocked(bool visible); void SetWidgetsLocked(bool locked);
bool AreWidgetsLocked() const; bool AreWidgetsLocked() const;
void RefreshWidgetVisibility(); void RefreshWidgetVisibility();

View File

@ -20,7 +20,7 @@ public:
ModemTapServer ModemTapServer
}; };
explicit BroadbandAdapterSettingsDialog(QWidget* target, Type bba_type); explicit BroadbandAdapterSettingsDialog(QWidget* parent, Type bba_type);
private: private:
QLineEdit* m_address_input; QLineEdit* m_address_input;

View File

@ -55,7 +55,7 @@ private:
void CreateMainWindow(); void CreateMainWindow();
QVBoxLayout* CreateSlotLayout(); QVBoxLayout* CreateSlotLayout();
QVBoxLayout* CreateFinderLayout(); QVBoxLayout* CreateFinderLayout();
void closeEvent(QCloseEvent* bar) override; void closeEvent(QCloseEvent* event) override;
bool eventFilter(QObject* object, QEvent* event) final override; bool eventFilter(QObject* object, QEvent* event) final override;
// UI // UI

View File

@ -11,7 +11,7 @@ class StickWidget : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit StickWidget(QWidget* parent, u16 width, u16 height); explicit StickWidget(QWidget* parent, u16 max_x, u16 max_y);
signals: signals:
void ChangedX(u16 x); void ChangedX(u16 x);