Skip to content

Commit 46b02a1

Browse files
committed
Revert "feat: add trash file drop support"
This reverts commit 83021e8. 文管采用了相关脚本处理,无需dde-shell特殊处理回收站,只需保持原有逻辑。
1 parent adde632 commit 46b02a1

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

panels/dock/taskmanager/taskmanager.cpp

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@
2424
#include <QGuiApplication>
2525
#include <QStringLiteral>
2626
#include <QUrl>
27-
#include <QDir>
2827
#include <QStandardPaths>
29-
#include <DTrashManager>
3028

3129
#include <appletbridge.h>
3230

@@ -275,13 +273,6 @@ void TaskManager::handleWindowAdded(QPointer<AbstractWindow> window)
275273

276274
void TaskManager::dropFilesOnItem(const QString& itemId, const QStringList& urls)
277275
{
278-
if (itemId == "dde-trash") {
279-
qCDebug(taskManagerLog) << "dropFilesOnItem: dde-trash - moving files to trash:" << urls;
280-
// 将文件移动到回收站
281-
moveFilesToTrash(urls);
282-
return;
283-
}
284-
285276
auto indexes = m_itemModel->match(m_itemModel->index(0, 0), TaskManager::ItemIdRole, itemId, 1, Qt::MatchExactly);
286277
if (indexes.isEmpty()) {
287278
return;
@@ -295,20 +286,6 @@ void TaskManager::dropFilesOnItem(const QString& itemId, const QStringList& urls
295286
m_itemModel->requestOpenUrls(indexes.first(), urlList);
296287
}
297288

298-
void TaskManager::moveFilesToTrash(const QStringList& urls)
299-
{
300-
// 将文件路径转换为本地路径并移动到回收站
301-
for (const QString& urlString : urls) {
302-
QUrl url(urlString);
303-
QString filePath = url.toLocalFile();
304-
if (DTrashManager::instance()->moveToTrash(filePath)) {
305-
qCDebug(taskManagerLog) << "Successfully moved to trash:" << filePath;
306-
} else {
307-
qCWarning(taskManagerLog) << "Failed to move to trash:" << filePath;
308-
}
309-
}
310-
}
311-
312289
void TaskManager::hideItemPreview()
313290
{
314291
m_windowMonitor->hideItemPreview();

panels/dock/taskmanager/taskmanager.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ class TaskManager : public DS_NAMESPACE::DContainment, public AbstractTaskManage
9797
Q_INVOKABLE void saveDockElementsOrder(const QStringList &appIds);
9898
Q_INVOKABLE QString getTrashTipText();
9999

100-
private:
101-
void moveFilesToTrash(const QStringList& urls);
102-
103100
Q_SIGNALS:
104101
void dataModelChanged();
105102
void windowSplitChanged();

0 commit comments

Comments
 (0)