Commit 5e64c2a3 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Clip: Fix parent mrl when using workspace.

parent 4079c047
......@@ -29,6 +29,8 @@
#include "MediaContainer.h"
#include "Media.h"
#include "MetaDataManager.h"
#include "SettingsManager.h"
#include "Workspace.h"
#include <QtDebug>
......@@ -203,6 +205,10 @@ MediaContainer::load( const QDomElement &clips, MediaContainer *parentMC )
if ( clip.hasAttribute( "media" ) == true )
{
QString media = clip.attribute( "media" );
//Handle workspace stuff.
if ( media.startsWith( Workspace::workspacePrefix ) == true )
media = media.replace( Workspace::workspacePrefix, VLMC_PROJECT_GET_STRING( "general/ProjectDir" ) );
if ( m_medias.contains( media ) == true )
{
Media* m = m_medias[media];
......
......@@ -29,6 +29,7 @@
#include "Clip.h"
#include "Library.h"
#include "Media.h"
#include "Workspace.h"
const int Clip::DefaultFPS = 30;
......@@ -229,7 +230,12 @@ Clip::save( QXmlStreamWriter &project )
{
project.writeStartElement( "clip" );
if ( isRootClip() == true )
project.writeAttribute( "media", m_media->fileInfo()->absoluteFilePath() );
{
if ( m_media->isInWorkspace() == true )
project.writeAttribute( "media", Workspace::pathInProjectDir( m_media ) );
else
project.writeAttribute( "media", m_media->fileInfo()->absoluteFilePath() );
}
else
{
project.writeAttribute( "parent", m_parent->uuid() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment