Some performance optimizations.

This commit is contained in:
Martín Lucas Golini
2022-03-13 14:57:09 -03:00
parent 746e44bf2b
commit 775b65ffa6
11 changed files with 185 additions and 35 deletions

View File

@@ -116,11 +116,17 @@ void App::updateEditorTitle( UICodeEditor* editor ) {
}
void App::setAppTitle( const std::string& title ) {
mWindow->setTitle( mWindowTitle +
String( mCurrentProject.empty()
? ""
: " - " + FileSystem::fileNameFromPath( mCurrentProject ) ) +
String( title.empty() ? "" : " - " + title ) );
std::string fullTitle( mWindowTitle );
if ( !mCurrentProject.empty() ) {
std::string currentProject( FileSystem::fileNameFromPath( mCurrentProject ) );
if ( !currentProject.empty() )
fullTitle += " - " + currentProject;
}
if ( !title.empty() )
fullTitle += " - " + title;
mWindow->setTitle( fullTitle );
}
void App::onDocumentModified( UICodeEditor* editor, TextDocument& ) {