Changeset View
Changeset View
Standalone View
Standalone View
src/skanlite.cpp
Context not available. | |||||
127 | m_settingsUi.revertOptions->setIcon(QIcon::fromTheme(QLatin1String("edit-undo"))); | 127 | m_settingsUi.revertOptions->setIcon(QIcon::fromTheme(QLatin1String("edit-undo"))); | ||
---|---|---|---|---|---|
128 | m_saveLocation = new SaveLocation(this); | 128 | m_saveLocation = new SaveLocation(this); | ||
129 | 129 | | |||
130 | m_filterList.clear(); | ||||
131 | | ||||
130 | // add the supported image types | 132 | // add the supported image types | ||
131 | const QList<QByteArray> tmpList = QImageWriter::supportedMimeTypes(); | 133 | const QList<QByteArray> tmpList = QImageWriter::supportedMimeTypes(); | ||
132 | m_filterList.clear(); | | |||
133 | foreach (auto ba, tmpList) { | 134 | foreach (auto ba, tmpList) { | ||
134 | if (ba.isEmpty()) { | 135 | if (ba.isEmpty()) { | ||
135 | continue; | 136 | continue; | ||
136 | } | 137 | } | ||
137 | m_filterList.append(QString::fromLatin1(ba)); | 138 | m_filterList.append(QString::fromLatin1(ba)); | ||
138 | } | 139 | } | ||
140 | // add the supported document types | ||||
141 | m_filterList.append(QLatin1String("application/pdf")); | ||||
139 | 142 | | |||
140 | qDebug() << m_filterList; | 143 | qDebug() << "Supported Mime Types:" << m_filterList; | ||
141 | 144 | | |||
142 | // Put first class citizens at first place | 145 | // Put first class citizens at first place | ||
146 | m_filterList.removeAll(QLatin1String("application/pdf")); | ||||
143 | m_filterList.removeAll(QLatin1String("image/jpeg")); | 147 | m_filterList.removeAll(QLatin1String("image/jpeg")); | ||
144 | m_filterList.removeAll(QLatin1String("image/tiff")); | 148 | m_filterList.removeAll(QLatin1String("image/tiff")); | ||
145 | m_filterList.removeAll(QLatin1String("image/png")); | 149 | m_filterList.removeAll(QLatin1String("image/png")); | ||
146 | m_filterList.insert(0, QLatin1String("image/png")); | 150 | m_filterList.insert(0, QLatin1String("image/png")); | ||
147 | m_filterList.insert(1, QLatin1String("image/jpeg")); | 151 | m_filterList.insert(1, QLatin1String("image/jpeg")); | ||
148 | m_filterList.insert(2, QLatin1String("image/tiff")); | 152 | m_filterList.insert(2, QLatin1String("image/tiff")); | ||
153 | m_filterList.insert(3, QLatin1String("application/pdf")); | ||||
149 | 154 | | |||
150 | m_filter16BitList << QLatin1String("image/png"); | 155 | m_filter16BitList << QLatin1String("image/png"); | ||
151 | //m_filter16BitList << QLatin1String("image/tiff"); | 156 | //m_filter16BitList << QLatin1String("image/tiff"); | ||
Context not available. | |||||
523 | if (enforceSavingAsPng16bit) { | 528 | if (enforceSavingAsPng16bit) { | ||
524 | m_imageSaver->save16BitPng(fileUrl, localName, m_data, m_width, m_height, m_bytesPerLine, (int) m_ksanew->currentDPI(), m_format, fileFormat, quality); | 529 | m_imageSaver->save16BitPng(fileUrl, localName, m_data, m_width, m_height, m_bytesPerLine, (int) m_ksanew->currentDPI(), m_format, fileFormat, quality); | ||
525 | } else { | 530 | } else { | ||
526 | m_imageSaver->saveQImage(fileUrl, localName, m_data, m_width, m_height, m_bytesPerLine, (int) m_ksanew->currentDPI(), m_format, fileFormat, quality); | 531 | if (suffix == QLatin1String("pdf")) { | ||
532 | m_imageSaver->savePdf(fileUrl, localName, m_data, m_width, m_height, m_bytesPerLine, (int) m_ksanew->currentDPI(), m_format, fileFormat, quality); | ||||
533 | } else { | ||||
534 | m_imageSaver->saveQImage(fileUrl, localName, m_data, m_width, m_height, m_bytesPerLine, (int) m_ksanew->currentDPI(), m_format, fileFormat, quality); | ||||
535 | } | ||||
527 | } | 536 | } | ||
528 | 537 | | |||
529 | m_showImgDialog->close(); // calling close() on a closed window does nothing. | 538 | m_showImgDialog->close(); // calling close() on a closed window does nothing. | ||
Context not available. |