Skip to content

Commit

Permalink
Remove (public/private) slot annotations
Browse files Browse the repository at this point in the history
With the new signal/slot-connect syntax, it's no longer needed to
annotate methods as being a "slot". So remove these annotations from the
header file.

Because "public slot:" now just becomes "public:", I also moved this
section together with the regular "public:" section in the header file.
Similar for "private slot:" -> "private:".

I took this opportunity to also order the sections in a consistent order
everywhere: public, signals, protected, private
And I made sure we don't mix member functions and member variables
within a single section.
  • Loading branch information
m9710797 committed May 14, 2022
1 parent ca365c2 commit 2c3fd4c
Show file tree
Hide file tree
Showing 32 changed files with 227 additions and 237 deletions.
14 changes: 6 additions & 8 deletions src/BitMapViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,12 @@ class BitMapViewer : public QDialog, private Ui::BitMapViewer
Q_OBJECT
public:
BitMapViewer(QWidget* parent = nullptr);
void refresh();

private:
void decodeVDPregs();
void setPages();

VramBitMappedView* imageWidget;
int screenMod;
bool useVDP;

public slots:
void refresh();

private slots:
void on_screenMode_currentIndexChanged(const QString& text);
void on_showPage_currentIndexChanged(int index);
void on_linesVisible_currentIndexChanged(int index);
Expand All @@ -39,6 +32,11 @@ private slots:
void updateImagePosition(int x, int y, int color, unsigned addr, int byteValue);

void VDPDataStoreDataRefreshed();

private:
VramBitMappedView* imageWidget;
int screenMod;
bool useVDP;
};

#endif /* BITMAPVIEWER_OPENMSX_H */
18 changes: 9 additions & 9 deletions src/BreakpointDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,24 @@ class BreakpointDialog : public QDialog, private Ui::BreakpointDialog
std::optional<uint8_t> segment = {}, QString condition = {});

private:
const MemoryLayout& memLayout;

DebugSession* debugSession;
Symbol* currentSymbol;
int idxSlot, idxSubSlot;
int conditionHeight;
std::unique_ptr<QCompleter> jumpCompleter;
std::unique_ptr<QCompleter> allCompleter;
std::optional<uint16_t> parseInput(const QLineEdit& ed, Symbol** symbol = nullptr) const;
void enableSlots();
void disableSlots();

private slots:
void addressChanged(const QString& text);
void typeChanged(int i);
void slotChanged(int i);
void subslotChanged(int i);
void hasCondition(int state);

private:
const MemoryLayout& memLayout;
DebugSession* debugSession;
Symbol* currentSymbol;
int idxSlot, idxSubSlot;
int conditionHeight;
std::unique_ptr<QCompleter> jumpCompleter;
std::unique_ptr<QCompleter> allCompleter;
};

#endif // BREAKPOINTDIALOG_OPENMSX_H
45 changes: 22 additions & 23 deletions src/BreakpointViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,21 @@ class BreakpointViewer : public QTabWidget, private Ui::BreakpointViewer
BreakpointViewer(QWidget* parent = nullptr);
void setBreakpoints(Breakpoints* bps);

private:
Ui::BreakpointViewer* ui;
QTableWidget* tables[BreakpointRef::ALL];
std::map<QString, BreakpointRef> maps[BreakpointRef::ALL];
void on_btnAddBp_clicked();
void on_btnRemoveBp_clicked();
void on_btnAddWp_clicked();
void on_btnRemoveWp_clicked();
void on_btnAddCn_clicked();
void on_btnRemoveCn_clicked();

bool selfUpdating = false;
bool userMode = true;
bool runState;
bool conditionsMsg = false;
Breakpoints* breakpoints;
void setRunState();
void setBreakState();
void sync();

signals:
void contentsUpdated(bool merge);

