Skip to content

Commit

Permalink
feat: change cursor when saving
Browse files Browse the repository at this point in the history
Change-Id: Ib6703eb28217ca56a8e059171e62a10ab6680205
  • Loading branch information
rekols committed Aug 27, 2018
1 parent 9ea1f8d commit 456230b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deepin-editor.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -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
StartupNotify=false
4 changes: 4 additions & 0 deletions editor/src/editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 456230b

Please sign in to comment.