More utos() cleanups
I found a few other places where I can use utos() instead of stringstreams. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
12260a3de9
commit
ed43fd3689
|
@ -2,17 +2,15 @@
|
|||
* @file
|
||||
* Copyright 2014 (c) Anna Schumaker.
|
||||
*/
|
||||
#include <core/string.h>
|
||||
#include <core/tags/album.h>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
static Database<Album> album_db("album.db", true);
|
||||
|
||||
static const std::string make_key(const std::string &name, unsigned int year)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << year << "/" << name;
|
||||
return ss.str();
|
||||
return string :: utos(year) + "/" + name;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#include <core/string.h>
|
||||
#include <core/tags/track.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
|
@ -81,10 +80,9 @@ const std::string Track :: path() const
|
|||
|
||||
const std::string Track :: primary_key() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
if (_library)
|
||||
ss << _library->index() << "/" << _path;
|
||||
return ss.str();
|
||||
return string :: utos(_library->index()) + "/" + _path;
|
||||
return "";
|
||||
}
|
||||
|
||||
void Track :: played()
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
*/
|
||||
#include <core/callback.h>
|
||||
#include <core/deck.h>
|
||||
#include <core/string.h>
|
||||
#include <gui/tabs.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
|
||||
static unsigned int q_col_width[] = { 20, 300, 60, 100, 100, 45, 100, 60, 1 };
|
||||
|
||||
|
@ -252,16 +251,16 @@ bool QueueTab :: on_key_press_event(const std::string &key)
|
|||
|
||||
void QueueTab :: tab_set_size()
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "<span size='x-large'>" << tab_pq->size() << "</span>";
|
||||
q_tab_size.set_markup(ss.str());
|
||||
std::string span = "<span size='x-large'>";
|
||||
span += string :: utos(tab_pq->size()) + "</span>";
|
||||
q_tab_size.set_markup(span);
|
||||
}
|
||||
|
||||
void QueueTab :: queue_set_number(unsigned int num)
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << "<span size='x-large'>" << num << ". </span>";
|
||||
q_tab_number.set_markup(ss.str());
|
||||
std::string span = "<span size='x-large'>";
|
||||
span += string :: utos(num) + ". </span>";
|
||||
q_tab_number.set_markup(span);
|
||||
}
|
||||
|
||||
void QueueTab :: on_tab_reordered()
|
||||
|
|
Loading…
Reference in New Issue