fix shadowing warnings
This commit is contained in:
@@ -125,7 +125,7 @@ void showSongs(NC::Menu<T> &menu, const MPD::Song &s, HasSongs &screen, const st
|
|||||||
buf.removeFormatting();
|
buf.removeFormatting();
|
||||||
if (is_now_playing)
|
if (is_now_playing)
|
||||||
buf << Config.now_playing_suffix;
|
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)
|
if (separate_albums)
|
||||||
menu << NC::fmtUnderlineEnd;
|
menu << NC::fmtUnderlineEnd;
|
||||||
return;
|
return;
|
||||||
@@ -162,13 +162,13 @@ void showSongsInColumns(NC::Menu<T> &menu, const MPD::Song &s, HasSongs &screen)
|
|||||||
menu << Config.now_playing_prefix;
|
menu << Config.now_playing_prefix;
|
||||||
|
|
||||||
int width;
|
int width;
|
||||||
int y = menu.y();
|
int y = menu.getY();
|
||||||
int remained_width = menu.getWidth();
|
int remained_width = menu.getWidth();
|
||||||
std::vector<Column>::const_iterator it, last = Config.columns.end() - 1;
|
std::vector<Column>::const_iterator it, last = Config.columns.end() - 1;
|
||||||
for (it = Config.columns.begin(); it != Config.columns.end(); ++it)
|
for (it = Config.columns.begin(); it != Config.columns.end(); ++it)
|
||||||
{
|
{
|
||||||
// check current X coordinate
|
// check current X coordinate
|
||||||
int x = menu.x();
|
int x = menu.getX();
|
||||||
// column has relative width and all after it have fixed width,
|
// column has relative width and all after it have fixed width,
|
||||||
// so stretch it so it fills whole screen along with these after.
|
// so stretch it so it fills whole screen along with these after.
|
||||||
if (it->stretch_limit >= 0) // (*)
|
if (it->stretch_limit >= 0) // (*)
|
||||||
|
|||||||
18
src/menu.h
18
src/menu.h
@@ -455,25 +455,25 @@ template <typename T> Menu<T>::~Menu()
|
|||||||
delete *it;
|
delete *it;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> void Menu<T>::reserve(size_t size)
|
template <typename T> void Menu<T>::reserve(size_t size_)
|
||||||
{
|
{
|
||||||
m_options.reserve(size);
|
m_options.reserve(size_);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T> void Menu<T>::resizeList(size_t size)
|
template <typename T> void Menu<T>::resizeList(size_t new_size)
|
||||||
{
|
{
|
||||||
if (size > m_options.size())
|
if (new_size > m_options.size())
|
||||||
{
|
{
|
||||||
m_options.resize(size);
|
m_options.resize(new_size);
|
||||||
for (size_t i = 0; i < size; ++i)
|
for (size_t i = 0; i < new_size; ++i)
|
||||||
if (!m_options[i])
|
if (!m_options[i])
|
||||||
m_options[i] = new Item();
|
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];
|
delete m_options[i];
|
||||||
m_options.resize(size);
|
m_options.resize(new_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,8 +216,8 @@ void NcmpcppStatusChanged(MPD::Connection *, MPD::StatusChanges changed, void *)
|
|||||||
static std::string player_state;
|
static std::string player_state;
|
||||||
static MPD::Song np;
|
static MPD::Song np;
|
||||||
|
|
||||||
int sx = wFooter->x();
|
int sx = wFooter->getX();
|
||||||
int sy = wFooter->y();
|
int sy = wFooter->getY();
|
||||||
|
|
||||||
myPlaylist->NowPlaying = Mpd.GetCurrentlyPlayingSongPos();
|
myPlaylist->NowPlaying = Mpd.GetCurrentlyPlayingSongPos();
|
||||||
|
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ void Window::pushChar(int ch)
|
|||||||
m_input_queue.push(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;
|
int input;
|
||||||
size_t beginning, maxbeginning, minx, x, real_x, y, maxx, real_maxx;
|
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;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
if (tmp->length() >= length)
|
if (tmp->length() >= length_)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
tmp_in += input;
|
tmp_in += input;
|
||||||
@@ -647,12 +647,12 @@ void Window::goToXY(int x, int y)
|
|||||||
wmove(m_window, y, x);
|
wmove(m_window, y, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Window::x()
|
int Window::getX()
|
||||||
{
|
{
|
||||||
return getcurx(m_window);
|
return getcurx(m_window);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Window::y()
|
int Window::getY()
|
||||||
{
|
{
|
||||||
return getcury(m_window);
|
return getcury(m_window);
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/window.h
12
src/window.h
@@ -240,14 +240,14 @@ struct Window
|
|||||||
/// @see setGetStringHelper()
|
/// @see setGetStringHelper()
|
||||||
/// @see SetTimeout()
|
/// @see SetTimeout()
|
||||||
/// @see CreateHistory()
|
/// @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);
|
size_t width = 0, bool encrypted = 0);
|
||||||
|
|
||||||
/// Wrapper for above function that doesn't take base string (it will be empty).
|
/// Wrapper for above function that doesn't take base string (it will be empty).
|
||||||
/// Taken parameters are the same as for above.
|
/// 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
|
/// Moves cursor to given coordinates
|
||||||
@@ -256,12 +256,10 @@ struct Window
|
|||||||
void goToXY(int x, int y);
|
void goToXY(int x, int y);
|
||||||
|
|
||||||
/// @return x window coordinate
|
/// @return x window coordinate
|
||||||
/// @see GetXy()
|
int getX();
|
||||||
int x();
|
|
||||||
|
|
||||||
/// @return y windows coordinate
|
/// @return y windows coordinate
|
||||||
/// @see GetXy()
|
int getY();
|
||||||
int y();
|
|
||||||
|
|
||||||
/// Used to indicate whether given coordinates of main screen lies within
|
/// 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.
|
/// window area or not and if they do, transform them into in-window coords.
|
||||||
|
|||||||
Reference in New Issue
Block a user