diff --git a/src/display.cpp b/src/display.cpp index c119d78b..af929bb2 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -125,7 +125,7 @@ void showSongs(NC::Menu &menu, const MPD::Song &s, HasSongs &screen, const st buf.removeFormatting(); if (is_now_playing) buf << Config.now_playing_suffix; - menu << NC::XY(menu.getWidth()-buf.str().length()-(is_selected ? Config.selected_item_suffix_length : 0), menu.y()) << buf; + menu << NC::XY(menu.getWidth()-buf.str().length()-(is_selected ? Config.selected_item_suffix_length : 0), menu.getY()) << buf; if (separate_albums) menu << NC::fmtUnderlineEnd; return; @@ -162,13 +162,13 @@ void showSongsInColumns(NC::Menu &menu, const MPD::Song &s, HasSongs &screen) menu << Config.now_playing_prefix; int width; - int y = menu.y(); + int y = menu.getY(); int remained_width = menu.getWidth(); std::vector::const_iterator it, last = Config.columns.end() - 1; for (it = Config.columns.begin(); it != Config.columns.end(); ++it) { // check current X coordinate - int x = menu.x(); + int x = menu.getX(); // column has relative width and all after it have fixed width, // so stretch it so it fills whole screen along with these after. if (it->stretch_limit >= 0) // (*) diff --git a/src/menu.h b/src/menu.h index 9548ed1d..2f9504c1 100644 --- a/src/menu.h +++ b/src/menu.h @@ -455,25 +455,25 @@ template Menu::~Menu() delete *it; } -template void Menu::reserve(size_t size) +template void Menu::reserve(size_t size_) { - m_options.reserve(size); + m_options.reserve(size_); } -template void Menu::resizeList(size_t size) +template void Menu::resizeList(size_t new_size) { - if (size > m_options.size()) + if (new_size > m_options.size()) { - m_options.resize(size); - for (size_t i = 0; i < size; ++i) + m_options.resize(new_size); + for (size_t i = 0; i < new_size; ++i) if (!m_options[i]) m_options[i] = new Item(); } - else if (size < m_options.size()) + else if (new_size < m_options.size()) { - for (size_t i = size; i < m_options.size(); ++i) + for (size_t i = new_size; i < m_options.size(); ++i) delete m_options[i]; - m_options.resize(size); + m_options.resize(new_size); } } diff --git a/src/status.cpp b/src/status.cpp index 61c67a9e..a896aebe 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -216,8 +216,8 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *) static std::string player_state; static MPD::Song np; - int sx = wFooter->x(); - int sy = wFooter->y(); + int sx = wFooter->getX(); + int sy = wFooter->getY(); myPlaylist->NowPlaying = Mpd.GetCurrentlyPlayingSongPos(); diff --git a/src/window.cpp b/src/window.cpp index 260fdafd..04e9063c 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -420,7 +420,7 @@ void Window::pushChar(int ch) m_input_queue.push(ch); } -std::string Window::getString(const std::string &base, size_t length, size_t width, bool encrypted) +std::string Window::getString(const std::string &base, size_t length_, size_t width, bool encrypted) { int input; size_t beginning, maxbeginning, minx, x, real_x, y, maxx, real_maxx; @@ -584,7 +584,7 @@ std::string Window::getString(const std::string &base, size_t length, size_t wid break; default: { - if (tmp->length() >= length) + if (tmp->length() >= length_) break; tmp_in += input; @@ -647,12 +647,12 @@ void Window::goToXY(int x, int y) wmove(m_window, y, x); } - int Window::x() +int Window::getX() { return getcurx(m_window); } -int Window::y() +int Window::getY() { return getcury(m_window); } diff --git a/src/window.h b/src/window.h index c0fbad99..1984c583 100644 --- a/src/window.h +++ b/src/window.h @@ -240,14 +240,14 @@ struct Window /// @see setGetStringHelper() /// @see SetTimeout() /// @see CreateHistory() - std::string getString(const std::string &base, size_t length = -1, + std::string getString(const std::string &base, size_t length_ = -1, size_t width = 0, bool encrypted = 0); /// Wrapper for above function that doesn't take base string (it will be empty). /// Taken parameters are the same as for above. - std::string getString(size_t length = -1, size_t width = 0, bool encrypted = 0) + std::string getString(size_t length_ = -1, size_t width = 0, bool encrypted = 0) { - return getString("", length, width, encrypted); + return getString("", length_, width, encrypted); } /// Moves cursor to given coordinates @@ -256,12 +256,10 @@ struct Window void goToXY(int x, int y); /// @return x window coordinate - /// @see GetXy() - int x(); + int getX(); /// @return y windows coordinate - /// @see GetXy() - int y(); + int getY(); /// Used to indicate whether given coordinates of main screen lies within /// window area or not and if they do, transform them into in-window coords.