Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: The top bar of the trash has become a separate window #2092

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bool TrashDirIterator::hasNext() const

if (d->dEnumerator) {
if (!d->once)
TrashHelper::instance()->onTrashNotEmptyState();
TrashHelper::instance()->trashNotEmpty();

d->once = true;
const QUrl &urlNext = d->dEnumerator->next();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,11 @@ void TrashHelper::onTrashEmptyState() {
}
}

void TrashHelper::trashNotEmpty()
{
emit trashNotEmptyState();
}

void TrashHelper::onTrashNotEmptyState()
{
isTrashEmpty = false;
Expand All @@ -345,4 +350,5 @@ void TrashHelper::initEvent()
bool resutl = dpfSignalDispatcher->subscribe("dfmplugin_trashcore", "signal_TrashCore_TrashStateChanged", this, &TrashHelper::onTrashStateChanged);
if (!resutl)
fmWarning() << "subscribe signal_TrashCore_TrashStateChanged from dfmplugin_trashcore is failed.";
connect(this, &TrashHelper::trashNotEmptyState, this, &TrashHelper::onTrashNotEmptyState, Qt::QueuedConnection);
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,14 @@ class TrashHelper final : public QObject
bool customColumnRole(const QUrl &rootUrl, QList<DFMGLOBAL_NAMESPACE::ItemRoles> *roleList);
bool customRoleDisplayName(const QUrl &url, const DFMGLOBAL_NAMESPACE::ItemRoles role, QString *displayName);
void onTrashEmptyState();
void trashNotEmpty();

private Q_SLOTS:
void onTrashNotEmptyState();

Q_SIGNALS:
void trashNotEmptyState();

private:
void onTrashStateChanged();

Expand Down
Loading