Fixed: Crash the ovqt in ps editor.

This commit is contained in:
dnk-88 2011-05-09 20:51:29 +03:00
parent bfa32f26e1
commit 787ebd0f6f
2 changed files with 7 additions and 4 deletions

View file

@ -153,7 +153,7 @@ sint main(int argc, char **argv)
#if !defined(NL_OS_MAC) #if !defined(NL_OS_MAC)
pluginPaths << settings->value("PluginPath", "./plugins").toString(); pluginPaths << settings->value("PluginPath", "./plugins").toString();
#else #else
pluginPaths << qApp->applicationDirPath() + QString("/../PlugIns/ovqt"); pluginPaths << settings->value("PluginPath", qApp->applicationDirPath() + QString("/../PlugIns/ovqt")).toString();
#endif #endif
pluginManager.setPluginPaths(pluginPaths); pluginManager.setPluginPaths(pluginPaths);

View file

@ -222,24 +222,27 @@ void CParticleWorkspaceDialog::touchPSState(CParticleTreeItem *item)
void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index) void CParticleWorkspaceDialog::clickedItem(const QModelIndex & index)
{ {
if (_currentItem != NULL) if (_currentItem != 0)
_treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL); _treeModel->getOwnerNode(_currentItem)->getPSPointer()->setCurrentEditedElement(NULL);
_currentItem = static_cast<CParticleTreeItem *>(index.internalPointer()); _currentItem = static_cast<CParticleTreeItem *>(index.internalPointer());
if (_currentItem == 0)
return;
if (index.flags() != Qt::NoItemFlags) if (index.flags() != Qt::NoItemFlags)
_PropertyDialog->setCurrentEditedElement(_currentItem); _PropertyDialog->setCurrentEditedElement(_currentItem);
if ((_currentItem->itemType() == ItemType::Workspace) || if ((_currentItem->itemType() == ItemType::Workspace) ||
(_currentItem->itemType() == ItemType::ParticleSystemNotLoaded)) (_currentItem->itemType() == ItemType::ParticleSystemNotLoaded))
_currentItem = NULL; _currentItem = 0;
} }
void CParticleWorkspaceDialog::customContextMenu() void CParticleWorkspaceDialog::customContextMenu()
{ {
if (!Modules::psEdit().getParticleWorkspace()) return; if (!Modules::psEdit().getParticleWorkspace()) return;
clickedItem(_ui.treeView->currentIndex()); clickedItem(_ui.treeView->currentIndex());
if (_currentItem == NULL) return; if (_currentItem == 0) return;
QMenu *popurMenu = new QMenu(this); QMenu *popurMenu = new QMenu(this);
switch (_currentItem->itemType()) switch (_currentItem->itemType())
{ {