Commit dc00eb11 authored by Mickael Savinaud's avatar Mickael Savinaud
Browse files

BUG: correct #664

parent 82268f3c
......@@ -118,7 +118,7 @@ Application::LoadDatasetModel( const QString& imageFilename,
// try if the filename is valid
VectorImageModel::EnsureValidImage(imageFilename);
// Build model (relink to cached data).
DatasetModel::BuildContext context( path, name );
DatasetModel::BuildContext context( path, name, width, height );
model->BuildModel( &context );
// Load image if DatasetModel is empty.
......
......@@ -202,14 +202,14 @@ DatasetModel
m_Descriptor = newChildModel< DatasetDescriptor >( &context );
// Load image-models from descriptor.
ParseDescriptor();
ParseDescriptor(buildContext);
}
}
/*******************************************************************************/
void
DatasetModel
::ParseDescriptor()
::ParseDescriptor(BuildContext* bContext )
{
for( QDomElement imageElt( m_Descriptor->FirstImageElement() );
!imageElt.isNull();
......@@ -234,7 +234,7 @@ DatasetModel
// TODO: 1) Re-use quicklook filename.
// TODO: 2) Assign rendering-settings.
// TODO: 3) Remove WxH for screen best-fit during loading of model!
LoadImage( filename, false, -1, -1 );
LoadImage( filename, false, bContext->m_Width, bContext->m_Height );
}
}
......
......@@ -97,9 +97,11 @@ public:
//
// Public methods.
public:
BuildContext( const QString& path, const QString& name ) :
BuildContext( const QString& path, const QString& name, int width, int height ) :
m_Path( path ),
m_Name( name )
m_Name( name ),
m_Width(width),
m_Height(height)
{
}
......@@ -108,6 +110,8 @@ public:
public:
QString m_Path;
QString m_Name;
int m_Width;
int m_Height;
};
//
......@@ -196,7 +200,7 @@ private:
void LoadImage( const QString& filename, bool foo, int width, int height );
/** */
void ParseDescriptor();
void ParseDescriptor(BuildContext* bContext );
/** */
void WriteDescriptor() const;
......
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