27 #ifndef CUSTOMFILESYSTEMMODEL_H
28 #define CUSTOMFILESYSTEMMODEL_H
30 #include <QFileSystemModel>
33 #include "CustomFileIconProvider.h"
36 static const int OpenWithRole = Qt::UserRole + 10;
37 static const int CanOpenRole = Qt::UserRole + 11;
38 static const int IsApplicationRole = Qt::UserRole + 12;
48 QVariant data(
const QModelIndex& index,
int role = Qt::ToolTipRole)
const override;
50 QByteArray readExtendedAttribute(
const QModelIndex& index,
const QString& attributeName)
const;
53 QVariant fileData(
const QModelIndex& index,
int role)
const;
58 QString openWith(
const QFileInfo& fileInfo)
const;
61 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent)
override;
64 Qt::DropActions supportedDropActions()
const override;
65 Qt::DropActions supportedDragActions()
const override;
66 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
67 bool canDropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent)
const override;
69 void setPositionForIndex(
const QPoint& position,
const QModelIndex& index)
const;
70 QPoint& getPositionForIndex(
const QModelIndex& index)
const;
72 void persistItemPositions()
const;
74 bool setData(
const QModelIndex &idx,
const QVariant &value,
int role)
override;
76 void removeCustomCoordinates(
const QModelIndex& index)
const;
80 mutable QMap<QModelIndex, QByteArray> openWithAttributes;
83 mutable QMap<QModelIndex, QByteArray> canOpenAttributes;
86 mutable QMap<QModelIndex, QPoint> iconCoordinates;
89 mutable QMap<QModelIndex, bool> isApplication;
94 bool createBrowserBookmarkFile(
const QMimeData *data, QString dropTargetPath)
const;
97 QString makeFilenameSafe(
const QString& input)
const;
Definition: CustomFileIconProvider.h:9
Definition: CustomFileSystemModel.h:41
The LaunchDB class provides functionality to retrieve the default application associated with a file.
Definition: LaunchDB.h:43