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

Revert "Try to fix project profile corruption."

This reverts commit f8f8000f.
parent 19073c3f
......@@ -4857,7 +4857,7 @@ void Bin::checkProfile(const std::shared_ptr<Mlt::Producer> &producer)
if (*clipProfile.get() == *projectProfile.get()) {
if (KdenliveSettings::default_profile().isEmpty()) {
// Confirm default project format
KdenliveSettings::setDefault_profile(pCore->getCurrentProfilePath());
KdenliveSettings::setDefault_profile(pCore->getCurrentProfile()->path());
}
} else {
// Profiles do not match, propose profile adjustment
......
......@@ -473,7 +473,6 @@ bool Core::setCurrentProfile(const QString &profilePath)
currentProfile->profile().set_display_aspect(profileFromRepository->display_aspect_num(), profileFromRepository->display_aspect_den());
currentProfile->profile().set_width(profileFromRepository->width());
currentProfile->profile().get_profile()->description = qstrdup(profileFromRepository->description().toUtf8().constData());
currentProfile->setPath(profilePath);
// inform render widget
m_timecode.setFormat(profileFromRepository->fps());
......
......@@ -260,7 +260,7 @@ void KdenliveSettingsDialog::initProjectPage()
m_configProject.profile_box->setLayout(vbox);
m_configProject.profile_box->setTitle(i18n("Select the Default Profile (preset)"));
// Select profile
m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfilePath() : KdenliveSettings::default_profile());
m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfile()->path() : KdenliveSettings::default_profile());
connect(m_pw, &ProfileWidget::profileChanged, this, &KdenliveSettingsDialog::slotDialogModified);
m_configProject.projecturl->setMode(KFile::Directory);
m_configProject.projecturl->setUrl(QUrl::fromLocalFile(KdenliveSettings::defaultprojectfolder()));
......@@ -1605,7 +1605,7 @@ void KdenliveSettingsDialog::slotReloadBlackMagic()
void KdenliveSettingsDialog::checkProfile()
{
m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfilePath() : KdenliveSettings::default_profile());
m_pw->loadProfile(KdenliveSettings::default_profile().isEmpty() ? pCore->getCurrentProfile()->path() : KdenliveSettings::default_profile());
}
void KdenliveSettingsDialog::slotReloadShuttleDevices()
......
......@@ -1372,7 +1372,7 @@ QMap<QString, QString> KdenliveDoc::documentProperties()
QDir folder(m_projectFolder);
m_documentProperties.insert(QStringLiteral("storagefolder"), folder.absoluteFilePath(m_documentProperties.value(QStringLiteral("documentid"))));
}
m_documentProperties.insert(QStringLiteral("profile"), pCore->getCurrentProfilePath());
m_documentProperties.insert(QStringLiteral("profile"), pCore->getCurrentProfile()->path());
if (m_documentProperties.contains(QStringLiteral("decimalPoint"))) {
// "kdenlive:docproperties.decimalPoint" was removed in document version 100
m_documentProperties.remove(QStringLiteral("decimalPoint"));
......
......@@ -215,7 +215,7 @@ void MainWindow::init(const QString &mltPath)
m_commandStack = new QUndoGroup();
// If using a custom profile, make sure the file exists or fallback to default
QString currentProfilePath = pCore->getCurrentProfilePath();
QString currentProfilePath = pCore->getCurrentProfile()->path();
if (currentProfilePath.startsWith(QLatin1Char('/')) && !QFile::exists(currentProfilePath)) {
KMessageBox::sorry(this, i18n("Cannot find your default profile, switching to ATSC 1080p 25"));
pCore->setCurrentProfile(QStringLiteral("atsc_1080p_25"));
......@@ -2086,7 +2086,7 @@ void MainWindow::slotEditProjectSettings()
}
}
}
if (pCore->getCurrentProfilePath() != profile || project->profileChanged(profile)) {
if (pCore->getCurrentProfile()->path() != profile || project->profileChanged(profile)) {
if (!qFuzzyCompare(pCore->getCurrentProfile()->fps() - ProfileRepository::get()->getProfile(profile)->fps(), 0.)) {
// Fps was changed, we save the project to an xml file with updated profile and reload project
// Check if blank project
......
......@@ -138,11 +138,6 @@ QString ProfileModel::path() const
return m_path;
}
void ProfileModel::setPath(const QString path)
{
m_path = path;
}
mlt_profile ProfileModel::get_profile() const
{
return m_profile->get_profile();
......
......@@ -47,7 +47,6 @@ public:
int colorspace() const override;
mlt_profile get_profile() const;
QString path() const override;
void setPath(const QString path);
void adjustDimensions() override{};
......
......@@ -109,7 +109,7 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap<QString, QString> metada
QString currentProf;
if (doc) {
currentProf = pCore->getCurrentProfilePath();
currentProf = pCore->getCurrentProfile()->path();
enable_proxy->setChecked(doc->useProxy());
generate_proxy->setChecked(doc->getDocumentProperty(QStringLiteral("generateproxy")).toInt() != 0);
proxy_minsize->setValue(doc->getDocumentProperty(QStringLiteral("proxyminsize")).toInt());
......@@ -160,7 +160,6 @@ ProjectSettings::ProjectSettings(KdenliveDoc *doc, QMap<QString, QString> metada
}
// Select profile
qDebug() << "/// LOADING PROFILE: " << currentProf;
m_pw->loadProfile(currentProf);
proxy_minsize->setEnabled(generate_proxy->isChecked());
......@@ -502,7 +501,7 @@ void ProjectSettings::accept()
}
}
}
if (!m_newProject && selectedProfile() != pCore->getCurrentProfilePath()) {
if (!m_newProject && selectedProfile() != pCore->getCurrentProfile()->path()) {
if (KMessageBox::warningContinueCancel(
this,
i18n("Changing the profile of your project cannot be undone.\nIt is recommended to save your project before attempting this operation "
......
......@@ -147,7 +147,7 @@ void ProjectManager::newFile(bool showProjectSettings)
{
QString profileName = KdenliveSettings::default_profile();
if (profileName.isEmpty()) {
profileName = pCore->getCurrentProfilePath();
profileName = pCore->getCurrentProfile()->path();
}
newFile(profileName, showProjectSettings);
}
......
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