Kaynağa Gözat

LibGUI: Make Window::set_title() take a String

Andreas Kling 4 yıl önce
ebeveyn
işleme
050648b270

+ 3 - 3
Userland/Libraries/LibGUI/Window.cpp

@@ -220,12 +220,12 @@ void Window::hide()
     }
 }
 
-void Window::set_title(const StringView& title)
+void Window::set_title(String title)
 {
-    m_title_when_windowless = title;
+    m_title_when_windowless = move(title);
     if (!is_visible())
         return;
-    WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowTitle>(m_window_id, title);
+    WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowTitle>(m_window_id, m_title_when_windowless);
 }
 
 String Window::title() const

+ 1 - 1
Userland/Libraries/LibGUI/Window.h

@@ -81,7 +81,7 @@ public:
     int window_id() const { return m_window_id; }
 
     String title() const;
-    void set_title(const StringView&);
+    void set_title(String);
 
     Color background_color() const { return m_background_color; }
     void set_background_color(Color color) { m_background_color = color; }