Skip to content

Commit

Permalink
fix: check and disallow folder insider folder
Browse files Browse the repository at this point in the history
检查并禁止文件夹嵌套。

Log:
  • Loading branch information
BLumia committed Nov 20, 2023
1 parent ecf8dd6 commit 6f5188b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/models/multipageproxymodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void MultipageProxyModel::commitDndOperation(const QString &dragId, const QStrin
folder->moveItem(dragOrigPage, std::get<2>(dragOrigPos), dropOrigPage, std::get<2>(dropOrigPos));
} else {
if (dragId.startsWith("internal/folders/")) return; // cannot drag folder onto something
if (std::get<0>(dropOrigPos) != 0) return; // folder inside folder is not allowed
if (dropId.startsWith("internal/folders/")) {
// drop into existing folder
m_topLevel->removeItem(dragId);
Expand Down

0 comments on commit 6f5188b

Please sign in to comment.