mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 01:40:02 +00:00
Remove custom icon selection for trash
Summary: CCBUG: 391200 Test Plan: 1. Open Dolphin 2. Edit trash in places item Result: No custom icon option available Reviewers: ngraham, #dolphin, broulik, pino, elvisangelaccio, cfeck Reviewed By: ngraham, #dolphin, elvisangelaccio, cfeck Subscribers: rkflx, cfeck, elvisangelaccio, pino, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D14378
This commit is contained in:
parent
aed8626f86
commit
6e04f50081
|
@ -59,7 +59,7 @@ void PlacesItemEditDialog::setIcon(const QString& icon)
|
||||||
|
|
||||||
QString PlacesItemEditDialog::icon() const
|
QString PlacesItemEditDialog::icon() const
|
||||||
{
|
{
|
||||||
return m_iconButton->icon();
|
return m_iconButton ? m_iconButton->icon() : m_icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlacesItemEditDialog::setText(const QString& text)
|
void PlacesItemEditDialog::setText(const QString& text)
|
||||||
|
@ -144,15 +144,17 @@ void PlacesItemEditDialog::initialize()
|
||||||
m_urlEdit->setMinimumWidth(m_urlEdit->fontMetrics().height() * (40 / 2));
|
m_urlEdit->setMinimumWidth(m_urlEdit->fontMetrics().height() * (40 / 2));
|
||||||
connect(m_urlEdit, &KUrlRequester::textChanged, this, &PlacesItemEditDialog::slotUrlChanged);
|
connect(m_urlEdit, &KUrlRequester::textChanged, this, &PlacesItemEditDialog::slotUrlChanged);
|
||||||
|
|
||||||
m_iconButton = new KIconButton(mainWidget);
|
if (m_url.scheme() != QLatin1String("trash")) {
|
||||||
formLayout->addRow(i18nc("@label", "Choose an icon:"), m_iconButton);
|
m_iconButton = new KIconButton(mainWidget);
|
||||||
m_iconButton->setIconSize(IconSize(KIconLoader::Desktop));
|
formLayout->addRow(i18nc("@label", "Choose an icon:"), m_iconButton);
|
||||||
m_iconButton->setIconType(KIconLoader::NoGroup, KIconLoader::Place);
|
m_iconButton->setIconSize(IconSize(KIconLoader::Desktop));
|
||||||
if (m_icon.isEmpty()) {
|
m_iconButton->setIconType(KIconLoader::NoGroup, KIconLoader::Place);
|
||||||
QMimeDatabase db;
|
if (m_icon.isEmpty()) {
|
||||||
m_iconButton->setIcon(db.mimeTypeForUrl(m_url).iconName());
|
QMimeDatabase db;
|
||||||
} else {
|
m_iconButton->setIcon(db.mimeTypeForUrl(m_url).iconName());
|
||||||
m_iconButton->setIcon(m_icon);
|
} else {
|
||||||
|
m_iconButton->setIcon(m_icon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_allowGlobal) {
|
if (m_allowGlobal) {
|
||||||
|
|
Loading…
Reference in a new issue