From 787ebd0f6f013350127243b16a37c6ddd440f231 Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Mon, 9 May 2011 20:51:29 +0300 Subject: [PATCH] Fixed: Crash the ovqt in ps editor. --- code/nel/tools/3d/object_viewer_qt/src/main.cpp | 2 +- .../plugins/object_viewer/particle_workspace_dialog.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index 8588c148a..15173fa5c 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -153,7 +153,7 @@ sint main(int argc, char **argv) #if !defined(NL_OS_MAC) pluginPaths << settings->value("PluginPath", "./plugins").toString(); #else - pluginPaths << qApp->applicationDirPath() + QString("/../PlugIns/ovqt"); + pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/ovqt")).toString(); #endif pluginManager.setPluginPaths(pluginPaths); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp index 50698198b..4d6d35c9f 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/object_viewer/particle_workspace_dialog.cpp @@ -222,24 +222,27 @@ void CParticleWorkspaceDialog::touchPSState(CParticleTreeItem *item) void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index) { - if (_currentItem != NULL) + if (_currentItem != 0) _treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL); _currentItem = static_cast(index.internalPointer()); + + if (_currentItem == 0) + return; if (index.flags() != Qt::NoItemFlags) _PropertyDialog->setCurrentEditedElement(_currentItem); if ((_currentItem->itemType() == ItemType::Workspace) || (_currentItem->itemType() == ItemType::ParticleSystemNotLoaded)) - _currentItem = NULL; + _currentItem = 0; } void CParticleWorkspaceDialog::customContextMenu() { if (!Modules::psEdit().getParticleWorkspace()) return; clickedItem(_ui.treeView->currentIndex()); - if (_currentItem == NULL) return; + if (_currentItem == 0) return; QMenu *popurMenu = new QMenu(this); switch (_currentItem->itemType()) {