private:
void setTextField(BreakpointRef::Type type, int row, int column, const QString& value);
std::optional<AddressRange> parseLocationField(std::optional<int> index,
BreakpointRef::Type type,
Expand Down Expand Up @@ -72,7 +76,6 @@ class BreakpointViewer : public QTabWidget, private Ui::BreakpointViewer
BreakpointRef* findBreakpointRef(BreakpointRef::Type type, int row);
BreakpointRef* scanBreakpointRef(const Breakpoint& bp);

private slots:
void changeCurrentWpType(int row, int index);
void disableSorting(BreakpointRef::Type type = BreakpointRef::ALL);
void changeBpTableItem(QTableWidgetItem* item);
Expand All @@ -81,20 +84,16 @@ private slots:
void on_itemPressed(QTableWidgetItem* item);
void on_headerClicked(int index);

public slots:
void on_btnAddBp_clicked();
void on_btnRemoveBp_clicked();
void on_btnAddWp_clicked();
void on_btnRemoveWp_clicked();
void on_btnAddCn_clicked();
void on_btnRemoveCn_clicked();

void setRunState();
void setBreakState();
void sync();
private:
Ui::BreakpointViewer* ui;
QTableWidget* tables[BreakpointRef::ALL];
std::map<QString, BreakpointRef> maps[BreakpointRef::ALL];

signals:
void contentsUpdated(bool merge);
bool selfUpdating = false;
bool userMode = true;
bool runState;
bool conditionsMsg = false;
Breakpoints* breakpoints;
};

#endif // BREAKPOINTVIEWER_H
3 changes: 1 addition & 2 deletions src/CommClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@ class CommClient : public QObject
void sendCommand(CommandBase* command);
void connectToOpenMSX(std::unique_ptr<OpenMSXConnection> conn);

public slots:
void closeConnection();

signals:
void connectionReady();
void connectionTerminated();

void logParsed(const QString& level, const QString& message);
void updateParsed(const QString& type, const QString& name, const QString& message);

private:
CommClient() = default;
~CommClient() override;

private:
std::unique_ptr<OpenMSXConnection> connection;
};

Expand Down
16 changes: 7 additions & 9 deletions src/ConnectDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ class ConnectDialog : public QDialog
public:
static std::unique_ptr<OpenMSXConnection> getConnection(QWidget* parent = nullptr);

private slots:
void on_connectButton_clicked();
void on_rescanButton_clicked();

private:
ConnectDialog(QWidget* parent);
~ConnectDialog() override;
Expand All @@ -32,6 +28,10 @@ private slots:

void timerEvent(QTimerEvent *event) override;

void on_connectButton_clicked();
void on_rescanButton_clicked();

private:
int delay;
Ui::ConnectDialog ui;
using OpenMSXConnections = std::vector<std::unique_ptr<OpenMSXConnection>>;
Expand All @@ -57,15 +57,13 @@ class ConnectionInfoRequest : public QObject, CommandBase
void cancel() override;

private:
enum State { GET_MACHINE, GET_TITLE, DONE };
void terminate();

private:
ConnectDialog& dialog;
OpenMSXConnection& connection;
State state;
enum State { GET_MACHINE, GET_TITLE, DONE } state;
QString title;

private slots:
void terminate();
};

#endif
6 changes: 3 additions & 3 deletions src/DebugSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ class DebugSession : public QObject
Breakpoints& breakpoints();
SymbolTable& symbolTable();

void sessionModified();

private:
void skipUnknownElement(QXmlStreamReader& ses);

private:
Breakpoints breaks;
SymbolTable symTable;
QString fileName;
bool modified;

public slots:
void sessionModified();
};

#endif // DEBUGSESSION_H
9 changes: 4 additions & 5 deletions src/DebuggableViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ class DebuggableViewer : public QWidget
public:
DebuggableViewer(QWidget* parent = nullptr);

public slots:
void settingsChanged();
void setDebuggables(const QMap<QString, int>& list);
void refresh();

private:
void debuggableSelected(int index);
void locationChanged(int loc);

private:
HexViewer* hexView;
QComboBox* debuggableList;
QString lastSelected;
int lastLocation;

private slots:
void debuggableSelected(int index);
void locationChanged(int loc);
};

