]> granicus.if.org Git - taglib/commitdiff
oops -- forgot FLAC -- return bool for the FLAC::File::save() too to provide
authorScott Wheeler <wheeler@kde.org>
Wed, 23 Jun 2004 18:45:26 +0000 (18:45 +0000)
committerScott Wheeler <wheeler@kde.org>
Wed, 23 Jun 2004 18:45:26 +0000 (18:45 +0000)
some information on if the save was successful.

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@323170 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

flac/flacfile.cpp
flac/flacfile.h
ogg/flac/oggflacfile.cpp
ogg/flac/oggflacfile.h

index b8315ee49e4fadf99d215bfabc197ba11e2cf1bb..81e60e6fbd2b1e96c44d8c180d8736b67bbf3019 100644 (file)
@@ -122,8 +122,13 @@ FLAC::Properties *FLAC::File::audioProperties() const
 }
 
 
-void FLAC::File::save()
+bool FLAC::File::save()
 {
+  if(readOnly()) {
+    debug("FLAC::File::save() - Cannot save to a read only file.");
+    return false;
+  }
+
   // Create new vorbis comments
 
   if(!d->comment) {
@@ -214,6 +219,7 @@ void FLAC::File::save()
     writeBlock(d->ID3v1Tag->render());
   }
 
+  return true;
 }
 
 ID3v2::Tag *FLAC::File::ID3v2Tag(bool create)
index 2a0ca0159e67b2f03d87ab914d277424e4cfb0f8..9fef90398cae2c7f1c726e056b199d3494416017 100644 (file)
@@ -108,8 +108,10 @@ namespace TagLib {
        * Save the file.  This will primarily save the XiphComment, but
        * will also keep any old ID3-tags up to date. If the file
        * has no XiphComment, one will be constructed from the ID3-tags.
+       *
+       * This returns true if the save was successful.
        */
-      virtual void save();
+      virtual bool save();
 
       /*!
        * Returns a pointer to the ID3v2 tag of the file.
index fe7b0d05a69d59b19b6d0ebe7fc25083677863cd..9f8fd7cf806211b23b2d4ee4bf229c761cfe24c5 100644 (file)
@@ -87,7 +87,7 @@ Properties *Ogg::FLAC::File::audioProperties() const
 }
 
 
-void Ogg::FLAC::File::save()
+bool Ogg::FLAC::File::save()
 {
   d->xiphCommentData = d->comment->render();
 
@@ -110,7 +110,7 @@ void Ogg::FLAC::File::save()
 
   setPacket(d->commentPacket, v);
 
-  Ogg::File::save();
+  return Ogg::File::save();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
index 5ef7f8a4a16f3f6c1fab3a66f0213313e3c26b68..1804e118427832fc61dfb2dab28e1ecd52e0af30 100644 (file)
@@ -83,8 +83,9 @@ namespace TagLib {
 
       /*!
        * Save the file.  This will primarily save and update the XiphComment.
+       * Returns true if the save is successful.
        */
-      virtual void save();
+      virtual bool save();
 
       /*!
        * Returns the length of the audio-stream, used by FLAC::Properties for