mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
kio: pass the full path to KIO::pixmapForUrl() from KFileWidgetPrivate::setLocationText()
for best MIME type determination results the content of the file may have to be read and relative path (only the filename in this case) does not cut it Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
f6ebdfe0a7
commit
ed8815b5c9
1 changed files with 9 additions and 3 deletions
|
@ -1165,7 +1165,13 @@ void KFileWidgetPrivate::removeDummyHistoryEntry()
|
|||
void KFileWidgetPrivate::setLocationText(const KUrl& url)
|
||||
{
|
||||
if (!url.isEmpty()) {
|
||||
QPixmap urlIcon = KIO::pixmapForUrl(url, KIconLoader::Small);
|
||||
QPixmap urlIcon;
|
||||
const QString u = url.url();
|
||||
if (!KUrl::isRelativeUrl(u)) {
|
||||
urlIcon = KIO::pixmapForUrl(url, KIconLoader::Small);
|
||||
} else {
|
||||
urlIcon = KIO::pixmapForUrl(KUrl(this->url, u), KIconLoader::Small);
|
||||
}
|
||||
if (url.hasPath()) {
|
||||
if (!url.directory().isEmpty()) {
|
||||
KUrl u(url);
|
||||
|
@ -1494,7 +1500,7 @@ void KFileWidgetPrivate::_k_fileCompletion( const QString& match )
|
|||
);
|
||||
}
|
||||
|
||||
void KFileWidgetPrivate::_k_slotLocationChanged( const QString& text )
|
||||
void KFileWidgetPrivate::_k_slotLocationChanged(const QString &text)
|
||||
{
|
||||
locationEdit->lineEdit()->setModified(true);
|
||||
|
||||
|
@ -1505,7 +1511,7 @@ void KFileWidgetPrivate::_k_slotLocationChanged( const QString& text )
|
|||
if (text.isEmpty()) {
|
||||
removeDummyHistoryEntry();
|
||||
} else {
|
||||
setDummyHistoryEntry( text );
|
||||
setDummyHistoryEntry(text);
|
||||
}
|
||||
|
||||
if (!locationEdit->lineEdit()->text().isEmpty()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue