Changeset View
Changeset View
Standalone View
Standalone View
src/panels/information/informationpanelcontent.cpp
Show First 20 Lines • Show All 165 Lines • ▼ Show 20 Line(s) | 160 | { | |||
---|---|---|---|---|---|
166 | 166 | | |||
167 | const QUrl itemUrl = item.url(); | 167 | const QUrl itemUrl = item.url(); | ||
168 | const bool isSearchUrl = itemUrl.scheme().contains(QStringLiteral("search")) && item.localPath().isEmpty(); | 168 | const bool isSearchUrl = itemUrl.scheme().contains(QStringLiteral("search")) && item.localPath().isEmpty(); | ||
169 | if (!applyPlace(itemUrl)) { | 169 | if (!applyPlace(itemUrl)) { | ||
170 | setNameLabelText(item.text()); | 170 | setNameLabelText(item.text()); | ||
171 | if (isSearchUrl) { | 171 | if (isSearchUrl) { | ||
172 | // in the case of a search-URL the URL is not readable for humans | 172 | // in the case of a search-URL the URL is not readable for humans | ||
173 | // (at least not useful to show in the Information Panel) | 173 | // (at least not useful to show in the Information Panel) | ||
174 | KIconLoader iconLoader; | 174 | m_preview->setPixmap( | ||
175 | QPixmap icon = iconLoader.loadIcon(QStringLiteral("nepomuk"), | 175 | QIcon::fromTheme(QStringLiteral("nepomuk")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) | ||
176 | KIconLoader::NoGroup, | 176 | ); | ||
177 | KIconLoader::SizeEnormous); | | |||
178 | m_preview->setPixmap(icon); | | |||
179 | } else { | 177 | } else { | ||
180 | // try to get a preview pixmap from the item... | 178 | // try to get a preview pixmap from the item... | ||
181 | 179 | | |||
182 | // Mark the currently shown preview as outdated. This is done | 180 | // Mark the currently shown preview as outdated. This is done | ||
183 | // with a small delay to prevent a flickering when the next preview | 181 | // with a small delay to prevent a flickering when the next preview | ||
184 | // can be shown within a short timeframe. This timer is not started | 182 | // can be shown within a short timeframe. This timer is not started | ||
185 | // for directories, as directory previews might fail and return the | 183 | // for directories, as directory previews might fail and return the | ||
186 | // same icon. | 184 | // same icon. | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
230 | void InformationPanelContent::showItems(const KFileItemList& items) | 228 | void InformationPanelContent::showItems(const KFileItemList& items) | ||
231 | { | 229 | { | ||
232 | // If there is a preview job, kill it to prevent that we have jobs for | 230 | // If there is a preview job, kill it to prevent that we have jobs for | ||
233 | // multiple items running, and thus a race condition (bug 250787). | 231 | // multiple items running, and thus a race condition (bug 250787). | ||
234 | if (m_previewJob) { | 232 | if (m_previewJob) { | ||
235 | m_previewJob->kill(); | 233 | m_previewJob->kill(); | ||
236 | } | 234 | } | ||
237 | 235 | | |||
238 | KIconLoader iconLoader; | 236 | m_preview->setPixmap( | ||
239 | QPixmap icon = iconLoader.loadIcon(QStringLiteral("dialog-information"), | 237 | QIcon::fromTheme(QStringLiteral("dialog-information")).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous) | ||
240 | KIconLoader::NoGroup, | 238 | ); | ||
241 | KIconLoader::SizeEnormous); | | |||
242 | m_preview->setPixmap(icon); | | |||
243 | setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count())); | 239 | setNameLabelText(i18ncp("@label", "%1 item selected", "%1 items selected", items.count())); | ||
244 | 240 | | |||
245 | if (m_metaDataWidget) { | 241 | if (m_metaDataWidget) { | ||
246 | m_metaDataWidget->setItems(items); | 242 | m_metaDataWidget->setItems(items); | ||
247 | } | 243 | } | ||
248 | 244 | | |||
249 | m_phononWidget->hide(); | 245 | m_phononWidget->hide(); | ||
250 | 246 | | |||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 308 | } else if (action == configureAction) { | |||
319 | connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData); | 315 | connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData); | ||
320 | } | 316 | } | ||
321 | } | 317 | } | ||
322 | 318 | | |||
323 | void InformationPanelContent::showIcon(const KFileItem& item) | 319 | void InformationPanelContent::showIcon(const KFileItem& item) | ||
324 | { | 320 | { | ||
325 | m_outdatedPreviewTimer->stop(); | 321 | m_outdatedPreviewTimer->stop(); | ||
326 | if (!applyPlace(item.targetUrl())) { | 322 | if (!applyPlace(item.targetUrl())) { | ||
327 | const QPixmap icon = KIconLoader::global()->loadIcon(item.iconName(), KIconLoader::Desktop, | 323 | QPixmap pixmap = QIcon::fromTheme(item.iconName()).pixmap(KIconLoader::SizeEnormous, KIconLoader::SizeEnormous); | ||
328 | KIconLoader::SizeEnormous, KIconLoader::DefaultState, | 324 | KIconLoader::global()->drawOverlays(item.overlays(), pixmap, KIconLoader::Desktop); | ||
329 | item.overlays()); | 325 | m_preview->setPixmap(pixmap); | ||
330 | m_preview->setPixmap(icon); | | |||
331 | } | 326 | } | ||
332 | } | 327 | } | ||
333 | 328 | | |||
334 | void InformationPanelContent::showPreview(const KFileItem& item, | 329 | void InformationPanelContent::showPreview(const KFileItem& item, | ||
335 | const QPixmap& pixmap) | 330 | const QPixmap& pixmap) | ||
336 | { | 331 | { | ||
337 | m_outdatedPreviewTimer->stop(); | 332 | m_outdatedPreviewTimer->stop(); | ||
338 | Q_UNUSED(item); | 333 | Q_UNUSED(item); | ||
▲ Show 20 Lines • Show All 98 Lines • Show Last 20 Lines |