Bug 125832 - Changing of meta data not saved
Summary: Changing of meta data not saved
Status: RESOLVED FIXED
Alias: None
Product: kfile-plugins
Classification: Applications
Component: mp3 (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Multimedia Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-18 21:34 UTC by erik_t
Modified: 2006-04-22 22:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description erik_t 2006-04-18 21:34:53 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    SuSE RPMs
OS:                Linux

When I click right on a file, and then try to change the meta datas of a mp3, not all will be saved, if I also change the filename. Only the name is changed. When I then change the metas, then it will be saved.
Comment 1 Carsten Pfeiffer 2006-04-22 22:33:41 UTC
SVN commit 532794 by pfeiffer:

KPropertiesDialog first renames the file, then allows all
plugins to save their changes.
-> the KFileMetaInfo-plugin needs to write to the new file
   instead of the old
BUG: 125832


 M  +1 -1      kfile/kmetaprops.cpp  
 M  +13 -1     kio/kfilemetainfo.cpp  
 M  +10 -1     kio/kfilemetainfo.h  


--- branches/KDE/3.5/kdelibs/kio/kfile/kmetaprops.cpp #532793:532794
@@ -262,7 +262,7 @@
   QPtrListIterator<KFileMetaInfoWidget> it( d->m_editWidgets );
   KFileMetaInfoWidget* w;
   for (; (w = it.current()); ++it) w->apply();
-  d->m_info.applyChanges();
+  d->m_info.applyChanges(properties->kurl().path());
 }
 
 #include "kmetaprops.moc"
--- branches/KDE/3.5/kdelibs/kio/kio/kfilemetainfo.cpp #532793:532794
@@ -527,6 +527,11 @@
 
 bool KFileMetaInfo::applyChanges()
 {
+    return applyChanges( path() );
+}
+
+bool KFileMetaInfo::applyChanges( const QString& path )
+{
     bool doit = false;
 
 //    kdDebug(7033) << "KFileMetaInfo::applyChanges()\n";
@@ -563,7 +568,14 @@
 
 //    kdDebug(7033) << "Ok, trying to write the info\n";
 
-    return p->writeInfo(*this);
+    KURL savedURL = url();
+    d->url = KURL();
+    d->url.setPath( path );
+    
+    bool ret = p->writeInfo(*this);
+    
+    d->url = savedURL;
+    return ret;
 }
 
 KFilePlugin * const KFileMetaInfo::plugin() const
--- branches/KDE/3.5/kdelibs/kio/kio/kfilemetainfo.h #532793:532794
@@ -1149,7 +1149,16 @@
     */
     bool applyChanges();
 
-    /**
+   /**
+    * This method writes all pending changes of the meta info to the file @p path.
+    * If any items are marked as removed, they are really removed from the
+    * list. The info object as well as all items are updated.
+    *
+    * @return true if successful, false if not
+    */
+    bool applyChanges(const QString& path);
+
+   /**
      * Checks whether an item with the given @p key exists.
      *
      * @param key the key to check