this, &InformationPanelContent::markOutdatedPreview);
QVBoxLayout* layout = new QVBoxLayout(this);
this, &InformationPanelContent::markOutdatedPreview);
QVBoxLayout* layout = new QVBoxLayout(this);
connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
this, &InformationPanelContent::urlActivated);
#endif
connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated,
this, &InformationPanelContent::urlActivated);
#endif
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
layout->addWidget(m_preview);
layout->addWidget(m_phononWidget);
layout->addWidget(m_nameLabel);
layout->addWidget(m_preview);
layout->addWidget(m_phononWidget);
layout->addWidget(m_nameLabel);
- const KUrl itemUrl = item.url();
- const bool isSearchUrl = itemUrl.protocol().contains("search") && item.localPath().isEmpty();
+ const QUrl itemUrl = item.url();
+ const bool isSearchUrl = itemUrl.scheme().contains(QStringLiteral("search")) && item.localPath().isEmpty();
if (!applyPlace(itemUrl)) {
setNameLabelText(item.text());
if (isSearchUrl) {
// in the case of a search-URL the URL is not readable for humans
// (at least not useful to show in the Information Panel)
KIconLoader iconLoader;
if (!applyPlace(itemUrl)) {
setNameLabelText(item.text());
if (isSearchUrl) {
// in the case of a search-URL the URL is not readable for humans
// (at least not useful to show in the Information Panel)
KIconLoader iconLoader;
m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height()));
m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
m_previewJob = new KIO::PreviewJob(KFileItemList() << item, QSize(m_preview->width(), m_preview->height()));
m_previewJob->setScaleType(KIO::PreviewJob::Unscaled);
m_previewJob->setIgnoreMaximumSize(item.isLocalFile());
previewAction->setCheckable(true);
previewAction->setChecked(InformationPanelSettings::previewsShown());
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
previewAction->setCheckable(true);
previewAction->setChecked(InformationPanelSettings::previewsShown());
QAction* configureAction = popup.addAction(i18nc("@action:inmenu", "Configure..."));
m_preview->setVisible(isChecked);
InformationPanelSettings::setPreviewsShown(isChecked);
} else if (action == configureAction) {
m_preview->setVisible(isChecked);
InformationPanelSettings::setPreviewsShown(isChecked);
} else if (action == configureAction) {
dialog->setDescription(i18nc("@label::textbox",
"Select which data should be shown in the information panel:"));
dialog->setItems(m_metaDataWidget->items());
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
dialog->setDescription(i18nc("@label::textbox",
"Select which data should be shown in the information panel:"));
dialog->setItems(m_metaDataWidget->items());
dialog->setAttribute(Qt::WA_DeleteOnClose);
dialog->show();
connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
}
}
connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
}
}
{
const int count = m_placesItemModel->count();
for (int i = 0; i < count; ++i) {
const PlacesItem* item = m_placesItemModel->placesItem(i);
{
const int count = m_placesItemModel->count();
for (int i = 0; i < count; ++i) {
const PlacesItem* item = m_placesItemModel->placesItem(i);
setNameLabelText(item->text());
m_preview->setPixmap(QIcon::fromTheme(item->icon()).pixmap(128, 128));
return true;
setNameLabelText(item->text());
m_preview->setPixmap(QIcon::fromTheme(item->icon()).pixmap(128, 128));
return true;
// so that the width of the information panel gets increased.
// To prevent this, the maximum width is adjusted to
// the current width of the panel.
// so that the width of the information panel gets increased.
// To prevent this, the maximum width is adjusted to
// the current width of the panel.
m_nameLabel->setMaximumWidth(maxWidth);
// The metadata widget also contains a text widget which may return
m_nameLabel->setMaximumWidth(maxWidth);
// The metadata widget also contains a text widget which may return