Changed: Constification of catches

This commit is contained in:
kervala 2016-11-19 21:15:58 +01:00
parent 1840d26972
commit 65c74399b0
10 changed files with 23 additions and 23 deletions

View file

@ -590,7 +590,7 @@ void CMainFrame::OnFileLoadconfig()
}
}
}
catch (Exception& e)
catch (const Exception& e)
{
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
}
@ -762,7 +762,7 @@ void CMainFrame::OnFileSaveconfig()
{
ObjView->serial(file);
}
catch (Exception& e)
catch (const Exception& e)
{
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
}

View file

@ -112,7 +112,7 @@ void CMeshDlg::OnBrowseShape()
m_ShapeName = (std::string(fname) + ext).c_str();
touchPSState();
}
catch (NLMISC::Exception &e)
catch (const NLMISC::Exception &e)
{
MessageBox(utf8ToTStr(e.what()), _T("shape loading error"));
}

View file

@ -534,7 +534,7 @@ void CObjectViewer::loadConfigFile()
if (var = cf.getVarPtr("cloud_wind_speed"))
_CSS.WindSpeed = var->asFloat();
}
catch (Exception& e)
catch (const Exception& e)
{
::MessageBox (NULL, utf8ToTStr(e.what()), _T("Objectviewer.cfg"), MB_OK|MB_ICONEXCLAMATION);
}
@ -822,7 +822,7 @@ bool CObjectViewer::initUI (HWND parent)
{
iF.serial(SchemeManager);
}
catch (NLMISC::EStream &e)
catch (const NLMISC::EStream &e)
{
std::string msg = toString("Unable to load the default scheme bank file : %s", e.what());
::MessageBox(NULL, utf8ToTStr(msg), _T("Object Viewer"), MB_ICONEXCLAMATION);
@ -1896,7 +1896,7 @@ bool CObjectViewer::loadInstanceGroup(const std::string &igFilename)
// Append the ig.
addInstanceGroup(ig);
}
catch (Exception& e)
catch (const Exception& e)
{
// clean
delete ig;
@ -1961,7 +1961,7 @@ bool CObjectViewer::loadMesh (std::vector<std::string> &meshFilename, const std:
// Add the shape
shapeSkel=streamShape.getShapePointer();
}
catch (Exception& e)
catch (const Exception& e)
{
_MainFrame->MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
@ -2014,7 +2014,7 @@ bool CObjectViewer::loadMesh (std::vector<std::string> &meshFilename, const std:
// Add the shape
shapeMesh=streamShape.getShapePointer();
}
catch (Exception& e)
catch (const Exception& e)
{
_MainFrame->MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
continue;
@ -3219,7 +3219,7 @@ bool CObjectViewer::createVegetableLandscape()
_VegetableCollisionManager->setLandscape(&_VegetableLandscape->Landscape);
_VegetableCollisionEntity= _VegetableCollisionManager->createEntity();
}
catch (Exception &e)
catch (const Exception &e)
{
// close the progress dialog
dlgProgress.DestroyWindow();
@ -3776,7 +3776,7 @@ void CObjectViewer::shootScene()
break;
}
}
catch (Exception &e)
catch (const Exception &e)
{
std::string message = toString("Error during writing of the file %s: %s", filenamefinal.c_str(), e.what());
_MainFrame->MessageBox (utf8ToTStr(message), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);

View file

@ -419,7 +419,7 @@ bool CParticleDlg::savePSAs(HWND parent, CParticleWorkspace::CNode &psNode ,cons
psNode.setModified(false);
setStatusBarText(CString(fullPath.c_str()) + " " + getStrRsc(IDS_SAVED));
}
catch (NLMISC::Exception &e)
catch (const NLMISC::Exception &e)
{
if (askToContinueWhenError)
{
@ -468,7 +468,7 @@ bool CParticleDlg::loadPS(HWND parent, CParticleWorkspace::CNode &psNode, TLoadP
setStatusBarText(CString(psNode.getFullPath().c_str()) + " " + getStrRsc(IDS_LOADED));
}
}
catch (NLMISC::Exception &e)
catch (const NLMISC::Exception &e)
{
switch(behav)
{
@ -547,7 +547,7 @@ void CParticleDlg::OnCreateNewPsWorkspace()
{
newPW->save();
}
catch(NLMISC::EStream &e)
catch(const NLMISC::EStream &e)
{
MessageBox(utf8ToTStr(e.what()), getStrRsc(IDS_ERROR), MB_ICONEXCLAMATION);
}
@ -583,7 +583,7 @@ void CParticleDlg::loadWorkspace(const std::string &fullPath)
newPW->load();
setStatusBarText(CString(newPW->getFilename().c_str()) + " " + getStrRsc(IDS_LOADED));
}
catch(NLMISC::EStream &e)
catch(const NLMISC::EStream &e)
{
MessageBox(utf8ToTStr(e.what()), getStrRsc(IDS_ERROR), MB_ICONEXCLAMATION);
setStatusBarText(CString(e.what()));
@ -633,7 +633,7 @@ void CParticleDlg::saveWorkspaceStructure()
_PW->save();
setStatusBarText(CString(_PW->getFilename().c_str()) + " " + getStrRsc(IDS_SAVED));
}
catch(NLMISC::EStream &e)
catch(const NLMISC::EStream &e)
{
localizedMessageBox(*this, utf8ToTStr(e.what()), IDS_ERROR, MB_ICONEXCLAMATION);
setStatusBarText(CString(e.what()));

View file

@ -1037,7 +1037,7 @@ BOOL CParticleTreeCtrl::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHA
return false;
}
}
catch(NLMISC::EStream &e)
catch(const NLMISC::EStream &e)
{
MessageBox(utf8ToTStr(e.what()), getStrRsc(IDS_ERROR), MB_OK|MB_ICONEXCLAMATION);
return TRUE;

View file

@ -107,7 +107,7 @@ void CSchemeBankDlg::OnSaveBank()
iF.open(tStrToUtf8(fd.GetFileName()));
iF.serial(SchemeManager);
}
catch (std::exception &e)
catch (const std::exception &e)
{
std::string message = NLMISC::toString("Error saving scheme bank : %s", e.what());
MessageBox(utf8ToTStr(message), _T("Object viewer"), MB_ICONEXCLAMATION | MB_OK);
@ -134,7 +134,7 @@ void CSchemeBankDlg::OnLoadBank()
iF.serial(sm);
SchemeManager.swap(sm);
}
catch (std::exception &e)
catch (const std::exception &e)
{
std::string message = NLMISC::toString("Error loading scheme bank : %s", e.what());
MessageBox(utf8ToTStr(message), _T("Object viewer"), MB_ICONEXCLAMATION | MB_OK);

View file

@ -1310,7 +1310,7 @@ bool CSkeletonScaleDlg::saveSkelScaleInStream(NLMISC::IStream &f)
sint32 ver= f.serialVersion(0);
f.serialCont(boneScales);
}
catch(NLMISC::EStream &)
catch(const NLMISC::EStream &)
{
MessageBox(_T("Failed to save file!"));
return false;
@ -1356,7 +1356,7 @@ bool CSkeletonScaleDlg::loadSkelScaleFromStream(NLMISC::IStream &f)
// and update display
refreshTextViews();
}
catch(NLMISC::EStream &)
catch(const NLMISC::EStream &)
{
MessageBox(_T("Failed to save file!"));
return false;

View file

@ -234,7 +234,7 @@ void CSoundAnimView::save()
{
CSoundAnimManager::instance()->saveAnimation(anim, filename);
}
catch (Exception& e)
catch (const Exception& e)
{
MessageBox (utf8ToTStr(e.what()), _T("NeL object viewer"), MB_OK|MB_ICONEXCLAMATION);
}

View file

@ -192,7 +192,7 @@ void CTextureChooser::OnBrowseTexture()
_Texture = tf;
textureToBitmap();
}
catch (NLMISC::Exception &e)
catch (const NLMISC::Exception &e)
{
MessageBox(utf8ToTStr(e.what()), _T("error loading texture"));
}

View file

@ -93,7 +93,7 @@ MissionCompilerMainWindow::MissionCompilerMainWindow(QWidget *parent) :
try{
m_ligoConfig.readPrimitiveClass(NLMISC::CPath::lookup("world_editor_classes.xml").c_str(), false);
}
catch( NLMISC::Exception &e )
catch(const NLMISC::Exception &e)
{
nlinfo( "Exception occurred during Mission Compiler LIGO startup: %s", e.what() );
}