Return empty string from wxDisplayImpl::GetName() by default

Simplify the code by not making this function pure virtual as all the
ports except MSW had to override it just to return an empty string.

Instead, just return empty string by default as it's not critical to
force the derived classes to override this function.
This commit is contained in:
Vadim Zeitlin
2018-10-04 16:37:12 +02:00
parent f704c40207
commit 9cc1424b84
5 changed files with 1 additions and 19 deletions

View File

@@ -79,7 +79,7 @@ public:
virtual wxRect GetClientArea() const { return GetGeometry(); }
// return the name (may be empty)
virtual wxString GetName() const = 0;
virtual wxString GetName() const { return wxString(); }
// return the index of this display
unsigned GetIndex() const { return m_index; }
@@ -125,8 +125,6 @@ class WXDLLEXPORT wxDisplayImplSingle : public wxDisplayImpl
public:
wxDisplayImplSingle() : wxDisplayImpl(0) { }
virtual wxString GetName() const wxOVERRIDE { return wxString(); }
#if wxUSE_DISPLAY
// no video modes support for us, provide just the stubs
virtual wxArrayVideoModes

View File

@@ -96,7 +96,6 @@ public:
virtual wxRect GetClientArea() const wxOVERRIDE;
#if wxUSE_DISPLAY
virtual wxString GetName() const wxOVERRIDE;
virtual bool IsPrimary() const wxOVERRIDE;
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
@@ -206,11 +205,6 @@ wxRect wxDisplayImplGTK::GetClientArea() const
}
#if wxUSE_DISPLAY
wxString wxDisplayImplGTK::GetName() const
{
return wxString();
}
bool wxDisplayImplGTK::IsPrimary() const
{
#ifdef __WXGTK4__

View File

@@ -73,7 +73,6 @@ public:
virtual wxRect GetGeometry() const wxOVERRIDE;
virtual wxRect GetClientArea() const wxOVERRIDE;
virtual wxString GetName() const wxOVERRIDE { return wxString(); }
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;

View File

@@ -22,8 +22,6 @@ public:
virtual wxRect GetGeometry() const wxOVERRIDE;
virtual wxRect GetClientArea() const wxOVERRIDE;
virtual wxString GetName() const wxOVERRIDE;
#if wxUSE_DISPLAY
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
@@ -46,11 +44,6 @@ wxRect wxDisplayImplQt::GetClientArea() const
return wxQtConvertRect( QApplication::desktop()->availableGeometry( GetIndex() ));
}
wxString wxDisplayImplQt::GetName() const
{
return wxString();
}
#if wxUSE_DISPLAY
wxArrayVideoModes wxDisplayImplQt::GetModes(const wxVideoMode& WXUNUSED(mode)) const
{

View File

@@ -132,8 +132,6 @@ public:
return IsPrimary() ? wxGetMainScreenWorkArea() : m_rect;
}
virtual wxString GetName() const wxOVERRIDE { return wxString(); }
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const wxOVERRIDE;
virtual wxVideoMode GetCurrentMode() const wxOVERRIDE;
virtual bool ChangeMode(const wxVideoMode& mode) wxOVERRIDE;