Commit f649796a authored by Jan Möbius's avatar Jan Möbius

Fixed various cppcheck warnings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16348 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f29daa53
...@@ -697,10 +697,12 @@ void Core::slotAddEmptyObjectMenu() { ...@@ -697,10 +697,12 @@ void Core::slotAddEmptyObjectMenu() {
++currentType; ++currentType;
} }
static addEmptyWidget* widget = 0;
if (supportedTypes().size() != 0) { if (supportedTypes().size() != 0) {
static addEmptyWidget* widget = 0;
if ( !widget ){ if ( !widget ){
widget = new addEmptyWidget(types,typeNames); widget = new addEmptyWidget(types,typeNames);
widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() ); widget->setWindowIcon( OpenFlipper::Options::OpenFlipperIcon() );
......
...@@ -226,7 +226,6 @@ QWidget *Core::getToolbox(QString _pluginName, QString _toolboxName) { ...@@ -226,7 +226,6 @@ QWidget *Core::getToolbox(QString _pluginName, QString _toolboxName) {
} }
if (pluginIt == plugins_.end()) return 0; if (pluginIt == plugins_.end()) return 0;
std::vector<std::pair<QString , QWidget*> >::const_iterator widgetIt;
for (std::vector<std::pair<QString , QWidget*> >::const_iterator it = pluginIt->toolboxWidgets.begin(), it_end = pluginIt->toolboxWidgets.end(); for (std::vector<std::pair<QString , QWidget*> >::const_iterator it = pluginIt->toolboxWidgets.begin(), it_end = pluginIt->toolboxWidgets.end();
it != it_end; ++it) { it != it_end; ++it) {
if (it->first == _toolboxName) if (it->first == _toolboxName)
......
...@@ -333,11 +333,13 @@ bool LicenseManager::authenticate() { ...@@ -333,11 +333,13 @@ bool LicenseManager::authenticate() {
// Get windows product id // Get windows product id
// =============================================================================================== // ===============================================================================================
QString productId = "-";
#ifdef WIN32 #ifdef WIN32
QSettings registryProduct("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", QSettings::NativeFormat); QSettings registryProduct("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", QSettings::NativeFormat);
productId = registryProduct.value( "ProductId", "Unknown" ).toString(); QString productId = registryProduct.value( "ProductId", "Unknown" ).toString();
#else
QString productId = "-";
#endif #endif
QString productHash = QCryptographicHash::hash ( productId.toAscii() , QCryptographicHash::Sha1 ).toHex(); QString productHash = QCryptographicHash::hash ( productId.toAscii() , QCryptographicHash::Sha1 ).toHex();
......
...@@ -180,9 +180,10 @@ void ObjectPickDialog::slotMouseEventClick(QMouseEvent * _event, bool /*_double* ...@@ -180,9 +180,10 @@ void ObjectPickDialog::slotMouseEventClick(QMouseEvent * _event, bool /*_double*
{ {
unsigned int nodeIdx, targetIdx; unsigned int nodeIdx, targetIdx;
BaseObjectData *obj;
if (viewer_->viewer()->pick(ACG::SceneGraph::PICK_ANYTHING, _event->pos(), nodeIdx, targetIdx)) if (viewer_->viewer()->pick(ACG::SceneGraph::PICK_ANYTHING, _event->pos(), nodeIdx, targetIdx))
{ {
BaseObjectData *obj = 0;
if (PluginFunctions::getPickedObject (nodeIdx, obj)) if (PluginFunctions::getPickedObject (nodeIdx, obj))
{ {
if (!obj->flag ("vsi_objectId_disabled")) if (!obj->flag ("vsi_objectId_disabled"))
...@@ -204,10 +205,12 @@ unsigned int ObjectPickDialog::selectedId() ...@@ -204,10 +205,12 @@ unsigned int ObjectPickDialog::selectedId()
void ObjectPickDialog::selectedId(unsigned int _id) void ObjectPickDialog::selectedId(unsigned int _id)
{ {
BaseObject *obj = 0, *obj2 = 0; BaseObject* obj = 0;
if (PluginFunctions::getObject(_id, obj)) if (PluginFunctions::getObject(_id, obj))
{ {
BaseObject* obj2 = 0;
if (selectedId_ != _id && PluginFunctions::getObject(selectedId_, obj2)) if (selectedId_ != _id && PluginFunctions::getObject(selectedId_, obj2))
{ {
obj2->setFlag ("vsi_objectId_selected", false); obj2->setFlag ("vsi_objectId_selected", false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment