Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Properly cleanup deprecated guide data on document open

parent bd71262e
......@@ -1703,7 +1703,6 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
currentGuide.insert(QStringLiteral("type"), QJsonValue(0));
// Clear entry in old format
n.toElement().setAttribute(QStringLiteral("name"), QStringLiteral("_"));
n.firstChild().setNodeValue(QString());
guidesList.push_back(currentGuide);
} else if (prop.startsWith(QLatin1String("kdenlive:marker."))) {
//Process marker
......@@ -1718,7 +1717,6 @@ bool DocumentValidator::upgrade(double version, const double currentVersion)
currentMarker.insert(QStringLiteral("type"), QJsonValue(markerType));
// Clear entry in old format
n.toElement().setAttribute(QStringLiteral("name"), QStringLiteral("_"));
n.firstChild().setNodeValue(QString());
if (markersList.contains(markerBinClip)) {
// we already have a marker list for this clip
QJsonArray markerList = markersList.value(markerBinClip);
......
......@@ -163,24 +163,6 @@ void BinController::initializeBin(Mlt::Playlist playlist)
}
}
QMap<double, QString> BinController::takeGuidesData()
{
QLocale locale;
// Load guides
Mlt::Properties guidesProperties;
Mlt::Properties playlistProps(m_binPlaylist->get_properties());
guidesProperties.pass_values(playlistProps, "kdenlive:guide.");
qCDebug(KDENLIVE_LOG) << "***********\nFOUND GUIDES: " << guidesProperties.count() << "\n**********";
QMap<double, QString> guidesData;
for (int i = 0; i < guidesProperties.count(); i++) {
double time = locale.toDouble(guidesProperties.get_name(i));
guidesData.insert(time, guidesProperties.get(i));
// Clear bin data
QString propertyName = "kdenlive:guide." + QString(guidesProperties.get_name(i));
m_binPlaylist->set(propertyName.toUtf8().constData(), (char *)nullptr);
}
return guidesData;
}
// TODO REFACTOR: DELETE
void BinController::createIfNeeded(Mlt::Profile *profile)
{
......@@ -552,14 +534,6 @@ void BinController::saveDocumentProperties(const QMap<QString, QString> &props,
playlistProps.set(propName.toUtf8().constData(), (char *)nullptr);
}
// Clear previous guides
Mlt::Properties guideProperties;
guideProperties.pass_values(playlistProps, "kdenlive:guide.");
for (int i = 0; i < guideProperties.count(); i++) {
QString propName = QStringLiteral("kdenlive:guide.") + guideProperties.get_name(i);
playlistProps.set(propName.toUtf8().constData(), (char *)nullptr);
}
QMapIterator<QString, QString> i(props);
while (i.hasNext()) {
i.next();
......@@ -571,13 +545,6 @@ void BinController::saveDocumentProperties(const QMap<QString, QString> &props,
j.next();
playlistProps.set(("kdenlive:docmetadata." + j.key()).toUtf8().constData(), j.value().toUtf8().constData());
}
// Append guides
QLocale locale;
for (const auto &guide : *guideModel) {
QString propertyName = "kdenlive:guide." + locale.toString(guide.first.seconds());
playlistProps.set(propertyName.toUtf8().constData(), guide.second.first.toUtf8().constData());
}
}
void BinController::saveProperty(const QString &name, const QString &value)
......
......@@ -137,7 +137,6 @@ public:
/** @brief Get the list of ids whose clip have the resource indicated by @param url */
const QStringList getBinIdsByResource(const QFileInfo &url) const;
void storeMarker(const QString &markerId, const QString &markerHash);
QMap<double, QString> takeGuidesData();
/** @brief A Bin clip effect was changed, update track producers */
void updateTrackProducer(const QString &id);
......
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