Store copy of layoutDescription in Frame.

This commit is contained in:
Jim Evins
2013-10-31 00:00:00 -04:00
parent 96ea6fce9f
commit a11b498e9a
2 changed files with 12 additions and 12 deletions
+4 -6
View File
@@ -38,10 +38,8 @@ namespace libglabels
}
QString &Frame::getLayoutDescription() const
QString &Frame::layoutDescription()
{
QString description;
if ( mLayouts.size() == 1 )
{
Layout *layout = *mLayouts.begin();
@@ -51,16 +49,16 @@ namespace libglabels
* %2 = number of labels down a page,
* %3 = total number of labels on a page (sheet).
*/
description = QString( tr("%1 x %2 (%3 per sheet)") )
mLayoutDescription = QString( tr("%1 x %2 (%3 per sheet)") )
.arg(layout->nx()).arg(layout->ny()).arg(nLabels());
}
else
{
/* Translators: %1 is the total number of labels on a page (sheet). */
description = QString( tr("%1 per sheet") ).arg( nLabels() );
mLayoutDescription = QString( tr("%1 per sheet") ).arg( nLabels() );
}
return description;
return mLayoutDescription;
}