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

Fix default timeline preview profile not correctly remembered

parent 27a2a7b6
Pipeline #261140 failed with stage
in 4 minutes and 44 seconds
......@@ -331,6 +331,7 @@ EncodingTimelinePreviewProfilesChooser::EncodingTimelinePreviewProfilesChooser(Q
}
}
connect(m_profilesCombo, &KComboBox::currentIndexChanged, m_messageWidget, &KMessageWidget::hide);
connect(m_profilesCombo, &KComboBox::currentIndexChanged, this, &EncodingTimelinePreviewProfilesChooser::currentIndexChanged);
}
void EncodingTimelinePreviewProfilesChooser::loadEncodingProfiles()
......@@ -394,13 +395,12 @@ void EncodingTimelinePreviewProfilesChooser::filterPreviewProfiles(const QString
// This profile has a hardcoded framerate, chack if same as project
fps = fpsString.toDouble();
}
QStandardItem *item = model->item(i);
if (fps > 0. && qAbs(fps - projectFps) > 0.01) {
// Fps does not match, disable
QStandardItem *item = model->item(i);
item->setFlags(item->flags() & ~Qt::ItemIsEnabled);
continue;
}
QStandardItem *item = model->item(i);
item->setFlags(item->flags() | Qt::ItemIsEnabled);
}
QStandardItem *item = model->item(current);
......
......@@ -89,4 +89,7 @@ public:
private slots:
void loadEncodingProfiles() override;
signals:
void currentIndexChanged();
};
......@@ -260,7 +260,8 @@ void KdenliveSettingsDialog::initProjectPage()
QWidget *p8 = new QWidget;
m_configProject.setupUi(p8);
// Timeline preview
m_tlPreviewProfiles = new EncodingTimelinePreviewProfilesChooser(p8, true, QStringLiteral("preview_profile"), true);
QString currentPreviewData = QString("%1;%2").arg(KdenliveSettings::previewparams(), KdenliveSettings::previewextension());
m_tlPreviewProfiles = new EncodingTimelinePreviewProfilesChooser(p8, true, currentPreviewData, false);
m_configProject.preview_profile_box->addWidget(m_tlPreviewProfiles);
auto *vbox = new QVBoxLayout;
m_pw = new ProfileWidget(this);
......@@ -271,6 +272,7 @@ void KdenliveSettingsDialog::initProjectPage()
// Select profile
m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfile()->path() : KdenliveSettings::default_profile());
m_tlPreviewProfiles->filterPreviewProfiles(m_pw->selectedProfile());
connect(m_tlPreviewProfiles, &EncodingTimelinePreviewProfilesChooser::currentIndexChanged, this, &KdenliveSettingsDialog::slotDialogModified);
connect(m_pw, &ProfileWidget::profileChanged, this, &KdenliveSettingsDialog::slotDialogModified);
m_configProject.projecturl->setMode(KFile::Directory);
m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
......
Supports Markdown
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