mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
kio: replace KMimeType::iconNameForUrl() with KIO::pixmapForUrl() where possible
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c241daaf8a
commit
fe6daca7c7
2 changed files with 22 additions and 18 deletions
|
@ -1165,7 +1165,7 @@ void KFileWidgetPrivate::removeDummyHistoryEntry()
|
||||||
void KFileWidgetPrivate::setLocationText(const KUrl& url)
|
void KFileWidgetPrivate::setLocationText(const KUrl& url)
|
||||||
{
|
{
|
||||||
if (!url.isEmpty()) {
|
if (!url.isEmpty()) {
|
||||||
QPixmap urlIcon = KIO::pixmapForUrl( url, KIconLoader::Small );
|
QPixmap urlIcon = KIO::pixmapForUrl(url, KIconLoader::Small);
|
||||||
if (url.hasPath()) {
|
if (url.hasPath()) {
|
||||||
if (!url.directory().isEmpty()) {
|
if (!url.directory().isEmpty()) {
|
||||||
KUrl u(url);
|
KUrl u(url);
|
||||||
|
@ -1385,7 +1385,7 @@ void KFileWidgetPrivate::_k_urlEntered(const KUrl& url)
|
||||||
|
|
||||||
bool blocked = locationEdit->blockSignals(true);
|
bool blocked = locationEdit->blockSignals(true);
|
||||||
if (keepLocation) {
|
if (keepLocation) {
|
||||||
locationEdit->changeUrl(0, KIcon(KMimeType::iconNameForUrl(filename)), filename);
|
locationEdit->changeUrl(0, KIcon(KIO::pixmapForUrl(KUrl(filename))), filename);
|
||||||
locationEdit->lineEdit()->setModified(true);
|
locationEdit->lineEdit()->setModified(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1487,7 +1487,11 @@ void KFileWidgetPrivate::_k_fileCompletion( const QString& match )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setDummyHistoryEntry(locationEdit->currentText(), KIconLoader::global()->loadMimeTypeIcon( KMimeType::iconNameForUrl( match ), KIconLoader::Small), !locationEdit->currentText().isEmpty());
|
setDummyHistoryEntry(
|
||||||
|
locationEdit->currentText(),
|
||||||
|
KIO::pixmapForUrl(KUrl(match), KIconLoader::Small),
|
||||||
|
!locationEdit->currentText().isEmpty()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void KFileWidgetPrivate::_k_slotLocationChanged( const QString& text )
|
void KFileWidgetPrivate::_k_slotLocationChanged( const QString& text )
|
||||||
|
|
|
@ -18,16 +18,17 @@
|
||||||
|
|
||||||
#include "kurlcombobox.h"
|
#include "kurlcombobox.h"
|
||||||
|
|
||||||
#include <QtCore/QDir>
|
#include <QDir>
|
||||||
#include <QtGui/qevent.h>
|
#include <QMouseEvent>
|
||||||
#include <QtGui/QDrag>
|
#include <QDrag>
|
||||||
|
|
||||||
#include <kdebug.h>
|
#include "kglobalsettings.h"
|
||||||
#include <kglobalsettings.h>
|
#include "kicon.h"
|
||||||
#include <kicon.h>
|
#include "klocale.h"
|
||||||
#include <klocale.h>
|
#include "kmimetype.h"
|
||||||
#include <kmimetype.h>
|
#include "kiconloader.h"
|
||||||
#include <kiconloader.h>
|
#include "kio/global.h"
|
||||||
|
#include "kdebug.h"
|
||||||
|
|
||||||
class KUrlComboBox::KUrlComboBoxPrivate
|
class KUrlComboBox::KUrlComboBoxPrivate
|
||||||
{
|
{
|
||||||
|
@ -420,10 +421,10 @@ void KUrlComboBox::mouseMoveEvent(QMouseEvent *event)
|
||||||
|
|
||||||
QIcon KUrlComboBox::KUrlComboBoxPrivate::getIcon( const KUrl& url ) const
|
QIcon KUrlComboBox::KUrlComboBoxPrivate::getIcon( const KUrl& url ) const
|
||||||
{
|
{
|
||||||
if (myMode == Directories)
|
if (myMode == Directories) {
|
||||||
return dirIcon;
|
return dirIcon;
|
||||||
else
|
}
|
||||||
return KIcon(KMimeType::iconNameForUrl(url, 0));
|
return KIcon(KIO::pixmapForUrl(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -433,12 +434,11 @@ void KUrlComboBox::KUrlComboBoxPrivate::updateItem( const KUrlComboBoxPrivate::K
|
||||||
{
|
{
|
||||||
m_parent->setItemIcon(index,icon);
|
m_parent->setItemIcon(index,icon);
|
||||||
|
|
||||||
if ( m_parent->isEditable() ) {
|
if (m_parent->isEditable()) {
|
||||||
m_parent->setItemText(index, item->url.pathOrUrl(myMode == Directories
|
m_parent->setItemText(index, item->url.pathOrUrl(myMode == Directories
|
||||||
? KUrl::AddTrailingSlash
|
? KUrl::AddTrailingSlash
|
||||||
: KUrl::RemoveTrailingSlash));
|
: KUrl::RemoveTrailingSlash));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
m_parent->setItemText(index,item->text);
|
m_parent->setItemText(index,item->text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue