Commit 40728b4e authored by Nicolas Carion's avatar Nicolas Carion

Direct access to document root from Core

parent 04e1293e
......@@ -502,3 +502,9 @@ std::shared_ptr<ProjectItemModel> Core::projectItemModel()
{
return m_projectItemModel;
}
QString Core::getDocumentRoot() const
{
// TODO refac: the root should probably be stored elsewhere
return m_binController->documentRoot();
}
......@@ -115,6 +115,9 @@ public:
/** @brief Returns frame rate of current profile */
double getCurrentFps() const;
/** @brief Returns the root of the document */
QString getDocumentRoot() const;
/** @brief Returns the frame size (width x height) of current profile */
QSize getCurrentFrameSize() const;
/** @brief Returns the frame display size (width x height) of current profile */
......
......@@ -68,11 +68,11 @@ ClipController::ClipController(const QString clipId, std::shared_ptr<BinControll
// This is a proxy producer, read original url from kdenlive property
path = m_properties->get("kdenlive:originalurl");
if (QFileInfo(path).isRelative()) {
path.prepend(bincontroller->documentRoot());
path.prepend(pcore->getDocumentRoot());
}
m_usesProxy = true;
} else if (m_service != QLatin1String("color") && m_service != QLatin1String("colour") && QFileInfo(path).isRelative()) {
path.prepend(bincontroller->documentRoot());
path.prepend(pcore->getDocumentRoot());
}
m_path = QFileInfo(path).absoluteFilePath();
getInfoForProducer();
......@@ -101,10 +101,7 @@ AudioStreamInfo *ClipController::audioInfo() const
void ClipController::addMasterProducer(const std::shared_ptr<Mlt::Producer> &producer)
{
QString documentRoot;
if (auto ptr = m_binController.lock()) {
documentRoot = ptr->documentRoot();
}
QString documentRoot = pcore->getDocumentRoot();
m_masterProducer = producer;
m_properties = new Mlt::Properties(m_masterProducer->get_properties());
int id = m_properties->get_int("kdenlive:id");
......
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