forked from qt-creator/qt-creator
FileIconProvider calling itself instead of a second object.
Reviewed-by: Friedemann Kleint
This commit is contained in:
@@ -90,7 +90,6 @@ struct FileIconProviderPrivate {
|
|||||||
// Mapping of file suffix to icon.
|
// Mapping of file suffix to icon.
|
||||||
StringIconPairList m_cache;
|
StringIconPairList m_cache;
|
||||||
|
|
||||||
QFileIconProvider m_systemIconProvider;
|
|
||||||
QIcon m_unknownFileIcon;
|
QIcon m_unknownFileIcon;
|
||||||
|
|
||||||
// singleton pattern
|
// singleton pattern
|
||||||
@@ -140,23 +139,23 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo) const
|
|||||||
}
|
}
|
||||||
// Get icon from OS.
|
// Get icon from OS.
|
||||||
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
#if defined(Q_WS_WIN) || defined(Q_WS_MAC)
|
||||||
return d->m_systemIconProvider.icon(fileInfo);
|
return QFileIconProvider::icon(fileInfo);
|
||||||
#else
|
#else
|
||||||
// File icons are unknown on linux systems.
|
// File icons are unknown on linux systems.
|
||||||
return (fileInfo.isDir()) ?
|
return (fileInfo.isDir()) ?
|
||||||
d->m_systemIconProvider.icon(fileInfo) :
|
QFileIconProvider::icon(fileInfo) :
|
||||||
d->m_unknownFileIcon;
|
d->m_unknownFileIcon;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon FileIconProvider::icon(IconType type) const
|
QIcon FileIconProvider::icon(IconType type) const
|
||||||
{
|
{
|
||||||
return d->m_systemIconProvider.icon(type);
|
return QFileIconProvider::icon(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FileIconProvider::type(const QFileInfo &info) const
|
QString FileIconProvider::type(const QFileInfo &info) const
|
||||||
{
|
{
|
||||||
return d->m_systemIconProvider.type(info);
|
return QFileIconProvider::type(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
Reference in New Issue
Block a user