Commit d21f2e46 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix startup crash on empty config file.

Fixes #1002
parent 54ca0bae
......@@ -385,9 +385,9 @@ bool Core::setCurrentProfile(const QString &profilePath)
m_timecode.setFormat(getCurrentProfile()->fps());
profileChanged();
emit m_mainWindow->updateRenderWidgetProfile();
pCore->monitorManager()->resetProfiles();
emit pCore->monitorManager()->updatePreviewScaling();
if (m_guiConstructed && m_mainWindow->getCurrentTimeline()->controller()->getModel()) {
m_monitorManager->resetProfiles();
emit m_monitorManager->updatePreviewScaling();
if (m_guiConstructed && m_mainWindow->hasTimeline() && m_mainWindow->getCurrentTimeline()->controller()->getModel()) {
m_mainWindow->getCurrentTimeline()->controller()->getModel()->updateProfile(getProjectProfile());
checkProfileValidity();
emit m_mainWindow->getCurrentTimeline()->controller()->frameFormatChanged();
......
......@@ -140,7 +140,6 @@ static QString defaultStyle(const char *fallback = nullptr)
MainWindow::MainWindow(QWidget *parent)
: KXmlGuiWindow(parent)
{
}
......@@ -207,7 +206,6 @@ void MainWindow::init(const QString &mltPath)
// Initialise MLT connection
MltConnection::construct(mltPath);
pCore->setCurrentProfile(defaultProfile.isEmpty() ? ProjectManager::getDefaultProjectFormat() : defaultProfile);
m_commandStack = new QUndoGroup();
......@@ -4180,6 +4178,11 @@ TimelineWidget *MainWindow::getCurrentTimeline() const
return m_timelineTabs->getCurrentTimeline();
}
bool MainWindow::hasTimeline() const
{
return m_timelineTabs != nullptr;
}
void MainWindow::resetTimelineTracks()
{
TimelineWidget *current = getCurrentTimeline();
......
......@@ -132,6 +132,9 @@ public:
/** @brief Returns a pointer to the current timeline */
TimelineWidget *getCurrentTimeline() const;
/** @brief Returns true if a timeline widget is available */
bool hasTimeline() const;
/** @brief Returns true if the timeline widget is visible */
bool timelineVisible() const;
......
......@@ -315,8 +315,12 @@ void MonitorManager::slotEnd()
void MonitorManager::resetProfiles()
{
if (m_clipMonitor) {
m_clipMonitor->resetProfile();
}
if (m_projectMonitor) {
m_projectMonitor->resetProfile();
}
}
void MonitorManager::resetConsumers(bool fullReset)
......
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