mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Switch the return type of File::save() from void to bool to provide a little
bit of feedback on whether or not the safe operation worked. CCMAIL:83882@bugs.kde.org git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@323165 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -176,8 +176,13 @@ const Ogg::PageHeader *Ogg::File::lastPageHeader()
|
||||
return d->lastPageHeader->isValid() ? d->lastPageHeader : 0;
|
||||
}
|
||||
|
||||
void Ogg::File::save()
|
||||
bool Ogg::File::save()
|
||||
{
|
||||
if(readOnly()) {
|
||||
debug("Ogg::File::save() - Cannot save to a read only file.");
|
||||
return false;
|
||||
}
|
||||
|
||||
List<int> pageGroup;
|
||||
|
||||
for(List<int>::ConstIterator it = d->dirtyPages.begin(); it != d->dirtyPages.end(); ++it) {
|
||||
@ -191,6 +196,8 @@ void Ogg::File::save()
|
||||
writePageGroup(pageGroup);
|
||||
d->dirtyPages.clear();
|
||||
d->dirtyPackets.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -73,7 +73,7 @@ namespace TagLib {
|
||||
*/
|
||||
const PageHeader *lastPageHeader();
|
||||
|
||||
virtual void save();
|
||||
virtual bool save();
|
||||
|
||||
protected:
|
||||
/*!
|
||||
|
@ -79,7 +79,7 @@ Vorbis::Properties *Vorbis::File::audioProperties() const
|
||||
return d->properties;
|
||||
}
|
||||
|
||||
void Vorbis::File::save()
|
||||
bool Vorbis::File::save()
|
||||
{
|
||||
ByteVector v(vorbisCommentHeaderID);
|
||||
|
||||
@ -89,7 +89,7 @@ void Vorbis::File::save()
|
||||
|
||||
setPacket(1, v);
|
||||
|
||||
Ogg::File::save();
|
||||
return Ogg::File::save();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -83,7 +83,7 @@ namespace TagLib {
|
||||
*/
|
||||
virtual Properties *audioProperties() const;
|
||||
|
||||
virtual void save();
|
||||
virtual bool save();
|
||||
|
||||
private:
|
||||
File(const File &);
|
||||
|
Reference in New Issue
Block a user