cache: fixed signalling issue where changing default input didn't update the cache
This commit is contained in:
@@ -41,6 +41,12 @@ void ImageStream::FootageSetEvent(Footage *f)
|
||||
this,
|
||||
&ImageStream::ColorConfigChanged,
|
||||
Qt::DirectConnection);
|
||||
|
||||
connect(f->project()->color_manager(),
|
||||
&ColorManager::DefaultInputColorSpaceChanged,
|
||||
this,
|
||||
&ImageStream::DefaultColorSpaceChanged,
|
||||
Qt::DirectConnection);
|
||||
}
|
||||
|
||||
void ImageStream::LoadCustomParameters(QXmlStreamReader *reader)
|
||||
@@ -101,7 +107,7 @@ void ImageStream::set_premultiplied_alpha(bool e)
|
||||
const QString &ImageStream::colorspace(bool default_if_empty) const
|
||||
{
|
||||
if (colorspace_.isEmpty() && default_if_empty) {
|
||||
return footage()->project()->default_input_colorspace();
|
||||
return footage()->project()->color_manager()->GetDefaultInputColorSpace();
|
||||
} else {
|
||||
return colorspace_;
|
||||
}
|
||||
|
||||
+4
-26
@@ -52,9 +52,9 @@ void Project::Load(QXmlStreamReader *reader, const QAtomicInt* cancelled)
|
||||
// Read color management info
|
||||
while (XMLReadNextStartElement(reader)) {
|
||||
if (reader->name() == QStringLiteral("config")) {
|
||||
set_ocio_config(reader->readElementText());
|
||||
color_manager_.SetConfig(reader->readElementText());
|
||||
} else if (reader->name() == QStringLiteral("default")) {
|
||||
set_default_input_colorspace(reader->readElementText());
|
||||
color_manager_.SetDefaultInputColorSpace(reader->readElementText());
|
||||
} else {
|
||||
reader->skipCurrentElement();
|
||||
}
|
||||
@@ -86,9 +86,9 @@ void Project::Save(QXmlStreamWriter *writer) const
|
||||
|
||||
writer->writeStartElement("colormanagement");
|
||||
|
||||
writer->writeTextElement("config", ocio_config_);
|
||||
writer->writeTextElement("config", color_manager_.GetConfigFilename());
|
||||
|
||||
writer->writeTextElement("default", default_input_colorspace());
|
||||
writer->writeTextElement("default", color_manager_.GetDefaultInputColorSpace());
|
||||
|
||||
writer->writeEndElement(); // colormanagement
|
||||
|
||||
@@ -135,28 +135,6 @@ void Project::set_filename(const QString &s)
|
||||
emit NameChanged();
|
||||
}
|
||||
|
||||
const QString &Project::ocio_config() const
|
||||
{
|
||||
return ocio_config_;
|
||||
}
|
||||
|
||||
void Project::set_ocio_config(const QString &ocio_config)
|
||||
{
|
||||
color_manager_.SetConfig(ocio_config);
|
||||
|
||||
ocio_config_ = ocio_config;
|
||||
}
|
||||
|
||||
const QString &Project::default_input_colorspace() const
|
||||
{
|
||||
return color_manager_.GetDefaultInputColorSpace();
|
||||
}
|
||||
|
||||
void Project::set_default_input_colorspace(const QString &colorspace)
|
||||
{
|
||||
color_manager_.SetDefaultInputColorSpace(colorspace);
|
||||
}
|
||||
|
||||
ColorManager *Project::color_manager()
|
||||
{
|
||||
return &color_manager_;
|
||||
|
||||
@@ -58,12 +58,6 @@ public:
|
||||
QString pretty_filename() const;
|
||||
void set_filename(const QString& s);
|
||||
|
||||
const QString& ocio_config() const;
|
||||
void set_ocio_config(const QString& ocio_config);
|
||||
|
||||
const QString& default_input_colorspace() const;
|
||||
void set_default_input_colorspace(const QString& colorspace);
|
||||
|
||||
ColorManager* color_manager();
|
||||
|
||||
QList<ItemPtr> get_items_of_type(Item::Type type) const;
|
||||
@@ -86,8 +80,6 @@ private:
|
||||
|
||||
QString filename_;
|
||||
|
||||
QString ocio_config_;
|
||||
|
||||
ColorManager color_manager_;
|
||||
|
||||
bool is_modified_;
|
||||
|
||||
Reference in New Issue
Block a user