diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc index c3d64eb78..10d4809ed 100644 --- a/rtgui/filebrowser.cc +++ b/rtgui/filebrowser.cc @@ -604,13 +604,13 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry) std::lower_bound( fd.begin(), fd.end(), - (ThumbBrowserEntryBase*)entry, - [](ThumbBrowserEntryBase* a, ThumbBrowserEntryBase* b) + entry, + [](const ThumbBrowserEntryBase* a, const ThumbBrowserEntryBase* b) { - return *b < *a; + return *a < *b; } ), - (ThumbBrowserEntryBase*)entry + entry ); initEntry (entry); diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h index 561d652dd..55d7179ab 100644 --- a/rtgui/thumbbrowserentrybase.h +++ b/rtgui/thumbbrowserentrybase.h @@ -167,9 +167,9 @@ public: void setPosition (int x, int y, int w, int h); void setOffset (int x, int y); - bool operator< (ThumbBrowserEntryBase& other) + bool operator <(const ThumbBrowserEntryBase& other) const { - return shortname.casefold() > other.shortname.casefold(); + return shortname.casefold() < other.shortname.casefold(); } ThumbBrowserEntryBase* getOriginal () const;