Commit b5452853 authored by Nicolas Carion's avatar Nicolas Carion

cleanup logging, fix track insertion fuzzing

parent c4bd72af
......@@ -177,6 +177,8 @@ void fuzz(const std::string &input)
if (name == "$$") {
name = "";
}
if (pos < -1) pos = 0;
pos = std::min((int)all_tracks[timeline].size(), pos);
if (timeline) {
TrackModel::construct(timeline, -1, pos, QString::fromStdString(name), audio);
}
......
......@@ -37,7 +37,6 @@ BinPlaylist::BinPlaylist()
void BinPlaylist::manageBinItemInsertion(const std::shared_ptr<AbstractProjectItem> &binElem)
{
qDebug() << "MANAGE BIN ITEM INSERT" << binElem->clipId();
QString id = binElem->clipId();
switch (binElem->itemType()) {
case AbstractProjectItem::FolderItem: {
......@@ -51,12 +50,9 @@ void BinPlaylist::manageBinItemInsertion(const std::shared_ptr<AbstractProjectIt
case AbstractProjectItem::ClipItem: {
Q_ASSERT(m_allClips.count(id) == 0);
auto clip = std::static_pointer_cast<ProjectClip>(binElem);
qDebug() << "Inserting clip" << binElem->clipId();
if (clip->isValid()) {
qDebug() << "Inserting valid clip" << binElem->clipId();
m_binPlaylist->append(*clip->originalProducer().get());
} else {
qDebug() << "Inserting invalid clip" << binElem->clipId();
// if clip is not loaded yet, we insert a dummy producer
Mlt::Producer dummy(pCore->getCurrentProfile()->profile(), "color:blue");
dummy.set("kdenlive:id", id.toUtf8().constData());
......
......@@ -1087,7 +1087,6 @@ void ProjectClip::updateParent(std::shared_ptr<TreeItem> parent)
if (parent) {
auto item = std::static_pointer_cast<AbstractProjectItem>(parent);
ClipController::setProducerProperty(QStringLiteral("kdenlive:folderid"), item->clipId());
qDebug() << "Setting parent to " << item->clipId();
}
AbstractProjectItem::updateParent(parent);
}
......
......@@ -629,15 +629,15 @@ void EffectStackModel::moveEffect(int destRow, std::shared_ptr<AbstractEffectIte
void EffectStackModel::registerItem(const std::shared_ptr<TreeItem> &item)
{
QWriteLocker locker(&m_lock);
qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting effect";
// qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting effect";
QModelIndex ix;
if (!item->isRoot()) {
auto effectItem = std::static_pointer_cast<EffectItemModel>(item);
if (!m_loadingExisting) {
qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting effect in " << m_childServices.size();
// qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting effect in " << m_childServices.size();
effectItem->plant(m_masterService);
for (const auto &service : m_childServices) {
qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting CLONE effect in " << (void *)service.lock().get();
// qDebug() << "$$$$$$$$$$$$$$$$$$$$$ Planting CLONE effect in " << (void *)service.lock().get();
effectItem->plantClone(service);
}
}
......
......@@ -1779,7 +1779,7 @@ bool TimelineModel::requestTrackDeletion(int trackId, Fun &undo, Fun &redo)
void TimelineModel::registerTrack(std::shared_ptr<TrackModel> track, int pos, bool doInsert, bool reloadView)
{
qDebug() << "REGISTER TRACK" << track->getId() << pos;
// qDebug() << "REGISTER TRACK" << track->getId() << pos;
int id = track->getId();
if (pos == -1) {
pos = static_cast<int>(m_allTracks.size());
......@@ -1826,7 +1826,7 @@ void TimelineModel::registerGroup(int groupId)
Fun TimelineModel::deregisterTrack_lambda(int id, bool updateView)
{
return [this, id, updateView]() {
qDebug() << "DEREGISTER TRACK" << id;
// qDebug() << "DEREGISTER TRACK" << id;
auto it = m_iteratorTable[id]; // iterator to the element
int index = getTrackPosition(id); // compute index in list
m_tractor->remove_track(static_cast<int>(index + 1)); // melt operation, add 1 to account for black background track
......
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