Fixed: Crash the ovqt in ps editor.
This commit is contained in:
parent
cba0e9844d
commit
3079e1d2f7
2 changed files with 7 additions and 4 deletions
|
@ -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);
|
||||||
|
|
|
@ -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())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue