clipboard: vector size only calculated once.
transition: check of t pointer inside the check sourcescommon: logical expression simplified.
This commit is contained in:
+4
-2
@@ -8,14 +8,16 @@ QVector<void*> clipboard;
|
|||||||
QVector<Transition*> clipboard_transitions;
|
QVector<Transition*> clipboard_transitions;
|
||||||
|
|
||||||
void clear_clipboard() {
|
void clear_clipboard() {
|
||||||
for (int i=0;i<clipboard.size();i++) {
|
uint clipboard_size = clipboard.size();
|
||||||
|
for (int i=0;i<clipboard_size;i++) {
|
||||||
if (clipboard_type == CLIPBOARD_TYPE_CLIP) {
|
if (clipboard_type == CLIPBOARD_TYPE_CLIP) {
|
||||||
delete static_cast<Clip*>(clipboard.at(i));
|
delete static_cast<Clip*>(clipboard.at(i));
|
||||||
} else if (clipboard_type == CLIPBOARD_TYPE_EFFECT) {
|
} else if (clipboard_type == CLIPBOARD_TYPE_EFFECT) {
|
||||||
delete static_cast<Effect*>(clipboard.at(i));
|
delete static_cast<Effect*>(clipboard.at(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (int i=0;clipboard_transitions.size();i++) {
|
clipboard_size = clipboard_transitions.size();
|
||||||
|
for (int i=0;i<clipboard_size;i++) {
|
||||||
delete clipboard_transitions.at(i);
|
delete clipboard_transitions.at(i);
|
||||||
}
|
}
|
||||||
clipboard.clear();
|
clipboard.clear();
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ void SourcesCommon::dropEvent(QWidget* parent, QDropEvent *event, const QModelIn
|
|||||||
|
|
||||||
// dragging files within project
|
// dragging files within project
|
||||||
// if we dragged to the root OR dragged to a folder
|
// if we dragged to the root OR dragged to a folder
|
||||||
if (!drop_item.isValid() || (drop_item.isValid() && m->get_type() == MEDIA_TYPE_FOLDER)) {
|
if (!drop_item.isValid() || m->get_type() == MEDIA_TYPE_FOLDER) {
|
||||||
QVector<Media*> move_items;
|
QVector<Media*> move_items;
|
||||||
for (int i=0;i<items.size();i++) {
|
for (int i=0;i<items.size();i++) {
|
||||||
const QModelIndex& item = items.at(i);
|
const QModelIndex& item = items.at(i);
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ Transition* get_transition_from_meta(Clip* c, Clip* s, const EffectMeta* em) {
|
|||||||
|
|
||||||
int create_transition(Clip* c, Clip* s, const EffectMeta* em, long length) {
|
int create_transition(Clip* c, Clip* s, const EffectMeta* em, long length) {
|
||||||
Transition* t = get_transition_from_meta(c, s, em);
|
Transition* t = get_transition_from_meta(c, s, em);
|
||||||
if (length >= 0) t->set_length(length);
|
|
||||||
if (t != NULL) {
|
if (t != NULL) {
|
||||||
|
if (length >= 0) t->set_length(length);
|
||||||
QVector<Transition*>& transition_list = (c->sequence == NULL) ? clipboard_transitions : c->sequence->transitions;
|
QVector<Transition*>& transition_list = (c->sequence == NULL) ? clipboard_transitions : c->sequence->transitions;
|
||||||
transition_list.append(t);
|
transition_list.append(t);
|
||||||
return transition_list.size() - 1;
|
return transition_list.size() - 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user