#endif // DEBUGGABLEVIEWER_H
8 changes: 4 additions & 4 deletions src/DisasmViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class DisasmViewer : public QFrame

enum {Top, Middle, Bottom, Closest, TopAlways, MiddleAlways, BottomAlways, Reload};

public slots:
void setAddress(uint16_t addr, int infoLine = FIRST_INFO_LINE, int method = Top);
void setCursorAddress(uint16_t addr, int infoLine = FIRST_INFO_LINE, int method = Top);
void setProgramCounter(uint16_t pc, bool reload = false);
Expand All @@ -49,6 +48,10 @@ public slots:
void mousePressEvent(QMouseEvent* e) override;
void wheelEvent(QWheelEvent* e) override;

int findDisasmLine(uint16_t lineAddr, int infoLine = 0);
int lineAtPos(const QPoint& pos);

private:
QScrollBar* scrollBar;

QPixmap breakMarker;
Expand Down Expand Up @@ -80,9 +83,6 @@ public slots:
MemoryLayout* memLayout;
SymbolTable* symTable;

int findDisasmLine(uint16_t lineAddr, int infoLine = 0);
int lineAtPos(const QPoint& pos);

signals:
void breakpointToggled(int addr);
};
Expand Down
2 changes: 1 addition & 1 deletion src/FlagsViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class FlagsViewer : public QFrame

QSize sizeHint() const override;

public slots:
void setFlags(quint8 newFlags);

private:
Expand All @@ -26,6 +25,7 @@ public slots:
void drawValue(QPainter& p, int x, int y, const QString& str,
bool changed);

private:
int frameL, frameR, frameT, frameB;
unsigned char flags;
unsigned char flagsChanged;
Expand Down
6 changes: 3 additions & 3 deletions src/GotoDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ class GotoDialog : public QDialog, private Ui::GotoDialog

std::optional<uint16_t> address();

private:
void addressChanged(const QString& text);

private:
const MemoryLayout& memLayout;

DebugSession* debugSession;
Symbol* currentSymbol;

private slots:
void addressChanged(const QString& text);
};

#endif // GOTODIALOG_H
13 changes: 6 additions & 7 deletions src/HexViewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ class HexViewer : public QFrame

QSize sizeHint() const override;

public slots:
void setLocation(int addr);
void setTopLocation(int addr);
void scrollBarChanged(int addr);
void settingsChanged();
void refresh();

signals:
void locationChanged(int addr);

private:
void wheelEvent(QWheelEvent* e) override;
void resizeEvent(QResizeEvent* e) override;
Expand All @@ -50,6 +52,9 @@ public slots:
void transferCancelled(HexRequest* r);
int coorToOffset(int x, int y) const;

void changeWidth();

private:
QScrollBar* vertScrollBar;
QAction* fillWidthAction;
QAction* fillWidth2Action;
Expand Down Expand Up @@ -86,12 +91,6 @@ public slots:
int cursorPosition,editValue;

friend class HexRequest;

private slots:
void changeWidth();

signals:
void locationChanged(int addr);
};

#endif // HEXVIEWER_H
16 changes: 8 additions & 8 deletions src/InteractiveButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ class InteractiveButton : public QPushButton
public:
InteractiveButton(QWidget* parent = nullptr);

protected:
void enterEvent(QEvent* event) override;
void leaveEvent(QEvent* event) override;
void highlight(bool state);
void mustBeSet(bool state);

signals:
void mouseOver(bool state);
// this one is specific for the VDPRegViewer and depends on the
// name of the button also
void newBitValue(int reg, int bit, bool state);

public slots:
void highlight(bool state);
void mustBeSet(bool state);
protected:
void enterEvent(QEvent* event) override;
void leaveEvent(QEvent* event) override;

private slots:
private:
// this one is specific for the VDPRegViewer
void newBitValueSlot(bool);

private:
void setColor();

private:
bool _mustBeSet;
bool _highlight;
bool _state;
Expand Down
Loading

0 comments on commit 2c3fd4c

Please sign in to comment.