Fix some coverity issues

This commit is contained in:
heckflosse 2017-06-14 13:50:46 +02:00
parent 2fcb7d9665
commit 18076077c0
8 changed files with 15 additions and 52 deletions

View File

@ -255,29 +255,6 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t
set_keep_above (true); set_keep_above (true);
} }
Splash::Splash (Gtk::Window& parent, int maxtime) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, true)
{
splashImage = Gtk::manage(new SplashImage ());
get_content_area()->pack_start (*splashImage);
splashImage->show ();
if (maxtime > 0) {
Glib::signal_timeout().connect (sigc::mem_fun(*this, &Splash::on_timer), maxtime);
}
set_position (Gtk::WIN_POS_CENTER);
if (maxtime > 0) {
set_decorated (false);
}
add_events(Gdk::BUTTON_RELEASE_MASK);
set_resizable (false);
set_keep_above (true);
}
bool Splash::on_timer () bool Splash::on_timer ()
{ {

View File

@ -48,7 +48,6 @@ private:
Gtk::ScrolledWindow* releaseNotesSW; Gtk::ScrolledWindow* releaseNotesSW;
public: public:
Splash (Gtk::Window& parent, int maxtime);
explicit Splash (Gtk::Window& parent); explicit Splash (Gtk::Window& parent);
bool hasReleaseNotes() bool hasReleaseNotes()

View File

@ -25,7 +25,7 @@
using namespace std; using namespace std;
ThumbBrowserBase::ThumbBrowserBase () ThumbBrowserBase::ThumbBrowserBase ()
: location(THLOC_FILEBROWSER), inspector(nullptr), isInspectorActive(false), lastClicked(nullptr), previewHeight(options.thumbSize), numOfCols(1) : location(THLOC_FILEBROWSER), inspector(nullptr), isInspectorActive(false), eventTime(0), lastClicked(nullptr), previewHeight(options.thumbSize), numOfCols(1)
{ {
inW = -1; inW = -1;
inH = -1; inH = -1;

View File

@ -21,7 +21,7 @@
#include "multilangmgr.h" #include "multilangmgr.h"
#include "guiutils.h" #include "guiutils.h"
ToolBar::ToolBar () : showColPickers(true), listener (nullptr) ToolBar::ToolBar () : showColPickers(true), listener (nullptr), pickerListener(nullptr)
{ {
editingMode = false; editingMode = false;

View File

@ -28,7 +28,7 @@
using namespace rtengine::procparams; using namespace rtengine::procparams;
ToolPanelCoordinator::ToolPanelCoordinator () : ipc(nullptr), editDataProvider(nullptr) ToolPanelCoordinator::ToolPanelCoordinator () : ipc(nullptr), hasChanged(false), editDataProvider(nullptr)
{ {
exposurePanel = Gtk::manage (new ToolVBox ()); exposurePanel = Gtk::manage (new ToolVBox ());
@ -509,11 +509,11 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
toneCurve->enableAll (); toneCurve->enableAll ();
toneCurve->enableListener (); toneCurve->enableListener ();
if (ipc) {
const rtengine::ImageMetaData* pMetaData = ipc->getInitialImage()->getMetaData(); const rtengine::ImageMetaData* pMetaData = ipc->getInitialImage()->getMetaData();
exifpanel->setImageData (pMetaData); exifpanel->setImageData (pMetaData);
iptcpanel->setImageData (pMetaData); iptcpanel->setImageData (pMetaData);
if (ipc) {
ipc->setAutoExpListener (toneCurve); ipc->setAutoExpListener (toneCurve);
ipc->setAutoCamListener (colorappearance); ipc->setAutoCamListener (colorappearance);
ipc->setAutoBWListener (blackwhite); ipc->setAutoBWListener (blackwhite);
@ -526,12 +526,12 @@ void ToolPanelCoordinator::initImage (rtengine::StagedImageProcessor* ipc_, bool
ipc->setSizeListener (crop); ipc->setSizeListener (crop);
ipc->setSizeListener (resize); ipc->setSizeListener (resize);
ipc->setImageTypeListener (this); ipc->setImageTypeListener (this);
}
flatfield->setShortcutPath(Glib::path_get_dirname(ipc->getInitialImage()->getFileName())); flatfield->setShortcutPath(Glib::path_get_dirname(ipc->getInitialImage()->getFileName()));
icm->setRawMeta (raw, (const rtengine::ImageData*)pMetaData); icm->setRawMeta (raw, (const rtengine::ImageData*)pMetaData);
lensProf->setRawMeta (raw, pMetaData); lensProf->setRawMeta (raw, pMetaData);
}
toneCurve->setRaw (raw); toneCurve->setRaw (raw);
hasChanged = true; hasChanged = true;

View File

@ -170,19 +170,6 @@ protected:
TextOrIcon* toiM; TextOrIcon* toiM;
TextOrIcon* toiW; TextOrIcon* toiW;
Gtk::Label* labelE;
Gtk::Label* labelD;
Gtk::Label* labelC;
Gtk::Label* labelT;
Gtk::Label* labelR;
Gtk::Label* labelM;
Gtk::Image* imgIconE;
Gtk::Image* imgIconD;
Gtk::Image* imgIconC;
Gtk::Image* imgIconT;
Gtk::Image* imgIconR;
Gtk::Image* imgIconM;
Gtk::Image* imgPanelEnd[6]; Gtk::Image* imgPanelEnd[6];
Gtk::VBox* vbPanelEnd[6]; Gtk::VBox* vbPanelEnd[6];

View File

@ -428,7 +428,7 @@ void WhiteBalance::optChanged ()
equal->setEditedState (UnEdited); equal->setEditedState (UnEdited);
tempBias->setEditedState (UnEdited); tempBias->setEditedState (UnEdited);
} else { } else {
int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI); unsigned int methodId = findWBEntryId (row[methodColumns.colLabel], WBLT_GUI);
WBEntry* currMethod = WBParams::wbEntries[methodId]; WBEntry* currMethod = WBParams::wbEntries[methodId];
tempBias->set_sensitive(currMethod->type == WBT_AUTO); tempBias->set_sensitive(currMethod->type == WBT_AUTO);
@ -792,7 +792,7 @@ void WhiteBalance::cache_customWB(int temp, double green)
cache_customGreen (green); cache_customGreen (green);
} }
int WhiteBalance::findWBEntryId (Glib::ustring label, enum WB_LabelType lblType) unsigned int WhiteBalance::findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType)
{ {
for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) { for (unsigned int i = 0; i < WBParams::wbEntries.size(); i++) {
if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) { if (label == (lblType == WBLT_GUI ? WBParams::wbEntries[i]->GUILabel : WBParams::wbEntries[i]->ppLabel)) {
@ -800,7 +800,7 @@ int WhiteBalance::findWBEntryId (Glib::ustring label, enum WB_LabelType lblType)
} }
} }
return -1; return 0; // default to camera wb
} }
WBEntry* WhiteBalance::findWBEntry (Glib::ustring label, enum WB_LabelType lblType) WBEntry* WhiteBalance::findWBEntry (Glib::ustring label, enum WB_LabelType lblType)

View File

@ -86,7 +86,7 @@ protected:
int _setActiveMethod (Glib::ustring &label, Gtk::TreeModel::Children &children); int _setActiveMethod (Glib::ustring &label, Gtk::TreeModel::Children &children);
Gtk::TreeModel::Row getActiveMethod (); Gtk::TreeModel::Row getActiveMethod ();
int findWBEntryId (Glib::ustring label, enum WB_LabelType lblType = WBLT_GUI); unsigned int findWBEntryId (const Glib::ustring &label, enum WB_LabelType lblType = WBLT_GUI);
rtengine::procparams::WBEntry* findWBEntry (Glib::ustring label, enum WB_LabelType lblType = WBLT_GUI); rtengine::procparams::WBEntry* findWBEntry (Glib::ustring label, enum WB_LabelType lblType = WBLT_GUI);
public: public: