Changeset View
Changeset View
Standalone View
Standalone View
src/panels/information/informationpanelcontent.cpp
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Line(s) | 226 | if (InformationPanelSettings::previewsShown()) { | |||
---|---|---|---|---|---|
228 | const QUrl itemUrl = m_item.url(); | 228 | const QUrl itemUrl = m_item.url(); | ||
229 | const bool isSearchUrl = itemUrl.scheme().contains(QLatin1String("search")) && m_item.localPath().isEmpty(); | 229 | const bool isSearchUrl = itemUrl.scheme().contains(QLatin1String("search")) && m_item.localPath().isEmpty(); | ||
230 | if (isSearchUrl) { | 230 | if (isSearchUrl) { | ||
231 | m_preview->show(); | 231 | m_preview->show(); | ||
232 | 232 | | |||
233 | // in the case of a search-URL the URL is not readable for humans | 233 | // in the case of a search-URL the URL is not readable for humans | ||
234 | // (at least not useful to show in the Information Panel) | 234 | // (at least not useful to show in the Information Panel) | ||
235 | m_preview->setPixmap( | 235 | m_preview->setPixmap( | ||
236 | QIcon::fromTheme(QStringLiteral("baloo")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) | 236 | QIcon::fromTheme(QStringLiteral("baloo")).pixmap(m_preview->height(), m_preview->width()) | ||
237 | ); | 237 | ); | ||
238 | } else { | 238 | } else { | ||
239 | 239 | | |||
240 | refreshPixmapView(); | 240 | refreshPixmapView(); | ||
241 | 241 | | |||
242 | const QString mimeType = m_item.mimetype(); | 242 | const QString mimeType = m_item.mimetype(); | ||
243 | const bool isAnimatedImage = m_preview->isAnimatedImage(itemUrl.toLocalFile()); | 243 | const bool isAnimatedImage = m_preview->isAnimatedImage(itemUrl.toLocalFile()); | ||
244 | m_isVideo = !isAnimatedImage && mimeType.startsWith(QLatin1String("video/")); | 244 | m_isVideo = !isAnimatedImage && mimeType.startsWith(QLatin1String("video/")); | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 307 | { | |||
309 | // multiple items running, and thus a race condition (bug 250787). | 309 | // multiple items running, and thus a race condition (bug 250787). | ||
310 | if (m_previewJob) { | 310 | if (m_previewJob) { | ||
311 | m_previewJob->kill(); | 311 | m_previewJob->kill(); | ||
312 | } | 312 | } | ||
313 | 313 | | |||
314 | m_preview->stopAnimatedImage(); | 314 | m_preview->stopAnimatedImage(); | ||
315 | 315 | | |||
316 | m_preview->setPixmap( | 316 | m_preview->setPixmap( | ||
317 | QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) | 317 | QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(m_preview->height(), m_preview->width()) | ||
318 | ); | 318 | ); | ||
319 | setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count())); | 319 | setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count())); | ||
320 | 320 | | |||
321 | m_metaDataWidget->setItems(items); | 321 | m_metaDataWidget->setItems(items); | ||
322 | 322 | | |||
323 | m_phononWidget->hide(); | 323 | m_phononWidget->hide(); | ||
324 | 324 | | |||
325 | m_item = KFileItem(); | 325 | m_item = KFileItem(); | ||
Show All 27 Lines | 329 | { | |||
353 | } | 353 | } | ||
354 | 354 | | |||
355 | return QWidget::eventFilter(obj, event); | 355 | return QWidget::eventFilter(obj, event); | ||
356 | } | 356 | } | ||
357 | 357 | | |||
358 | void InformationPanelContent::showIcon(const KFileItem& item) | 358 | void InformationPanelContent::showIcon(const KFileItem& item) | ||
359 | { | 359 | { | ||
360 | m_outdatedPreviewTimer->stop(); | 360 | m_outdatedPreviewTimer->stop(); | ||
361 | QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous); | 361 | QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(m_preview->height(), m_preview->width()); | ||
362 | KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop); | 362 | KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop); | ||
363 | m_preview->setPixmap(pixmap); | 363 | m_preview->setPixmap(pixmap); | ||
364 | } | 364 | } | ||
365 | 365 | | |||
366 | void InformationPanelContent::showPreview(const KFileItem& item, | 366 | void InformationPanelContent::showPreview(const KFileItem& item, | ||
367 | const QPixmap& pixmap) | 367 | const QPixmap& pixmap) | ||
368 | { | 368 | { | ||
369 | m_outdatedPreviewTimer->stop(); | 369 | m_outdatedPreviewTimer->stop(); | ||
▲ Show 20 Lines • Show All 124 Lines • Show Last 20 Lines |