[vlmc-devel] Use QSharedPointer<Clip>::create
Yikai Lu
git at videolan.org
Mon Aug 22 22:01:01 CEST 2016
vlmc | branch: medialibrary | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Aug 21 18:11:36 2016 -0500| [acec279330f4956a6054b1ebd122674aadedf76b] | committer: Hugo Beauzée-Luyssen
Use QSharedPointer<Clip>::create
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> https://code.videolan.org/videolan/vlmc/commit/acec279330f4956a6054b1ebd122674aadedf76b
---
src/Media/Media.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp
index 864a540..5f5582e 100644
--- a/src/Media/Media.cpp
+++ b/src/Media/Media.cpp
@@ -125,7 +125,7 @@ Media::baseClip()
QSharedPointer<Clip>
Media::cut( qint64 begin, qint64 end )
{
- auto clip = QSharedPointer<Clip>( new Clip( sharedFromThis(), begin, end ) );
+ auto clip = QSharedPointer<Clip>::create( sharedFromThis(), begin, end );
m_clips[clip->uuid()] = clip;
emit subclipAdded( clip );
return clip;
@@ -193,7 +193,7 @@ Media::fromVariant( const QVariant& v )
auto uuid = m["uuid"].toUuid();
auto mlMedia = Core::instance()->mediaLibrary()->media( mediaId );
//FIXME: Is QSharedPointer exception safe in case its constructor throws an exception?
- auto media = QSharedPointer<Media>( new Media( mlMedia, uuid ) );
+ auto media = QSharedPointer<Media>::create( mlMedia, uuid );
// Now load the subclips:
if ( m.contains( "clips" ) == false )
@@ -225,7 +225,7 @@ Media::loadSubclip( const QVariantMap& m )
const auto begin = m["begin"].toLongLong();
const auto end = m["end"].toLongLong();
const auto formats = m["formats"].toInt();
- auto clip = QSharedPointer<Clip>( new Clip( sharedFromThis(), begin, end, uuid ) );
+ auto clip = QSharedPointer<Clip>::create( sharedFromThis(), begin, end, uuid );
clip->setFormats( static_cast<Clip::Formats>( formats ) );
m_clips[uuid] = clip;
More information about the Vlmc-devel
mailing list