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:
Scott Wheeler
2004-06-23 18:35:52 +00:00
parent 5f2e59150c
commit 420541441c
7 changed files with 39 additions and 28 deletions

View File

@ -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;
}
////////////////////////////////////////////////////////////////////////////////