Merge with "Beep6581/dev"

This commit is contained in:
Pandagrapher
2023-03-11 11:02:29 +01:00
252 changed files with 9021 additions and 3231 deletions

View File

@@ -26,6 +26,8 @@
#include "guiutils.h"
#include "lwbuttonset.h"
#include "threadutils.h"
#include "options.h"
#include "thumbnail.h"
#include "../rtengine/coord2d.h"
@@ -96,6 +98,7 @@ protected:
private:
const std::string collate_name;
const std::string collate_exif;
public:
@@ -118,7 +121,7 @@ public:
bool updatepriority;
eWithFilename withFilename;
explicit ThumbBrowserEntryBase (const Glib::ustring& fname);
explicit ThumbBrowserEntryBase (const Glib::ustring& fname, Thumbnail *thm);
virtual ~ThumbBrowserEntryBase ();
void setParent (ThumbBrowserBase* l)
@@ -175,9 +178,32 @@ public:
void setPosition (int x, int y, int w, int h);
void setOffset (int x, int y);
bool operator <(const ThumbBrowserEntryBase& other) const
bool compare (const ThumbBrowserEntryBase& other, Options::SortMethod method) const
{
return collate_name < other.collate_name;
int cmp = 0;
switch (method){
case Options::SORT_BY_NAME:
return collate_name < other.collate_name;
case Options::SORT_BY_DATE:
cmp = thumbnail->getDateTime().compare(other.thumbnail->getDateTime());
break;
case Options::SORT_BY_EXIF:
cmp = collate_exif.compare(other.collate_exif);
break;
case Options::SORT_BY_RANK:
cmp = thumbnail->getRank() - other.thumbnail->getRank();
break;
case Options::SORT_BY_LABEL:
cmp = thumbnail->getColorLabel() - other.thumbnail->getColorLabel();
break;
case Options::SORT_METHOD_COUNT: abort();
}
// Always fall back to sorting by name
if (!cmp)
cmp = collate_name.compare(other.collate_name);
return cmp < 0;
}
virtual void refreshThumbnailImage () = 0;