From b6f2c4cf9cfd63d936a8b3d053aaf678cd9ff251 Mon Sep 17 00:00:00 2001 From: Andreas Schenk <andreas_schenk@hms.harvard.edu> Date: Fri, 27 May 2011 16:03:17 -0400 Subject: [PATCH] fixed BZDNG-170 (code completion issues) --- modules/gui/src/python_shell/python_completer.cc | 1 - .../gui/src/python_shell/python_namespace_tree_item.cc | 10 ++++++++-- .../gui/src/python_shell/python_namespace_tree_item.hh | 4 ++-- .../src/python_shell/python_namespace_tree_model.cc | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/gui/src/python_shell/python_completer.cc b/modules/gui/src/python_shell/python_completer.cc index 2fe2ba8ca..9ec41df66 100644 --- a/modules/gui/src/python_shell/python_completer.cc +++ b/modules/gui/src/python_shell/python_completer.cc @@ -65,7 +65,6 @@ QString PythonCompleter::pathFromIndex(const QModelIndex & index) const void PythonCompleter::SetCompletionPrefix(const QString& prefix) { dynamic_cast<PythonNamespaceTreeModel*>(this->model())->Reset(); - this->setCompletionPrefix(""); this->setCompletionPrefix(prefix); } diff --git a/modules/gui/src/python_shell/python_namespace_tree_item.cc b/modules/gui/src/python_shell/python_namespace_tree_item.cc index 5a5cd4bba..465c99f6f 100644 --- a/modules/gui/src/python_shell/python_namespace_tree_item.cc +++ b/modules/gui/src/python_shell/python_namespace_tree_item.cc @@ -47,8 +47,11 @@ void PythonNamespaceTreeItem::DeleteChildren() children_.clear(); initialized_=false; } -unsigned int PythonNamespaceTreeItem::ChildCount() const +unsigned int PythonNamespaceTreeItem::ChildCount() { + if(CanFetchMore()){ + FetchMore(); + } return children_.size(); } @@ -56,8 +59,11 @@ PythonNamespaceTreeItem* PythonNamespaceTreeItem::GetParent() const { return parent_; } -PythonNamespaceTreeItem* PythonNamespaceTreeItem::GetChild(unsigned int index) const +PythonNamespaceTreeItem* PythonNamespaceTreeItem::GetChild(unsigned int index) { + if(CanFetchMore()){ + FetchMore(); + } return children_.value(index); } unsigned int PythonNamespaceTreeItem::GetRow() const diff --git a/modules/gui/src/python_shell/python_namespace_tree_item.hh b/modules/gui/src/python_shell/python_namespace_tree_item.hh index c428b075c..c1cee49ef 100644 --- a/modules/gui/src/python_shell/python_namespace_tree_item.hh +++ b/modules/gui/src/python_shell/python_namespace_tree_item.hh @@ -35,8 +35,8 @@ public: PythonNamespaceTreeItem(const bp::object& ns, const QString& name, PythonNamespaceTreeItem* parent=0); virtual ~PythonNamespaceTreeItem(); PythonNamespaceTreeItem* GetParent() const; - PythonNamespaceTreeItem* GetChild(unsigned int index) const; - unsigned int ChildCount() const; + PythonNamespaceTreeItem* GetChild(unsigned int index); + unsigned int ChildCount(); void DeleteChildren(); unsigned int GetRow() const; QString GetName() const; diff --git a/modules/gui/src/python_shell/python_namespace_tree_model.cc b/modules/gui/src/python_shell/python_namespace_tree_model.cc index 044e32960..6b05294f8 100644 --- a/modules/gui/src/python_shell/python_namespace_tree_model.cc +++ b/modules/gui/src/python_shell/python_namespace_tree_model.cc @@ -19,7 +19,7 @@ #include "python_interpreter.hh" #include "python_namespace_tree_model.hh" #include "python_namespace_tree_item.hh" -#include <QDebug> + namespace ost{namespace gui{ PythonNamespaceTreeModel::PythonNamespaceTreeModel(): -- GitLab