Commit ccdb0cc0 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

Disable the view while deleting.

BUG: 268336
parent 7cdcf647
...@@ -192,6 +192,9 @@ void RadialMap::Widget::enterEvent(QEvent *) ...@@ -192,6 +192,9 @@ void RadialMap::Widget::enterEvent(QEvent *)
void RadialMap::Widget::mousePressEvent(QMouseEvent *e) void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
{ {
if (!isEnabled())
return;
//m_focus is set correctly (I've been strict, I assure you it is correct!) //m_focus is set correctly (I've been strict, I assure you it is correct!)
if (m_focus && !m_focus->isFake()) if (m_focus && !m_focus->isFake())
...@@ -261,6 +264,7 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e) ...@@ -261,6 +264,7 @@ void RadialMap::Widget::mousePressEvent(QMouseEvent *e)
job->ui()->setWindow(this); job->ui()->setWindow(this);
connect(job, SIGNAL(finished(KJob*)), this, SLOT(deleteJobFinished(KJob*))); connect(job, SIGNAL(finished(KJob*)), this, SLOT(deleteJobFinished(KJob*)));
QApplication::setOverrideCursor(Qt::BusyCursor); QApplication::setOverrideCursor(Qt::BusyCursor);
setEnabled(false);
} }
} else { } else {
//ensure m_focus is set for new mouse position //ensure m_focus is set for new mouse position
...@@ -290,6 +294,7 @@ section_two: ...@@ -290,6 +294,7 @@ section_two:
void RadialMap::Widget::deleteJobFinished(KJob *job) void RadialMap::Widget::deleteJobFinished(KJob *job)
{ {
QApplication::restoreOverrideCursor(); QApplication::restoreOverrideCursor();
setEnabled(true);
if (!job->error() && m_toBeDeleted) { if (!job->error() && m_toBeDeleted) {
m_toBeDeleted->file()->parent()->remove(m_toBeDeleted->file()); m_toBeDeleted->file()->parent()->remove(m_toBeDeleted->file());
delete m_toBeDeleted->file(); delete m_toBeDeleted->file();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment