Cppcheck: Fixed most issued in rtgui/*
This commit is contained in:
parent
01048ee513
commit
566d4c9822
@ -35,7 +35,6 @@ static double one2one(double val)
|
||||
Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep, double vdefault, Gtk::Image *imgIcon1, Gtk::Image *imgIcon2, double2double_fun slider2value_, double2double_fun value2slider_)
|
||||
{
|
||||
|
||||
Gtk::HBox *hbox2 = NULL;
|
||||
label = NULL;
|
||||
adjusterListener = NULL;
|
||||
afterReset = false;
|
||||
@ -107,6 +106,8 @@ Adjuster::Adjuster (Glib::ustring vlabel, double vmin, double vmax, double vstep
|
||||
if (!imgIcon1 || !imgIcon2) {
|
||||
pack_start (*slider, true, true);
|
||||
} else {
|
||||
Gtk::HBox *hbox2 = NULL;
|
||||
|
||||
// A second HBox is necessary
|
||||
hbox2 = Gtk::manage (new Gtk::HBox());
|
||||
|
||||
|
@ -24,10 +24,6 @@
|
||||
#include "soundman.h"
|
||||
#include "rtimage.h"
|
||||
|
||||
struct BQProcessLoaded {
|
||||
BatchQueue* bq;
|
||||
};
|
||||
|
||||
int processLoadedBatchQueueUIThread (void* data)
|
||||
{
|
||||
|
||||
|
@ -21,7 +21,8 @@
|
||||
BrowserFilter::BrowserFilter () : exifFilterEnabled (false),
|
||||
showTrash (true),
|
||||
showNotTrash (true),
|
||||
showOriginal (false)
|
||||
showOriginal (false),
|
||||
multiselect (false)
|
||||
{
|
||||
for (int i = 0; i < 6; i++) {
|
||||
showRanked[i] = true;
|
||||
|
@ -24,7 +24,9 @@
|
||||
|
||||
CacheImageData::CacheImageData ()
|
||||
: md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false),
|
||||
timeValid(false), exifValid(false), redAWBMul(-1.0), greenAWBMul(-1.0), blueAWBMul(-1.0), thumbImgType(0)
|
||||
timeValid(false), year(0), month(0), day(0), hour(0), min(0), sec(0), exifValid(false),
|
||||
fnumber(0.0), shutter(0.0), focalLen(0.0), focalLen35mm(0.0), focusDist(0.f), iso(0),
|
||||
redAWBMul(-1.0), greenAWBMul(-1.0), blueAWBMul(-1.0), rotate(0), thumbImgType(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
Clipboard clipboard;
|
||||
|
||||
Clipboard::Clipboard () : partProfile (false) {}
|
||||
Clipboard::Clipboard () : partProfile (false), _hasIPTC(false), hasDiagonalCurveDataType(DCT_Empty), hasFlatCurveDataType(FCT_Empty) {}
|
||||
|
||||
Clipboard::~Clipboard ()
|
||||
{
|
||||
|
@ -124,9 +124,8 @@ void CoordinateAdjuster::createWidgets(const std::vector<Axis> &axis)
|
||||
|
||||
set_spacing(3);
|
||||
|
||||
AxisAdjuster *currAdjuster = NULL;
|
||||
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
AxisAdjuster *currAdjuster = NULL;
|
||||
const Axis *currAxis = &(axis.at(i));
|
||||
axisAdjusters.at(i) = new AxisAdjuster(this, currAxis, i);
|
||||
currAdjuster = axisAdjusters.at(i);
|
||||
|
@ -32,6 +32,7 @@ CropHandler::CropHandler ()
|
||||
: zoom(10), ww(0), wh(0), imx(-1), imy(-1), imw(0), imh(0), cax(-1), cay(-1),
|
||||
cx(0), cy(0), cw(0), ch(0), cropX(0), cropY(0), cropW(0), cropH(0), enabled(false),
|
||||
cropimg(NULL), cropimgtrue(NULL), cropimg_width(0), cropimg_height(0),
|
||||
cix(0), ciy(0), ciw(0), cih(0), cis(1),
|
||||
initial(false), isLowUpdatePriority(false), ipc(NULL), crop(NULL),
|
||||
displayHandler(NULL)
|
||||
{
|
||||
|
@ -113,10 +113,9 @@ CurveEditor* CurveEditorGroup::addCurve(CurveType cType, Glib::ustring curveLabe
|
||||
*/
|
||||
void CurveEditorGroup::newLine()
|
||||
{
|
||||
Gtk::HBox* headerBox;
|
||||
|
||||
if (curveEditors.size() > numberOfPackedCurve) {
|
||||
headerBox = Gtk::manage (new Gtk::HBox ());
|
||||
Gtk::HBox* headerBox = Gtk::manage (new Gtk::HBox ());
|
||||
|
||||
if (!numberOfPackedCurve) {
|
||||
headerBox->pack_start(*curveGroupLabel, Gtk::PACK_SHRINK, 2);
|
||||
@ -381,7 +380,7 @@ void CurveEditorGroup::setUnChanged (bool uc, CurveEditor* ce)
|
||||
}
|
||||
}
|
||||
|
||||
CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), lastFilename("")
|
||||
CurveEditorSubGroup::CurveEditorSubGroup(Glib::ustring& curveDir) : curveDir(curveDir), lastFilename(""), valLinear(0), valUnchanged(0), parent(nullptr), curveBBoxPos(0)
|
||||
{
|
||||
leftBar = NULL;
|
||||
bottomBar = NULL;
|
||||
|
@ -1117,12 +1117,10 @@ bool DiagonalCurveEditorSubGroup::curveReset(CurveEditor *ce)
|
||||
case (DCT_NURBS) : // = Control cage
|
||||
NURBSCurve->reset (dce->NURBSResetCurve, dce->getIdentityValue());
|
||||
return true;
|
||||
break;
|
||||
|
||||
case (DCT_Spline) : // = Custom
|
||||
customCurve->reset (dce->customResetCurve, dce->getIdentityValue());
|
||||
return true;
|
||||
break;
|
||||
|
||||
case (DCT_Parametric) : {
|
||||
DiagonalCurveEditor* dCurve = static_cast<DiagonalCurveEditor*>(parent->displayedCurve);
|
||||
@ -1137,12 +1135,10 @@ bool DiagonalCurveEditorSubGroup::curveReset(CurveEditor *ce)
|
||||
shcSelector->reset();
|
||||
paramCurve->reset (dce->paramResetCurve, dce->getIdentityValue());
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -156,7 +156,7 @@ private:
|
||||
}
|
||||
|
||||
public:
|
||||
MonitorProfileSelector (rtengine::StagedImageProcessor* const& ipc) :
|
||||
explicit MonitorProfileSelector (rtengine::StagedImageProcessor* const& ipc) :
|
||||
intentBox (Glib::ustring (), true),
|
||||
processor (ipc)
|
||||
{
|
||||
|
@ -102,7 +102,7 @@ void ExtProgStore::init ()
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
bool ExtProgStore::searchProgram (const Glib::ustring& name,
|
||||
const Glib::ustring& exePath,
|
||||
const Glib::ustring& exePath86,
|
||||
@ -111,7 +111,6 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name,
|
||||
bool allowQueueProcess)
|
||||
{
|
||||
|
||||
#ifdef WIN32
|
||||
// get_user_special_dir crashes on some Windows configurations.
|
||||
static Glib::ustring progFilesDir, progFilesDirx86;
|
||||
|
||||
@ -196,10 +195,10 @@ bool ExtProgStore::searchProgram (const Glib::ustring& name,
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool ExtProgStore::spawnCommandAsync (const Glib::ustring& cmd)
|
||||
{
|
||||
|
@ -44,13 +44,14 @@ class ExtProgStore
|
||||
MyMutex mtx; // covers actions
|
||||
std::vector<ExtProgAction> actions;
|
||||
|
||||
#ifdef WIN32
|
||||
bool searchProgram (const Glib::ustring& name,
|
||||
const Glib::ustring& exePath,
|
||||
const Glib::ustring& exePath86,
|
||||
int maxVer,
|
||||
bool allowRaw,
|
||||
bool allowQueueProcess);
|
||||
|
||||
#endif
|
||||
public:
|
||||
static ExtProgStore* getInstance();
|
||||
|
||||
|
@ -487,13 +487,13 @@ void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry)
|
||||
untrash->set_sensitive (false);
|
||||
|
||||
for (size_t i = 0; i < selected.size(); i++)
|
||||
if ((static_cast<FileBrowserEntry*>(selected[i]))->thumbnail->getStage() == 1) {
|
||||
if ((static_cast<FileBrowserEntry*>(selected[i]))->thumbnail->getStage()) {
|
||||
untrash->set_sensitive (true);
|
||||
break;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < selected.size(); i++)
|
||||
if ((static_cast<FileBrowserEntry*>(selected[i]))->thumbnail->getStage() == 0) {
|
||||
if (!(static_cast<FileBrowserEntry*>(selected[i]))->thumbnail->getStage()) {
|
||||
trash->set_sensitive (true);
|
||||
break;
|
||||
}
|
||||
@ -512,7 +512,6 @@ void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry)
|
||||
submenuDF->attach (*Gtk::manage(autoDF = new Gtk::MenuItem (M("FILEBROWSER_AUTODARKFRAME"))), 0, 1, p, p + 1);
|
||||
p++;
|
||||
submenuDF->attach (*Gtk::manage(thisIsDF = new Gtk::MenuItem (M("FILEBROWSER_MOVETODARKFDIR"))), 0, 1, p, p + 1);
|
||||
p++;
|
||||
selectDF->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), selectDF));
|
||||
autoDF->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), autoDF));
|
||||
thisIsDF->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), thisIsDF ));
|
||||
@ -527,7 +526,6 @@ void FileBrowser::rightClicked (ThumbBrowserEntryBase* entry)
|
||||
submenuFF->attach (*Gtk::manage(autoFF = new Gtk::MenuItem (M("FILEBROWSER_AUTOFLATFIELD"))), 0, 1, p, p + 1);
|
||||
p++;
|
||||
submenuFF->attach (*Gtk::manage(thisIsFF = new Gtk::MenuItem (M("FILEBROWSER_MOVETOFLATFIELDDIR"))), 0, 1, p, p + 1);
|
||||
p++;
|
||||
selectFF->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), selectFF));
|
||||
autoFF->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), autoFF));
|
||||
thisIsFF->signal_activate().connect (sigc::bind(sigc::mem_fun(*this, &FileBrowser::menuItemActivated), thisIsFF ));
|
||||
@ -612,7 +610,7 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry)
|
||||
entry->addButtonSet (new FileThumbnailButtonSet (entry));
|
||||
entry->getThumbButtonSet()->setRank (entry->thumbnail->getRank());
|
||||
entry->getThumbButtonSet()->setColorLabel (entry->thumbnail->getColorLabel());
|
||||
entry->getThumbButtonSet()->setInTrash (entry->thumbnail->getStage() == 1);
|
||||
entry->getThumbButtonSet()->setInTrash (entry->thumbnail->getStage());
|
||||
entry->getThumbButtonSet()->setButtonListener (this);
|
||||
entry->resize (getThumbnailHeight());
|
||||
|
||||
@ -1134,8 +1132,9 @@ bool FileBrowser::keyPressed (GdkEventKey* event)
|
||||
bool ctrl = event->state & GDK_CONTROL_MASK;
|
||||
bool shift = event->state & GDK_SHIFT_MASK;
|
||||
bool alt = event->state & GDK_MOD1_MASK;
|
||||
#ifdef __WIN32__
|
||||
bool altgr = event->state & GDK_MOD2_MASK;
|
||||
|
||||
#endif
|
||||
if ((event->keyval == GDK_C || event->keyval == GDK_c || event->keyval == GDK_Insert) && ctrl) {
|
||||
copyProfile ();
|
||||
return true;
|
||||
@ -1474,8 +1473,8 @@ bool FileBrowser::checkFilter (ThumbBrowserEntryBase* entryb) // true -> entry
|
||||
((entry->thumbnail->isRecentlySaved() && filter.showRecentlySaved[0]) && !filter.showRecentlySaved[1]) ||
|
||||
((!entry->thumbnail->isRecentlySaved() && filter.showRecentlySaved[1]) && !filter.showRecentlySaved[0]) ||
|
||||
|
||||
(entry->thumbnail->getStage() == 1 && !filter.showTrash) ||
|
||||
(entry->thumbnail->getStage() == 0 && !filter.showNotTrash)) {
|
||||
(entry->thumbnail->getStage() && !filter.showTrash) ||
|
||||
(!entry->thumbnail->getStage() && !filter.showNotTrash)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1568,11 +1567,11 @@ void FileBrowser::toTrashRequested (std::vector<FileBrowserEntry*> tbe)
|
||||
|
||||
// no need to notify listeners as item goes to trash, likely to be deleted
|
||||
|
||||
if (tbe[i]->thumbnail->getStage() == 1) {
|
||||
if (tbe[i]->thumbnail->getStage()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tbe[i]->thumbnail->setStage (1);
|
||||
tbe[i]->thumbnail->setStage (true);
|
||||
|
||||
if (tbe[i]->getThumbButtonSet()) {
|
||||
tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank());
|
||||
@ -1592,11 +1591,11 @@ void FileBrowser::fromTrashRequested (std::vector<FileBrowserEntry*> tbe)
|
||||
for (size_t i = 0; i < tbe.size(); i++) {
|
||||
// if thumbnail was marked inTrash=true then param file must be there, no need to run customprofilebuilder
|
||||
|
||||
if (tbe[i]->thumbnail->getStage() == 0) {
|
||||
if (!tbe[i]->thumbnail->getStage()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
tbe[i]->thumbnail->setStage (0);
|
||||
tbe[i]->thumbnail->setStage (false);
|
||||
|
||||
if (tbe[i]->getThumbButtonSet()) {
|
||||
tbe[i]->getThumbButtonSet()->setRank (tbe[i]->thumbnail->getRank());
|
||||
@ -1715,7 +1714,7 @@ void FileBrowser::buttonPressed (LWButton* button, int actionCode, void* actionD
|
||||
FileBrowserEntry* entry = static_cast<FileBrowserEntry*>(actionData);
|
||||
tbe.push_back (entry);
|
||||
|
||||
if (entry->thumbnail->getStage() == 0) {
|
||||
if (!entry->thumbnail->getStage()) {
|
||||
toTrashRequested (tbe);
|
||||
} else {
|
||||
fromTrashRequested (tbe);
|
||||
|
@ -989,9 +989,6 @@ void FileCatalog::copyMoveRequested (std::vector<FileBrowserEntry*> tbe, bool m
|
||||
fc.set_filename(tbe[0]->filename);
|
||||
//!!! TODO prevent dialog closing on "enter" key press
|
||||
|
||||
bool filecopymovecomplete;
|
||||
int i_copyindex;
|
||||
|
||||
if( fc.run() == Gtk::RESPONSE_OK ) {
|
||||
Glib::ustring dest_Dir = fc.get_current_folder();
|
||||
|
||||
@ -1020,8 +1017,8 @@ void FileCatalog::copyMoveRequested (std::vector<FileBrowserEntry*> tbe, bool m
|
||||
/* comparison of src_Dir and dest_Dir is done per image for compatibility with
|
||||
possible future use of Collections as source where each file's source path may be different.*/
|
||||
|
||||
filecopymovecomplete = false;
|
||||
i_copyindex = 1;
|
||||
bool filecopymovecomplete = false;
|
||||
int i_copyindex = 1;
|
||||
|
||||
while(!filecopymovecomplete) {
|
||||
// check for filename conflicts at destination - prevent overwriting (actually RT will crash on overwriting attempt)
|
||||
@ -1224,8 +1221,6 @@ void FileCatalog::setExportPanel (ExportPanel* expanel)
|
||||
void FileCatalog::renameRequested (std::vector<FileBrowserEntry*> tbe)
|
||||
{
|
||||
|
||||
bool success;
|
||||
|
||||
RenameDialog* renameDlg = new RenameDialog ((Gtk::Window*)get_toplevel());
|
||||
|
||||
for (size_t i = 0; i < tbe.size(); i++) {
|
||||
@ -1235,7 +1230,7 @@ void FileCatalog::renameRequested (std::vector<FileBrowserEntry*> tbe)
|
||||
Glib::ustring dirName = Glib::path_get_dirname (tbe[i]->filename);
|
||||
Glib::ustring baseName = Glib::path_get_basename (tbe[i]->filename);
|
||||
|
||||
success = false;
|
||||
bool success = false;
|
||||
|
||||
do {
|
||||
if (renameDlg->run () == Gtk::RESPONSE_OK) {
|
||||
|
@ -353,7 +353,8 @@ void HistogramPanel::toggle_button_full ()
|
||||
//
|
||||
// HistogramRGBArea
|
||||
HistogramRGBArea::HistogramRGBArea () ://needChroma unactive by default
|
||||
frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false), showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false)
|
||||
val(0), r(0), g(0), b(0), frozen(false), valid(false), needRed(true), needGreen(true), needBlue(true), needLuma(true), rawMode(false),
|
||||
showMode(options.histogramBar), barDisplayed(options.histogramBar), needChroma(false), parent(nullptr)
|
||||
{
|
||||
|
||||
harih = new HistogramRGBAreaIdleHelper;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "guiutils.h"
|
||||
|
||||
LWButton::LWButton (Cairo::RefPtr<Cairo::ImageSurface> i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring tooltip)
|
||||
: halign(ha), valign(va), icon(i), state(Normal), listener(NULL), actionCode(aCode), actionData(aData), toolTip(tooltip)
|
||||
: xpos(0), ypos(0), halign(ha), valign(va), icon(i), bgr(0.0), bgg(0.0), bgb(0.0), fgr(0.0), fgg(0.0), fgb(0.0), state(Normal), listener(NULL), actionCode(aCode), actionData(aData), toolTip(tooltip)
|
||||
{
|
||||
|
||||
if (i) {
|
||||
|
@ -18,7 +18,7 @@
|
||||
*/
|
||||
#include "lwbuttonset.h"
|
||||
|
||||
LWButtonSet::LWButtonSet () : aw(0), ah(0)
|
||||
LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(0), ay(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -165,11 +165,11 @@ void MyDiagonalCurve::get_LUT (LUTf &lut)
|
||||
// calculate remaining points
|
||||
std::vector<double> curveDescr = getPoints ();
|
||||
rtengine::DiagonalCurve rtcurve(curveDescr, lut.getUpperBound() * 1.2);
|
||||
double t;
|
||||
|
||||
double maxVal = double(lut.getUpperBound());
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
t = double(i) / maxVal;
|
||||
double t = double(i) / maxVal;
|
||||
lut[i] = rtcurve.getVal (t);
|
||||
}
|
||||
|
||||
@ -1167,7 +1167,6 @@ void MyDiagonalCurve::pipetteButton1Released(EditDataProvider *provider)
|
||||
snapToElmt = -100;
|
||||
|
||||
if (curve.type != DCT_Parametric) {
|
||||
std::vector<double>::iterator itx, ity;
|
||||
buttonPressed = false;
|
||||
/* get the pointer position */
|
||||
getCursorPosition(Gdk::EventType(Gdk::BUTTON_RELEASE), false, graphY, 0, Gdk::ModifierType(0));
|
||||
|
@ -86,11 +86,10 @@ void MyFlatCurve::get_LUT (LUTf &lut)
|
||||
std::vector<double> curveDescr = getPoints ();
|
||||
rtengine::FlatCurve rtcurve(curveDescr, periodic, lut.getUpperBound() * 1.2 > 5000 ? 5000 : lut.getUpperBound() * 1.2);
|
||||
|
||||
double t;
|
||||
double maxVal = double(lut.getUpperBound());
|
||||
|
||||
for (int i = 0; i < size; i++) {
|
||||
t = double(i) / maxVal;
|
||||
double t = double(i) / maxVal;
|
||||
lut[i] = rtcurve.getVal (t);
|
||||
}
|
||||
|
||||
@ -815,13 +814,13 @@ bool MyFlatCurve::handleEvents (GdkEvent* event)
|
||||
case Gdk::BUTTON_RELEASE:
|
||||
if (edited_point == -1) { //curve.type!=FCT_Parametric) {
|
||||
if (buttonPressed && event->button.button == 1) {
|
||||
int src, dst;
|
||||
buttonPressed = false;
|
||||
remove_modal_grab ();
|
||||
|
||||
// Removing any deleted point if we were previously modifying the point position
|
||||
if (editedHandle & (FCT_EditedHandle_CPoint | FCT_EditedHandle_CPointX | FCT_EditedHandle_CPointY)) {
|
||||
/* delete inactive points: */
|
||||
int src, dst;
|
||||
itx = curve.x.begin();
|
||||
ity = curve.y.begin();
|
||||
itlt = curve.leftTangent.begin();
|
||||
|
@ -2168,9 +2168,9 @@ bool Options::load ()
|
||||
} else {
|
||||
#ifdef WIN32
|
||||
WCHAR pathW[MAX_PATH] = {0};
|
||||
char pathA[MAX_PATH];
|
||||
|
||||
if (SHGetSpecialFolderPathW(NULL, pathW, CSIDL_LOCAL_APPDATA, false)) {
|
||||
char pathA[MAX_PATH];
|
||||
WideCharToMultiByte(CP_UTF8, 0, pathW, -1, pathA, MAX_PATH, 0, 0);
|
||||
rtdir = Glib::build_filename(Glib::ustring(pathA), Glib::ustring(CACHEFOLDERNAME));
|
||||
}
|
||||
|
@ -609,9 +609,10 @@ Gtk::Widget* Preferences::getPerformancePanel ()
|
||||
rgbDenoiseTreadLimitSB->set_digits (0);
|
||||
rgbDenoiseTreadLimitSB->set_increments (1, 5);
|
||||
rgbDenoiseTreadLimitSB->set_max_length(2); // Will this be sufficient? :)
|
||||
int maxThreadNumber = 10;
|
||||
#ifdef _OPENMP
|
||||
maxThreadNumber = omp_get_max_threads();
|
||||
int maxThreadNumber = omp_get_max_threads();
|
||||
#else
|
||||
int maxThreadNumber = 10;
|
||||
#endif
|
||||
rgbDenoiseTreadLimitSB->set_range (0, maxThreadNumber);
|
||||
threadLimitHB->pack_start (*RGBDTLl, Gtk::PACK_SHRINK, 2);
|
||||
|
@ -72,9 +72,10 @@ public:
|
||||
|
||||
Impl(): nConcurrentThreads(0)
|
||||
{
|
||||
int threadCount = 2;
|
||||
#ifdef _OPENMP
|
||||
threadCount = omp_get_num_procs();
|
||||
int threadCount = omp_get_num_procs();
|
||||
#else
|
||||
int threadCount = 2;
|
||||
#endif
|
||||
|
||||
threadPool_ = new Glib::ThreadPool(threadCount, 0);
|
||||
|
@ -223,10 +223,10 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event)
|
||||
int x, y, w, h;
|
||||
getObservedFrameArea (x, y, w, h);
|
||||
if (x>imgX || y>imgY || w < imgW || h < imgH) {
|
||||
bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6;
|
||||
bool moreInside = event->x > x + 6 && event->x < x + w - 1 - 6 && event->y > y + 6 && event->y < y + h - 1 - 6;
|
||||
|
||||
if (!isMoving) {
|
||||
bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6;
|
||||
bool moreInside = event->x > x + 6 && event->x < x + w - 1 - 6 && event->y > y + 6 && event->y < y + h - 1 - 6;
|
||||
isMoving = true;
|
||||
|
||||
if (!inside || moreInside) {
|
||||
|
@ -164,10 +164,10 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath
|
||||
{
|
||||
|
||||
bool fileFound = false;
|
||||
unsigned int folder = 0; // folder's own Id
|
||||
|
||||
// reload the available profiles from the profile dir
|
||||
if (!realPath.empty() && Glib::file_test(realPath, Glib::FILE_TEST_EXISTS) && Glib::file_test (realPath, Glib::FILE_TEST_IS_DIR)) {
|
||||
unsigned int folder = 0; // folder's own Id
|
||||
|
||||
// add this entry to the folder list
|
||||
folders.push_back(virtualPath);
|
||||
@ -488,7 +488,7 @@ void ProfileStore::dumpFolderList()
|
||||
printf("Folder list:\n------------\n");
|
||||
|
||||
for (unsigned int i = 0; i < folders.size(); i++) {
|
||||
printf(" #%3d - %s\n", i, folders.at(i).c_str());
|
||||
printf(" #%3ud - %s\n", i, folders.at(i).c_str());
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
@ -90,7 +90,7 @@ class ProgressConnector
|
||||
|
||||
public:
|
||||
|
||||
ProgressConnector (): workThread( 0 ) { }
|
||||
ProgressConnector (): retval( 0 ), workThread( 0 ) { }
|
||||
|
||||
void startFunc (const sigc::slot0<T>& startHandler, const sigc::slot0<bool>& endHandler )
|
||||
{
|
||||
|
@ -88,159 +88,159 @@ Glib::ustring RenameDialog::getNewName ()
|
||||
return newName->get_text ();
|
||||
}
|
||||
|
||||
void RenameDialog::fillTemplateList ()
|
||||
{
|
||||
//void RenameDialog::fillTemplateList ()
|
||||
//{
|
||||
//
|
||||
// templateModel->clear ();
|
||||
//
|
||||
// for (size_t i = 0; i < options.renameTemplates.size(); i++) {
|
||||
// Gtk::TreeModel::iterator iter = templateModel->append ();
|
||||
// iter->set_value (templateColumns.tmplName, options.renameTemplates[i]);
|
||||
// iter->set_value (templateColumns.rowSeparator, false);
|
||||
// }
|
||||
//
|
||||
// // append separator and the manage... item
|
||||
// Gtk::TreeModel::iterator iter = templateModel->append ();
|
||||
// iter->set_value (templateColumns.tmplName, Glib::ustring(""));
|
||||
// iter->set_value (templateColumns.rowSeparator, true);
|
||||
// iter = templateModel->append ();
|
||||
// iter->set_value (templateColumns.tmplName, Glib::ustring(M("FILEBROWSER_ADDDELTEMPLATE")));
|
||||
// iter->set_value (templateColumns.rowSeparator, false);
|
||||
//}
|
||||
|
||||
templateModel->clear ();
|
||||
//bool RenameDialog::rowSeparatorFunc (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter)
|
||||
//{
|
||||
//
|
||||
// return iter->get_value (templateColumns.rowSeparator);
|
||||
//}
|
||||
|
||||
for (size_t i = 0; i < options.renameTemplates.size(); i++) {
|
||||
Gtk::TreeModel::iterator iter = templateModel->append ();
|
||||
iter->set_value (templateColumns.tmplName, options.renameTemplates[i]);
|
||||
iter->set_value (templateColumns.rowSeparator, false);
|
||||
}
|
||||
//void RenameDialog::useTemplToggled ()
|
||||
//{
|
||||
//
|
||||
// templates->set_sensitive (useTmpl->get_active ());
|
||||
//
|
||||
// if (useTmpl->get_active () && isTemplSelected ()) {
|
||||
// all->set_sensitive (true);
|
||||
// newName->set_text (applyTemplate (oldName->get_text(), imageData, getActiveTemplate()));
|
||||
// } else {
|
||||
// all->set_sensitive (false);
|
||||
// }
|
||||
//
|
||||
// newName->select_region (0, newName->get_text().size());
|
||||
//}
|
||||
|
||||
// append separator and the manage... item
|
||||
Gtk::TreeModel::iterator iter = templateModel->append ();
|
||||
iter->set_value (templateColumns.tmplName, Glib::ustring(""));
|
||||
iter->set_value (templateColumns.rowSeparator, true);
|
||||
iter = templateModel->append ();
|
||||
iter->set_value (templateColumns.tmplName, Glib::ustring(M("FILEBROWSER_ADDDELTEMPLATE")));
|
||||
iter->set_value (templateColumns.rowSeparator, false);
|
||||
}
|
||||
//bool RenameDialog::isTemplSelected ()
|
||||
//{
|
||||
//
|
||||
// Gtk::TreeModel::iterator iter = templates->get_active();
|
||||
// return iter && iter->get_value (templateColumns.tmplName) != M("FILEBROWSER_ADDDELTEMPLATE");
|
||||
//}
|
||||
|
||||
bool RenameDialog::rowSeparatorFunc (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter)
|
||||
{
|
||||
//Glib::ustring RenameDialog::getActiveTemplate ()
|
||||
//{
|
||||
//
|
||||
// Gtk::TreeModel::iterator iter = templates->get_active();
|
||||
//
|
||||
// if (iter && iter->get_value (templateColumns.tmplName) != M("FILEBROWSER_ADDDELTEMPLATE")) {
|
||||
// return iter->get_value (templateColumns.tmplName);
|
||||
// } else {
|
||||
// return "";
|
||||
// }
|
||||
//}
|
||||
|
||||
return iter->get_value (templateColumns.rowSeparator);
|
||||
}
|
||||
//void RenameDialog::tmplSelectionChanged ()
|
||||
//{
|
||||
//
|
||||
// Gtk::TreeModel::iterator iter = templates->get_active();
|
||||
//
|
||||
// if (iter && iter->get_value (templateColumns.tmplName) == M("FILEBROWSER_ADDDELTEMPLATE")) {
|
||||
// RenameTemplateEditor* rte = new RenameTemplateEditor (p);
|
||||
//
|
||||
// if (rte->run() == Gtk::RESPONSE_OK) {
|
||||
// fillTemplateList ();
|
||||
// }
|
||||
//
|
||||
// delete rte;
|
||||
// // show add/del template dialog
|
||||
// } else {
|
||||
// useTemplToggled ();
|
||||
// }
|
||||
//}
|
||||
|
||||
void RenameDialog::useTemplToggled ()
|
||||
{
|
||||
//RenameTemplateEditor::RenameTemplateEditor (Gtk::Window* parent)
|
||||
// : Gtk::Dialog ("Edit rename templates", *parent, true, true)
|
||||
//{
|
||||
//
|
||||
// list = Gtk::manage (new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE));
|
||||
// list->set_headers_visible (false);
|
||||
// get_vbox ()->pack_start (*list);
|
||||
//
|
||||
// Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());
|
||||
// templ = Gtk::manage (new Gtk::Entry ());
|
||||
// Gtk::Button* add = Gtk::manage (new Gtk::Button ());
|
||||
// Gtk::Button* del = Gtk::manage (new Gtk::Button ());
|
||||
// add->add (*Gtk::manage (new RTImage ("list-add-small.png")));
|
||||
// del->add (*Gtk::manage (new RTImage ("list-remove-red-small.png")));
|
||||
// hb->pack_start (*templ);
|
||||
// hb->pack_start (*add, Gtk::PACK_SHRINK, 2);
|
||||
// hb->pack_start (*del, Gtk::PACK_SHRINK, 2);
|
||||
//
|
||||
// get_vbox ()->pack_start (*hb, Gtk::PACK_SHRINK, 4);
|
||||
//
|
||||
// add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
|
||||
//
|
||||
// refreshTemplateList ();
|
||||
//
|
||||
// add->signal_pressed().connect( sigc::mem_fun(*this, &RenameTemplateEditor::addPressed) );
|
||||
// del->signal_pressed().connect( sigc::mem_fun(*this, &RenameTemplateEditor::delPressed) );
|
||||
//
|
||||
// show_all_children ();
|
||||
//
|
||||
// set_size_request (-1, 250);
|
||||
//}
|
||||
//
|
||||
//void RenameTemplateEditor::refreshTemplateList ()
|
||||
//{
|
||||
//
|
||||
// list->clear_items ();
|
||||
//
|
||||
// for (size_t i = 0; i < options.renameTemplates.size(); i++) {
|
||||
// list->append_text (options.renameTemplates[i]);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//void RenameTemplateEditor::addPressed ()
|
||||
//{
|
||||
//
|
||||
// if (templ->get_text() != "") {
|
||||
// options.renameTemplates.push_back (templ->get_text ());
|
||||
// refreshTemplateList ();
|
||||
// templ->set_text("");
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//void RenameTemplateEditor::delPressed ()
|
||||
//{
|
||||
//
|
||||
// std::vector<int> sel = list->get_selected ();
|
||||
//
|
||||
// for (size_t i = 0; i < sel.size(); i++) {
|
||||
// Glib::ustring toDel = list->get_text (sel[i]);
|
||||
// std::vector<Glib::ustring>::iterator f = std::find (options.renameTemplates.begin(), options.renameTemplates.end(), toDel);
|
||||
//
|
||||
// if (f != options.renameTemplates.end()) {
|
||||
// options.renameTemplates.erase (f);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// refreshTemplateList ();
|
||||
//}
|
||||
|
||||
templates->set_sensitive (useTmpl->get_active ());
|
||||
|
||||
if (useTmpl->get_active () && isTemplSelected ()) {
|
||||
all->set_sensitive (true);
|
||||
newName->set_text (applyTemplate (oldName->get_text(), imageData, getActiveTemplate()));
|
||||
} else {
|
||||
all->set_sensitive (false);
|
||||
}
|
||||
|
||||
newName->select_region (0, newName->get_text().size());
|
||||
}
|
||||
|
||||
bool RenameDialog::isTemplSelected ()
|
||||
{
|
||||
|
||||
Gtk::TreeModel::iterator iter = templates->get_active();
|
||||
return iter && iter->get_value (templateColumns.tmplName) != M("FILEBROWSER_ADDDELTEMPLATE");
|
||||
}
|
||||
|
||||
Glib::ustring RenameDialog::getActiveTemplate ()
|
||||
{
|
||||
|
||||
Gtk::TreeModel::iterator iter = templates->get_active();
|
||||
|
||||
if (iter && iter->get_value (templateColumns.tmplName) != M("FILEBROWSER_ADDDELTEMPLATE")) {
|
||||
return iter->get_value (templateColumns.tmplName);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
void RenameDialog::tmplSelectionChanged ()
|
||||
{
|
||||
|
||||
Gtk::TreeModel::iterator iter = templates->get_active();
|
||||
|
||||
if (iter && iter->get_value (templateColumns.tmplName) == M("FILEBROWSER_ADDDELTEMPLATE")) {
|
||||
RenameTemplateEditor* rte = new RenameTemplateEditor (p);
|
||||
|
||||
if (rte->run() == Gtk::RESPONSE_OK) {
|
||||
fillTemplateList ();
|
||||
}
|
||||
|
||||
delete rte;
|
||||
// show add/del template dialog
|
||||
} else {
|
||||
useTemplToggled ();
|
||||
}
|
||||
}
|
||||
|
||||
RenameTemplateEditor::RenameTemplateEditor (Gtk::Window* parent)
|
||||
: Gtk::Dialog ("Edit rename templates", *parent, true, true)
|
||||
{
|
||||
|
||||
list = Gtk::manage (new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE));
|
||||
list->set_headers_visible (false);
|
||||
get_vbox ()->pack_start (*list);
|
||||
|
||||
Gtk::HBox* hb = Gtk::manage (new Gtk::HBox ());
|
||||
templ = Gtk::manage (new Gtk::Entry ());
|
||||
Gtk::Button* add = Gtk::manage (new Gtk::Button ());
|
||||
Gtk::Button* del = Gtk::manage (new Gtk::Button ());
|
||||
add->add (*Gtk::manage (new RTImage ("list-add-small.png")));
|
||||
del->add (*Gtk::manage (new RTImage ("list-remove-red-small.png")));
|
||||
hb->pack_start (*templ);
|
||||
hb->pack_start (*add, Gtk::PACK_SHRINK, 2);
|
||||
hb->pack_start (*del, Gtk::PACK_SHRINK, 2);
|
||||
|
||||
get_vbox ()->pack_start (*hb, Gtk::PACK_SHRINK, 4);
|
||||
|
||||
add_button (Gtk::Stock::OK, Gtk::RESPONSE_OK);
|
||||
|
||||
refreshTemplateList ();
|
||||
|
||||
add->signal_pressed().connect( sigc::mem_fun(*this, &RenameTemplateEditor::addPressed) );
|
||||
del->signal_pressed().connect( sigc::mem_fun(*this, &RenameTemplateEditor::delPressed) );
|
||||
|
||||
show_all_children ();
|
||||
|
||||
set_size_request (-1, 250);
|
||||
}
|
||||
|
||||
void RenameTemplateEditor::refreshTemplateList ()
|
||||
{
|
||||
|
||||
list->clear_items ();
|
||||
|
||||
for (size_t i = 0; i < options.renameTemplates.size(); i++) {
|
||||
list->append_text (options.renameTemplates[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void RenameTemplateEditor::addPressed ()
|
||||
{
|
||||
|
||||
if (templ->get_text() != "") {
|
||||
options.renameTemplates.push_back (templ->get_text ());
|
||||
refreshTemplateList ();
|
||||
templ->set_text("");
|
||||
}
|
||||
}
|
||||
|
||||
void RenameTemplateEditor::delPressed ()
|
||||
{
|
||||
|
||||
std::vector<int> sel = list->get_selected ();
|
||||
|
||||
for (size_t i = 0; i < sel.size(); i++) {
|
||||
Glib::ustring toDel = list->get_text (sel[i]);
|
||||
std::vector<Glib::ustring>::iterator f = std::find (options.renameTemplates.begin(), options.renameTemplates.end(), toDel);
|
||||
|
||||
if (f != options.renameTemplates.end()) {
|
||||
options.renameTemplates.erase (f);
|
||||
}
|
||||
}
|
||||
|
||||
refreshTemplateList ();
|
||||
}
|
||||
|
||||
Glib::ustring RenameDialog::applyTemplate (const Glib::ustring& oName, const CacheImageData* cid, const Glib::ustring& templ)
|
||||
{
|
||||
|
||||
return Glib::ustring ("szeva");
|
||||
|
||||
}
|
||||
//Glib::ustring RenameDialog::applyTemplate (const Glib::ustring& oName, const CacheImageData* cid, const Glib::ustring& templ)
|
||||
//{
|
||||
//
|
||||
// return Glib::ustring ("szeva");
|
||||
//
|
||||
//}
|
||||
|
||||
|
||||
|
@ -30,29 +30,29 @@ class RenameDialog : public Gtk::Dialog
|
||||
|
||||
protected:
|
||||
|
||||
class TemplateColumns : public Gtk::TreeModel::ColumnRecord
|
||||
{
|
||||
public:
|
||||
Gtk::TreeModelColumn<Glib::ustring> tmplName;
|
||||
Gtk::TreeModelColumn<bool> rowSeparator;
|
||||
TemplateColumns()
|
||||
{
|
||||
add(tmplName);
|
||||
add(rowSeparator);
|
||||
}
|
||||
};
|
||||
TemplateColumns templateColumns;
|
||||
Glib::RefPtr<Gtk::ListStore> templateModel;
|
||||
// class TemplateColumns : public Gtk::TreeModel::ColumnRecord
|
||||
// {
|
||||
// public:
|
||||
// Gtk::TreeModelColumn<Glib::ustring> tmplName;
|
||||
// Gtk::TreeModelColumn<bool> rowSeparator;
|
||||
// TemplateColumns()
|
||||
// {
|
||||
// add(tmplName);
|
||||
// add(rowSeparator);
|
||||
// }
|
||||
// };
|
||||
// TemplateColumns templateColumns;
|
||||
// Glib::RefPtr<Gtk::ListStore> templateModel;
|
||||
|
||||
Gtk::Window* p;
|
||||
Gtk::Label* oldName;
|
||||
Gtk::Entry* newName;
|
||||
Gtk::CheckButton* useTmpl;
|
||||
MyComboBox* templates;
|
||||
Gtk::Button* all;
|
||||
// Gtk::CheckButton* useTmpl;
|
||||
// MyComboBox* templates;
|
||||
// Gtk::Button* all;
|
||||
const CacheImageData* imageData;
|
||||
|
||||
void fillTemplateList ();
|
||||
// void fillTemplateList ();
|
||||
|
||||
public:
|
||||
explicit RenameDialog (Gtk::Window* parent);
|
||||
@ -60,32 +60,32 @@ public:
|
||||
void initName (const Glib::ustring& iname, const CacheImageData* cid);
|
||||
Glib::ustring getNewName ();
|
||||
|
||||
bool rowSeparatorFunc (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);
|
||||
void tmplSelectionChanged ();
|
||||
void useTemplToggled ();
|
||||
// bool rowSeparatorFunc (const Glib::RefPtr<Gtk::TreeModel>& model, const Gtk::TreeModel::iterator& iter);
|
||||
// void tmplSelectionChanged ();
|
||||
// void useTemplToggled ();
|
||||
|
||||
bool isTemplSelected ();
|
||||
Glib::ustring getActiveTemplate ();
|
||||
// bool isTemplSelected ();
|
||||
// Glib::ustring getActiveTemplate ();
|
||||
|
||||
static Glib::ustring applyTemplate (const Glib::ustring& oName, const CacheImageData* cid, const Glib::ustring& templ);
|
||||
// static Glib::ustring applyTemplate (const Glib::ustring& oName, const CacheImageData* cid, const Glib::ustring& templ);
|
||||
};
|
||||
|
||||
class RenameTemplateEditor : public Gtk::Dialog
|
||||
{
|
||||
|
||||
protected:
|
||||
Gtk::ListViewText* list;
|
||||
Gtk::Entry* templ;
|
||||
|
||||
void refreshTemplateList ();
|
||||
public:
|
||||
explicit RenameTemplateEditor (Gtk::Window* parent);
|
||||
|
||||
Glib::ustring getSelectedTemplate ();
|
||||
|
||||
void addPressed ();
|
||||
void delPressed ();
|
||||
};
|
||||
//class RenameTemplateEditor : public Gtk::Dialog
|
||||
//{
|
||||
//
|
||||
//protected:
|
||||
// Gtk::ListViewText* list;
|
||||
// Gtk::Entry* templ;
|
||||
//
|
||||
// void refreshTemplateList ();
|
||||
//public:
|
||||
// explicit RenameTemplateEditor (Gtk::Window* parent);
|
||||
//
|
||||
// Glib::ustring getSelectedTemplate ();
|
||||
//
|
||||
// void addPressed ();
|
||||
// void delPressed ();
|
||||
//};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1121,7 +1121,7 @@ void Retinex::gammaretinexChanged()
|
||||
if(gammaretinex->get_active_row_number() == 4) {
|
||||
gam->show();
|
||||
slope->show();
|
||||
} else if(gammaretinex->get_active_row_number() != 4) {
|
||||
} else /*if(gammaretinex->get_active_row_number() != 4)*/ {
|
||||
gam->hide();
|
||||
slope->hide();
|
||||
}
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "multilangmgr.h"
|
||||
#include "mycurve.h"
|
||||
|
||||
SHCSelector::SHCSelector() : ColoredBar(RTO_Left2Right), movingPosition(-1), cl(NULL)
|
||||
SHCSelector::SHCSelector() : ColoredBar(RTO_Left2Right), movingPosition(-1), tmpX(0.0), tmpPos(0.0), wslider(0.0), cl(NULL)
|
||||
{
|
||||
|
||||
positions[0] = defaults[0] = 0.25;
|
||||
|
@ -559,7 +559,6 @@ void ThumbBrowserBase::arrangeFiles ()
|
||||
|
||||
int ct = 0;
|
||||
int currx = 0;
|
||||
int curry = 0;
|
||||
|
||||
while (ct < N) {
|
||||
// find widest item in the column
|
||||
@ -571,7 +570,7 @@ void ThumbBrowserBase::arrangeFiles ()
|
||||
}
|
||||
|
||||
// arrange items in the column
|
||||
curry = 0;
|
||||
int curry = 0;
|
||||
|
||||
for (int i = 0; ct < N && i < numOfRows; i++, ct++) {
|
||||
while (ct < N && fd[ct]->filtered) {
|
||||
@ -641,12 +640,11 @@ void ThumbBrowserBase::arrangeFiles ()
|
||||
|
||||
// arrange files
|
||||
int ct = 0;
|
||||
int currx = 0;
|
||||
int curry = 0;
|
||||
|
||||
while (ct < N) {
|
||||
// arrange items in the row
|
||||
currx = 0;
|
||||
int currx = 0;
|
||||
|
||||
for (int i = 0; ct < N && i < numOfCols; i++, ct++) {
|
||||
while (ct < N && fd[ct]->filtered) {
|
||||
|
@ -119,7 +119,6 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
|
||||
getTextSizes (infow, infoh);
|
||||
|
||||
int iofs_x = 4, iofs_y = 4;
|
||||
int igap = 2;
|
||||
int istartx = prex;
|
||||
int istarty = prey;
|
||||
|
||||
@ -141,6 +140,7 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
|
||||
istarty += iofs_y;
|
||||
|
||||
if (!bbIcons.empty()) {
|
||||
int igap = 2;
|
||||
int iwidth = 0;
|
||||
int iheight = 0;
|
||||
|
||||
@ -251,7 +251,6 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
|
||||
fn->set_width (textw * Pango::SCALE);
|
||||
fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
|
||||
backBuffer->draw_layout (gc_, textposx_ex, textposy + tpos, fn);
|
||||
tpos += exlabh;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -63,8 +63,8 @@ Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, CacheImageDa
|
||||
|
||||
Thumbnail::Thumbnail (CacheManager* cm, const Glib::ustring& fname, const std::string& md5)
|
||||
: fname(fname), cachemgr(cm), ref(1), enqueueNumber(0), tpp(NULL), pparamsValid(false),
|
||||
needsReProcessing(true), imageLoading(false), lastImg(NULL),
|
||||
initial_(true)
|
||||
pparamsSet(false), needsReProcessing(true), imageLoading(false), lastImg(NULL),
|
||||
lastW(0), lastH(0), lastScale(0.0), initial_(true)
|
||||
{
|
||||
|
||||
|
||||
|
@ -187,7 +187,7 @@ public:
|
||||
{
|
||||
return pparams.inTrash;
|
||||
}
|
||||
void setStage (int stage)
|
||||
void setStage (bool stage)
|
||||
{
|
||||
if (pparams.inTrash != stage) {
|
||||
pparams.inTrash = stage;
|
||||
|
@ -104,14 +104,13 @@ static double wbTemp2Slider(double temp)
|
||||
const double slope = (double)(CENTERTEMP - MINTEMP) / (MAXTEMP - CENTERTEMP);
|
||||
const double y = (temp - CENTERTEMP) / (MAXTEMP - CENTERTEMP);
|
||||
double x = pow(y, 0.25); // rough guess of x, will be a little lower
|
||||
double y1;
|
||||
double k = 0.1;
|
||||
bool add = true;
|
||||
|
||||
// the y=f(x) function is a mess to invert, therefore we have this trial-refinement loop instead.
|
||||
// from tests, worst case is about 20 iterations, ie no problem
|
||||
for (;;) {
|
||||
y1 = x * slope + (1.0 - slope) * pow(x, 4.0);
|
||||
double y1 = x * slope + (1.0 - slope) * pow(x, 4.0);
|
||||
|
||||
if (5000 * fabs(y1 - y) < 0.1) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user