Commit b23ccba0 authored by Nicolas Carion's avatar Nicolas Carion

Remove old -i option and simplify startup

parent ea8f9e95
......@@ -61,7 +61,7 @@ Core::~Core()
m_self = nullptr;
}
void Core::build(const QString &MltPath, const QUrl &Url, const QString &clipsToLoad)
void Core::build(const QString &MltPath, const QUrl &Url)
{
m_self = new Core();
m_self->initLocale();
......@@ -78,7 +78,9 @@ void Core::build(const QString &MltPath, const QUrl &Url, const QString &clipsTo
qRegisterMetaType<MltVideoProfile> ("MltVideoProfile");
m_self->initialize(MltPath);
m_self->m_mainWindow->init(MltPath, Url, clipsToLoad);
m_self->m_mainWindow->init();
pCore->projectManager()->init(Url, QString());
QTimer::singleShot(0, pCore->projectManager(), &ProjectManager::slotLoadOnOpen);
if (qApp->isSessionRestored()) {
//NOTE: we are restoring only one window, because Kdenlive only uses one MainWindow
m_self->m_mainWindow->restore(1, false);
......
......@@ -64,7 +64,7 @@ public:
* If Url is present, it will be opened, otherwhise, if openlastproject is
* set, latest project will be opened. If no file is open after trying this,
* a default new file will be created. */
static void build(const QString &MltPath = QString(), const QUrl &Url = QUrl(), const QString &clipsToLoad = QString());
static void build(const QString &MltPath = QString(), const QUrl &Url = QUrl());
/** @brief Returns a pointer to the singleton object. */
static Core *self();
......
......@@ -136,7 +136,6 @@ int main(int argc, char *argv[])
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("config"), i18n("Set a custom config file name"), QStringLiteral("config")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("mlt-path"), i18n("Set the path for MLT environment"), QStringLiteral("mlt-path")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("i"), i18n("Comma separated list of clips to add"), QStringLiteral("clips")));
parser.addPositionalArgument(QStringLiteral("file"), i18n("Document to open"));
// Parse command line
......@@ -145,7 +144,6 @@ int main(int argc, char *argv[])
KCrash::initialize();
QString clipsToLoad = parser.value(QStringLiteral("i"));
QString mltPath = parser.value(QStringLiteral("mlt-path"));
QUrl url;
if (parser.positionalArguments().count()) {
......@@ -155,7 +153,7 @@ int main(int argc, char *argv[])
QUrl startup = QUrl::fromLocalFile(currentPath.endsWith(QDir::separator()) ? currentPath : currentPath + QDir::separator());
url = startup.resolved(url);
}
Core::build(mltPath, url, clipsToLoad);
Core::build(mltPath, url);
int result = app.exec();
if (EXIT_RESTART == result) {
......
......@@ -164,7 +164,7 @@ MainWindow::MainWindow(QWidget *parent) :
{
}
void MainWindow::init(const QString &MltPath, const QUrl &Url, const QString &clipsToLoad)
void MainWindow::init()
{
// Widget themes for non KDE users
......@@ -674,8 +674,6 @@ void MainWindow::init(const QString &MltPath, const QUrl &Url, const QString &cl
KdenliveSettings::setDecklink_extension(data.section(QLatin1Char(';'), 1, 1));
}
}
pCore->projectManager()->init(Url, clipsToLoad);
QTimer::singleShot(0, pCore->projectManager(), &ProjectManager::slotLoadOnOpen);
QTimer::singleShot(0, this, &MainWindow::GUISetupDone);
connect(this, &MainWindow::reloadTheme, this, &MainWindow::slotReloadTheme, Qt::UniqueConnection);
......
......@@ -74,7 +74,7 @@ public:
* If Url is present, it will be opened, otherwhise, 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 init(const QString &MltPath, const QUrl &Url, const QString &clipsToLoad);
void init();
virtual ~MainWindow();
static EffectsList videoEffects;
......
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