tag editor: fix filename change detection

This commit is contained in:
Andrzej Rybczak
2014-08-27 06:09:22 +02:00
parent e7c2e7790f
commit e3e6aa09cc
6 changed files with 24 additions and 24 deletions

View File

@@ -18,6 +18,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
#include "statusbar.h"
#include <boost/algorithm/string/split.hpp>
#include "mutable_song.h"
@@ -138,18 +139,17 @@ void MutableSong::setComment(const std::string &value, unsigned idx)
replaceTag(MPD_TAG_COMMENT, Song::getComment(idx), value, idx);
}
const std::string &MutableSong::getNewURI() const
const std::string &MutableSong::getNewName() const
{
return m_uri;
return m_name;
}
void MutableSong::setNewURI(const std::string &value)
void MutableSong::setNewName(const std::string &value)
{
std::string orig_uri = getURI();
if (orig_uri == value)
m_uri.clear();
if (getName() == value)
m_name.clear();
else
m_uri = value;
m_name = value;
}
unsigned MutableSong::getDuration() const
@@ -191,12 +191,12 @@ void MutableSong::setTags(SetFunction set, const std::string &value, const std::
bool MutableSong::isModified() const
{
return !m_uri.empty() || !m_tags.empty();
return !m_name.empty() || !m_tags.empty();
}
void MutableSong::clearModifications()
{
m_uri.clear();
m_name.clear();
m_tags.clear();
}