From: Jean-Baptiste Mardelle Date: Sun, 9 Aug 2009 19:23:32 +0000 (+0000) Subject: Fix broken loading when document profile was different than default profile X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c3259e44d9526e707ed70a0d62f6e3eb2496a123;p=kdenlive Fix broken loading when document profile was different than default profile svn path=/trunk/kdenlive/; revision=3810 --- diff --git a/src/kdenlivedoc.cpp b/src/kdenlivedoc.cpp index ae4c236d..c6fdf30b 100644 --- a/src/kdenlivedoc.cpp +++ b/src/kdenlivedoc.cpp @@ -208,6 +208,8 @@ KdenliveDoc::KdenliveDoc(const KUrl &url, const KUrl &projectFolder, QUndoGroup m_document = createEmptyDocument(tracks.x(), tracks.y()); } + KdenliveSettings::setCurrent_profile(profilePath()); + // Set the video profile (empty == default) // Make sure the project folder is usable @@ -245,6 +247,7 @@ KdenliveDoc::~KdenliveDoc() int KdenliveDoc::setSceneList() { + m_render->resetProfile(); if (m_render->setSceneList(m_document.toString(), m_documentProperties.value("position").toInt()) == -1) { // INVALID MLT Consumer, something is wrong return -1; diff --git a/src/kthumb.cpp b/src/kthumb.cpp index 1745b66e..e8b15d8d 100644 --- a/src/kthumb.cpp +++ b/src/kthumb.cpp @@ -252,10 +252,8 @@ QPixmap KThumb::getFrame(Mlt::Producer *producer, int framepos, int width, int h mlt_service_lock(service.get_service());*/ mlt_image_format format = mlt_image_rgb24a; - int frame_width = width; - int frame_height = height; - uint8_t *data = frame->get_image(format, frame_width, frame_height, 0); - QImage image((uchar *)data, frame_width, frame_height, QImage::Format_ARGB32); + uint8_t *data = frame->get_image(format, width, height, 0); + QImage image((uchar *)data, width, height, QImage::Format_ARGB32); //mlt_service_unlock(service.get_service()); if (!image.isNull()) { diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index aefdfac7..c6cb29c2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1802,7 +1802,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc) //cha connect(m_projectMonitor, SIGNAL(zoneUpdated(QPoint)), trackView, SLOT(slotSetZone(QPoint))); connect(m_projectMonitor, SIGNAL(durationChanged(int)), trackView, SLOT(setDuration(int))); connect(m_projectMonitor->render, SIGNAL(refreshDocumentProducers()), doc, SLOT(checkProjectClips())); - + connect(doc, SIGNAL(addProjectClip(DocClipBase *, bool)), m_projectList, SLOT(slotAddClip(DocClipBase *, bool))); connect(doc, SIGNAL(resetProjectList()), m_projectList, SLOT(slotResetProjectList())); connect(doc, SIGNAL(signalDeleteProjectClip(const QString &)), m_projectList, SLOT(slotDeleteClip(const QString &))); diff --git a/src/projectlist.cpp b/src/projectlist.cpp index 84c7a78f..56b402e5 100644 --- a/src/projectlist.cpp +++ b/src/projectlist.cpp @@ -497,8 +497,8 @@ void ProjectList::deleteProjectFolder(QMap map) void ProjectList::slotAddClip(DocClipBase *clip, bool getProperties) { if (getProperties) { - m_listView->setEnabled(false); - m_listView->blockSignals(true); + m_listView->setEnabled(false); + m_listView->blockSignals(true); } const QString parent = clip->getProperty("groupid"); kDebug() << "Adding clip with groupid: " << parent; @@ -582,7 +582,7 @@ void ProjectList::slotUpdateClip(const QString &id) void ProjectList::updateAllClips() { m_listView->setSortingEnabled(false); - + QTreeWidgetItemIterator it(m_listView); DocClipBase *clip; ProjectItem *item; @@ -603,9 +603,8 @@ void ProjectList::updateAllClips() }*/ if (item->referencedClip()->producer() == NULL) { if (clip->isPlaceHolder() == false) { - requestClipInfo(clip->toXML(), clip->getId()); - } - else item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); + requestClipInfo(clip->toXML(), clip->getId()); + } else item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); } else { if (item->icon(0).isNull()) { requestClipThumbnail(clip->getId()); @@ -614,7 +613,7 @@ void ProjectList::updateAllClips() item->changeDuration(item->referencedClip()->producer()->get_playtime()); } } - item->setData(1, UsageRole, QString::number(item->numReferences())); + item->setData(1, UsageRole, QString::number(item->numReferences())); qApp->processEvents(); } ++it; @@ -797,7 +796,7 @@ void ProjectList::setDocument(KdenliveDoc *doc) for (int i = 0; i < list.count(); i++) { slotAddClip(list.at(i), false); } - + m_listView->blockSignals(false); m_toolbar->setEnabled(true); connect(m_doc->clipManager(), SIGNAL(reloadClip(const QString &)), this, SLOT(slotReloadClip(const QString &))); diff --git a/src/renderer.cpp b/src/renderer.cpp index 502b4517..47cdad14 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -69,7 +69,7 @@ Render::Render(const QString & rendererName, int winid, int /* extid */, QWidget m_name(rendererName), m_mltConsumer(NULL), m_mltProducer(NULL), - m_mltProfile(NULL), + m_mltProfile(NULL), m_framePosition(0), m_isZoneMode(false), m_isLoopMode(false),