Fix lgtm issues

This commit is contained in:
Ingo Weyrich 2019-11-02 00:18:48 +01:00
parent f02f5c4a69
commit afeca7f5f9
3 changed files with 9 additions and 9 deletions

View File

@ -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<rtengine::IImagefloat*> *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<rtengine::IImagefloat*> *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++;
}

View File

@ -150,7 +150,7 @@ public:
void saveProfile ();
Glib::ustring getShortName ();
Glib::ustring getFileName ();
Glib::ustring getFileName () const;
bool handleShortcutKey (GdkEventKey* event);
bool getIsProcessing() const

View File

@ -653,8 +653,8 @@ void RTWindow::remEditorPanel (EditorPanel* ep)
set_title_decorated ("");
} else {
EditorPanel* ep = static_cast<EditorPanel*> (mainNB->get_nth_page (mainNB->get_current_page()));
set_title_decorated (ep->getFileName());
const EditorPanel* lep = static_cast<EditorPanel*> (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