| 225 | } |
| 226 | |
| 227 | QString DocumentPrivate::localizedSize(const QSizeF size) const |
| 228 | { |
| 229 | double inchesWidth = 0, inchesHeight = 0; |
| 230 | switch (m_generator->pagesSizeMetric()) { |
| 231 | case Generator::Points: |
| 232 | inchesWidth = size.width() / 72.0; |
| 233 | inchesHeight = size.height() / 72.0; |
| 234 | break; |
| 235 | |
| 236 | case Generator::Pixels: { |
| 237 | const QSizeF dpi = m_generator->dpi(); |
| 238 | inchesWidth = size.width() / dpi.width(); |
| 239 | inchesHeight = size.height() / dpi.height(); |
| 240 | } break; |
| 241 | |
| 242 | case Generator::None: |
| 243 | break; |
| 244 | } |
| 245 | if (QLocale::system().measurementSystem() == QLocale::ImperialSystem) { |
| 246 | return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 × %2 in (%3)", inchesWidth, inchesHeight, namePaperSize(inchesWidth, inchesHeight)); |
| 247 | } else { |
| 248 | return i18nc("%1 is width, %2 is height, %3 is paper size name", "%1 × %2 mm (%3)", QString::number(inchesWidth * 25.4, 'd', 0), QString::number(inchesHeight * 25.4, 'd', 0), namePaperSize(inchesWidth, inchesHeight)); |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | qulonglong DocumentPrivate::calculateMemoryToFree() |
| 253 | { |
no test coverage detected