Changeset View
Changeset View
Standalone View
Standalone View
containments/desktop/plugins/folder/foldermodel.cpp
Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Line(s) | 114 | { | |||
---|---|---|---|---|---|
145 | setSourceModel(m_dirModel); | 145 | setSourceModel(m_dirModel); | ||
146 | 146 | | |||
147 | setSortLocaleAware(true); | 147 | setSortLocaleAware(true); | ||
148 | setFilterCaseSensitivity(Qt::CaseInsensitive); | 148 | setFilterCaseSensitivity(Qt::CaseInsensitive); | ||
149 | setDynamicSortFilter(true); | 149 | setDynamicSortFilter(true); | ||
150 | 150 | | |||
151 | sort(m_sortMode, m_sortDesc ? Qt::DescendingOrder : Qt::AscendingOrder); | 151 | sort(m_sortMode, m_sortDesc ? Qt::DescendingOrder : Qt::AscendingOrder); | ||
152 | 152 | | |||
153 | setSupportedDragActions(Qt::CopyAction | Qt::MoveAction | Qt::LinkAction); | | |||
154 | | ||||
155 | createActions(); | 153 | createActions(); | ||
156 | } | 154 | } | ||
157 | 155 | | |||
158 | FolderModel::~FolderModel() | 156 | FolderModel::~FolderModel() | ||
159 | { | 157 | { | ||
160 | } | 158 | } | ||
161 | 159 | | |||
162 | QHash< int, QByteArray > FolderModel::roleNames() const | 160 | QHash< int, QByteArray > FolderModel::roleNames() const | ||
▲ Show 20 Lines • Show All 1080 Lines • ▼ Show 20 Line(s) | 1171 | { | |||
1243 | result = collator.compare(leftItem.name(), rightItem.name()); | 1241 | result = collator.compare(leftItem.name(), rightItem.name()); | ||
1244 | 1242 | | |||
1245 | if (result != 0) | 1243 | if (result != 0) | ||
1246 | return result < 0; | 1244 | return result < 0; | ||
1247 | 1245 | | |||
1248 | return QString::compare(leftItem.url().url(), rightItem.url().url(), Qt::CaseSensitive); | 1246 | return QString::compare(leftItem.url().url(), rightItem.url().url(), Qt::CaseSensitive); | ||
1249 | } | 1247 | } | ||
1250 | 1248 | | |||
1249 | Qt::DropActions FolderModel::supportedDragActions() const | ||||
1250 | { | ||||
1251 | return Qt::CopyAction | Qt::MoveAction | Qt::LinkAction; | ||||
1252 | } | ||||
1253 | | ||||
1251 | inline bool FolderModel::matchMimeType(const KFileItem &item) const | 1254 | inline bool FolderModel::matchMimeType(const KFileItem &item) const | ||
1252 | { | 1255 | { | ||
1253 | if (m_mimeSet.isEmpty()) { | 1256 | if (m_mimeSet.isEmpty()) { | ||
1254 | return false; | 1257 | return false; | ||
1255 | } | 1258 | } | ||
1256 | 1259 | | |||
1257 | if (m_mimeSet.contains(QStringLiteral("all/all")) || m_mimeSet.contains(QStringLiteral("all/allfiles"))) { | 1260 | if (m_mimeSet.contains(QStringLiteral("all/all")) || m_mimeSet.contains(QStringLiteral("all/allfiles"))) { | ||
1258 | return true; | 1261 | return true; | ||
▲ Show 20 Lines • Show All 440 Lines • Show Last 20 Lines |