[vlmc-devel] Library: Save media list from Library class & ensure they are saved with their workspace path
Hugo Beauzée-Luyssen
git at videolan.org
Wed Apr 2 18:55:43 CEST 2014
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Wed Apr 2 19:07:12 2014 +0300| [6b0c72b9b6cee99ff17813f6b8f9564140eb28b2] | committer: Hugo Beauzée-Luyssen
Library: Save media list from Library class & ensure they are saved with their workspace path
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=6b0c72b9b6cee99ff17813f6b8f9564140eb28b2
---
src/Library/Library.cpp | 6 +++++-
src/Media/Media.cpp | 8 --------
src/Media/Media.h | 2 --
3 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/Library/Library.cpp b/src/Library/Library.cpp
index 6392f77..5e102a3 100644
--- a/src/Library/Library.cpp
+++ b/src/Library/Library.cpp
@@ -94,7 +94,11 @@ Library::save( QXmlStreamWriter& project )
project.writeStartElement( "medias" );
while ( it != end )
{
- it.value()->getMedia()->save( project );
+ Q_ASSERT( (*it)->isRootClip() == true );
+ const Media* m = (*it)->getMedia();
+ project.writeStartElement( "media" );
+ project.writeAttribute( "mrl", m_workspace->toWorkspacePath( m ) );
+ project.writeEndElement();
++it;
}
project.writeEndElement();
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp
index 0e481da..fb2b09c 100644
--- a/src/Media/Media.cpp
+++ b/src/Media/Media.cpp
@@ -112,14 +112,6 @@ Media::source() const
}
void
-Media::save( QXmlStreamWriter& project )
-{
- project.writeStartElement( "media" );
- project.writeAttribute( "mrl", m_fileInfo->absoluteFilePath() );
- project.writeEndElement();
-}
-
-void
Media::setBaseClip( Clip *clip )
{
Q_ASSERT( m_baseClip == NULL );
diff --git a/src/Media/Media.h b/src/Media/Media.h
index ae6bdf0..d891be7 100644
--- a/src/Media/Media.h
+++ b/src/Media/Media.h
@@ -95,8 +95,6 @@ public:
const Clip* baseClip() const { return m_baseClip; }
void setBaseClip( Clip* clip );
- void save( QXmlStreamWriter& project );
-
void onMetaDataComputed();
// This has to be called from the GUI thread.
More information about the Vlmc-devel
mailing list