Restore opening of clips from command line.

CCBUG: 416404
parent b86e9224
Pipeline #13545 passed with stage
in 14 minutes and 24 seconds
......@@ -118,7 +118,7 @@ void Core::build(bool isAppImage, const QString &MltPath)
m_self->m_jobManager.reset(new JobManager(m_self.get()));
}
void Core::initGUI(const QUrl &Url)
void Core::initGUI(const QUrl &Url, const QString &clipsToLoad)
{
m_guiConstructed = true;
m_profile = KdenliveSettings::default_profile();
......@@ -192,7 +192,7 @@ void Core::initGUI(const QUrl &Url)
connect(m_producerQueue, SIGNAL(removeInvalidProxy(QString,bool)), m_binWidget, SLOT(slotRemoveInvalidProxy(QString,bool)));*/
m_mainWindow->init();
projectManager()->init(Url, QString());
projectManager()->init(Url, clipsToLoad);
if (qApp->isSessionRestored()) {
// NOTE: we are restoring only one window, because Kdenlive only uses one MainWindow
m_mainWindow->restore(1, false);
......
......@@ -78,7 +78,7 @@ public:
* If Url is present, it will be opened, otherwise, if openlastproject is
* set, latest project will be opened. If no file is open after trying this,
* a default new file will be created. */
void initGUI(const QUrl &Url);
void initGUI(const QUrl &Url, const QString &clipsToLoad = QString());
/** @brief Returns a pointer to the singleton object. */
static std::unique_ptr<Core> &self();
......
......@@ -225,6 +225,7 @@ int main(int argc, char *argv[])
} else if (parser.value(QStringLiteral("mlt-log")) == QStringLiteral("debug")) {
mlt_log_set_level(MLT_LOG_DEBUG);
}
const QString clipsToLoad = parser.value(QStringLiteral("i"));
QUrl url;
if (parser.positionalArguments().count() != 0) {
url = QUrl::fromLocalFile(parser.positionalArguments().at(0));
......@@ -234,7 +235,7 @@ int main(int argc, char *argv[])
url = startup.resolved(url);
}
Core::build(!parser.value(QStringLiteral("config")).isEmpty(), parser.value(QStringLiteral("mlt-path")));
pCore->initGUI(url);
pCore->initGUI(url, clipsToLoad);
//delete splash;
//splash->endSplash();
//qApp->processEvents();
......
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