Skip to content

Commit

Permalink
C++11 modernization: Use the 'override' keyword. (mythplugins/mythbro…
Browse files Browse the repository at this point in the history
…wser)

The new override keyword should be used on functions in a derived
classes that overload a function in their base class.  It implicitly
declares the function as virtual, so it replaces that keyword.  It
additionally requires that a function exist in the base class with the
exact same type signature.  I.E. it validates that the overridden
function exists.  This prevents functions that look like they override
a base class function but don't.
  • Loading branch information
linuxdude42 committed Oct 26, 2018
1 parent f8ffc1e commit 022532a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions mythplugins/mythbrowser/mythbrowser/bookmarkeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class BookmarkEditor : public MythScreenType
const char *name);
~BookmarkEditor() = default;

bool Create(void);
bool keyPressEvent(QKeyEvent *event);
bool Create(void) override; // MythScreenType
bool keyPressEvent(QKeyEvent *event) override; // MythScreenType

private:
Bookmark *m_site;
Expand Down
8 changes: 4 additions & 4 deletions mythplugins/mythbrowser/mythbrowser/bookmarkmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class BrowserConfig : public MythScreenType
BrowserConfig(MythScreenStack *parent, const char *name = nullptr);
~BrowserConfig() = default;

bool Create(void);
bool keyPressEvent(QKeyEvent *);
bool Create(void) override; // MythScreenType
bool keyPressEvent(QKeyEvent *) override; // MythScreenType

private:
MythUITextEdit *m_commandEdit;
Expand All @@ -64,8 +64,8 @@ class BookmarkManager : public MythScreenType
BookmarkManager(MythScreenStack *parent, const char *name);
~BookmarkManager();

bool Create(void);
bool keyPressEvent(QKeyEvent *);
bool Create(void) override; // MythScreenType
bool keyPressEvent(QKeyEvent *) override; // MythScreenType

private slots:
void slotGroupSelected(MythUIButtonListItem *item);
Expand Down
4 changes: 2 additions & 2 deletions mythplugins/mythbrowser/mythbrowser/mythbrowser.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class MythBrowser : public MythScreenType
MythBrowser(MythScreenStack *parent, QStringList &urlList);
~MythBrowser();

bool Create(void);
bool keyPressEvent(QKeyEvent *);
bool Create(void) override; // MythScreenType
bool keyPressEvent(QKeyEvent *) override; // MythScreenType

void setDefaultSaveDirectory(const QString &saveDir) { m_defaultSaveDir = saveDir; }
void setDefaultSaveFilename(const QString &saveFile) { m_defaultSaveFilename = saveFile; }
Expand Down
4 changes: 2 additions & 2 deletions mythplugins/mythbrowser/mythbrowser/mythflashplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ class MythFlashPlayer : public MythScreenType
MythFlashPlayer(MythScreenStack *parent, QStringList &urlList);
~MythFlashPlayer();

bool Create(void);
bool keyPressEvent(QKeyEvent *);
bool Create(void) override; // MythScreenType
bool keyPressEvent(QKeyEvent *) override; // MythScreenType

private:
QVariant evaluateJavaScript(const QString&);
Expand Down

0 comments on commit 022532a

Please sign in to comment.