Skip to content

Commit

Permalink
[code editors] Fix python console editor's modified content lost when…
Browse files Browse the repository at this point in the history
… switching to another app
  • Loading branch information
nirvn committed Nov 15, 2024
1 parent fda2aa4 commit 8433013
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gui/codeeditors/qgscodeeditorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,10 @@ bool QgsCodeEditorWidget::loadFile( const QString &path )
{
const QString content = file.readAll();
mEditor->setText( content );
mEditor->setModified( false );
setFilePath( path );
mEditor->recolor();
mEditor->setModified( false );
mLastModified = QFileInfo( path ).lastModified();
setFilePath( path );
return true;
}
return false;
Expand Down Expand Up @@ -449,9 +449,9 @@ bool QgsCodeEditorWidget::save( const QString &path )
file.write( mEditor->text().toUtf8() );
file.close();

setFilePath( filePath );
mEditor->setModified( false );
mLastModified = QFileInfo( filePath ).lastModified();
setFilePath( filePath );

return true;
}
Expand Down

0 comments on commit 8433013

Please sign in to comment.