diff options
Diffstat (limited to 'libkms++')
-rw-r--r-- | libkms++/connector.cpp | 7 | ||||
-rw-r--r-- | libkms++/connector.h | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/libkms++/connector.cpp b/libkms++/connector.cpp index 0731f2b..8ff5a5f 100644 --- a/libkms++/connector.cpp +++ b/libkms++/connector.cpp @@ -89,16 +89,15 @@ Videomode Connector::get_default_mode() const return drm_mode_to_video_mode(drmmode); } -Videomode Connector::get_mode(const char *mode) const +Videomode Connector::get_mode(const string& mode) const { auto c = m_priv->drm_connector; - string sMode(mode); for (int i = 0; i < c->count_modes; i++) - if (sMode == c->modes[i].name) + if (mode == c->modes[i].name) return drm_mode_to_video_mode(c->modes[i]); - throw invalid_argument(sMode + ": mode not found"); + throw invalid_argument(mode + ": mode not found"); } bool Connector::connected() const diff --git a/libkms++/connector.h b/libkms++/connector.h index 198a6dd..14e6b36 100644 --- a/libkms++/connector.h +++ b/libkms++/connector.h @@ -34,7 +34,7 @@ public: Videomode get_default_mode() const; - Videomode get_mode(const char *mode) const; + Videomode get_mode(const std::string& mode) const; Crtc* get_current_crtc() const { return m_current_crtc; } std::vector<Crtc*> get_possible_crtcs() const; |