From 456230bc42dd0f9f4c96ff3320f7e6dc882f5b7e Mon Sep 17 00:00:00 2001 From: rekols Date: Mon, 27 Aug 2018 15:56:57 +0800 Subject: [PATCH] feat: change cursor when saving Change-Id: Ib6703eb28217ca56a8e059171e62a10ab6680205 --- deepin-editor.desktop | 2 +- editor/src/editor.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deepin-editor.desktop b/deepin-editor.desktop index e1a228e5..21050ada 100755 --- a/deepin-editor.desktop +++ b/deepin-editor.desktop @@ -7,4 +7,4 @@ Icon=deepin-editor MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; Name=Deepin Editor Type=Application -StartupNotify=true \ No newline at end of file +StartupNotify=false diff --git a/editor/src/editor.cpp b/editor/src/editor.cpp index 2a5408d5..821fde3a 100644 --- a/editor/src/editor.cpp +++ b/editor/src/editor.cpp @@ -82,6 +82,8 @@ bool Editor::saveFile(const QString &encode, const QString &newline) { bool fileCreateFailed = false; + QApplication::setOverrideCursor(Qt::WaitCursor); + if (!Utils::fileExists(textEditor->filepath)) { QString directory = QFileInfo(textEditor->filepath).dir().absolutePath(); @@ -142,6 +144,8 @@ bool Editor::saveFile(const QString &encode, const QString &newline) // update status. textEditor->setModified(false); + QTimer::singleShot(100, [=] { QApplication::restoreOverrideCursor(); }); + return true; }