diff --git a/rtdata/languages/Deutsch b/rtdata/languages/Deutsch
index 63595e328..7967786dd 100644
--- a/rtdata/languages/Deutsch
+++ b/rtdata/languages/Deutsch
@@ -829,6 +829,8 @@ HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;(Bildschleier entfernen)\nMaske anzeigen
HISTORY_MSG_DEHAZE_STRENGTH;(Bildschleier entfernen)\nIntensität
HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;(Sensor—Matrix)\nFarbinterpolation\nAuto-Kontrastschwelle
HISTORY_MSG_DUALDEMOSAIC_CONTRAST;(Sensor-Matrix)\nFarbinterpolation\nKontrastschwelle
+HISTORY_MSG_FILMNEGATIVE_ENABLED;(Filmnegativ)
+HISTORY_MSG_FILMNEGATIVE_VALUES;(Filmnegativ) - Werte
HISTORY_MSG_HISTMATCHING;(Belichtung)\nAuto-Tonwertkurve
HISTORY_MSG_ICM_OUTPUT_PRIMARIES;(Farbmanagement)\nAusgabeprofil\nVorlagen
HISTORY_MSG_ICM_OUTPUT_TEMP;(Farbmanagement)\nAusgabeprofil\nIccV4-Illuminant D
@@ -1065,6 +1067,7 @@ PARTIALPASTE_EQUALIZER;Wavelet
PARTIALPASTE_EVERYTHING;Alle Parameter aktivieren / deaktivieren
PARTIALPASTE_EXIFCHANGES;Änderungen an Exif-Daten
PARTIALPASTE_EXPOSURE;Belichtung
+PARTIALPASTE_FILMNEGATIVE;Filmnegativ
PARTIALPASTE_FILMSIMULATION;Filmsimulation
PARTIALPASTE_FLATFIELDAUTOSELECT;Weißbild: Automatische Auswahl
PARTIALPASTE_FLATFIELDBLURRADIUS;Weißbild: Unschärferadius
@@ -1718,6 +1721,12 @@ TP_EXPOSURE_TCMODE_STANDARD;Standard
TP_EXPOSURE_TCMODE_WEIGHTEDSTD;Gewichteter Standard
TP_EXPOS_BLACKPOINT_LABEL;Schwarzpunkt
TP_EXPOS_WHITEPOINT_LABEL;Weißpunkt
+TP_FILMNEGATIVE_BLUE;Blauverhältnis
+TP_FILMNEGATIVE_GREEN;Bezugsexponent (Kontrast)
+TP_FILMNEGATIVE_GUESS_TOOLTIP;Berechnet die Exponenten durch Auswahl zweier neutraler\nReferenzpunkte im Bild. Weiß (Hellgrau) und Schwarz (Dunkelgrau).\nDie Reihenfolge spielt keine Rolle. Die Exponenten werden aktualisiert,\nnachdem der zweite Punkt ausgewählt wurde.
+TP_FILMNEGATIVE_LABEL;Filmnegativ
+TP_FILMNEGATIVE_PICK;Weißen und schwarzen Bereich auswählen
+TP_FILMNEGATIVE_RED;Rotverhältnis
TP_FILMSIMULATION_LABEL;Filmsimulation
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapee sucht nach Hald-CLUT-Bildern, die für die Filmsimulation benötigt werden, in einem Ordner, der viel Zeit benötigt.\nGehen Sie zu\n< Einstellungen > Bildbearbeitung > Filmsimulation >\nund prüfen Sie welcher Order benutzt wird. Wählen Sie den Ordner aus, der nur die Hald-CLUT-Bilder beinhaltet, oder einen leeren Ordner, wenn Sie die Filsimulation nicht verwenden möchten.\n\nWeitere Informationen über die Filmsimulation finden Sie auf RawPedia.\n\nMöchten Sie die Suche beenden?
TP_FILMSIMULATION_STRENGTH;Intensität
@@ -2362,16 +2371,3 @@ ZOOMPANEL_ZOOMFITSCREEN;An Bildschirm anpassen.\nTaste: Alt + f
ZOOMPANEL_ZOOMIN;Hineinzoomen\nTaste: +
ZOOMPANEL_ZOOMOUT;Herauszoomen\nTaste: -
-!!!!!!!!!!!!!!!!!!!!!!!!!
-! Untranslated keys follow; remove the ! prefix after an entry is translated.
-!!!!!!!!!!!!!!!!!!!!!!!!!
-
-HISTORY_MSG_FILMNEGATIVE_ENABLED;(Filmnegativ)
-HISTORY_MSG_FILMNEGATIVE_VALUES;(Filmnegativ) - Werte
-PARTIALPASTE_FILMNEGATIVE;Filmnegativ
-TP_FILMNEGATIVE_BLUE;Blauverhältnis
-TP_FILMNEGATIVE_GREEN;Bezugsexponent (Kontrast)
-TP_FILMNEGATIVE_GUESS_TOOLTIP;Berechnet die Exponenten durch Auswahl zweier neutraler\nReferenzpunkte im Bild. Weiß (Hellgrau) und Schwarz (Dunkelgrau).\nDie Reihenfolge spielt keine Rolle. Die Exponenten werden aktualisiert,\nnachdem der zweite Punkt ausgewählt wurde.
-TP_FILMNEGATIVE_LABEL;Filmnegativ
-TP_FILMNEGATIVE_PICK;Weißen und schwarzen Bereich auswählen
-TP_FILMNEGATIVE_RED;Rotverhältnis
diff --git a/rtdata/languages/Japanese b/rtdata/languages/Japanese
index 316133b3a..96ffea174 100644
--- a/rtdata/languages/Japanese
+++ b/rtdata/languages/Japanese
@@ -152,8 +152,12 @@ FILEBROWSER_COLORLABEL_TOOLTIP;カラー・ラベル\n\nドロップダウン・
FILEBROWSER_COPYPROFILE;プロファイルをコピー
FILEBROWSER_CURRENT_NAME;現在の名前:
FILEBROWSER_DARKFRAME;ダークフレーム
+FILEBROWSER_DELETEDIALOG_ALL;ゴミ箱の中にある%1枚のファイル全てを完全に削除しますか?
FILEBROWSER_DELETEDIALOG_HEADER;ファイル削除確認
+FILEBROWSER_DELETEDIALOG_SELECTED;選択した%1枚のファイルを完全に削除しますか?
+FILEBROWSER_DELETEDIALOG_SELECTEDINCLPROC;キュー処理に保持されているファイルを含め、選択した%1枚のファイルを完全に削除しますか?
FILEBROWSER_EMPTYTRASH;ゴミ箱を空にする
+FILEBROWSER_EMPTYTRASHHINT;ゴミ箱の中のファイルを全て完全に 削除します
FILEBROWSER_EXTPROGMENU;..で開く
FILEBROWSER_FLATFIELD;フラットフィールド
FILEBROWSER_MOVETODARKFDIR;ダークフレーム・ディレクトリに移動
@@ -187,6 +191,8 @@ FILEBROWSER_POPUPRANK2;ランク 2 **
FILEBROWSER_POPUPRANK3;ランク 3 ***
FILEBROWSER_POPUPRANK4;ランク 4 ****
FILEBROWSER_POPUPRANK5;ランク 5 *****
+FILEBROWSER_POPUPREMOVE;完全に削除
+FILEBROWSER_POPUPREMOVEINCLPROC;キュー処理に保持されているファイルを含めて完全に削除
FILEBROWSER_POPUPRENAME;名前変更
FILEBROWSER_POPUPSELECTALL;全選択
FILEBROWSER_POPUPTRASH;ゴミ箱へ移動
@@ -213,6 +219,7 @@ FILEBROWSER_SHOWDIRHINT;全ての絞り込みをクリア\nショートカット
FILEBROWSER_SHOWEDITEDHINT;編集済み画像を表示\nショートカット: 7
FILEBROWSER_SHOWEDITEDNOTHINT;未編集画像を表示\nショートカット: 6
FILEBROWSER_SHOWEXIFINFO;EXIF情報を表示\nショートカット: i\n\nシングル・エディタ・タブのショートカット: Alt-i
+FILEBROWSER_SHOWNOTTRASHHINT;ゴミ箱の中にある画像だけを表示
FILEBROWSER_SHOWORIGINALHINT;元画像だけを表示\n\nファイル名は同じだが拡張子が異なる画像がある場合は、環境設定の中のファイルブラウザタブにある拡張子リストの上位に位置する拡張子を持った画像を元画像とする。
FILEBROWSER_SHOWRANK1HINT;1つ星ランクを表示\nショートカット: 1
FILEBROWSER_SHOWRANK2HINT;2つ星ランクを表示\nショートカット: 2
@@ -771,6 +778,8 @@ HISTORY_MSG_DEHAZE_SHOW_DEPTH_MAP;霞除去 - 深度マップの表示
HISTORY_MSG_DEHAZE_STRENGTH;霞除去 - 強さ
HISTORY_MSG_DUALDEMOSAIC_AUTO_CONTRAST;デュアルデモザイク - 自動しきい値
HISTORY_MSG_DUALDEMOSAIC_CONTRAST;AMaZE+VNG4 - コントラストのしきい値
+HISTORY_MSG_FILMNEGATIVE_ENABLED;ネガフィルム
+HISTORY_MSG_FILMNEGATIVE_VALUES;ネガフィルムの値
HISTORY_MSG_HISTMATCHING;トーンカーブの自動調節
HISTORY_MSG_ICM_OUTPUT_PRIMARIES;出力 - プライマリ
HISTORY_MSG_ICM_OUTPUT_TEMP;出力 - ICC-v4 光源 D
@@ -1007,6 +1016,7 @@ PARTIALPASTE_EQUALIZER;ウェーブレット
PARTIALPASTE_EVERYTHING;すべて
PARTIALPASTE_EXIFCHANGES;exifデータを変える
PARTIALPASTE_EXPOSURE;露光量
+PARTIALPASTE_FILMNEGATIVE;ネガフィルム
PARTIALPASTE_FILMSIMULATION;フィルムシミュレーション
PARTIALPASTE_FLATFIELDAUTOSELECT;フラットフィールド 自動選択
PARTIALPASTE_FLATFIELDBLURRADIUS;フラットフィールド ぼかし半径
@@ -1065,6 +1075,7 @@ PREFERENCES_APPEARANCE_COLORPICKERFONT;カラーピッカーのフォント
PREFERENCES_APPEARANCE_CROPMASKCOLOR;切り抜きのマスクカラー
PREFERENCES_APPEARANCE_MAINFONT;メインフォント
PREFERENCES_APPEARANCE_NAVGUIDECOLOR;ナビゲーターのガイドカラー
+PREFERENCES_APPEARANCE_PSEUDOHIDPI;擬似HiDPIモード
PREFERENCES_APPEARANCE_THEME;テーマ
PREFERENCES_APPLNEXTSTARTUP;要再起動
PREFERENCES_AUTOMONPROFILE;OSのメインモニター・プロファイルを使用
@@ -1284,6 +1295,7 @@ QUEUE_FORMAT_TITLE;ファイル形式
QUEUE_LOCATION_FOLDER;フォルダに保存
QUEUE_LOCATION_TEMPLATE;テンプレートを使う
QUEUE_LOCATION_TEMPLATE_TOOLTIP;次の書式文字を使用することができます:\n%f, %d1, %d2, ..., %p1, %p2, ...%r\n\nこれらの書式文字は画像パス名のそれぞれ別々の部分、画像の属性を参照します\n\n例えば、次の画像を処理中の場合は:\n\n/home/tom/photos/2010-10-31/dsc0042.nef\n書式文字の意味するものは:\n%d4 = home\n%d3 = tom\n%d2 = photos\n%d1 = 2010-10-31\n%f = dsc0042\n%p1 = /home/tom/photos/2010-10-31/\n%p2 = /home/tom/photos/\n%p3 = /home/tom/\n%p4 = /home/\n\n%rは写真のランクに置き換えられます。評価なしは%rは'0 'に置換されます。画像がごみ箱にある場合、%rは'X'に置換されます\n\n元画像と同じ場所に出力したい場合はこのように書きます:\n%p1/%f\n\n処理画像のディレクトリ下 "converted" という名前のディレクトリに出力画像を保存したい場合このように書きます:\n%p1/converted/%f\n\n"/home/tom/photos/converted/2010-10-31" という名前のディレクトリに出力画像を保存したい場合はこのように書きます:\n%p2/converted/%d1/%f
+QUEUE_LOCATION_TITLE;出力の場所
QUEUE_STARTSTOP_TOOLTIP;キューにある画像の現像を始める、或いは中止する\n\nショートカット: Ctrl+s
SAMPLEFORMAT_0;データ形式不明
SAMPLEFORMAT_1;符号なし8ビット
@@ -1658,6 +1670,12 @@ TP_EXPOSURE_TCMODE_STANDARD;標準
TP_EXPOSURE_TCMODE_WEIGHTEDSTD;加重平均
TP_EXPOS_BLACKPOINT_LABEL;raw ブラック・ポイント
TP_EXPOS_WHITEPOINT_LABEL;raw ホワイト・ポイント
+TP_FILMNEGATIVE_BLUE;ブルーの比率
+TP_FILMNEGATIVE_GREEN;参考指数(コントラスト)
+TP_FILMNEGATIVE_GUESS_TOOLTIP;画像の中でニュートラルな参考ポイントを2点選んで指数を計算します;白い(明るいグレー)1点と黒い(暗いグレー)1点を選びます。順番は関係ありません。2つ目のポイントが選択されると指数が更新されます。
+TP_FILMNEGATIVE_LABEL;ネガフィルム
+TP_FILMNEGATIVE_PICK;白と黒のポイントをピックアップする
+TP_FILMNEGATIVE_RED;レッドの比率
TP_FILMSIMULATION_LABEL;フィルムシミュレーション
TP_FILMSIMULATION_SLOWPARSEDIR;RawTherapeeはフィルムシミュレーション機能に使う画像をHald CLUTフォルダーの中から探すよう設計されています(プログラムに組み込むにはフォルダーが大き過ぎるため)。\n変更するには、環境設定 > 画像処理 > フィルムシミュレーションと進み\nどのフォルダーが使われているか確認します。機能を利用する場合は、Hald CLUTだけが入っているフォルダーを指定するか、 この機能を使わない場合はそのフォルダーを空にしておきます。\n\n詳しくはRawPediaを参照して下さい。\n\nフィルム画像のスキャンを止めますか?
TP_FILMSIMULATION_STRENGTH;強さ
@@ -2301,25 +2319,3 @@ ZOOMPANEL_ZOOMFITSCREEN;画像全体を画面に合わせる\nショートカッ
ZOOMPANEL_ZOOMIN;ズームイン\nショートカット: +
ZOOMPANEL_ZOOMOUT;ズームアウト\nショートカット: -
-!!!!!!!!!!!!!!!!!!!!!!!!!
-! Untranslated keys follow; remove the ! prefix after an entry is translated.
-!!!!!!!!!!!!!!!!!!!!!!!!!
-
-!FILEBROWSER_DELETEDIALOG_ALL;Are you sure you want to permanently delete all %1 files in trash?
-!FILEBROWSER_DELETEDIALOG_SELECTED;Are you sure you want to permanently delete the selected %1 files?
-!FILEBROWSER_DELETEDIALOG_SELECTEDINCLPROC;Are you sure you want to permanently delete the selected %1 files, including a queue-processed version?
-!FILEBROWSER_EMPTYTRASHHINT;Permanently delete all files in trash.
-!FILEBROWSER_POPUPREMOVE;Delete permanently
-!FILEBROWSER_POPUPREMOVEINCLPROC;Delete permanently, including queue-processed version
-!FILEBROWSER_SHOWNOTTRASHHINT;Show only images not in trash.
-!HISTORY_MSG_FILMNEGATIVE_ENABLED;Film Negative
-!HISTORY_MSG_FILMNEGATIVE_VALUES;Film negative values
-!PARTIALPASTE_FILMNEGATIVE;Film Negative
-!PREFERENCES_APPEARANCE_PSEUDOHIDPI;Pseudo-HiDPI mode
-!QUEUE_LOCATION_TITLE;Output Location
-!TP_FILMNEGATIVE_BLUE;Blue ratio
-!TP_FILMNEGATIVE_GREEN;Reference exponent (contrast)
-!TP_FILMNEGATIVE_GUESS_TOOLTIP;Calculate exponents by picking two neutral reference spots in the image; one white (light gray) and one black (dark gray). The order does not matter. The exponents will be updated after the second spot is picked.
-!TP_FILMNEGATIVE_LABEL;Film Negative
-!TP_FILMNEGATIVE_PICK;Pick white and black spots
-!TP_FILMNEGATIVE_RED;Red ratio
diff --git a/rtengine/improcfun.cc b/rtengine/improcfun.cc
index c164abc0d..85954abfa 100644
--- a/rtengine/improcfun.cc
+++ b/rtengine/improcfun.cc
@@ -5653,7 +5653,7 @@ void ImProcFunctions::getAutoExp (const LUTu &histogram, int histcompr, double
double ImProcFunctions::getAutoDistor (const Glib::ustring &fname, int thumb_size)
{
- if (fname != "") {
+ if (!fname.empty()) {
rtengine::RawMetaDataLocation ri;
int w_raw = -1, h_raw = thumb_size;
int w_thumb = -1, h_thumb = thumb_size;
diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc
index 6459e824c..3d04e3871 100644
--- a/rtengine/procparams.cc
+++ b/rtengine/procparams.cc
@@ -39,11 +39,11 @@ namespace
Glib::ustring expandRelativePath(const Glib::ustring &procparams_fname, const Glib::ustring &prefix, Glib::ustring embedded_fname)
{
- if (embedded_fname == "" || !Glib::path_is_absolute(procparams_fname)) {
+ if (embedded_fname.empty() || !Glib::path_is_absolute(procparams_fname)) {
return embedded_fname;
}
- if (prefix != "") {
+ if (!prefix.empty()) {
if (embedded_fname.length() < prefix.length() || embedded_fname.substr(0, prefix.length()) != prefix) {
return embedded_fname;
}
@@ -61,7 +61,7 @@ Glib::ustring expandRelativePath(const Glib::ustring &procparams_fname, const Gl
Glib::ustring relativePathIfInside(const Glib::ustring &procparams_fname, bool fnameAbsolute, Glib::ustring embedded_fname)
{
- if (fnameAbsolute || embedded_fname == "" || !Glib::path_is_absolute(procparams_fname)) {
+ if (fnameAbsolute || embedded_fname.empty() || !Glib::path_is_absolute(procparams_fname)) {
return embedded_fname;
}
diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc
index 153578756..bb1575b02 100644
--- a/rtengine/rawimagesource.cc
+++ b/rtengine/rawimagesource.cc
@@ -3843,7 +3843,7 @@ bool RawImageSource::findInputProfile(Glib::ustring inProfile, cmsHPROFILE embed
return false;
}
- if (inProfile == "(embedded)" && embedded) {
+ if (embedded && inProfile == "(embedded)") {
in = embedded;
} else if (inProfile == "(cameraICC)") {
// DCPs have higher quality, so use them first
@@ -3852,7 +3852,7 @@ bool RawImageSource::findInputProfile(Glib::ustring inProfile, cmsHPROFILE embed
if (*dcpProf == nullptr) {
in = ICCStore::getInstance()->getStdProfile(camName);
}
- } else if (inProfile != "(camera)" && inProfile != "") {
+ } else if (inProfile != "(camera)" && !inProfile.empty()) {
Glib::ustring normalName = inProfile;
if (!inProfile.compare (0, 5, "file:")) {
diff --git a/rtengine/simpleprocess.cc b/rtengine/simpleprocess.cc
index 4bdaa6ff1..2d594e0af 100644
--- a/rtengine/simpleprocess.cc
+++ b/rtengine/simpleprocess.cc
@@ -1326,7 +1326,7 @@ private:
} else {
// use the selected output profile if present, otherwise use LCMS2 profile generate by lab2rgb16 w/ gamma
- if (params.icm.outputProfile != "" && params.icm.outputProfile != ColorManagementParams::NoICMString) {
+ if (!params.icm.outputProfile.empty() && params.icm.outputProfile != ColorManagementParams::NoICMString) {
// if ICCStore::getInstance()->getProfile send back an object, then ICCStore::getInstance()->getContent will do too
cmsHPROFILE jprof = ICCStore::getInstance()->getProfile (params.icm.outputProfile); //get outProfile
diff --git a/rtengine/stdimagesource.cc b/rtengine/stdimagesource.cc
index ce61441c5..c47bb09be 100644
--- a/rtengine/stdimagesource.cc
+++ b/rtengine/stdimagesource.cc
@@ -226,7 +226,7 @@ void StdImageSource::colorSpaceConversion (Imagefloat* im, const ColorManagement
cmsHPROFILE in = nullptr;
cmsHPROFILE out = ICCStore::getInstance()->workingSpace (cmp.workingProfile);
- if (cmp.inputProfile == "(embedded)" || cmp.inputProfile == "" || cmp.inputProfile == "(camera)" || cmp.inputProfile == "(cameraICC)") {
+ if (cmp.inputProfile == "(embedded)" || cmp.inputProfile.empty() || cmp.inputProfile == "(camera)" || cmp.inputProfile == "(cameraICC)") {
if (embedded) {
in = embedded;
} else {
diff --git a/rtexif/nikonattribs.cc b/rtexif/nikonattribs.cc
index b2066150d..1c6ead006 100644
--- a/rtexif/nikonattribs.cc
+++ b/rtexif/nikonattribs.cc
@@ -257,65 +257,18 @@ public:
std::ostringstream af;
- if (aff & 1)
- if (af.str() == "") {
- af << "Center";
- } else {
- af << ", Center";
- } else if (aff & 2)
- if (af.str() == "") {
- af << "Top";
- } else {
- af << ", Top";
- } else if (aff & 4)
- if (af.str() == "") {
- af << "Bottom";
- } else {
- af << ", Bottom";
- } else if (aff & 8)
- if (af.str() == "") {
- af << "Left";
- } else {
- af << ", Left";
- } else if (aff & 16)
- if (af.str() == "") {
- af << "Right";
- } else {
- af << ", Right";
- } else if (aff & 32)
- if (af.str() == "") {
- af << "Upper-left";
- } else {
- af << ", Upper-left";
- } else if (aff & 64)
- if (af.str() == "") {
- af << "Upper-right";
- } else {
- af << ", Upper-right";
- } else if (aff & 128)
- if (af.str() == "") {
- af << " Lower-left";
- } else {
- af << ", Lower-left";
- } else if (aff & 256)
- if (af.str() == "") {
- af << "Lower-right";
- } else {
- af << ", Lower-right";
- } else if (aff & 512)
- if (af.str() == "") {
- af << "Far Left";
- } else {
- af << ", Far Left";
- } else if (aff & 1024) {
- if (af.str() == "") {
- af << "Far Right";
- } else {
- af << ", Far Right";
+ if (aff) {
+ for (size_t i = 0; i < afpchoices.size(); ++i) {
+ if (aff & (1 << i)) {
+ if (!af.str().empty()) {
+ af << ", ";
+ }
+ af << afpchoices.at(i);
+ }
}
}
- str << "AFPointsInFocus = " << af.str();
+ str << "AFPointsInFocus = " << (af.str().empty() ? "None" : af.str());
return str.str();
}
};
@@ -553,7 +506,7 @@ public:
std::map::const_iterator r = lenses.find (lid.str());
if (r != lenses.end()) {
- if (r == lenses.begin() && EffectiveMaxApertureString != "") { // first entry is for unchipped lenses
+ if (r == lenses.begin() && !EffectiveMaxApertureString.empty()) { // first entry is for unchipped lenses
Tag *FLTag = t->getParent()->getRoot()->findTag ("FocalLength");
ld << "Lens = MF ";
diff --git a/rtgui/adjuster.h b/rtgui/adjuster.h
index f57129bf1..f3f256940 100644
--- a/rtgui/adjuster.h
+++ b/rtgui/adjuster.h
@@ -30,7 +30,7 @@ class AdjusterListener
public:
virtual ~AdjusterListener() = default;
virtual void adjusterChanged (Adjuster* a, double newval) = 0;
- virtual void adjusterAutoToggled (Adjuster* a, bool newval) = 0;
+ virtual void adjusterAutoToggled (Adjuster* a, bool newval) {}
};
typedef double(*double2double_fun)(double val);
diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc
index 7222be05d..239057b87 100644
--- a/rtgui/batchqueue.cc
+++ b/rtgui/batchqueue.cc
@@ -667,7 +667,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img)
Glib::ustring fname;
SaveFormat saveFormat;
- if (processing->outFileName == "") { // auto file name
+ if (processing->outFileName.empty()) { // auto file name
Glib::ustring s = calcAutoFileNameBase (processing->filename, processing->sequence);
saveFormat = options.saveFormatBatch;
fname = autoCompleteFileName (s, saveFormat.format);
@@ -686,7 +686,7 @@ rtengine::ProcessingJob* BatchQueue::imageReady(rtengine::IImagefloat* img)
//printf ("fname=%s, %s\n", fname.c_str(), removeExtension(fname).c_str());
- if (img && fname != "") {
+ if (img && !fname.empty()) {
int err = 0;
if (saveFormat.format == "tif") {
diff --git a/rtgui/batchqueuebuttonset.cc b/rtgui/batchqueuebuttonset.cc
index f5be480e8..b42d3c773 100644
--- a/rtgui/batchqueuebuttonset.cc
+++ b/rtgui/batchqueuebuttonset.cc
@@ -27,6 +27,10 @@ Cairo::RefPtr BatchQueueButtonSet::cancelIcon;
Cairo::RefPtr BatchQueueButtonSet::headIcon;
Cairo::RefPtr BatchQueueButtonSet::tailIcon;
+Glib::ustring BatchQueueButtonSet::moveHeadToolTip;
+Glib::ustring BatchQueueButtonSet::moveEndToolTip;
+Glib::ustring BatchQueueButtonSet::cancelJobToolTip;
+
BatchQueueButtonSet::BatchQueueButtonSet (BatchQueueEntry* myEntry)
{
@@ -34,10 +38,13 @@ BatchQueueButtonSet::BatchQueueButtonSet (BatchQueueEntry* myEntry)
cancelIcon = Cairo::RefPtr(new RTSurface("cancel-small.png"));
headIcon = Cairo::RefPtr(new RTSurface("goto-start-small.png"));
tailIcon = Cairo::RefPtr(new RTSurface("goto-end-small.png"));
+ moveHeadToolTip = M("FILEBROWSER_POPUPMOVEHEAD");
+ moveEndToolTip = M("FILEBROWSER_POPUPMOVEEND");
+ cancelJobToolTip = M("FILEBROWSER_POPUPCANCELJOB");
iconsLoaded = true;
}
- add (new LWButton (headIcon, 8, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPMOVEHEAD")));
- add (new LWButton (tailIcon, 9, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPMOVEEND")));
- add (new LWButton (cancelIcon, 10, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPCANCELJOB")));
+ add(new LWButton(headIcon, 8, myEntry, LWButton::Left, LWButton::Center, &moveHeadToolTip));
+ add(new LWButton(tailIcon, 9, myEntry, LWButton::Left, LWButton::Center, &moveEndToolTip));
+ add(new LWButton(cancelIcon, 10, myEntry, LWButton::Right, LWButton::Center, &cancelJobToolTip));
}
diff --git a/rtgui/batchqueuebuttonset.h b/rtgui/batchqueuebuttonset.h
index 66dab91a1..e97819719 100644
--- a/rtgui/batchqueuebuttonset.h
+++ b/rtgui/batchqueuebuttonset.h
@@ -34,6 +34,10 @@ public:
static Cairo::RefPtr headIcon;
static Cairo::RefPtr tailIcon;
+ static Glib::ustring moveHeadToolTip;
+ static Glib::ustring moveEndToolTip;
+ static Glib::ustring cancelJobToolTip;
+
explicit BatchQueueButtonSet (BatchQueueEntry* myEntry);
};
diff --git a/rtgui/batchqueueentry.cc b/rtgui/batchqueueentry.cc
index d52fe4305..a5dfb6dde 100644
--- a/rtgui/batchqueueentry.cc
+++ b/rtgui/batchqueueentry.cc
@@ -148,7 +148,7 @@ void BatchQueueEntry::removeButtonSet ()
buttonSet = nullptr;
}
-std::vector > BatchQueueEntry::getIconsOnImageArea ()
+std::vector> BatchQueueEntry::getIconsOnImageArea ()
{
std::vector > ret;
@@ -160,7 +160,7 @@ std::vector > BatchQueueEntry::getIconsOnImageArea ()
return ret;
}
-void BatchQueueEntry::getIconSize (int& w, int& h)
+void BatchQueueEntry::getIconSize (int& w, int& h) const
{
w = savedAsIcon->get_width ();
@@ -168,7 +168,7 @@ void BatchQueueEntry::getIconSize (int& w, int& h)
}
-Glib::ustring BatchQueueEntry::getToolTip (int x, int y)
+Glib::ustring BatchQueueEntry::getToolTip (int x, int y) const
{
// get the parent class' tooltip first
Glib::ustring tooltip = ThumbBrowserEntryBase::getToolTip(x, y);
diff --git a/rtgui/batchqueueentry.h b/rtgui/batchqueueentry.h
index f3e8c1336..d13dfe827 100644
--- a/rtgui/batchqueueentry.h
+++ b/rtgui/batchqueueentry.h
@@ -68,9 +68,9 @@ public:
void removeButtonSet ();
- std::vector > getIconsOnImageArea () override;
- void getIconSize (int& w, int& h) override;
- Glib::ustring getToolTip (int x, int y) override;
+ std::vector> getIconsOnImageArea () override;
+ void getIconSize (int& w, int& h) const override;
+ Glib::ustring getToolTip (int x, int y) const override;
// bqentryupdatelistener interface
void updateImage (guint8* img, int w, int h, int origw, int origh, guint8* newOPreview) override;
diff --git a/rtgui/bayerpreprocess.cc b/rtgui/bayerpreprocess.cc
index 35f36e83e..0ba60d045 100644
--- a/rtgui/bayerpreprocess.cc
+++ b/rtgui/bayerpreprocess.cc
@@ -143,10 +143,6 @@ void BayerPreProcess::adjusterChanged(Adjuster* a, double newval)
}
}
-void BayerPreProcess::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void BayerPreProcess::setBatchMode(bool batchMode)
{
ToolPanel::setBatchMode(batchMode);
diff --git a/rtgui/bayerpreprocess.h b/rtgui/bayerpreprocess.h
index e06a46d31..f50ac90bb 100644
--- a/rtgui/bayerpreprocess.h
+++ b/rtgui/bayerpreprocess.h
@@ -47,7 +47,6 @@ public:
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void hotDeadPixelChanged();
void setAdjusterBehavior (bool linedenoiseadd, bool greenequiladd);
diff --git a/rtgui/bayerrawexposure.cc b/rtgui/bayerrawexposure.cc
index f9027c09f..12158c774 100644
--- a/rtgui/bayerrawexposure.cc
+++ b/rtgui/bayerrawexposure.cc
@@ -152,10 +152,6 @@ void BayerRAWExposure::adjusterChanged(Adjuster* a, double newval)
}
}
-void BayerRAWExposure::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void BayerRAWExposure::checkBoxToggled (CheckBox* c, CheckValue newval)
{
if (c == PextwoGreen) {
diff --git a/rtgui/bayerrawexposure.h b/rtgui/bayerrawexposure.h
index 08d415838..e955afc12 100644
--- a/rtgui/bayerrawexposure.h
+++ b/rtgui/bayerrawexposure.h
@@ -43,7 +43,6 @@ public:
void setBatchMode (bool batchMode) override;
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void checkBoxToggled (CheckBox* c, CheckValue newval) override;
void setAdjusterBehavior (bool pexblackadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
diff --git a/rtgui/blackwhite.cc b/rtgui/blackwhite.cc
index 3d5deb8f2..2b97188e2 100644
--- a/rtgui/blackwhite.cc
+++ b/rtgui/blackwhite.cc
@@ -1150,10 +1150,6 @@ void BlackWhite::adjusterChanged(Adjuster* a, double newval)
}
}
-void BlackWhite::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void BlackWhite::updateRGBLabel ()
{
if (!batchMode) {
diff --git a/rtgui/blackwhite.h b/rtgui/blackwhite.h
index dd45a7729..242926924 100644
--- a/rtgui/blackwhite.h
+++ b/rtgui/blackwhite.h
@@ -55,7 +55,6 @@ public:
void updateRGBLabel ();
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool bwadd, bool bwgadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
void enabledcc_toggled ();
diff --git a/rtgui/cacorrection.cc b/rtgui/cacorrection.cc
index c91eec145..5b66dd6c3 100644
--- a/rtgui/cacorrection.cc
+++ b/rtgui/cacorrection.cc
@@ -101,10 +101,6 @@ void CACorrection::adjusterChanged (Adjuster* a, double newval)
}
}
-void CACorrection::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void CACorrection::setAdjusterBehavior (bool badd)
{
diff --git a/rtgui/cacorrection.h b/rtgui/cacorrection.h
index 198037060..4fa85038c 100644
--- a/rtgui/cacorrection.h
+++ b/rtgui/cacorrection.h
@@ -40,7 +40,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool badd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
};
diff --git a/rtgui/chmixer.cc b/rtgui/chmixer.cc
index 4a3411e8b..82e885f08 100644
--- a/rtgui/chmixer.cc
+++ b/rtgui/chmixer.cc
@@ -182,10 +182,6 @@ void ChMixer::adjusterChanged(Adjuster* a, double newval)
}
}
-void ChMixer::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ChMixer::enabledChanged()
{
if (listener) {
diff --git a/rtgui/chmixer.h b/rtgui/chmixer.h
index 7e372cbc2..a0fff9b26 100644
--- a/rtgui/chmixer.h
+++ b/rtgui/chmixer.h
@@ -42,7 +42,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool rgbadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
void enabledChanged() override;
diff --git a/rtgui/colortoning.cc b/rtgui/colortoning.cc
index 7ca9a7305..e164739e5 100644
--- a/rtgui/colortoning.cc
+++ b/rtgui/colortoning.cc
@@ -1372,10 +1372,6 @@ void ColorToning::adjusterChanged(Adjuster* a, double newval)
}
}
-void ColorToning::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ColorToning::setBatchMode (bool batchMode)
{
ToolPanel::setBatchMode (batchMode);
diff --git a/rtgui/colortoning.h b/rtgui/colortoning.h
index abb44d09c..faba1e383 100644
--- a/rtgui/colortoning.h
+++ b/rtgui/colortoning.h
@@ -33,7 +33,6 @@ public:
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void trimValues (rtengine::procparams::ProcParams* pp) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool splitAdd, bool satThresholdAdd, bool satOpacityAdd, bool strprotectAdd, bool balanceAdd);
void neutral_pressed ();
//void neutralCurves_pressed ();
diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc
index 4b2c1a6cc..b29aa5eeb 100644
--- a/rtgui/cropwindow.cc
+++ b/rtgui/cropwindow.cc
@@ -38,6 +38,13 @@
using namespace rtengine;
+bool CropWindow::initialized = false;
+
+Glib::ustring CropWindow::zoomOuttt;
+Glib::ustring CropWindow::zoomIntt;
+Glib::ustring CropWindow::zoom100tt;
+Glib::ustring CropWindow::closett;
+
CropWindow::CropWindow (ImageArea* parent, bool isLowUpdatePriority_, bool isDetailWindow)
: ObjectMOBuffer(parent), state(SNormal), press_x(0), press_y(0), action_x(0), action_y(0), pickedObject(-1), pickModifierKey(0), rot_deg(0), onResizeArea(false), deleted(false),
fitZoomEnabled(true), fitZoom(false), cursor_type(CSArrow), /*isLowUpdatePriority(isLowUpdatePriority_),*/ hoveredPicker(nullptr), cropLabel(Glib::ustring("100%")),
@@ -61,11 +68,18 @@ CropWindow::CropWindow (ImageArea* parent, bool isLowUpdatePriority_, bool isDet
titleHeight = ih;
- bZoomOut = new LWButton (Cairo::RefPtr(new RTSurface("magnifier-minus-small.png")), 0, nullptr, LWButton::Left, LWButton::Center, "Zoom Out");
- bZoomIn = new LWButton (Cairo::RefPtr(new RTSurface("magnifier-plus-small.png")), 1, nullptr, LWButton::Left, LWButton::Center, "Zoom In");
- bZoom100 = new LWButton (Cairo::RefPtr(new RTSurface("magnifier-1to1-small.png")), 2, nullptr, LWButton::Left, LWButton::Center, "Zoom 100/%");
- //bZoomFit = new LWButton (Cairo::RefPtr(new RTSurface("magnifier-fit.png")), 3, NULL, LWButton::Left, LWButton::Center, "Zoom Fit");
- bClose = new LWButton (Cairo::RefPtr(new RTSurface("cancel-small.png")), 4, nullptr, LWButton::Right, LWButton::Center, "Close");
+ if (!initialized) {
+ zoomOuttt = "Zoom Out";
+ zoomIntt = "Zoom In";
+ zoom100tt = "Zoom 100/%";
+ closett = "Close";
+ initialized = true;
+ }
+ bZoomOut = new LWButton(Cairo::RefPtr(new RTSurface("magnifier-minus-small.png")), 0, nullptr, LWButton::Left, LWButton::Center, &zoomOuttt);
+ bZoomIn = new LWButton(Cairo::RefPtr(new RTSurface("magnifier-plus-small.png")), 1, nullptr, LWButton::Left, LWButton::Center, &zoomIntt);
+ bZoom100 = new LWButton(Cairo::RefPtr(new RTSurface("magnifier-1to1-small.png")), 2, nullptr, LWButton::Left, LWButton::Center, &zoom100tt);
+ //bZoomFit = new LWButton (Cairo::RefPtr(new RTSurface("magnifier-fit.png")), 3, NULL, LWButton::Left, LWButton::Center, "Zoom Fit");
+ bClose = new LWButton(Cairo::RefPtr(new RTSurface("cancel-small.png")), 4, nullptr, LWButton::Right, LWButton::Center, &closett);
buttonSet.add (bZoomOut);
buttonSet.add (bZoomIn);
diff --git a/rtgui/cropwindow.h b/rtgui/cropwindow.h
index 287cbf1ef..6e2097d3b 100644
--- a/rtgui/cropwindow.h
+++ b/rtgui/cropwindow.h
@@ -47,6 +47,12 @@ public:
class ImageArea;
class CropWindow : public LWButtonListener, public CropDisplayHandler, public EditCoordSystem, public ObjectMOBuffer
{
+ static bool initialized;
+
+ static Glib::ustring zoomOuttt;
+ static Glib::ustring zoomIntt;
+ static Glib::ustring zoom100tt;
+ static Glib::ustring closett;
// state management
ImgEditState state; // current state of user (see enum State)
diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc
index 77e9c53a6..8ffca7544 100644
--- a/rtgui/darkframe.cc
+++ b/rtgui/darkframe.cc
@@ -125,7 +125,7 @@ void DarkFrame::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
Glib::ustring fname = Glib::path_get_basename(dfp->GetCurrentImageFilePath());
Glib::ustring filetype;
- if (fname != "") {
+ if (!fname.empty()) {
// get image filetype, set filter to the same as current image's filetype
std::string::size_type idx;
idx = fname.rfind('.');
diff --git a/rtgui/defringe.cc b/rtgui/defringe.cc
index 7d29b8c8f..03bf648dd 100644
--- a/rtgui/defringe.cc
+++ b/rtgui/defringe.cc
@@ -164,10 +164,6 @@ void Defringe::adjusterChanged(Adjuster* a, double newval)
}
}
-void Defringe::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Defringe::enabledChanged ()
{
diff --git a/rtgui/defringe.h b/rtgui/defringe.h
index 1aa6cc303..c02fd8d6a 100644
--- a/rtgui/defringe.h
+++ b/rtgui/defringe.h
@@ -50,7 +50,6 @@ public:
void curveChanged () override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller* caller) override;
diff --git a/rtgui/dehaze.h b/rtgui/dehaze.h
index 322e0bf0c..66720a9fd 100644
--- a/rtgui/dehaze.h
+++ b/rtgui/dehaze.h
@@ -48,6 +48,5 @@ public:
void enabledChanged() override;
void showDepthMapChanged();
void setAdjusterBehavior(bool strengthAdd);
- void adjusterAutoToggled(Adjuster* a, bool newval) override {}
};
diff --git a/rtgui/diagonalcurveeditorsubgroup.cc b/rtgui/diagonalcurveeditorsubgroup.cc
index 86ff26bb4..9e2406309 100644
--- a/rtgui/diagonalcurveeditorsubgroup.cc
+++ b/rtgui/diagonalcurveeditorsubgroup.cc
@@ -1246,10 +1246,6 @@ void DiagonalCurveEditorSubGroup::adjusterChanged(Adjuster* a, double newval)
parent->curveChanged ();
}
-void DiagonalCurveEditorSubGroup::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
/*
* Listener called when the mouse is over a parametric curve's slider
*/
diff --git a/rtgui/diagonalcurveeditorsubgroup.h b/rtgui/diagonalcurveeditorsubgroup.h
index 39cc86973..54f424dc6 100644
--- a/rtgui/diagonalcurveeditorsubgroup.h
+++ b/rtgui/diagonalcurveeditorsubgroup.h
@@ -105,7 +105,6 @@ protected:
const std::vector getCurveFromGUI (int type) override;
void shcChanged () override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
bool adjusterEntered (GdkEventCrossing* ev, int ac);
bool adjusterLeft (GdkEventCrossing* ev, int ac);
void setSubGroupRangeLabels(Glib::ustring r1, Glib::ustring r2, Glib::ustring r3, Glib::ustring r4);
diff --git a/rtgui/dirpyrdenoise.cc b/rtgui/dirpyrdenoise.cc
index c60c06243..c3528d5dd 100644
--- a/rtgui/dirpyrdenoise.cc
+++ b/rtgui/dirpyrdenoise.cc
@@ -988,10 +988,6 @@ void DirPyrDenoise::adjusterChanged(Adjuster* a, double newval)
}
}
-void DirPyrDenoise::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void DirPyrDenoise::enabledChanged ()
{
diff --git a/rtgui/dirpyrdenoise.h b/rtgui/dirpyrdenoise.h
index de7dee800..7bdaff853 100644
--- a/rtgui/dirpyrdenoise.h
+++ b/rtgui/dirpyrdenoise.h
@@ -51,7 +51,6 @@ public:
void autoOpenCurve () override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void medianChanged ();
void chromaChanged (double autchroma, double autred, double autblue) override;
diff --git a/rtgui/dirpyrequalizer.cc b/rtgui/dirpyrequalizer.cc
index 5f557c0f1..be6f9c97b 100644
--- a/rtgui/dirpyrequalizer.cc
+++ b/rtgui/dirpyrequalizer.cc
@@ -373,10 +373,6 @@ void DirPyrEqualizer::adjusterChanged(Adjuster* a, double newval)
}
}
-void DirPyrEqualizer::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void DirPyrEqualizer::enabledChanged ()
{
diff --git a/rtgui/dirpyrequalizer.h b/rtgui/dirpyrequalizer.h
index d7903116b..4eb110428 100644
--- a/rtgui/dirpyrequalizer.h
+++ b/rtgui/dirpyrequalizer.h
@@ -65,7 +65,6 @@ public:
void trimValues (rtengine::procparams::ProcParams* pp) override;
void cbdlMethodChanged();
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged() override;
void gamutlabToggled ();
void lumaneutralPressed ();
diff --git a/rtgui/distortion.cc b/rtgui/distortion.cc
index 0ac067ba8..3620dbc21 100644
--- a/rtgui/distortion.cc
+++ b/rtgui/distortion.cc
@@ -95,10 +95,6 @@ void Distortion::adjusterChanged(Adjuster* a, double newval)
}
}
-void Distortion::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Distortion::setBatchMode (bool batchMode)
{
diff --git a/rtgui/distortion.h b/rtgui/distortion.h
index ce1e81046..a279913cb 100644
--- a/rtgui/distortion.h
+++ b/rtgui/distortion.h
@@ -43,7 +43,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool vadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
void idPressed ();
diff --git a/rtgui/epd.cc b/rtgui/epd.cc
index 4b7cca10a..ab6341866 100644
--- a/rtgui/epd.cc
+++ b/rtgui/epd.cc
@@ -159,10 +159,6 @@ void EdgePreservingDecompositionUI::adjusterChanged(Adjuster* a, double newval)
}
}
-void EdgePreservingDecompositionUI::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void EdgePreservingDecompositionUI::enabledChanged ()
{
if (listener) {
diff --git a/rtgui/epd.h b/rtgui/epd.h
index f2073a976..6b44d9147 100644
--- a/rtgui/epd.h
+++ b/rtgui/epd.h
@@ -42,7 +42,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void setAdjusterBehavior (bool stAdd, bool gAdd, bool esAdd, bool scAdd, bool rAdd);
};
diff --git a/rtgui/exifpanel.cc b/rtgui/exifpanel.cc
index c5036798e..6c196e575 100644
--- a/rtgui/exifpanel.cc
+++ b/rtgui/exifpanel.cc
@@ -496,7 +496,7 @@ void ExifPanel::addPressed ()
Glib::ustring sel = getSelection (true);
- if (sel == "") {
+ if (sel.empty()) {
tcombo->set_active_text ("Exif.UserComment");
} else {
tcombo->set_active_text (sel);
@@ -658,7 +658,7 @@ Glib::ustring ExifPanel::getSelection (bool onlyeditable)
void ExifPanel::updateChangeList (Gtk::TreeModel::Children root, std::string prefix)
{
- if (prefix != "") {
+ if (!prefix.empty()) {
prefix = prefix + ".";
}
diff --git a/rtgui/fattaltonemap.cc b/rtgui/fattaltonemap.cc
index 85d835cc7..032df6f40 100644
--- a/rtgui/fattaltonemap.cc
+++ b/rtgui/fattaltonemap.cc
@@ -119,10 +119,6 @@ void FattalToneMapping::adjusterChanged(Adjuster* a, double newval)
}
}
-void FattalToneMapping::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void FattalToneMapping::enabledChanged ()
{
if (listener) {
diff --git a/rtgui/fattaltonemap.h b/rtgui/fattaltonemap.h
index 76e850c4e..e6eafb605 100644
--- a/rtgui/fattaltonemap.h
+++ b/rtgui/fattaltonemap.h
@@ -42,7 +42,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void setAdjusterBehavior(bool amountAdd, bool thresholdAdd, bool anchorAdd);
};
diff --git a/rtgui/favoritbrowser.cc b/rtgui/favoritbrowser.cc
index 379ce26e6..0e1b4490b 100644
--- a/rtgui/favoritbrowser.cc
+++ b/rtgui/favoritbrowser.cc
@@ -97,7 +97,7 @@ void FavoritBrowser::dirSelected (const Glib::ustring& dirname, const Glib::ustr
void FavoritBrowser::addPressed ()
{
- if (lastSelectedDir == "") {
+ if (lastSelectedDir.empty()) {
return;
}
diff --git a/rtgui/filebrowser.cc b/rtgui/filebrowser.cc
index a270e5af8..cc215e70a 100644
--- a/rtgui/filebrowser.cc
+++ b/rtgui/filebrowser.cc
@@ -592,15 +592,16 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry)
{
entry->selected = false;
entry->drawable = false;
- entry->framed = editedFiles.find (entry->filename) != editedFiles.end();
+ entry->framed = editedFiles.find(entry->filename) != editedFiles.end();
// add button set to the thumbbrowserentry
- entry->addButtonSet (new FileThumbnailButtonSet (entry));
- entry->getThumbButtonSet()->setRank (entry->thumbnail->getRank());
- entry->getThumbButtonSet()->setColorLabel (entry->thumbnail->getColorLabel());
- entry->getThumbButtonSet()->setInTrash (entry->thumbnail->getStage());
- entry->getThumbButtonSet()->setButtonListener (this);
- entry->resize (getThumbnailHeight());
+ entry->addButtonSet(new FileThumbnailButtonSet(entry));
+ entry->getThumbButtonSet()->setRank(entry->thumbnail->getRank());
+ entry->getThumbButtonSet()->setColorLabel(entry->thumbnail->getColorLabel());
+ entry->getThumbButtonSet()->setInTrash(entry->thumbnail->getStage());
+ entry->getThumbButtonSet()->setButtonListener(this);
+ entry->resize(getThumbnailHeight());
+ entry->filtered = !checkFilter(entry);
// find place in abc order
{
@@ -619,9 +620,9 @@ void FileBrowser::addEntry_ (FileBrowserEntry* entry)
entry
);
- initEntry (entry);
+ initEntry(entry);
}
- redraw ();
+ redraw(false);
}
FileBrowserEntry* FileBrowser::delEntry (const Glib::ustring& fname)
diff --git a/rtgui/filebrowserentry.cc b/rtgui/filebrowserentry.cc
index 0fa5694de..4b1764824 100644
--- a/rtgui/filebrowserentry.cc
+++ b/rtgui/filebrowserentry.cc
@@ -119,39 +119,37 @@ void FileBrowserEntry::calcThumbnailSize ()
}
}
-std::vector > FileBrowserEntry::getIconsOnImageArea ()
+std::vector> FileBrowserEntry::getIconsOnImageArea ()
{
-
- std::vector > ret;
-
if (!thumbnail) {
- return ret;
+ return {};
}
+ std::vector> ret;
+
if (thumbnail->hasProcParams() && editedIcon) {
- ret.push_back (editedIcon);
+ ret.push_back(editedIcon);
}
if (thumbnail->isRecentlySaved() && recentlySavedIcon) {
- ret.push_back (recentlySavedIcon);
+ ret.push_back(recentlySavedIcon);
}
if (thumbnail->isEnqueued () && enqueuedIcon) {
- ret.push_back (enqueuedIcon);
+ ret.push_back(enqueuedIcon);
}
return ret;
}
-std::vector > FileBrowserEntry::getSpecificityIconsOnImageArea ()
+std::vector> FileBrowserEntry::getSpecificityIconsOnImageArea ()
{
-
- std::vector > ret;
-
if (!thumbnail) {
- return ret;
+ return {};
}
+ std::vector> ret;
+
if (thumbnail->isHDR() && hdr) {
ret.push_back (hdr);
}
@@ -188,7 +186,7 @@ void FileBrowserEntry::customBackBufferUpdate (Cairo::RefPtr c)
}
}
-void FileBrowserEntry::getIconSize (int& w, int& h)
+void FileBrowserEntry::getIconSize (int& w, int& h) const
{
w = editedIcon->get_width ();
@@ -286,34 +284,29 @@ void FileBrowserEntry::_updateImage(rtengine::IImage8* img, double s, const rten
bool FileBrowserEntry::motionNotify (int x, int y)
{
- bool b = ThumbBrowserEntryBase::motionNotify (x, y);
+ const bool b = ThumbBrowserEntryBase::motionNotify(x, y);
- int ix = x - startx - ofsX;
- int iy = y - starty - ofsY;
+ const int ix = x - startx - ofsX;
+ const int iy = y - starty - ofsY;
Inspector* inspector = parent->getInspector();
if (inspector && inspector->isActive() && !parent->isInTabMode()) {
- rtengine::Coord2D coord(-1., -1.);
- getPosInImgSpace(x, y, coord);
+ const rtengine::Coord2D coord(getPosInImgSpace(x, y));
if (coord.x != -1.) {
if (!wasInside) {
inspector->switchImage(filename);
+ wasInside = true;
}
-
- wasInside = true;
inspector->mouseMove(coord, 0);
} else {
- if (wasInside) {
- wasInside = false;
- rtengine::Coord2D coord(-1, -1);
- }
+ wasInside = false;
}
}
- if (inside (x, y)) {
- updateCursor (ix, iy);
+ if (inside(x, y)) {
+ updateCursor(ix, iy);
}
if (state == SRotateSelecting) {
diff --git a/rtgui/filebrowserentry.h b/rtgui/filebrowserentry.h
index 3a3d32977..5122de55f 100644
--- a/rtgui/filebrowserentry.h
+++ b/rtgui/filebrowserentry.h
@@ -93,9 +93,9 @@ public:
void refreshQuickThumbnailImage () override;
void calcThumbnailSize () override;
- std::vector > getIconsOnImageArea () override;
- std::vector > getSpecificityIconsOnImageArea () override;
- void getIconSize (int& w, int& h) override;
+ std::vector> getIconsOnImageArea () override;
+ std::vector> getSpecificityIconsOnImageArea () override;
+ void getIconSize (int& w, int& h) const override;
// thumbnaillistener interface
void procParamsChanged (Thumbnail* thm, int whoChangedIt) override;
diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc
index fcccaac3a..dbe540cb4 100644
--- a/rtgui/filecatalog.cc
+++ b/rtgui/filecatalog.cc
@@ -563,44 +563,49 @@ void FileCatalog::closeDir ()
redrawAll ();
}
-std::vector FileCatalog::getFileList ()
+std::vector FileCatalog::getFileList()
{
+
std::vector names;
- std::set extensions;
- for (const auto& parsedExt : options.parsedExtensions) {
- extensions.emplace (parsedExt.lowercase ());
- }
+ const std::set& extensions = options.parsedExtensionsSet;
try {
- auto dir = Gio::File::create_for_path (selectedDirectory);
+ const auto dir = Gio::File::create_for_path(selectedDirectory);
- auto enumerator = dir->enumerate_children ("standard::name");
+ auto enumerator = dir->enumerate_children("standard::name,standard::type,standard::is-hidden");
while (true) {
try {
- auto file = enumerator->next_file ();
+ const auto file = enumerator->next_file();
if (!file) {
break;
}
- const Glib::ustring fname = file->get_name ();
-
- auto lastdot = fname.find_last_of ('.');
- if (lastdot >= fname.length () - 1) {
+ if (file->get_file_type() == Gio::FILE_TYPE_DIRECTORY) {
continue;
}
- const auto fext = fname.substr (lastdot + 1).lowercase ();
- if (extensions.count (fext) == 0) {
+ if (!options.fbShowHidden && file->is_hidden()) {
continue;
}
- names.emplace_back (Glib::build_filename (selectedDirectory, fname));
+ const Glib::ustring fname = file->get_name();
+ const auto lastdot = fname.find_last_of('.');
+
+ if (lastdot >= fname.length() - 1) {
+ continue;
+ }
+
+ if (extensions.find(fname.substr(lastdot + 1).lowercase()) == extensions.end()) {
+ continue;
+ }
+
+ names.push_back(Glib::build_filename(selectedDirectory, fname));
} catch (Glib::Exception& exception) {
if (options.rtSettings.verbose) {
- std::cerr << exception.what () << std::endl;
+ std::cerr << exception.what() << std::endl;
}
}
}
@@ -620,13 +625,13 @@ void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring
{
try {
- Glib::RefPtr dir = Gio::File::create_for_path (dirname);
+ const Glib::RefPtr dir = Gio::File::create_for_path(dirname);
if (!dir) {
return;
}
- closeDir ();
+ closeDir();
previewsToLoad = 0;
previewsLoaded = 0;
@@ -636,16 +641,14 @@ void FileCatalog::dirSelected (const Glib::ustring& dirname, const Glib::ustring
}
selectedDirectory = dir->get_parse_name();
- //printf("FileCatalog::dirSelected selectedDirectory = %s\n",selectedDirectory.c_str());
- BrowsePath->set_text (selectedDirectory);
- buttonBrowsePath->set_image (*iRefreshWhite);
- fileNameList = getFileList ();
+
+ BrowsePath->set_text(selectedDirectory);
+ buttonBrowsePath->set_image(*iRefreshWhite);
+ fileNameList = getFileList();
for (unsigned int i = 0; i < fileNameList.size(); i++) {
- Glib::RefPtr f = Gio::File::create_for_path(fileNameList[i]);
-
- if (f->get_parse_name() != openfile) { // if we opened a file at the beginning don't add it again
- checkAndAddFile (f);
+ if (openfile.empty() || fileNameList[i] != openfile) { // if we opened a file at the beginning don't add it again
+ addFile(fileNameList[i]);
}
}
@@ -696,34 +699,33 @@ void FileCatalog::_refreshProgressBar ()
// In tab mode, no progress bar at all
// Also mention that this progress bar only measures the FIRST pass (quick thumbnails)
// The second, usually longer pass is done multithreaded down in the single entries and is NOT measured by this
- if (!inTabMode) {
+ if (!inTabMode && (!previewsToLoad || std::floor(100.f * previewsLoaded / previewsToLoad) != std::floor(100.f * (previewsLoaded - 1) / previewsToLoad))) {
GThreadLock lock; // All GUI access from idle_add callbacks or separate thread HAVE to be protected
-
Gtk::Notebook *nb = (Gtk::Notebook *)(filepanel->get_parent());
- Gtk::Grid* grid = Gtk::manage (new Gtk::Grid ());
+ Gtk::Grid* grid = Gtk::manage(new Gtk::Grid());
Gtk::Label *label = nullptr;
- if (!previewsToLoad ) {
- grid->attach_next_to(*Gtk::manage (new RTImage ("folder-closed.png")), options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1);
+ if (!previewsToLoad) {
+ grid->attach_next_to(*Gtk::manage(new RTImage("folder-closed.png")), options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1);
int filteredCount = min(fileBrowser->getNumFiltered(), previewsLoaded);
- label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER") +
- (filteredCount != previewsLoaded ? " [" + Glib::ustring::format(filteredCount) + "/" : " (")
- + Glib::ustring::format(previewsLoaded) +
- (filteredCount != previewsLoaded ? "]" : ")")));
+ label = Gtk::manage(new Gtk::Label(M("MAIN_FRAME_FILEBROWSER") +
+ (filteredCount != previewsLoaded ? " [" + Glib::ustring::format(filteredCount) + "/" : " (")
+ + Glib::ustring::format(previewsLoaded) +
+ (filteredCount != previewsLoaded ? "]" : ")")));
} else {
- grid->attach_next_to(*Gtk::manage (new RTImage ("magnifier.png")), options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1);
- label = Gtk::manage (new Gtk::Label (M("MAIN_FRAME_FILEBROWSER") + " [" + Glib::ustring::format(std::fixed, std::setprecision(0), std::setw(3), (double)previewsLoaded / previewsToLoad * 100 ) + "%]" ));
+ grid->attach_next_to(*Gtk::manage(new RTImage("magnifier.png")), options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1);
+ label = Gtk::manage(new Gtk::Label(M("MAIN_FRAME_FILEBROWSER") + " [" + Glib::ustring::format(std::fixed, std::setprecision(0), std::setw(3), (double)previewsLoaded / previewsToLoad * 100 ) + "%]" ));
filepanel->loadingThumbs("", (double)previewsLoaded / previewsToLoad);
}
- if( options.mainNBVertical ) {
+ if (options.mainNBVertical) {
label->set_angle(90);
}
grid->attach_next_to(*label, options.mainNBVertical ? Gtk::POS_TOP : Gtk::POS_RIGHT, 1, 1);
- grid->set_tooltip_markup (M("MAIN_FRAME_FILEBROWSER_TOOLTIP"));
- grid->show_all ();
+ grid->set_tooltip_markup(M("MAIN_FRAME_FILEBROWSER_TOOLTIP"));
+ grid->show_all();
if (nb) {
nb->set_tab_label(*filepanel, *grid);
@@ -1005,12 +1007,16 @@ void FileCatalog::copyMoveRequested(const std::vector& tbe, b
Gtk::FileChooserDialog fc (getToplevelWindow (this), fc_title, Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER );
fc.add_button( M("GENERAL_CANCEL"), Gtk::RESPONSE_CANCEL);
fc.add_button( M("GENERAL_OK"), Gtk::RESPONSE_OK);
- // open dialog at the 1-st file's path
- fc.set_filename(tbe[0]->filename);
+ if (!options.lastCopyMovePath.empty() && Glib::file_test(options.lastCopyMovePath, Glib::FILE_TEST_IS_DIR)) {
+ fc.set_current_folder(options.lastCopyMovePath);
+ } else {
+ // open dialog at the 1-st file's path
+ fc.set_current_folder(Glib::path_get_dirname(tbe[0]->filename));
+ }
//!!! TODO prevent dialog closing on "enter" key press
if( fc.run() == Gtk::RESPONSE_OK ) {
- Glib::ustring dest_Dir = fc.get_current_folder();
+ options.lastCopyMovePath = fc.get_current_folder();
// iterate through selected files
for (unsigned int i = 0; i < tbe.size(); i++) {
@@ -1027,10 +1033,10 @@ void FileCatalog::copyMoveRequested(const std::vector& tbe, b
Glib::ustring fname_Ext = getExtension(fname);
// construct destination File Paths
- Glib::ustring dest_fPath = Glib::build_filename (dest_Dir, fname);
+ Glib::ustring dest_fPath = Glib::build_filename (options.lastCopyMovePath, fname);
Glib::ustring dest_fPath_param = dest_fPath + paramFileExtension;
- if (moveRequested && (src_Dir == dest_Dir)) {
+ if (moveRequested && (src_Dir == options.lastCopyMovePath)) {
continue;
}
@@ -1085,7 +1091,7 @@ void FileCatalog::copyMoveRequested(const std::vector& tbe, b
// adjust destination fname to avoid conflicts (append "_", preserve extension)
Glib::ustring dest_fname = Glib::ustring::compose("%1%2%3%4%5", fname_noExt, "_", i_copyindex, ".", fname_Ext);
// re-construct destination File Paths
- dest_fPath = Glib::build_filename (dest_Dir, dest_fname);
+ dest_fPath = Glib::build_filename (options.lastCopyMovePath, dest_fname);
dest_fPath_param = dest_fPath + paramFileExtension;
i_copyindex++;
}
@@ -1677,49 +1683,46 @@ void FileCatalog::reparseDirectory ()
return;
}
- if (!Glib::file_test (selectedDirectory, Glib::FILE_TEST_IS_DIR)) {
- closeDir ();
+ if (!Glib::file_test(selectedDirectory, Glib::FILE_TEST_IS_DIR)) {
+ closeDir();
return;
}
- std::vector nfileNameList = getFileList ();
-
// check if a thumbnailed file has been deleted
- const std::vector& t = fileBrowser->getEntries ();
+ const std::vector& t = fileBrowser->getEntries();
std::vector fileNamesToDel;
- for (size_t i = 0; i < t.size(); i++)
- if (!Glib::file_test (t[i]->filename, Glib::FILE_TEST_EXISTS)) {
- fileNamesToDel.push_back (t[i]->filename);
+ for (const auto& entry : t) {
+ if (!Glib::file_test(entry->filename, Glib::FILE_TEST_EXISTS)) {
+ fileNamesToDel.push_back(entry->filename);
}
-
- for (size_t i = 0; i < fileNamesToDel.size(); i++) {
- delete fileBrowser->delEntry (fileNamesToDel[i]);
- cacheMgr->deleteEntry (fileNamesToDel[i]);
- previewsLoaded--;
}
- if (!fileNamesToDel.empty ()) {
+ for (const auto& toDelete : fileNamesToDel) {
+ delete fileBrowser->delEntry(toDelete);
+ cacheMgr->deleteEntry(toDelete);
+ --previewsLoaded;
+ }
+
+ if (!fileNamesToDel.empty()) {
_refreshProgressBar();
}
// check if a new file has been added
- for (size_t i = 0; i < nfileNameList.size(); i++) {
- bool found = false;
+ // build a set of collate-keys for faster search
+ std::set oldNames;
+ for (const auto& oldName : fileNameList) {
+ oldNames.insert(oldName.collate_key());
+ }
- for (size_t j = 0; j < fileNameList.size(); j++)
- if (nfileNameList[i] == fileNameList[j]) {
- found = true;
- break;
- }
-
- if (!found) {
- checkAndAddFile (Gio::File::create_for_parse_name (nfileNameList[i]));
- _refreshProgressBar ();
+ fileNameList = getFileList();
+ for (const auto& newName : fileNameList) {
+ if (oldNames.find(newName.collate_key()) == oldNames.end()) {
+ addFile(newName);
+ _refreshProgressBar();
}
}
- fileNameList = nfileNameList;
}
void FileCatalog::on_dir_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, bool internal)
@@ -1736,85 +1739,55 @@ void FileCatalog::on_dir_changed (const Glib::RefPtr& file, const Gli
}
}
-void FileCatalog::checkAndAddFile (Glib::RefPtr file)
+void FileCatalog::addFile (const Glib::ustring& fName)
{
-
- if (!file) {
- return;
- }
-
- try {
-
- const auto info = file->query_info("standard::*");
-
- if (!info || info->get_file_type() == Gio::FILE_TYPE_DIRECTORY) {
- return;
- }
-
- if (!options.fbShowHidden && info->is_hidden()) {
- return;
- }
-
- Glib::ustring ext;
-
- const auto lastdot = info->get_name().find_last_of('.');
-
- if (lastdot != Glib::ustring::npos) {
- ext = info->get_name().substr(lastdot + 1);
- }
-
- if (!options.is_extention_enabled(ext)) {
- return;
- }
-
- previewLoader->add(selectedDirectoryId, file->get_parse_name(), this);
+ if (!fName.empty()) {
+ previewLoader->add(selectedDirectoryId, fName, this);
previewsToLoad++;
-
- } catch(Gio::Error&) {}
+ }
}
void FileCatalog::addAndOpenFile (const Glib::ustring& fname)
{
- auto file = Gio::File::create_for_path (fname);
+ auto file = Gio::File::create_for_path(fname);
if (!file ) {
return;
}
- if (!file->query_exists ()) {
+ if (!file->query_exists()) {
return;
}
try {
- auto info = file->query_info ();
+ const auto info = file->query_info();
if (!info) {
return;
}
- Glib::ustring ext;
-
- auto lastdot = info->get_name().find_last_of ('.');
+ const auto lastdot = info->get_name().find_last_of('.');
if (lastdot != Glib::ustring::npos) {
- ext = info->get_name ().substr (lastdot + 1);
- }
-
- if (!options.is_extention_enabled(ext)) {
+ if (!options.is_extention_enabled(info->get_name().substr(lastdot + 1))) {
+ return;
+ }
+ } else {
return;
}
+
// if supported, load thumbnail first
- const auto tmb = cacheMgr->getEntry (file->get_parse_name ());
+ const auto tmb = cacheMgr->getEntry(file->get_parse_name());
if (!tmb) {
return;
}
- FileBrowserEntry* entry = new FileBrowserEntry (tmb, file->get_parse_name ());
- previewReady (selectedDirectoryId, entry);
+ FileBrowserEntry* entry = new FileBrowserEntry(tmb, file->get_parse_name());
+ previewReady(selectedDirectoryId, entry);
// open the file
- tmb->increaseRef ();
+ tmb->increaseRef();
idle_register.add(
[this, tmb]() -> bool
{
@@ -1829,27 +1802,30 @@ void FileCatalog::addAndOpenFile (const Glib::ustring& fname)
void FileCatalog::emptyTrash ()
{
- const std::vector t = fileBrowser->getEntries ();
+ const auto& t = fileBrowser->getEntries();
std::vector toDel;
- for (size_t i = 0; i < t.size(); i++)
- if ((static_cast(t[i]))->thumbnail->getStage() == 1) {
- toDel.push_back (static_cast(t[i]));
+ for (const auto entry : t) {
+ if ((static_cast(entry))->thumbnail->getStage() == 1) {
+ toDel.push_back(static_cast(entry));
}
-
- deleteRequested (toDel, false, false);
- trashChanged();
+ }
+ if (toDel.size() > 0) {
+ deleteRequested(toDel, false, false);
+ trashChanged();
+ }
}
bool FileCatalog::trashIsEmpty ()
{
- const std::vector t = fileBrowser->getEntries ();
- for (size_t i = 0; i < t.size(); i++)
- if ((static_cast(t[i]))->thumbnail->getStage() == 1) {
+ const auto& t = fileBrowser->getEntries();
+
+ for (const auto entry : t) {
+ if ((static_cast(entry))->thumbnail->getStage() == 1) {
return false;
}
-
+ }
return true;
}
diff --git a/rtgui/filecatalog.h b/rtgui/filecatalog.h
index 4c0d13e51..2f3054bcf 100644
--- a/rtgui/filecatalog.h
+++ b/rtgui/filecatalog.h
@@ -141,7 +141,7 @@ private:
IdleRegister idle_register;
void addAndOpenFile (const Glib::ustring& fname);
- void checkAndAddFile (Glib::RefPtr info);
+ void addFile (const Glib::ustring& fName);
std::vector getFileList ();
BrowserFilter getFilter ();
void trashChanged ();
diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc
index 5a344c8ba..da33caddf 100644
--- a/rtgui/filepanel.cc
+++ b/rtgui/filepanel.cc
@@ -358,7 +358,7 @@ void FilePanel::saveOptions ()
options.browserToolPanelWidth = winW - get_position();
options.browserToolPanelHeight = tpcPaned->get_position ();
- if (options.startupDir == STARTUPDIR_LAST && fileCatalog->lastSelectedDir () != "") {
+ if (options.startupDir == STARTUPDIR_LAST && !fileCatalog->lastSelectedDir().empty()) {
options.startupPath = fileCatalog->lastSelectedDir ();
}
diff --git a/rtgui/filethumbnailbuttonset.cc b/rtgui/filethumbnailbuttonset.cc
index 455ed8555..4c7d8743d 100644
--- a/rtgui/filethumbnailbuttonset.cc
+++ b/rtgui/filethumbnailbuttonset.cc
@@ -29,12 +29,14 @@ Cairo::RefPtr FileThumbnailButtonSet::unRankIcon;
Cairo::RefPtr FileThumbnailButtonSet::trashIcon;
Cairo::RefPtr FileThumbnailButtonSet::unTrashIcon;
Cairo::RefPtr FileThumbnailButtonSet::processIcon;
-Cairo::RefPtr FileThumbnailButtonSet::colorLabelIcon_0;
-Cairo::RefPtr FileThumbnailButtonSet::colorLabelIcon_1;
-Cairo::RefPtr FileThumbnailButtonSet::colorLabelIcon_2;
-Cairo::RefPtr FileThumbnailButtonSet::colorLabelIcon_3;
-Cairo::RefPtr FileThumbnailButtonSet::colorLabelIcon_4;
-Cairo::RefPtr FileThumbnailButtonSet::colorLabelIcon_5;
+std::array, 6> FileThumbnailButtonSet::colorLabelIcon;
+
+Glib::ustring FileThumbnailButtonSet::processToolTip;
+Glib::ustring FileThumbnailButtonSet::unrankToolTip;
+Glib::ustring FileThumbnailButtonSet::trashToolTip;
+Glib::ustring FileThumbnailButtonSet::untrashToolTip;
+Glib::ustring FileThumbnailButtonSet::colorLabelToolTip;
+std::array FileThumbnailButtonSet::rankToolTip;
FileThumbnailButtonSet::FileThumbnailButtonSet (FileBrowserEntry* myEntry)
{
@@ -46,73 +48,57 @@ FileThumbnailButtonSet::FileThumbnailButtonSet (FileBrowserEntry* myEntry)
trashIcon = Cairo::RefPtr(new RTSurface("trash-small.png"));
unTrashIcon = Cairo::RefPtr(new RTSurface("trash-remove-small.png"));
processIcon = Cairo::RefPtr(new RTSurface("gears-small.png"));
+ colorLabelIcon[0] = Cairo::RefPtr(new RTSurface("circle-empty-gray-small.png"));
+ colorLabelIcon[1] = Cairo::RefPtr(new RTSurface("circle-red-small.png"));
+ colorLabelIcon[2] = Cairo::RefPtr(new RTSurface("circle-yellow-small.png"));
+ colorLabelIcon[3] = Cairo::RefPtr(new RTSurface("circle-green-small.png"));
+ colorLabelIcon[4] = Cairo::RefPtr(new RTSurface("circle-blue-small.png"));
+ colorLabelIcon[5] = Cairo::RefPtr(new RTSurface("circle-purple-small.png"));
+
+ processToolTip = M("FILEBROWSER_POPUPPROCESS");
+ unrankToolTip = M("FILEBROWSER_UNRANK_TOOLTIP");
+ trashToolTip = M("FILEBROWSER_POPUPTRASH");
+ untrashToolTip = M("FILEBROWSER_POPUPUNTRASH");
+ colorLabelToolTip = M("FILEBROWSER_COLORLABEL_TOOLTIP");
+ rankToolTip[0] = M("FILEBROWSER_RANK1_TOOLTIP");
+ rankToolTip[1] = M("FILEBROWSER_RANK2_TOOLTIP");
+ rankToolTip[2] = M("FILEBROWSER_RANK3_TOOLTIP");
+ rankToolTip[3] = M("FILEBROWSER_RANK4_TOOLTIP");
+ rankToolTip[4] = M("FILEBROWSER_RANK5_TOOLTIP");
- colorLabelIcon_0 = Cairo::RefPtr(new RTSurface("circle-empty-gray-small.png"));
- colorLabelIcon_1 = Cairo::RefPtr(new RTSurface("circle-red-small.png"));
- colorLabelIcon_2 = Cairo::RefPtr(new RTSurface("circle-yellow-small.png"));
- colorLabelIcon_3 = Cairo::RefPtr(new RTSurface("circle-green-small.png"));
- colorLabelIcon_4 = Cairo::RefPtr(new RTSurface("circle-blue-small.png"));
- colorLabelIcon_5 = Cairo::RefPtr(new RTSurface("circle-purple-small.png"));;
iconsLoaded = true;
}
- add (new LWButton (processIcon, 6, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_POPUPPROCESS")));
- add (new LWButton (unRankIcon, 0, myEntry, LWButton::Left, LWButton::Center, M("FILEBROWSER_UNRANK_TOOLTIP")));
+ add(new LWButton(processIcon, 6, myEntry, LWButton::Left, LWButton::Center, &processToolTip));
+ add(new LWButton(unRankIcon, 0, myEntry, LWButton::Left, LWButton::Center, &unrankToolTip));
for (int i = 0; i < 5; i++) {
- add (new LWButton (rankIcon, i + 1, myEntry, LWButton::Left));
+ add(new LWButton(rankIcon, i + 1, myEntry, LWButton::Left, LWButton::Center, &rankToolTip[i]));
}
- add (new LWButton (trashIcon, 7, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_POPUPTRASH")));
-
- add (new LWButton (colorLabelIcon_0, 8, myEntry, LWButton::Right, LWButton::Center, M("FILEBROWSER_COLORLABEL_TOOLTIP")));
-
- buttons[2]->setToolTip (M("FILEBROWSER_RANK1_TOOLTIP"));
- buttons[3]->setToolTip (M("FILEBROWSER_RANK2_TOOLTIP"));
- buttons[4]->setToolTip (M("FILEBROWSER_RANK3_TOOLTIP"));
- buttons[5]->setToolTip (M("FILEBROWSER_RANK4_TOOLTIP"));
- buttons[6]->setToolTip (M("FILEBROWSER_RANK5_TOOLTIP"));
+ add(new LWButton(trashIcon, 7, myEntry, LWButton::Right, LWButton::Center, &trashToolTip));
+ add(new LWButton(colorLabelIcon[0], 8, myEntry, LWButton::Right, LWButton::Center, &colorLabelToolTip));
}
void FileThumbnailButtonSet::setRank (int stars)
{
for (int i = 1; i <= 5; i++) {
- buttons[i + 1]->setIcon (i <= stars ? rankIcon : gRankIcon);
+ buttons[i + 1]->setIcon(i <= stars ? rankIcon : gRankIcon);
}
}
void FileThumbnailButtonSet::setColorLabel (int colorLabel)
{
- if (colorLabel == 0) {
- buttons[8]->setIcon (colorLabelIcon_0); //transparent label
- }
-
- if (colorLabel == 1) {
- buttons[8]->setIcon (colorLabelIcon_1);
- }
-
- if (colorLabel == 2) {
- buttons[8]->setIcon (colorLabelIcon_2);
- }
-
- if (colorLabel == 3) {
- buttons[8]->setIcon (colorLabelIcon_3);
- }
-
- if (colorLabel == 4) {
- buttons[8]->setIcon (colorLabelIcon_4);
- }
-
- if (colorLabel == 5) {
- buttons[8]->setIcon (colorLabelIcon_5);
+ if (colorLabel >= 0 && colorLabel <= 5) {
+ buttons[8]->setIcon(colorLabelIcon[colorLabel]);
}
}
void FileThumbnailButtonSet::setInTrash (bool inTrash)
{
- buttons[7]->setIcon (inTrash ? unTrashIcon : trashIcon);
- buttons[7]->setToolTip (inTrash ? M("FILEBROWSER_POPUPUNTRASH") : M("FILEBROWSER_POPUPTRASH"));
+ buttons[7]->setIcon(inTrash ? unTrashIcon : trashIcon);
+ buttons[7]->setToolTip(inTrash ? &untrashToolTip : &trashToolTip);
}
diff --git a/rtgui/filethumbnailbuttonset.h b/rtgui/filethumbnailbuttonset.h
index 57811addd..13265b8c0 100644
--- a/rtgui/filethumbnailbuttonset.h
+++ b/rtgui/filethumbnailbuttonset.h
@@ -19,6 +19,8 @@
#ifndef _FILETHUMBNAILBUTTONSET_
#define _FILETHUMBNAILBUTTONSET_
+#include
+
#include "lwbuttonset.h"
#include
#include "filebrowserentry.h"
@@ -38,12 +40,14 @@ public:
static Cairo::RefPtr unTrashIcon;
static Cairo::RefPtr processIcon;
- static Cairo::RefPtr colorLabelIcon_0;
- static Cairo::RefPtr colorLabelIcon_1;
- static Cairo::RefPtr colorLabelIcon_2;
- static Cairo::RefPtr colorLabelIcon_3;
- static Cairo::RefPtr colorLabelIcon_4;
- static Cairo::RefPtr colorLabelIcon_5;
+ static std::array, 6> colorLabelIcon;
+
+ static Glib::ustring processToolTip;
+ static Glib::ustring unrankToolTip;
+ static Glib::ustring trashToolTip;
+ static Glib::ustring untrashToolTip;
+ static Glib::ustring colorLabelToolTip;
+ static std::array rankToolTip;
explicit FileThumbnailButtonSet (FileBrowserEntry* myEntry);
void setRank (int stars);
diff --git a/rtgui/filmnegative.cc b/rtgui/filmnegative.cc
index 3464f7e46..6e93b2364 100644
--- a/rtgui/filmnegative.cc
+++ b/rtgui/filmnegative.cc
@@ -200,10 +200,6 @@ void FilmNegative::adjusterChanged(Adjuster* a, double newval)
}
}
-void FilmNegative::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void FilmNegative::enabledChanged()
{
if (listener) {
diff --git a/rtgui/filmnegative.h b/rtgui/filmnegative.h
index 7de1bd56a..e967f535c 100644
--- a/rtgui/filmnegative.h
+++ b/rtgui/filmnegative.h
@@ -55,7 +55,6 @@ public:
void setBatchMode(bool batchMode) override;
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged() override;
void setFilmNegProvider(FilmNegProvider* provider);
diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc
index 734b46c34..6b40bb586 100644
--- a/rtgui/filmsimulation.cc
+++ b/rtgui/filmsimulation.cc
@@ -115,10 +115,6 @@ void FilmSimulation::adjusterChanged(Adjuster* a, double newval)
}
}
-void FilmSimulation::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void FilmSimulation::setBatchMode( bool batchMode )
{
ToolPanel::setBatchMode( batchMode );
diff --git a/rtgui/filmsimulation.h b/rtgui/filmsimulation.h
index c55662757..b5c9ffa6b 100644
--- a/rtgui/filmsimulation.h
+++ b/rtgui/filmsimulation.h
@@ -56,7 +56,6 @@ public:
FilmSimulation();
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void setBatchMode(bool batchMode) override;
void read(const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override;
void write(rtengine::procparams::ProcParams* pp, ParamsEdited* pedited = nullptr) override;
diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc
index 3cbd7acf1..25482909e 100644
--- a/rtgui/flatfield.cc
+++ b/rtgui/flatfield.cc
@@ -192,7 +192,7 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi
Glib::ustring fname = Glib::path_get_basename(ffp->GetCurrentImageFilePath());
Glib::ustring filetype;
- if (fname != "") {
+ if (!fname.empty()) {
// get image filetype, set filter to the same as current image's filetype
std::string::size_type idx;
idx = fname.rfind('.');
diff --git a/rtgui/gradient.cc b/rtgui/gradient.cc
index 4961597bb..d7b2cb7c2 100644
--- a/rtgui/gradient.cc
+++ b/rtgui/gradient.cc
@@ -269,10 +269,6 @@ void Gradient::adjusterChanged(Adjuster* a, double newval)
}
}
-void Gradient::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Gradient::enabledChanged ()
{
diff --git a/rtgui/gradient.h b/rtgui/gradient.h
index 8aa4a5339..05a267a0d 100644
--- a/rtgui/gradient.h
+++ b/rtgui/gradient.h
@@ -43,7 +43,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void setAdjusterBehavior (bool degreeadd, bool featheradd, bool strengthadd, bool centeradd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
diff --git a/rtgui/iccprofilecreator.cc b/rtgui/iccprofilecreator.cc
index e5172c7e7..0ab1ac61d 100644
--- a/rtgui/iccprofilecreator.cc
+++ b/rtgui/iccprofilecreator.cc
@@ -389,10 +389,6 @@ void ICCProfileCreator::adjusterChanged(Adjuster* a, double newval)
}
}
-void ICCProfileCreator::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ICCProfileCreator::primariesChanged()
{
if (primaries->get_active_row_number() > 0) {
diff --git a/rtgui/iccprofilecreator.h b/rtgui/iccprofilecreator.h
index 23e5b86c8..5265d5ab2 100644
--- a/rtgui/iccprofilecreator.h
+++ b/rtgui/iccprofilecreator.h
@@ -92,7 +92,6 @@ private:
void illuminantChanged();
void trcPresetsChanged();
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
static std::vector getGamma();
Glib::ustring getPrimariesPresetName(const Glib::ustring &preset);
void getPrimaries(const Glib::ustring &preset, double *p, ColorTemp &temp);
diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc
index ba8bf9cef..e7efa20e9 100644
--- a/rtgui/icmpanel.cc
+++ b/rtgui/icmpanel.cc
@@ -504,7 +504,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
if (pp->icm.inputProfile == "(none)") {
inone->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "");
- } else if (pp->icm.inputProfile == "(embedded)" || ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile == "") && icamera->get_state() == Gtk::STATE_INSENSITIVE)) {
+ } else if (pp->icm.inputProfile == "(embedded)" || ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile.empty()) && icamera->get_state() == Gtk::STATE_INSENSITIVE)) {
iembedded->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "");
} else if ((pp->icm.inputProfile == "(cameraICC)") && icameraICC->get_state() != Gtk::STATE_INSENSITIVE) {
@@ -519,7 +519,7 @@ void ICMPanel::read(const ProcParams* pp, const ParamsEdited* pedited)
// If neither (camera) nor (cameraICC) are available, as is the case when loading a non-raw, activate (embedded).
iembedded->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "(cameraICC)");
- } else if ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile == "") && icamera->get_state() != Gtk::STATE_INSENSITIVE) {
+ } else if ((pp->icm.inputProfile == "(camera)" || pp->icm.inputProfile.empty()) && icamera->get_state() != Gtk::STATE_INSENSITIVE) {
icamera->set_active(true);
updateDCP(pp->icm.dcpIlluminant, "");
} else {
@@ -701,10 +701,6 @@ void ICMPanel::adjusterChanged(Adjuster* a, double newval)
}
}
-void ICMPanel::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ICMPanel::wpChanged()
{
if (listener) {
@@ -953,7 +949,7 @@ void ICMPanel::setRawMeta(bool raw, const rtengine::FramesData* pMeta)
void ICMPanel::ipSelectionChanged()
{
- if (ipDialog->get_filename() == "") {
+ if (ipDialog->get_filename().empty()) {
return;
}
diff --git a/rtgui/icmpanel.h b/rtgui/icmpanel.h
index b1106b6e1..a03bd6fa7 100644
--- a/rtgui/icmpanel.h
+++ b/rtgui/icmpanel.h
@@ -126,7 +126,6 @@ public:
void setBatchMode(bool batchMode) override;
void setDefaults(const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void wpChanged();
void wtrcinChanged();
diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc
index dd891b351..886d9ff5b 100644
--- a/rtgui/imagearea.cc
+++ b/rtgui/imagearea.cc
@@ -247,7 +247,7 @@ bool ImageArea::on_draw(const ::Cairo::RefPtr< Cairo::Context> &cr)
(*i)->expose (cr);
}
- if (options.showInfo && infotext != "") {
+ if (options.showInfo && !infotext.empty()) {
iBackBuffer.copySurface(cr);
}
diff --git a/rtgui/impulsedenoise.cc b/rtgui/impulsedenoise.cc
index 9203ce8a7..d4ecebfb5 100644
--- a/rtgui/impulsedenoise.cc
+++ b/rtgui/impulsedenoise.cc
@@ -88,10 +88,6 @@ void ImpulseDenoise::adjusterChanged(Adjuster* a, double newval)
}
}
-void ImpulseDenoise::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ImpulseDenoise::enabledChanged ()
{
if (listener) {
diff --git a/rtgui/impulsedenoise.h b/rtgui/impulsedenoise.h
index 79484dc65..ae6aaa6a8 100644
--- a/rtgui/impulsedenoise.h
+++ b/rtgui/impulsedenoise.h
@@ -40,7 +40,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void setAdjusterBehavior (bool threshadd);
diff --git a/rtgui/inspector.cc b/rtgui/inspector.cc
index 06e2272e7..a183a3419 100644
--- a/rtgui/inspector.cc
+++ b/rtgui/inspector.cc
@@ -34,7 +34,7 @@ InspectorBuffer::InspectorBuffer(const Glib::ustring &imagePath) : currTransform
// generate thumbnail image
Glib::ustring ext = getExtension (imagePath);
- if (ext == "") {
+ if (ext.empty()) {
imgPath.clear();
return;
}
diff --git a/rtgui/inspector.h b/rtgui/inspector.h
index d5ed327b8..86ad9114e 100644
--- a/rtgui/inspector.h
+++ b/rtgui/inspector.h
@@ -87,7 +87,7 @@ public:
/** @brief Get the on/off state
*/
- bool isActive()
+ bool isActive() const
{
return active;
};
diff --git a/rtgui/labcurve.cc b/rtgui/labcurve.cc
index f458fa717..4b25c1e4f 100644
--- a/rtgui/labcurve.cc
+++ b/rtgui/labcurve.cc
@@ -567,10 +567,6 @@ void LCurve::adjusterChanged(Adjuster* a, double newval)
}
}
-void LCurve::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void LCurve::colorForValue (double valX, double valY, enum ColorCaller::ElemType elemType, int callerId, ColorCaller *caller)
{
diff --git a/rtgui/labcurve.h b/rtgui/labcurve.h
index b727cca84..db75a686a 100644
--- a/rtgui/labcurve.h
+++ b/rtgui/labcurve.h
@@ -77,7 +77,6 @@ public:
void curveChanged (CurveEditor* ce) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void avoidcolorshift_toggled ();
void lcredsk_toggled();
diff --git a/rtgui/localcontrast.cc b/rtgui/localcontrast.cc
index 93b67657d..cc4922a65 100644
--- a/rtgui/localcontrast.cc
+++ b/rtgui/localcontrast.cc
@@ -134,10 +134,6 @@ void LocalContrast::adjusterChanged(Adjuster* a, double newval)
}
}
-void LocalContrast::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void LocalContrast::enabledChanged ()
{
if (listener) {
diff --git a/rtgui/localcontrast.h b/rtgui/localcontrast.h
index efe7a18f0..529c95c89 100644
--- a/rtgui/localcontrast.h
+++ b/rtgui/localcontrast.h
@@ -47,7 +47,6 @@ public:
void setBatchMode(bool batchMode) override;
void adjusterChanged(Adjuster *a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged() override;
void setAdjusterBehavior(bool radiusAdd, bool amountAdd, bool darknessAdd, bool lightnessAdd);
};
diff --git a/rtgui/lwbutton.cc b/rtgui/lwbutton.cc
index 48843a02e..3c97ff6bb 100644
--- a/rtgui/lwbutton.cc
+++ b/rtgui/lwbutton.cc
@@ -19,7 +19,7 @@
#include "lwbutton.h"
#include "guiutils.h"
-LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring tooltip)
+LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha, Alignment va, Glib::ustring* 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(nullptr), actionCode(aCode), actionData(aData), toolTip(tooltip)
{
@@ -31,7 +31,7 @@ LWButton::LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignmen
}
}
-void LWButton::getSize (int& minw, int& minh)
+void LWButton::getSize (int& minw, int& minh) const
{
minw = w;
@@ -45,7 +45,13 @@ void LWButton::setPosition (int x, int y)
ypos = y;
}
-void LWButton::getPosition (int& x, int& y)
+void LWButton::addPosition (int x, int y)
+{
+ xpos += x;
+ ypos += y;
+}
+
+void LWButton::getPosition (int& x, int& y) const
{
x = xpos;
@@ -65,7 +71,7 @@ void LWButton::setIcon (Cairo::RefPtr i)
}
}
-Cairo::RefPtr LWButton::getIcon ()
+Cairo::RefPtr LWButton::getIcon () const
{
return icon;
@@ -82,7 +88,7 @@ void LWButton::setColors (const Gdk::RGBA& bg, const Gdk::RGBA& fg)
fgb = fg.get_blue ();
}
-bool LWButton::inside (int x, int y)
+bool LWButton::inside (int x, int y) const
{
return x > xpos && x < xpos + w && y > ypos && y < ypos + h;
@@ -210,24 +216,23 @@ void LWButton::redraw (Cairo::RefPtr context)
}
}
-void LWButton::getAlignment (Alignment& ha, Alignment& va)
+void LWButton::getAlignment (Alignment& ha, Alignment& va) const
{
ha = halign;
va = valign;
}
-Glib::ustring LWButton::getToolTip (int x, int y)
+Glib::ustring LWButton::getToolTip (int x, int y) const
{
-
- if (inside (x, y)) {
- return toolTip;
+ if (inside(x, y) && toolTip) {
+ return *toolTip;
} else {
- return "";
+ return {};
}
}
-void LWButton::setToolTip (const Glib::ustring& tooltip)
+void LWButton::setToolTip (Glib::ustring* tooltip)
{
toolTip = tooltip;
diff --git a/rtgui/lwbutton.h b/rtgui/lwbutton.h
index 4ab34f265..12dbb6346 100644
--- a/rtgui/lwbutton.h
+++ b/rtgui/lwbutton.h
@@ -49,26 +49,27 @@ private:
LWButtonListener* listener;
int actionCode;
void* actionData;
- Glib::ustring toolTip;
+ Glib::ustring* toolTip;
public:
- LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha = Left, Alignment va = Center, Glib::ustring tooltip = "");
+ LWButton (Cairo::RefPtr i, int aCode, void* aData, Alignment ha = Left, Alignment va = Center, Glib::ustring* tooltip = nullptr);
- void getSize (int& minw, int& minh);
- void getAlignment (Alignment& ha, Alignment& va);
+ void getSize (int& minw, int& minh) const;
+ void getAlignment (Alignment& ha, Alignment& va) const;
void setPosition (int x, int y);
- void getPosition (int& x, int& y);
- bool inside (int x, int y);
+ void addPosition (int x, int y);
+ void getPosition (int& x, int& y) const;
+ bool inside (int x, int y) const;
void setIcon (Cairo::RefPtr i);
- Cairo::RefPtr getIcon ();
+ Cairo::RefPtr getIcon () const;
void setColors (const Gdk::RGBA& bg, const Gdk::RGBA& fg);
- void setToolTip (const Glib::ustring& tooltip);
+ void setToolTip (Glib::ustring* tooltip);
bool motionNotify (int x, int y);
bool pressNotify (int x, int y);
bool releaseNotify (int x, int y);
- Glib::ustring getToolTip (int x, int y);
+ Glib::ustring getToolTip (int x, int y) const;
void setButtonListener (LWButtonListener* bl)
{
diff --git a/rtgui/lwbuttonset.cc b/rtgui/lwbuttonset.cc
index 6265c1039..d4d39bfe3 100644
--- a/rtgui/lwbuttonset.cc
+++ b/rtgui/lwbuttonset.cc
@@ -18,44 +18,42 @@
*/
#include "lwbuttonset.h"
-LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(0), ay(0)
+LWButtonSet::LWButtonSet () : aw(0), ah(0), ax(-1), ay(-1)
{
}
LWButtonSet::~LWButtonSet ()
{
-
- for (size_t i = 0; i < buttons.size(); i++) {
- delete buttons[i];
+ for (const auto entry : buttons) {
+ delete entry;
}
}
void LWButtonSet::add (LWButton* b)
{
-
buttons.push_back (b);
}
-void LWButtonSet::getMinimalDimensions (int& w, int& h)
+void LWButtonSet::getMinimalDimensions (int& w, int& h) const
{
-
w = 0;
h = 0;
- for (size_t i = 0; i < buttons.size(); i++) {
+ for (const auto entry : buttons) {
int bw, bh;
- buttons[i]->getSize (bw, bh);
+ entry->getSize(bw, bh);
w += bw;
-
- if (bh > h) {
- h = bh;
- }
+ h = std::max(bh, h);
}
}
void LWButtonSet::arrangeButtons (int x, int y, int w, int h)
{
+ if (x == ax && y == ay && w == aw && (h == -1 || h == ah )) {
+ return;
+ }
+
int mw, mh;
getMinimalDimensions (mw, mh);
@@ -103,108 +101,86 @@ void LWButtonSet::arrangeButtons (int x, int y, int w, int h)
void LWButtonSet::move (int nx, int ny)
{
-
- for (size_t i = 0; i < buttons.size(); i++) {
- int x, y;
- buttons[i]->getPosition (x, y);
- buttons[i]->setPosition (x + nx - ax, y + ny - ay);
+ for (const auto entry : buttons) {
+ entry->addPosition(nx - ax, ny - ay);
}
-
ax = nx;
ay = ny;
}
void LWButtonSet::redraw (Cairo::RefPtr context)
{
-
- for (size_t i = 0; i < buttons.size(); i++) {
- buttons[i]->redraw (context);
+ for (const auto entry : buttons) {
+ entry->redraw(context);
}
}
bool LWButtonSet::motionNotify (int x, int y)
{
-
bool res = false;
-
- for (size_t i = 0; i < buttons.size(); i++) {
- bool handled = buttons[i]->motionNotify (x, y);
- res = res || handled;
+ for (const auto entry : buttons) {
+ res = entry->motionNotify(x, y) || res;
}
-
return res;
}
bool LWButtonSet::pressNotify (int x, int y)
{
-
bool res = false;
-
- for (size_t i = 0; i < buttons.size(); i++) {
- bool handled = buttons[i]->pressNotify (x, y);
- res = res || handled;
+ for (const auto entry : buttons) {
+ res = entry->pressNotify(x, y) || res;
}
-
return res;
}
bool LWButtonSet::releaseNotify (int x, int y)
{
-
bool res = false;
-
- for (size_t i = 0; i < buttons.size(); i++) {
- bool handled = buttons[i]->releaseNotify (x, y);
- res = res || handled;
+ for (const auto entry : buttons) {
+ res = entry->releaseNotify(x, y) || res;
}
-
return res;
}
-bool LWButtonSet::inside (int x, int y)
+bool LWButtonSet::inside (int x, int y) const
{
- for (size_t i = 0; i < buttons.size(); i++)
- if (buttons[i]->inside (x, y)) {
+ for (const auto entry : buttons) {
+ if (entry->inside(x, y)) {
return true;
}
-
+ }
return false;
}
void LWButtonSet::setButtonListener (LWButtonListener* bl)
{
-
- for (size_t i = 0; i < buttons.size(); i++) {
- buttons[i]->setButtonListener (bl);
+ for (const auto entry : buttons) {
+ entry->setButtonListener(bl);
}
}
-void LWButtonSet::getAllocatedDimensions (int& w, int& h)
+void LWButtonSet::getAllocatedDimensions (int& w, int& h) const
{
-
w = aw;
h = ah;
}
void LWButtonSet::setColors (const Gdk::RGBA& bg, const Gdk::RGBA& fg)
{
-
- for (size_t i = 0; i < buttons.size(); i++) {
- buttons[i]->setColors (bg, fg);
+ for (const auto entry : buttons) {
+ entry->setColors(bg, fg);
}
}
-Glib::ustring LWButtonSet::getToolTip (int x, int y)
+Glib::ustring LWButtonSet::getToolTip (int x, int y) const
{
+ for (const auto entry : buttons) {
+ const auto ttip = entry->getToolTip(x, y);
- for (size_t i = 0; i < buttons.size(); i++) {
- Glib::ustring ttip = buttons[i]->getToolTip (x, y);
-
- if (ttip != "") {
+ if (!ttip.empty()) {
return ttip;
}
}
-
- return "";
+ return {};
}
diff --git a/rtgui/lwbuttonset.h b/rtgui/lwbuttonset.h
index 5452fa434..fa33620ae 100644
--- a/rtgui/lwbuttonset.h
+++ b/rtgui/lwbuttonset.h
@@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see .
*/
-#ifndef _LWBUTTONSET_
-#define _LWBUTTONSET_
+#pragma once
#include
#include "lwbutton.h"
@@ -35,20 +34,18 @@ public:
void add (LWButton* b);
- void getMinimalDimensions (int& w, int& h);
- void getAllocatedDimensions (int& w, int& h);
+ void getMinimalDimensions (int& w, int& h) const;
+ void getAllocatedDimensions (int& w, int& h) const;
void arrangeButtons (int x, int y, int w, int h);
void setColors (const Gdk::RGBA& bg, const Gdk::RGBA& fg);
bool motionNotify (int x, int y);
bool pressNotify (int x, int y);
bool releaseNotify (int x, int y);
void move (int nx, int ny);
- bool inside (int x, int y);
+ bool inside (int x, int y) const;
- Glib::ustring getToolTip (int x, int y);
+ Glib::ustring getToolTip (int x, int y) const;
void setButtonListener (LWButtonListener* bl);
void redraw (Cairo::RefPtr context);
};
-
-#endif
diff --git a/rtgui/options.cc b/rtgui/options.cc
index 89a490a68..56e24e180 100644
--- a/rtgui/options.cc
+++ b/rtgui/options.cc
@@ -369,6 +369,7 @@ void Options::setDefaults()
multiUser = true;
profilePath = "profiles";
loadSaveProfilePath = ""; // will be corrected in load as otherwise construction fails
+ lastCopyMovePath = "";
version = "0.0.0.0"; // temporary value; will be correctly set in RTWindow::on_realize
thumbSize = 160;
thumbSizeTab = 160;
@@ -412,6 +413,7 @@ void Options::setDefaults()
favorites.clear();
parseExtensionsEnabled.clear();
parsedExtensions.clear();
+ parsedExtensionsSet.clear();
renameUseTemplates = false;
renameTemplates.clear();
thumbnailZoomRatios.clear();
@@ -655,10 +657,12 @@ Options* Options::copyFrom(Options* other)
void Options::filterOutParsedExtensions()
{
parsedExtensions.clear();
+ parsedExtensionsSet.clear();
for (unsigned int i = 0; i < parseExtensions.size(); i++)
if (parseExtensionsEnabled[i]) {
parsedExtensions.push_back(parseExtensions[i].lowercase());
+ parsedExtensionsSet.emplace(parseExtensions[i].lowercase());
}
}
@@ -1872,6 +1876,7 @@ void Options::readFromFile(Glib::ustring fname)
safeDirGet(keyFile, "Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir);
safeDirGet(keyFile, "Dialogs", "LastLensProfileDir", lastLensProfileDir);
safeDirGet(keyFile, "Dialogs", "LastICCProfCreatorDir", lastICCProfCreatorDir);
+ safeDirGet(keyFile, "Dialogs", "LastCopyMovePath", lastCopyMovePath);
if (keyFile.has_key("Dialogs", "GimpPluginShowInfoDialog")) {
gimpPluginShowInfoDialog = keyFile.get_boolean("Dialogs", "GimpPluginShowInfoDialog");
@@ -2273,6 +2278,7 @@ void Options::saveToFile(Glib::ustring fname)
keyFile.set_string("Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir);
keyFile.set_string("Dialogs", "LastLensProfileDir", lastLensProfileDir);
keyFile.set_string("Dialogs", "LastICCProfCreatorDir", lastICCProfCreatorDir);
+ keyFile.set_string("Dialogs", "LastCopyMovePath", lastCopyMovePath);
keyFile.set_boolean("Dialogs", "GimpPluginShowInfoDialog", gimpPluginShowInfoDialog);
keyFile.set_string("Lensfun", "DBDirectory", rtSettings.lensfunDbDirectory);
@@ -2508,36 +2514,17 @@ bool Options::is_parse_extention(Glib::ustring fname)
/*
* return true if fname ends with one of the retained image file extensions
*/
-bool Options::has_retained_extention(Glib::ustring fname)
+bool Options::has_retained_extention(const Glib::ustring& fname)
{
-
- Glib::ustring ext = getExtension(fname).lowercase();
-
- if (!ext.empty()) {
- // there is an extension to the filename
-
- // look out if it has one of the retained extensions
- for (unsigned int i = 0; i < parsedExtensions.size(); i++) {
- if (ext == parsedExtensions[i]) {
- return true;
- }
- }
- }
-
- return false;
+ return parsedExtensionsSet.find(getExtension(fname).lowercase()) != parsedExtensionsSet.end();
}
/*
* return true if ext is an enabled extension
*/
-bool Options::is_extention_enabled(Glib::ustring ext)
+bool Options::is_extention_enabled(const Glib::ustring& ext)
{
- for (int j = 0; j < (int)parseExtensions.size(); j++)
- if (parseExtensions[j].casefold() == ext.casefold()) {
- return j >= (int)parseExtensionsEnabled.size() || parseExtensionsEnabled[j];
- }
-
- return false;
+ return parsedExtensionsSet.find(ext.lowercase()) != parsedExtensionsSet.end();
}
Glib::ustring Options::getUserProfilePath()
diff --git a/rtgui/options.h b/rtgui/options.h
index 304a1e220..d1d14a11f 100644
--- a/rtgui/options.h
+++ b/rtgui/options.h
@@ -19,6 +19,7 @@
#ifndef _OPTIONS_
#define _OPTIONS_
+#include
#include
#include "../rtengine/rtengine.h"
#include
@@ -174,6 +175,7 @@ public:
Glib::ustring startupPath;
Glib::ustring profilePath; // can be an absolute or relative path; depending on this value, bundled profiles may not be found
bool useBundledProfiles; // only used if multiUser == true
+ Glib::ustring lastCopyMovePath;
Glib::ustring loadSaveProfilePath;
Glib::ustring lastSaveAsPath;
int saveAsDialogWidth;
@@ -259,6 +261,7 @@ public:
std::vector parseExtensions; // List containing all extensions type
std::vector parseExtensionsEnabled; // List of bool to retain extension or not
std::vector parsedExtensions; // List containing all retained extensions (lowercase)
+ std::set parsedExtensionsSet; // Set containing all retained extensions (lowercase)
std::vector tpOpen;
bool autoSaveTpOpen;
//std::vector crvOpen;
@@ -422,8 +425,8 @@ public:
Glib::ustring getGlobalProfilePath();
Glib::ustring findProfilePath (Glib::ustring &profName);
bool is_parse_extention (Glib::ustring fname);
- bool has_retained_extention (Glib::ustring fname);
- bool is_extention_enabled (Glib::ustring ext);
+ bool has_retained_extention (const Glib::ustring& fname);
+ bool is_extention_enabled (const Glib::ustring& ext);
bool is_defProfRawMissing();
bool is_bundledDefProfRawMissing();
bool is_defProfImgMissing();
diff --git a/rtgui/pcvignette.cc b/rtgui/pcvignette.cc
index 303ae5cfb..9c141d618 100644
--- a/rtgui/pcvignette.cc
+++ b/rtgui/pcvignette.cc
@@ -93,10 +93,6 @@ void PCVignette::adjusterChanged(Adjuster* a, double newval)
}
}
-void PCVignette::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void PCVignette::enabledChanged ()
{
diff --git a/rtgui/pcvignette.h b/rtgui/pcvignette.h
index 98d42a477..ce41ab75f 100644
--- a/rtgui/pcvignette.h
+++ b/rtgui/pcvignette.h
@@ -26,7 +26,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void setAdjusterBehavior (bool strengthadd, bool featheradd, bool roundnessadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
diff --git a/rtgui/perspective.cc b/rtgui/perspective.cc
index db2f32248..752b2289b 100644
--- a/rtgui/perspective.cc
+++ b/rtgui/perspective.cc
@@ -98,10 +98,6 @@ void PerspCorrection::adjusterChanged(Adjuster* a, double newval)
}
}
-void PerspCorrection::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void PerspCorrection::setAdjusterBehavior (bool badd)
{
diff --git a/rtgui/perspective.h b/rtgui/perspective.h
index 8038120fa..77fedc84a 100644
--- a/rtgui/perspective.h
+++ b/rtgui/perspective.h
@@ -40,7 +40,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool badd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
};
diff --git a/rtgui/placesbrowser.cc b/rtgui/placesbrowser.cc
index 0d20e9bad..9935064ee 100644
--- a/rtgui/placesbrowser.cc
+++ b/rtgui/placesbrowser.cc
@@ -309,7 +309,7 @@ void PlacesBrowser::dirSelected (const Glib::ustring& dirname, const Glib::ustri
void PlacesBrowser::addPressed ()
{
- if (lastSelectedDir == "") {
+ if (lastSelectedDir.empty()) {
return;
}
diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc
index 92cd06bc1..07e378832 100644
--- a/rtgui/preprocess.cc
+++ b/rtgui/preprocess.cc
@@ -101,10 +101,6 @@ void PreProcess::adjusterChanged(Adjuster* a, double newval)
}
}
-void PreProcess::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void PreProcess::hotPixelChanged ()
{
if (batchMode) {
diff --git a/rtgui/preprocess.h b/rtgui/preprocess.h
index 58cc2c2de..ced119d7d 100644
--- a/rtgui/preprocess.h
+++ b/rtgui/preprocess.h
@@ -48,7 +48,6 @@ public:
void hotPixelChanged();
void deadPixelChanged();
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
//void adjusterChanged (Adjuster* a, double newval);
diff --git a/rtgui/prsharpening.cc b/rtgui/prsharpening.cc
index c7c2ddf9f..b12da977d 100644
--- a/rtgui/prsharpening.cc
+++ b/rtgui/prsharpening.cc
@@ -350,10 +350,6 @@ void PrSharpening::adjusterChanged (Adjuster* a, double newval)
}
}
-void PrSharpening::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void PrSharpening::enabledChanged ()
{
if (listener) {
diff --git a/rtgui/prsharpening.h b/rtgui/prsharpening.h
index 0bceca856..d8a27c188 100644
--- a/rtgui/prsharpening.h
+++ b/rtgui/prsharpening.h
@@ -65,7 +65,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void edgesonly_toggled ();
void halocontrol_toggled ();
diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc
index a6b624562..003d8b629 100644
--- a/rtgui/rawcacorrection.cc
+++ b/rtgui/rawcacorrection.cc
@@ -144,10 +144,6 @@ void RAWCACorr::adjusterChanged(Adjuster* a, double newval)
}
}
-void RAWCACorr::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void RAWCACorr::checkBoxToggled (CheckBox* c, CheckValue newval)
{
if (c == caAutocorrect) {
diff --git a/rtgui/rawcacorrection.h b/rtgui/rawcacorrection.h
index 13db1d1e3..ab80bd3ea 100644
--- a/rtgui/rawcacorrection.h
+++ b/rtgui/rawcacorrection.h
@@ -50,7 +50,6 @@ public:
void trimValues (rtengine::procparams::ProcParams* pp) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void checkBoxToggled (CheckBox* c, CheckValue newval) override;
};
diff --git a/rtgui/rawexposure.cc b/rtgui/rawexposure.cc
index 599c8fd12..f8885eb76 100644
--- a/rtgui/rawexposure.cc
+++ b/rtgui/rawexposure.cc
@@ -76,10 +76,6 @@ void RAWExposure::adjusterChanged(Adjuster* a, double newval)
}
}
-void RAWExposure::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void RAWExposure::setBatchMode(bool batchMode)
{
ToolPanel::setBatchMode (batchMode);
diff --git a/rtgui/rawexposure.h b/rtgui/rawexposure.h
index f34776d19..95a15ade2 100644
--- a/rtgui/rawexposure.h
+++ b/rtgui/rawexposure.h
@@ -41,7 +41,6 @@ public:
void setBatchMode (bool batchMode) override;
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool pexposadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
};
diff --git a/rtgui/renamedlg.cc b/rtgui/renamedlg.cc
index f03df455f..14931817f 100644
--- a/rtgui/renamedlg.cc
+++ b/rtgui/renamedlg.cc
@@ -88,159 +88,3 @@ Glib::ustring RenameDialog::getNewName ()
return newName->get_text ();
}
-//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);
-//}
-
-//bool RenameDialog::rowSeparatorFunc (const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter)
-//{
-//
-// return iter->get_value (templateColumns.rowSeparator);
-//}
-
-//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());
-//}
-
-//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)
-//{
-//
-// list = Gtk::manage (new Gtk::ListViewText (1, false, Gtk::SELECTION_MULTIPLE));
-// list->set_headers_visible (false);
-// get_content_area ()->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 ("add-small.png")));
-// del->add (*Gtk::manage (new RTImage ("remove-small.png")));
-// hb->pack_start (*templ);
-// hb->pack_start (*add, Gtk::PACK_SHRINK, 2);
-// hb->pack_start (*del, Gtk::PACK_SHRINK, 2);
-//
-// get_content_area ()->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->remove_all_columns();
-//
-// for (size_t i = 0; i < options.renameTemplates.size(); i++) {
-// list->append (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 sel = list->get_selected ();
-//
-// for (size_t i = 0; i < sel.size(); i++) {
-// Glib::ustring toDel = list->get_text (sel[i]);
-// std::vector::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");
-//
-//}
-
-
diff --git a/rtgui/renamedlg.h b/rtgui/renamedlg.h
index 94972d575..ab51a43c6 100644
--- a/rtgui/renamedlg.h
+++ b/rtgui/renamedlg.h
@@ -30,62 +30,19 @@ class RenameDialog : public Gtk::Dialog
protected:
-// class TemplateColumns : public Gtk::TreeModel::ColumnRecord
-// {
-// public:
-// Gtk::TreeModelColumn tmplName;
-// Gtk::TreeModelColumn rowSeparator;
-// TemplateColumns()
-// {
-// add(tmplName);
-// add(rowSeparator);
-// }
-// };
-// TemplateColumns templateColumns;
-// Glib::RefPtr templateModel;
Gtk::Window* p;
Gtk::Label* oldName;
Gtk::Entry* newName;
-// Gtk::CheckButton* useTmpl;
-// MyComboBox* templates;
-// Gtk::Button* all;
const CacheImageData* imageData;
-// void fillTemplateList ();
-
public:
explicit RenameDialog (Gtk::Window* parent);
void initName (const Glib::ustring& iname, const CacheImageData* cid);
Glib::ustring getNewName ();
-// bool rowSeparatorFunc (const Glib::RefPtr& model, const Gtk::TreeModel::iterator& iter);
-// void tmplSelectionChanged ();
-// void useTemplToggled ();
-
-// bool isTemplSelected ();
-// Glib::ustring getActiveTemplate ();
-
-// 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 ();
-//};
-
#endif
diff --git a/rtgui/resize.cc b/rtgui/resize.cc
index 106715a17..3789d4693 100644
--- a/rtgui/resize.cc
+++ b/rtgui/resize.cc
@@ -273,10 +273,6 @@ void Resize::adjusterChanged(Adjuster* a, double newval)
}
}
-void Resize::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
int Resize::getComputedWidth()
{
diff --git a/rtgui/resize.h b/rtgui/resize.h
index 3c599808d..3bcfe3f84 100644
--- a/rtgui/resize.h
+++ b/rtgui/resize.h
@@ -46,7 +46,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void entryWChanged ();
void entryHChanged ();
void appliesToChanged ();
diff --git a/rtgui/retinex.cc b/rtgui/retinex.cc
index 544ace535..e074d7e9c 100644
--- a/rtgui/retinex.cc
+++ b/rtgui/retinex.cc
@@ -1362,10 +1362,6 @@ void Retinex::adjusterChanged(Adjuster* a, double newval)
}
}
-void Retinex::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Retinex::autoOpenCurve ()
{
cdshape->openIfNonlinear();
diff --git a/rtgui/retinex.h b/rtgui/retinex.h
index 8703ec607..1be511cb3 100644
--- a/rtgui/retinex.h
+++ b/rtgui/retinex.h
@@ -104,7 +104,6 @@ public:
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void trimValues (rtengine::procparams::ProcParams* pp) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void autoOpenCurve () override;
void medianmapChanged ();
void minmaxChanged (double cdma, double cdmin, double mini, double maxi, double Tmean, double Tsigma, double Tmin, double Tmax) override;
diff --git a/rtgui/rotate.cc b/rtgui/rotate.cc
index 9f5d665d5..822443cf8 100644
--- a/rtgui/rotate.cc
+++ b/rtgui/rotate.cc
@@ -96,10 +96,6 @@ void Rotate::adjusterChanged(Adjuster* a, double newval)
}
}
-void Rotate::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Rotate::straighten (double deg)
{
diff --git a/rtgui/rotate.h b/rtgui/rotate.h
index c23807361..c3d18fecb 100644
--- a/rtgui/rotate.h
+++ b/rtgui/rotate.h
@@ -44,7 +44,6 @@ public:
void straighten (double deg);
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool rotadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
void selectStraightPressed ();
diff --git a/rtgui/rtimage.cc b/rtgui/rtimage.cc
index 6a289ead6..cd687f252 100644
--- a/rtgui/rtimage.cc
+++ b/rtgui/rtimage.cc
@@ -197,8 +197,7 @@ void RTImage::updateImages()
Glib::RefPtr RTImage::createPixbufFromFile (const Glib::ustring& fileName)
{
Cairo::RefPtr imgSurf = createImgSurfFromFile(fileName);
- Glib::RefPtr pixbuf = Gdk::Pixbuf::create(imgSurf, 0, 0, imgSurf->get_width(), imgSurf->get_height());
- return pixbuf;
+ return Gdk::Pixbuf::create(imgSurf, 0, 0, imgSurf->get_width(), imgSurf->get_height());
}
Cairo::RefPtr RTImage::createImgSurfFromFile (const Glib::ustring& fileName)
diff --git a/rtgui/saveformatpanel.cc b/rtgui/saveformatpanel.cc
index de2240fc6..483565446 100644
--- a/rtgui/saveformatpanel.cc
+++ b/rtgui/saveformatpanel.cc
@@ -218,7 +218,3 @@ void SaveFormatPanel::adjusterChanged(Adjuster* a, double newval)
listener->formatChanged(sf_templates[act].second.format);
}
}
-
-void SaveFormatPanel::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
diff --git a/rtgui/saveformatpanel.h b/rtgui/saveformatpanel.h
index 48fa97e13..e25210b97 100644
--- a/rtgui/saveformatpanel.h
+++ b/rtgui/saveformatpanel.h
@@ -60,7 +60,6 @@ public:
void formatChanged ();
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
};
#endif
diff --git a/rtgui/shadowshighlights.cc b/rtgui/shadowshighlights.cc
index 6fdf6f2f3..f58790051 100644
--- a/rtgui/shadowshighlights.cc
+++ b/rtgui/shadowshighlights.cc
@@ -172,10 +172,6 @@ void ShadowsHighlights::adjusterChanged (Adjuster* a, double newval)
}
}
-void ShadowsHighlights::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ShadowsHighlights::enabledChanged ()
{
diff --git a/rtgui/shadowshighlights.h b/rtgui/shadowshighlights.h
index e04e2000a..5e56e0766 100644
--- a/rtgui/shadowshighlights.h
+++ b/rtgui/shadowshighlights.h
@@ -46,7 +46,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void setAdjusterBehavior (bool hadd, bool sadd);
diff --git a/rtgui/sharpenedge.cc b/rtgui/sharpenedge.cc
index 968cb75ad..9d6466543 100644
--- a/rtgui/sharpenedge.cc
+++ b/rtgui/sharpenedge.cc
@@ -147,10 +147,6 @@ void SharpenEdge::adjusterChanged(Adjuster* a, double newval)
}
}
-void SharpenEdge::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void SharpenEdge::setBatchMode(bool batchMode)
{
passes->showEditedCB ();
diff --git a/rtgui/sharpenedge.h b/rtgui/sharpenedge.h
index 8bf5647ed..a08c63b8a 100644
--- a/rtgui/sharpenedge.h
+++ b/rtgui/sharpenedge.h
@@ -51,7 +51,6 @@ public:
void trimValues (rtengine::procparams::ProcParams* pp) override;
void setAdjusterBehavior (bool amountadd, bool passadd);
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void enabledChanged () override;
void chanthree_toggled ();
diff --git a/rtgui/sharpening.cc b/rtgui/sharpening.cc
index 8a7b8e591..e698872dd 100644
--- a/rtgui/sharpening.cc
+++ b/rtgui/sharpening.cc
@@ -356,10 +356,6 @@ void Sharpening::adjusterChanged(Adjuster* a, double newval)
}
}
-void Sharpening::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Sharpening::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop)
{
}
diff --git a/rtgui/sharpening.h b/rtgui/sharpening.h
index 75ea083c9..b9f093aae 100644
--- a/rtgui/sharpening.h
+++ b/rtgui/sharpening.h
@@ -68,7 +68,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged () override;
void edgesonly_toggled ();
void halocontrol_toggled ();
diff --git a/rtgui/sharpenmicro.cc b/rtgui/sharpenmicro.cc
index 0b4142677..1d765652b 100644
--- a/rtgui/sharpenmicro.cc
+++ b/rtgui/sharpenmicro.cc
@@ -156,10 +156,6 @@ void SharpenMicro::adjusterChanged(Adjuster* a, double newval)
}
}
-void SharpenMicro::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void SharpenMicro::setBatchMode(bool batchMode)
{
amount->showEditedCB ();
diff --git a/rtgui/sharpenmicro.h b/rtgui/sharpenmicro.h
index 6dfccea85..8cb95b806 100644
--- a/rtgui/sharpenmicro.h
+++ b/rtgui/sharpenmicro.h
@@ -54,7 +54,6 @@ public:
void trimValues (rtengine::procparams::ProcParams* pp) override;
void setAdjusterBehavior (bool amountadd, bool contrastadd, bool uniformityadd);
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void enabledChanged () override;
void matrix_toggled ();
diff --git a/rtgui/softlight.cc b/rtgui/softlight.cc
index 0054f8f6d..90c3890cd 100644
--- a/rtgui/softlight.cc
+++ b/rtgui/softlight.cc
@@ -89,12 +89,6 @@ void SoftLight::adjusterChanged(Adjuster* a, double newval)
}
}
-
-void SoftLight::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
-
void SoftLight::enabledChanged ()
{
if (listener) {
diff --git a/rtgui/softlight.h b/rtgui/softlight.h
index a036592e4..f6ed8370d 100644
--- a/rtgui/softlight.h
+++ b/rtgui/softlight.h
@@ -41,7 +41,6 @@ public:
void setBatchMode(bool batchMode) override;
void adjusterChanged(Adjuster *a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void enabledChanged() override;
void setAdjusterBehavior(bool strengthAdd);
};
diff --git a/rtgui/thumbbrowserbase.cc b/rtgui/thumbbrowserbase.cc
index 334f00e51..cf3b36d03 100644
--- a/rtgui/thumbbrowserbase.cc
+++ b/rtgui/thumbbrowserbase.cc
@@ -563,7 +563,7 @@ void ThumbBrowserBase::configScrollBars ()
}
}
-void ThumbBrowserBase::arrangeFiles()
+void ThumbBrowserBase::arrangeFiles(bool checkfilter)
{
MYREADERLOCK(l, entryRW);
@@ -572,17 +572,17 @@ void ThumbBrowserBase::arrangeFiles()
//GThreadLock lock;
int rowHeight = 0;
-
- for (unsigned int i = 0; i < fd.size(); i++) {
- // apply filter
- fd[i]->filtered = !checkFilter (fd[i]);
+ for (const auto entry : fd) {
+ if (checkfilter) {
+ // apply filter
+ entry->filtered = !checkFilter(entry);
+ }
// compute size of the items
- if (!fd[i]->filtered && fd[i]->getMinimalHeight() > rowHeight) {
- rowHeight = fd[i]->getMinimalHeight ();
+ if (!entry->filtered) {
+ rowHeight = std::max(entry->getMinimalHeight(), rowHeight);
}
}
-
if (arrangement == TB_Horizontal) {
numOfCols = 1;
@@ -667,9 +667,9 @@ void ThumbBrowserBase::arrangeFiles()
}
if (ct < fd.size()) {
- fd[ct]->setPosition(currx, curry, colWidths[i % numOfCols], rowHeight);
+ fd[ct]->setPosition(currx, curry, colWidths[i], rowHeight);
fd[ct]->drawable = true;
- currx += colWidths[i % numOfCols];
+ currx += colWidths[i];
}
}
@@ -748,7 +748,7 @@ bool ThumbBrowserBase::Internal::on_query_tooltip (int x, int y, bool keyboard_t
}
}
- if (ttip != "") {
+ if (!ttip.empty()) {
tooltip->set_markup (ttip);
return true;
} else {
@@ -970,12 +970,12 @@ bool ThumbBrowserBase::Internal::on_scroll_event (GdkEventScroll* event)
}
-void ThumbBrowserBase::redraw ()
+void ThumbBrowserBase::redraw (bool checkfilter)
{
GThreadLock lock;
- arrangeFiles ();
- queue_draw ();
+ arrangeFiles(checkfilter);
+ queue_draw();
}
void ThumbBrowserBase::zoomChanged (bool zoomIn)
diff --git a/rtgui/thumbbrowserbase.h b/rtgui/thumbbrowserbase.h
index dcda30f92..ae561db43 100644
--- a/rtgui/thumbbrowserbase.h
+++ b/rtgui/thumbbrowserbase.h
@@ -179,7 +179,7 @@ protected:
std::set editedFiles;
- void arrangeFiles ();
+ void arrangeFiles (bool checkfilter = true);
void zoomChanged (bool zoomIn);
public:
@@ -201,7 +201,7 @@ public:
return fd;
}
void on_style_updated () override;
- void redraw (); // arrange files and draw area
+ void redraw (bool checkfilter = true); // arrange files and draw area
void refreshThumbImages (); // refresh thumbnail sizes, re-generate thumbnail images, arrange and draw
void refreshQuickThumbImages (); // refresh thumbnail sizes, re-generate thumbnail images, arrange and draw
void refreshEditedState (const std::set& efiles);
diff --git a/rtgui/thumbbrowserentrybase.cc b/rtgui/thumbbrowserentrybase.cc
index ed34c65c7..f9e2b41b5 100644
--- a/rtgui/thumbbrowserentrybase.cc
+++ b/rtgui/thumbbrowserentrybase.cc
@@ -157,9 +157,6 @@ ThumbBrowserEntryBase::ThumbBrowserEntryBase (const Glib::ustring& fname) :
collate_name(getPaddedName(dispname).casefold_collate_key()),
thumbnail(nullptr),
filename(fname),
- shortname(dispname),
- exifline(""),
- datetimeline(""),
selected(false),
drawable(false),
filtered(false),
@@ -404,7 +401,7 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
// draw date/time label
int tpos = fnlabh;
- if (options.fbShowDateTime && datetimeline != "") {
+ if (options.fbShowDateTime && !datetimeline.empty()) {
fn = w->create_pango_layout (datetimeline);
fn->set_width (textw * Pango::SCALE);
fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
@@ -415,7 +412,7 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
}
// draw basic exif info
- if (options.fbShowBasicExif && exifline != "") {
+ if (options.fbShowBasicExif && !exifline.empty()) {
fn = w->create_pango_layout (exifline);
fn->set_width (textw * Pango::SCALE);
fn->set_ellipsize (Pango::ELLIPSIZE_MIDDLE);
@@ -439,7 +436,6 @@ void ThumbBrowserEntryBase::getTextSizes (int& infow, int& infoh)
Gtk::Widget* w = parent->getDrawingArea ();
// calculate dimensions of the text based fields
- dispname = shortname;
Glib::RefPtr context = w->get_pango_context () ;
context->set_font_description (w->get_style_context()->get_font());
@@ -449,7 +445,7 @@ void ThumbBrowserEntryBase::getTextSizes (int& infow, int& infoh)
Pango::FontDescription fontd = context->get_font_description ();
fontd.set_weight (Pango::WEIGHT_BOLD);
context->set_font_description (fontd);
- Glib::RefPtr fn = w->create_pango_layout(shortname);
+ Glib::RefPtr fn = w->create_pango_layout(dispname);
fn->get_pixel_size (fnlabw, fnlabh);
// calculate cummulated height of all info fields
@@ -672,16 +668,15 @@ void ThumbBrowserEntryBase::setOffset (int x, int y)
}
}
-bool ThumbBrowserEntryBase::inside (int x, int y)
+bool ThumbBrowserEntryBase::inside (int x, int y) const
{
return x > ofsX + startx && x < ofsX + startx + exp_width && y > ofsY + starty && y < ofsY + starty + exp_height;
}
-void ThumbBrowserEntryBase::getPosInImgSpace (int x, int y, rtengine::Coord2D &coord)
+rtengine::Coord2D ThumbBrowserEntryBase::getPosInImgSpace (int x, int y) const
{
-
- coord.x = coord.y = -1.;
+ rtengine::Coord2D coord(-1., -1.);
if (preview) {
x -= ofsX + startx;
@@ -692,15 +687,16 @@ void ThumbBrowserEntryBase::getPosInImgSpace (int x, int y, rtengine::Coord2D &c
coord.y = double(y - prey) / double(preh);
}
}
+ return coord;
}
-bool ThumbBrowserEntryBase::insideWindow (int x, int y, int w, int h)
+bool ThumbBrowserEntryBase::insideWindow (int x, int y, int w, int h) const
{
return !(ofsX + startx > x + w || ofsX + startx + exp_width < x || ofsY + starty > y + h || ofsY + starty + exp_height < y);
}
-std::vector > ThumbBrowserEntryBase::getIconsOnImageArea()
+std::vector> ThumbBrowserEntryBase::getIconsOnImageArea()
{
return std::vector >();
}
@@ -710,12 +706,6 @@ std::vector > ThumbBrowserEntryBase::getSpecificityIco
return std::vector >();
}
-void ThumbBrowserEntryBase::getIconSize(int& w, int& h)
-{
- w = 0;
- h = 0;
-}
-
bool ThumbBrowserEntryBase::motionNotify (int x, int y)
{
@@ -734,12 +724,12 @@ bool ThumbBrowserEntryBase::releaseNotify (int button, int type, int bstate, int
return buttonSet ? buttonSet->releaseNotify (x, y) : false;
}
-Glib::ustring ThumbBrowserEntryBase::getToolTip (int x, int y)
+Glib::ustring ThumbBrowserEntryBase::getToolTip (int x, int y) const
{
- Glib::ustring tooltip = "";
+ Glib::ustring tooltip;
if (buttonSet) {
- tooltip = buttonSet->getToolTip (x, y);
+ tooltip = buttonSet->getToolTip(x, y);
}
// Always show the filename in the tooltip since the filename in the thumbnail could be truncated.
@@ -748,11 +738,11 @@ Glib::ustring ThumbBrowserEntryBase::getToolTip (int x, int y)
tooltip = dispname;
if (withFilename < WFNAME_FULL) {
- if (options.fbShowDateTime && datetimeline != "") {
+ if (options.fbShowDateTime && !datetimeline.empty()) {
tooltip += Glib::ustring("\n") + datetimeline;
}
- if (options.fbShowBasicExif && exifline != "") {
+ if (options.fbShowBasicExif && !exifline.empty()) {
tooltip += Glib::ustring("\n") + exifline;
}
}
diff --git a/rtgui/thumbbrowserentrybase.h b/rtgui/thumbbrowserentrybase.h
index 8237b7c6b..12e64c60d 100644
--- a/rtgui/thumbbrowserentrybase.h
+++ b/rtgui/thumbbrowserentrybase.h
@@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see .
*/
-#ifndef _THUMBNAILBROWSERENTRYBASE_
-#define _THUMBNAILBROWSERENTRYBASE_
+#pragma once
#include
@@ -82,8 +81,8 @@ protected:
Glib::RefPtr backBuffer;
bool bbSelected, bbFramed;
guint8* bbPreview;
- std::vector > bbIcons;
- std::vector > bbSpecificityIcons;
+ std::vector> bbIcons;
+ std::vector> bbSpecificityIcons;
CursorShape cursor_type;
void drawFrame (Cairo::RefPtr cr, const Gdk::RGBA& bg, const Gdk::RGBA& fg);
@@ -101,7 +100,6 @@ public:
// thumbnail preview properties:
Glib::ustring filename;
- Glib::ustring shortname;
Glib::ustring exifline;
Glib::ustring datetimeline;
@@ -117,61 +115,61 @@ public:
bool updatepriority;
eWithFilename withFilename;
- explicit ThumbBrowserEntryBase (const Glib::ustring& fname);
- virtual ~ThumbBrowserEntryBase ();
+ explicit ThumbBrowserEntryBase (const Glib::ustring& fname);
+ virtual ~ThumbBrowserEntryBase ();
void setParent (ThumbBrowserBase* l)
{
parent = l;
}
- void updateBackBuffer ();
- void resize (int h);
- virtual void draw (Cairo::RefPtr cc);
+ void updateBackBuffer ();
+ void resize (int h);
+ virtual void draw (Cairo::RefPtr cc);
- void addButtonSet (LWButtonSet* bs);
- int getMinimalHeight ()
+ void addButtonSet (LWButtonSet* bs);
+ int getMinimalHeight () const
{
return height;
}
- int getMinimalWidth ()
+ int getMinimalWidth () const
{
return width;
}
- int getEffectiveWidth () const
+ int getEffectiveWidth () const
{
return exp_width;
}
- int getEffectiveHeight () const
+ int getEffectiveHeight () const
{
return exp_height;
}
- int getPreviewHeight () const
+ int getPreviewHeight () const
{
return preh;
}
- int getStartX () const
+ int getStartX () const
{
return startx;
}
- int getStartY () const
+ int getStartY () const
{
return starty;
}
- int getX () const
+ int getX () const
{
return ofsX + startx;
}
- int getY () const
+ int getY () const
{
return ofsY + starty;
}
- bool inside (int x, int y);
- void getPosInImgSpace (int x, int y, rtengine::Coord2D &coord);
- bool insideWindow (int x, int y, int w, int h);
- void setPosition (int x, int y, int w, int h);
+ bool inside (int x, int y) const;
+ rtengine::Coord2D getPosInImgSpace (int x, int y) const;
+ bool insideWindow (int x, int y, int w, int h) const;
+ void setPosition (int x, int y, int w, int h);
void setOffset (int x, int y);
bool operator <(const ThumbBrowserEntryBase& other) const
@@ -179,33 +177,29 @@ public:
return collate_name < other.collate_name;
}
- ThumbBrowserEntryBase* getOriginal () const;
- void setOriginal (ThumbBrowserEntryBase* original);
-
- virtual void refreshThumbnailImage () {}
+ virtual void refreshThumbnailImage () = 0;
virtual void refreshQuickThumbnailImage () {}
- virtual void calcThumbnailSize () {}
+ virtual void calcThumbnailSize () = 0;
virtual void drawProgressBar (Glib::RefPtr win, const Gdk::RGBA& foregr, const Gdk::RGBA& backgr, int x, int w, int y, int h) {}
- virtual std::vector > getIconsOnImageArea ();
- virtual std::vector > getSpecificityIconsOnImageArea ();
- virtual void getIconSize (int& w, int& h);
+ virtual std::vector> getIconsOnImageArea ();
+ virtual std::vector> getSpecificityIconsOnImageArea ();
+ virtual void getIconSize (int& w, int& h) const = 0;
+
+ virtual bool motionNotify (int x, int y);
+ virtual bool pressNotify (int button, int type, int bstate, int x, int y);
+ virtual bool releaseNotify (int button, int type, int bstate, int x, int y);
+ virtual Glib::ustring getToolTip (int x, int y) const;
+
+ inline ThumbBrowserEntryBase* getOriginal() const
+ {
+ return original;
+ }
+
+ inline void setOriginal(ThumbBrowserEntryBase* original)
+ {
+ this->original = original;
+ }
- virtual bool motionNotify (int x, int y);
- virtual bool pressNotify (int button, int type, int bstate, int x, int y);
- virtual bool releaseNotify (int button, int type, int bstate, int x, int y);
- virtual Glib::ustring getToolTip (int x, int y);
};
-
-inline ThumbBrowserEntryBase* ThumbBrowserEntryBase::getOriginal() const
-{
- return original;
-}
-
-inline void ThumbBrowserEntryBase::setOriginal(ThumbBrowserEntryBase* original)
-{
- this->original = original;
-}
-
-#endif
diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc
index 39f4ca093..1ec10aacc 100644
--- a/rtgui/thumbnail.cc
+++ b/rtgui/thumbnail.cc
@@ -117,9 +117,9 @@ void Thumbnail::_generateThumbnailImage ()
imgRatio = -1.;
// generate thumbnail image
- Glib::ustring ext = getExtension (fname);
+ const std::string ext = getExtension(fname).lowercase();
- if (ext == "") {
+ if (ext.empty()) {
return;
}
@@ -127,20 +127,20 @@ void Thumbnail::_generateThumbnailImage ()
cfs.exifValid = false;
cfs.timeValid = false;
- if (ext.lowercase() == "jpg" || ext.lowercase() == "jpeg") {
+ if (ext == "jpg" || ext == "jpeg") {
infoFromImage (fname);
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, 1, pparams->wb.equal);
if (tpp) {
cfs.format = FT_Jpeg;
}
- } else if (ext.lowercase() == "png") {
+ } else if (ext == "png") {
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, 1, pparams->wb.equal);
if (tpp) {
cfs.format = FT_Png;
}
- } else if (ext.lowercase() == "tif" || ext.lowercase() == "tiff") {
+ } else if (ext == "tif" || ext == "tiff") {
infoFromImage (fname);
tpp = rtengine::Thumbnail::loadFromImage (fname, tw, th, 1, pparams->wb.equal);
@@ -716,7 +716,7 @@ void Thumbnail::generateExifDateTimeStrings ()
exifString = Glib::ustring::compose ("f/%1 %2s %3%4 %5mm", Glib::ustring(rtengine::FramesData::apertureToString(cfs.fnumber)), Glib::ustring(rtengine::FramesData::shutterToString(cfs.shutter)), M("QINFO_ISO"), cfs.iso, Glib::ustring::format(std::setw(3), std::fixed, std::setprecision(2), cfs.focalLen));
- if (options.fbShowExpComp && cfs.expcomp != "0.00" && cfs.expcomp != "") { // don't show exposure compensation if it is 0.00EV;old cache iles do not have ExpComp, so value will not be displayed.
+ if (options.fbShowExpComp && cfs.expcomp != "0.00" && !cfs.expcomp.empty()) { // don't show exposure compensation if it is 0.00EV;old cache files do not have ExpComp, so value will not be displayed.
exifString = Glib::ustring::compose ("%1 %2EV", exifString, cfs.expcomp); // append exposure compensation to exifString
}
diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc
index 91b268e9c..e0e475b4e 100644
--- a/rtgui/tonecurve.cc
+++ b/rtgui/tonecurve.cc
@@ -645,10 +645,6 @@ void ToneCurve::adjusterChanged(Adjuster* a, double newval)
}
}
-void ToneCurve::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void ToneCurve::neutral_pressed ()
{
// This method deselects auto levels and HL reconstruction auto
diff --git a/rtgui/tonecurve.h b/rtgui/tonecurve.h
index 29b484137..512dd4d5f 100644
--- a/rtgui/tonecurve.h
+++ b/rtgui/tonecurve.h
@@ -104,7 +104,6 @@ public:
float blendPipetteValues (CurveEditor *ce, float chan1, float chan2, float chan3) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void neutral_pressed ();
void autolevels_toggled ();
void clip_changed ();
diff --git a/rtgui/vibrance.cc b/rtgui/vibrance.cc
index 0069576e0..82944bb81 100644
--- a/rtgui/vibrance.cc
+++ b/rtgui/vibrance.cc
@@ -290,10 +290,6 @@ void Vibrance::adjusterChanged(Adjuster* a, double newval)
}
}
-void Vibrance::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Vibrance::adjusterChanged(ThresholdAdjuster* a, double newBottom, double newTop)
{
}
diff --git a/rtgui/vibrance.h b/rtgui/vibrance.h
index ed3e10059..81d811f14 100644
--- a/rtgui/vibrance.h
+++ b/rtgui/vibrance.h
@@ -61,7 +61,6 @@ public:
void trimValues (rtengine::procparams::ProcParams* pp) override;
void setAdjusterBehavior (bool pastelsadd, bool saturatedadd);
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void curveChanged () override;
void autoOpenCurve () override;
diff --git a/rtgui/vignetting.cc b/rtgui/vignetting.cc
index 799a4cff7..87a835625 100644
--- a/rtgui/vignetting.cc
+++ b/rtgui/vignetting.cc
@@ -129,10 +129,6 @@ void Vignetting::adjusterChanged(Adjuster* a, double newval)
}
}
-void Vignetting::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Vignetting::setAdjusterBehavior (bool amountadd, bool radiusadd, bool strengthadd, bool centeradd)
{
diff --git a/rtgui/vignetting.h b/rtgui/vignetting.h
index 5432b6178..edd818431 100644
--- a/rtgui/vignetting.h
+++ b/rtgui/vignetting.h
@@ -43,7 +43,6 @@ public:
void setBatchMode (bool batchMode) override;
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool amountadd, bool radiusadd, bool strengthadd, bool centeradd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
};
diff --git a/rtgui/wavelet.cc b/rtgui/wavelet.cc
index 942608414..bc59de087 100644
--- a/rtgui/wavelet.cc
+++ b/rtgui/wavelet.cc
@@ -2513,10 +2513,6 @@ void Wavelet::adjusterChanged(Adjuster* a, double newval)
}
}
-void Wavelet::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void Wavelet::enabledUpdateUI ()
{
if (!batchMode) {
diff --git a/rtgui/wavelet.h b/rtgui/wavelet.h
index 90a72f623..4df743fa7 100644
--- a/rtgui/wavelet.h
+++ b/rtgui/wavelet.h
@@ -46,7 +46,6 @@ public:
bool wavComputed_ ();
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
void autoOpenCurve () override;
void curveChanged (CurveEditor* ce) override;
void read (const rtengine::procparams::ProcParams* pp, const ParamsEdited* pedited = nullptr) override;
diff --git a/rtgui/whitebalance.cc b/rtgui/whitebalance.cc
index 86cbe2e7a..c550e4c2b 100644
--- a/rtgui/whitebalance.cc
+++ b/rtgui/whitebalance.cc
@@ -447,10 +447,6 @@ void WhiteBalance::adjusterChanged(Adjuster* a, double newval)
}
}
-void WhiteBalance::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void WhiteBalance::optChanged ()
{
Gtk::TreeModel::Row row = getActiveMethod();
diff --git a/rtgui/whitebalance.h b/rtgui/whitebalance.h
index 71dce989d..c77439ecf 100644
--- a/rtgui/whitebalance.h
+++ b/rtgui/whitebalance.h
@@ -110,7 +110,6 @@ public:
void spotPressed ();
void spotSizeChanged ();
void adjusterChanged(Adjuster* a, double newval) override;
- void adjusterAutoToggled(Adjuster* a, bool newval) override;
int getSize ();
void setWBProvider (WBProvider* p)
{
diff --git a/rtgui/xtransrawexposure.cc b/rtgui/xtransrawexposure.cc
index 93f6ee202..c4f7d7059 100644
--- a/rtgui/xtransrawexposure.cc
+++ b/rtgui/xtransrawexposure.cc
@@ -110,10 +110,6 @@ void XTransRAWExposure::adjusterChanged(Adjuster* a, double newval)
}
}
-void XTransRAWExposure::adjusterAutoToggled(Adjuster* a, bool newval)
-{
-}
-
void XTransRAWExposure::setBatchMode(bool batchMode)
{
ToolPanel::setBatchMode (batchMode);
diff --git a/rtgui/xtransrawexposure.h b/rtgui/xtransrawexposure.h
index 75bdbd0e2..54b3de767 100644
--- a/rtgui/xtransrawexposure.h
+++ b/rtgui/xtransrawexposure.h
@@ -43,7 +43,6 @@ public:
void setBatchMode (bool batchMode) override;
void setDefaults (const rtengine::procparams::ProcParams* defParams, const ParamsEdited* pedited = nullptr) override;
void adjusterChanged (Adjuster* a, double newval) override;
- void adjusterAutoToggled (Adjuster* a, bool newval) override;
void setAdjusterBehavior (bool pexblackadd);
void trimValues (rtengine::procparams::ProcParams* pp) override;
};