[Bug 125832] Changing of meta data not saved

Carsten Pfeiffer pfeiffer at kde.org
Sat Apr 22 21:33:42 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=125832         
pfeiffer kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From pfeiffer kde org  2006-04-22 22:33 -------
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



More information about the kde-multimedia mailing list