${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qtreewidgetitemiterator_p.h
${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qdatawidgetmapper.h
${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qfileiconprovider.h
- ${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qfileiconprovider_p.h
${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qcolumnviewgrip_p.h
${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qcolumnview.h
${CMAKE_CURRENT_SOURCE_DIR}/itemviews/qcolumnview_p.h
#include "qdebug.h"
#include "qapplication.h"
#include "qstylepainter.h"
-#include "qfileiconprovider_p.h"
#include "qcoreapplication_p.h"
#include "ui_qfiledialog.h"
****************************************************************************/
#include "qfileiconprovider.h"
-#include "qfileiconprovider_p.h"
#ifndef QT_NO_FILEICONPROVIDER
#include "qdir.h"
#include "qpixmapcache.h"
#include "qguiplatformplugin.h"
+#include "qstyle.h"
QT_BEGIN_NAMESPACE
\value File
*/
-QFileIconProviderPrivate::QFileIconProviderPrivate() :
- homePath(QDir::home().absolutePath())
-{
-}
-
-QIcon QFileIconProviderPrivate::getIcon(QStyle::StandardPixmap name) const
+static QIcon getFileIcon(QStyle::StandardPixmap name)
{
switch (name) {
case QStyle::SP_FileIcon:
*/
QFileIconProvider::QFileIconProvider()
- : d_ptr(new QFileIconProviderPrivate)
{
}
QFileIconProvider::~QFileIconProvider()
{
- delete d_ptr;
}
/*!
QIcon QFileIconProvider::icon(IconType type) const
{
- Q_D(const QFileIconProvider);
switch (type) {
case Computer:
- return d->getIcon(QStyle::SP_ComputerIcon);
+ return getFileIcon(QStyle::SP_ComputerIcon);
case Desktop:
- return d->getIcon(QStyle::SP_DesktopIcon);
+ return getFileIcon(QStyle::SP_DesktopIcon);
case Trashcan:
- return d->getIcon(QStyle::SP_TrashIcon);
+ return getFileIcon(QStyle::SP_TrashIcon);
case Network:
- return d->getIcon(QStyle::SP_DriveNetIcon);
+ return getFileIcon(QStyle::SP_DriveNetIcon);
case Drive:
- return d->getIcon(QStyle::SP_DriveHDIcon);
+ return getFileIcon(QStyle::SP_DriveHDIcon);
case Folder:
- return d->getIcon(QStyle::SP_DirIcon);
+ return getFileIcon(QStyle::SP_DirIcon);
case File:
- return d->getIcon(QStyle::SP_FileIcon);
+ return getFileIcon(QStyle::SP_FileIcon);
default:
break;
};
QIcon QFileIconProvider::icon(const QFileInfo &info) const
{
- Q_D(const QFileIconProvider);
-
QIcon platformIcon = qt_guiPlatformPlugin()->fileSystemIcon(info);
if (!platformIcon.isNull())
return platformIcon;
if (info.isRoot()) {
- return d->getIcon(QStyle::SP_DriveHDIcon);
+ return getFileIcon(QStyle::SP_DriveHDIcon);
} else if (info.isFile()) {
if (info.isSymLink()) {
- return d->getIcon(QStyle::SP_FileLinkIcon);
+ return getFileIcon(QStyle::SP_FileLinkIcon);
} else {
- return d->getIcon(QStyle::SP_FileIcon);
+ return getFileIcon(QStyle::SP_FileIcon);
}
} else if (info.isDir()) {
+ static QString homePath = QDir::home().absolutePath();
+
if (info.isSymLink()) {
- return d->getIcon(QStyle::SP_DirLinkIcon);
- } else if (info.absoluteFilePath() == d->homePath) {
- return d->getIcon(QStyle::SP_DirHomeIcon);
+ return getFileIcon(QStyle::SP_DirLinkIcon);
+ } else if (info.absoluteFilePath() == homePath) {
+ return getFileIcon(QStyle::SP_DirHomeIcon);
} else {
- return d->getIcon(QStyle::SP_DirIcon);
+ return getFileIcon(QStyle::SP_DirIcon);
}
}
return QIcon();
QT_END_NAMESPACE
#endif
-
-
-
-
-
-
#ifndef QT_NO_FILEICONPROVIDER
-class QFileIconProviderPrivate;
-
class Q_GUI_EXPORT QFileIconProvider
{
public:
virtual QIcon icon(IconType type) const;
virtual QIcon icon(const QFileInfo &info) const;
virtual QString type(const QFileInfo &info) const;
-
-private:
- Q_DECLARE_PRIVATE(QFileIconProvider)
- Q_DISABLE_COPY(QFileIconProvider)
- QFileIconProviderPrivate* d_ptr;
};
#endif // QT_NO_FILEICONPROVIDER
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2016-2020 Ivailo Monev
-**
-** This file is part of the QtGui module of the Katie Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-**
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QFILEICONPROVIDER_P_H
-#define QFILEICONPROVIDER_P_H
-
-#include <QtCore/qstring.h>
-#include <QtGui/qicon.h>
-#include <QtGui/qstyle.h>
-
-QT_BEGIN_NAMESPACE
-
-class QFileIconProviderPrivate
-{
-public:
- QFileIconProviderPrivate();
- QIcon getIcon(QStyle::StandardPixmap name) const;
- const QString homePath;
-};
-
-
-QT_END_NAMESPACE
-
-#endif // QFILEICONPROVIDER_P_H