From afeca7f5f9df5d92327e4cedd7116102a655eef1 Mon Sep 17 00:00:00 2001 From: Ingo Weyrich Date: Sat, 2 Nov 2019 00:18:48 +0100 Subject: [PATCH] Fix lgtm issues --- rtgui/editorpanel.cc | 12 ++++++------ rtgui/editorpanel.h | 2 +- rtgui/rtwindow.cc | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 9ae613ebd..3328dcd65 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -1108,7 +1108,7 @@ Glib::ustring EditorPanel::getShortName () } } -Glib::ustring EditorPanel::getFileName () +Glib::ustring EditorPanel::getFileName () const { if (openThm) { return openThm->getFileName (); @@ -2012,9 +2012,9 @@ bool EditorPanel::idle_sendToGimp ( ProgressConnector *p if (img) { // get file name base - Glib::ustring shortname = removeExtension (Glib::path_get_basename (fname)); - Glib::ustring dirname = Glib::get_tmp_dir (); - Glib::ustring fname = Glib::build_filename (dirname, shortname); + const Glib::ustring shortname = removeExtension (Glib::path_get_basename (fname)); + const Glib::ustring dirname = Glib::get_tmp_dir (); + const Glib::ustring lfname = Glib::build_filename (dirname, shortname); SaveFormat sf; sf.format = "tif"; @@ -2023,13 +2023,13 @@ bool EditorPanel::idle_sendToGimp ( ProgressConnector *p sf.tiffUncompressed = true; sf.saveParams = true; - Glib::ustring fileName = Glib::ustring::compose ("%1.%2", fname, sf.format); + Glib::ustring fileName = Glib::ustring::compose ("%1.%2", lfname, sf.format); // TODO: Just list all file with a suitable name instead of brute force... int tries = 1; while (Glib::file_test (fileName, Glib::FILE_TEST_EXISTS) && tries < 1000) { - fileName = Glib::ustring::compose ("%1-%2.%3", fname, tries, sf.format); + fileName = Glib::ustring::compose ("%1-%2.%3", lfname, tries, sf.format); tries++; } diff --git a/rtgui/editorpanel.h b/rtgui/editorpanel.h index 00f1a942e..2f6c01a31 100644 --- a/rtgui/editorpanel.h +++ b/rtgui/editorpanel.h @@ -150,7 +150,7 @@ public: void saveProfile (); Glib::ustring getShortName (); - Glib::ustring getFileName (); + Glib::ustring getFileName () const; bool handleShortcutKey (GdkEventKey* event); bool getIsProcessing() const diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index 9f5357644..ed1ae8d6c 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -653,8 +653,8 @@ void RTWindow::remEditorPanel (EditorPanel* ep) set_title_decorated (""); } else { - EditorPanel* ep = static_cast (mainNB->get_nth_page (mainNB->get_current_page())); - set_title_decorated (ep->getFileName()); + const EditorPanel* lep = static_cast (mainNB->get_nth_page (mainNB->get_current_page())); + set_title_decorated (lep->getFileName()); } // TODO: ask what to do: close & apply, close & apply selection, close & revert, cancel