Changeset View
Changeset View
Standalone View
Standalone View
document/kpDocument_Open.cpp
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | 100 | { | |||
---|---|---|---|---|---|
102 | // Or at least choose one consistently. | 102 | // Or at least choose one consistently. | ||
103 | // | 103 | // | ||
104 | // TODO: Have captions for all dialogs in KolourPaint. | 104 | // TODO: Have captions for all dialogs in KolourPaint. | ||
105 | KMessageBox::sorry (parent, | 105 | KMessageBox::sorry (parent, | ||
106 | i18n ("Could not open \"%1\".", | 106 | i18n ("Could not open \"%1\".", | ||
107 | kpUrlFormatter::PrettyFilename (url))); | 107 | kpUrlFormatter::PrettyFilename (url))); | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | return QImage (); | 110 | return {}; | ||
111 | } | 111 | } | ||
112 | 112 | | |||
113 | QMimeDatabase db; | 113 | QMimeDatabase db; | ||
114 | QMimeType mimeType = db.mimeTypeForFile(tempFile); | 114 | QMimeType mimeType = db.mimeTypeForFile(tempFile); | ||
115 | 115 | | |||
116 | if (saveOptions) { | 116 | if (saveOptions) { | ||
117 | saveOptions->setMimeType(mimeType.name()); | 117 | saveOptions->setMimeType(mimeType.name()); | ||
118 | } | 118 | } | ||
Show All 13 Lines | 124 | #endif | |||
132 | KIO::NetAccess::removeTempFile(tempFile); | 132 | KIO::NetAccess::removeTempFile(tempFile); | ||
133 | 133 | | |||
134 | if (image.isNull ()) | 134 | if (image.isNull ()) | ||
135 | { | 135 | { | ||
136 | KMessageBox::sorry (parent, | 136 | KMessageBox::sorry (parent, | ||
137 | i18n ("Could not open \"%1\" - unsupported image format.\n" | 137 | i18n ("Could not open \"%1\" - unsupported image format.\n" | ||
138 | "The file may be corrupt.", | 138 | "The file may be corrupt.", | ||
139 | kpUrlFormatter::PrettyFilename (url))); | 139 | kpUrlFormatter::PrettyFilename (url))); | ||
140 | return QImage (); | 140 | return {}; | ||
141 | } | 141 | } | ||
142 | 142 | | |||
143 | #if DEBUG_KP_DOCUMENT | 143 | #if DEBUG_KP_DOCUMENT | ||
144 | qCDebug(kpLogDocument) << "\tpixmap: depth=" << image.depth () | 144 | qCDebug(kpLogDocument) << "\tpixmap: depth=" << image.depth () | ||
145 | << " hasAlphaChannel=" << image.hasAlphaChannel (); | 145 | << " hasAlphaChannel=" << image.hasAlphaChannel (); | ||
146 | #endif | 146 | #endif | ||
147 | 147 | | |||
148 | if ( saveOptions && metaInfo ) { | 148 | if ( saveOptions && metaInfo ) { | ||
▲ Show 20 Lines • Show All 95 Lines • Show Last 20 Lines |