Skip to content

Commit

Permalink
TextEditorPlugin: theme in config might be empty
Browse files Browse the repository at this point in the history
If the theme is "", code can be simplified (do nothing). Before it tried
opening a null file and fail. This would add a warning on the console.
  • Loading branch information
diegoiast committed Feb 1, 2025
1 parent 8562227 commit 8a23989
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/plugins/texteditor/texteditor_plg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,14 @@ void TextEditorPlugin::loadConfig(QSettings &settings) {

auto themeFileName = getConfig().getTheme();
delete this->theme;
this->theme = new Qutepart::Theme();
if (!this->theme->loadTheme(themeFileName)) {
qDebug() << "Failed loading thene " << themeFileName;
delete this->theme;
this->theme = nullptr;
if (!themeFileName.isEmpty()) {
this->theme = new Qutepart::Theme();
if (!this->theme->loadTheme(themeFileName)) {
qDebug() << "Failed loading theme " << themeFileName;
delete this->theme;
this->theme = nullptr;
}
}

auto history = getConfig().getSeachHistory();
historyModel->setHistory(history);
}
Expand Down

0 comments on commit 8a23989

Please sign in to comment.