Use Glib::ustring::collate_key()
for ThumbBrowserEntryBase::operator<()
Kudos to @heckflosse for having a nose for optimizations. 👍
Also kills unused `DirEntry` class.
This commit is contained in:
@@ -36,20 +36,6 @@
|
|||||||
#include "multilangmgr.h"
|
#include "multilangmgr.h"
|
||||||
#include "threadutils.h"
|
#include "threadutils.h"
|
||||||
|
|
||||||
|
|
||||||
class DirEntry
|
|
||||||
{
|
|
||||||
|
|
||||||
public:
|
|
||||||
Glib::ustring fullName;
|
|
||||||
|
|
||||||
explicit DirEntry (const Glib::ustring& n) : fullName (n) {}
|
|
||||||
|
|
||||||
bool operator< (DirEntry& other)
|
|
||||||
{
|
|
||||||
return fullName.casefold() < other.fullName.casefold();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
class FilePanel;
|
class FilePanel;
|
||||||
/*
|
/*
|
||||||
* Class:
|
* Class:
|
||||||
|
@@ -17,33 +17,73 @@
|
|||||||
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
* along with RawTherapee. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "thumbbrowserentrybase.h"
|
#include "thumbbrowserentrybase.h"
|
||||||
#include "thumbbrowserbase.h"
|
|
||||||
#include "options.h"
|
#include "options.h"
|
||||||
|
#include "thumbbrowserbase.h"
|
||||||
|
|
||||||
#include "../rtengine/mytime.h"
|
#include "../rtengine/mytime.h"
|
||||||
|
|
||||||
ThumbBrowserEntryBase::ThumbBrowserEntryBase (const Glib::ustring& fname)
|
ThumbBrowserEntryBase::ThumbBrowserEntryBase (const Glib::ustring& fname) :
|
||||||
: fnlabw(0), fnlabh(0), dtlabw(0), dtlabh(0), exlabw(0), exlabh(0), prew(0), preh(0),
|
fnlabw(0),
|
||||||
prex(0), prey(0), upperMargin(6), borderWidth(1), textGap(6), sideMargin(8), lowerMargin(8),
|
fnlabh(0),
|
||||||
preview(nullptr), dispname(Glib::path_get_basename (fname)), buttonSet(nullptr), width(0), height(0),
|
dtlabw(0),
|
||||||
exp_width(0), exp_height(0), startx(0), starty(0), ofsX(0), ofsY(0), redrawRequests(0),
|
dtlabh(0),
|
||||||
parent(nullptr), original(nullptr), bbSelected(false), bbFramed(false), bbPreview(nullptr), cursor_type(CSUndefined),
|
exlabw(0),
|
||||||
thumbnail(nullptr), filename(fname), shortname(dispname), exifline(""), datetimeline(""),
|
exlabh(0),
|
||||||
selected(false), drawable(false), filtered(false), framed(false), processing(false), italicstyle(false),
|
prew(0),
|
||||||
edited(false), recentlysaved(false), updatepriority(false), withFilename(WFNAME_NONE) {}
|
preh(0),
|
||||||
|
prex(0),
|
||||||
|
prey(0),
|
||||||
|
upperMargin(6),
|
||||||
|
borderWidth(1),
|
||||||
|
textGap(6),
|
||||||
|
sideMargin(8),
|
||||||
|
lowerMargin(8),
|
||||||
|
preview(nullptr),
|
||||||
|
dispname(Glib::path_get_basename(fname)),
|
||||||
|
buttonSet(nullptr),
|
||||||
|
width(0),
|
||||||
|
height(0),
|
||||||
|
exp_width(0),
|
||||||
|
exp_height(0),
|
||||||
|
startx(0),
|
||||||
|
starty(0),
|
||||||
|
ofsX(0),
|
||||||
|
ofsY(0),
|
||||||
|
redrawRequests(0),
|
||||||
|
parent(nullptr),
|
||||||
|
original(nullptr),
|
||||||
|
bbSelected(false),
|
||||||
|
bbFramed(false),
|
||||||
|
bbPreview(nullptr),
|
||||||
|
cursor_type(CSUndefined),
|
||||||
|
collate_name(dispname.casefold().collate_key()),
|
||||||
|
thumbnail(nullptr),
|
||||||
|
filename(fname),
|
||||||
|
shortname(dispname),
|
||||||
|
exifline(""),
|
||||||
|
datetimeline(""),
|
||||||
|
selected(false),
|
||||||
|
drawable(false),
|
||||||
|
filtered(false),
|
||||||
|
framed(false),
|
||||||
|
processing(false),
|
||||||
|
italicstyle(false),
|
||||||
|
edited(false),
|
||||||
|
recentlysaved(false),
|
||||||
|
updatepriority(false),
|
||||||
|
withFilename(WFNAME_NONE)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
ThumbBrowserEntryBase::~ThumbBrowserEntryBase ()
|
ThumbBrowserEntryBase::~ThumbBrowserEntryBase ()
|
||||||
{
|
{
|
||||||
|
delete[] preview;
|
||||||
if (preview) {
|
|
||||||
delete [] preview;
|
|
||||||
}
|
|
||||||
|
|
||||||
delete buttonSet;
|
delete buttonSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThumbBrowserEntryBase::addButtonSet (LWButtonSet* bs)
|
void ThumbBrowserEntryBase::addButtonSet (LWButtonSet* bs)
|
||||||
{
|
{
|
||||||
|
|
||||||
buttonSet = bs;
|
buttonSet = bs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,6 +88,9 @@ protected:
|
|||||||
// called during updateBackBuffer for custom overlays
|
// called during updateBackBuffer for custom overlays
|
||||||
virtual void customBackBufferUpdate (Cairo::RefPtr<Cairo::Context> c) {}
|
virtual void customBackBufferUpdate (Cairo::RefPtr<Cairo::Context> c) {}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const std::string collate_name;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Thumbnail* thumbnail;
|
Thumbnail* thumbnail;
|
||||||
@@ -169,7 +172,7 @@ public:
|
|||||||
|
|
||||||
bool operator <(const ThumbBrowserEntryBase& other) const
|
bool operator <(const ThumbBrowserEntryBase& other) const
|
||||||
{
|
{
|
||||||
return shortname.casefold() < other.shortname.casefold();
|
return collate_name < other.collate_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
ThumbBrowserEntryBase* getOriginal () const;
|
ThumbBrowserEntryBase* getOriginal () const;
|
||||||
|
Reference in New Issue
Block a user