Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
VLMC
Commits
8892561b
Commit
8892561b
authored
Mar 07, 2010
by
Hugo Beauzee-Luyssen
Browse files
Media: Base clip can't be const.
Ho and please, don't clone an objet to get over its constness.
parent
9f6df32d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/Gui/library/MediaCellView.cpp
View file @
8892561b
...
...
@@ -133,15 +133,14 @@ void MediaCellView::mouseMoveEvent( QMouseEvent* event )
QDrag
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
);
//FIXME : change the way the library handles Clips
Clip
*
clip
=
Library
::
getInstance
()
->
clip
(
m_uuid
);
const
Clip
*
clip
=
Library
::
getInstance
()
->
clip
(
m_uuid
);
if
(
0
==
clip
)
return
;
//getting the media from the current Clip
Media
*
parent
=
Library
::
getInstance
()
->
clip
(
m_uuid
)
->
getParent
();
const
Media
*
parent
=
Library
::
getInstance
()
->
clip
(
m_uuid
)
->
getParent
();
if
(
0
==
parent
)
return
;
drag
->
setPixmap
(
Library
::
getInstance
()
->
clip
(
m_uuid
)
->
getParent
()
->
snapshot
().
scaled
(
100
,
100
,
Qt
::
KeepAspectRatio
)
);
drag
->
setPixmap
(
parent
->
snapshot
().
scaled
(
100
,
100
,
Qt
::
KeepAspectRatio
)
);
drag
->
exec
(
Qt
::
CopyAction
|
Qt
::
MoveAction
,
Qt
::
CopyAction
);
}
...
...
src/Library/Library.cpp
View file @
8892561b
...
...
@@ -61,8 +61,7 @@ Library::clip( const QUuid& uuid )
Media
*
media
=
m_medias
.
value
(
uuid
);
if
(
media
->
baseClip
()
==
NULL
)
return
NULL
;
Clip
*
clip
=
new
Clip
(
media
->
baseClip
()
);
return
clip
;
return
media
->
baseClip
();
}
QUuid
mediaUuid
;
...
...
@@ -83,7 +82,7 @@ Library::clip( const QUuid& mediaUuid, const QUuid& clipUuid )
if
(
m_medias
.
value
(
mediaUuid
)
->
clips
().
contains
(
clipUuid
)
)
return
m_medias
.
value
(
mediaUuid
)
->
clip
(
clipUuid
);
else
return
new
Clip
(
m_medias
.
value
(
mediaUuid
)
->
baseClip
()
)
;
m_medias
.
value
(
mediaUuid
)
->
baseClip
();
}
return
NULL
;
}
...
...
src/Media/Clip.h
View file @
8892561b
...
...
@@ -69,7 +69,6 @@ class Clip : public QObject
/**
\return Returns the Media that the clip was basep uppon.
*/
Media
*
getParent
();
...
...
src/Media/Media.h
View file @
8892561b
...
...
@@ -148,7 +148,7 @@ public:
QList
<
int
>*
audioValues
()
{
return
m_audioValueList
;
}
const
Clip
*
baseClip
()
const
{
return
m_baseClip
;
}
Clip
*
baseClip
()
{
return
m_baseClip
;
}
private:
void
setFileType
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment