From: <ibr...@us...> - 2012-06-21 13:42:48
|
Revision: 4359 http://tora.svn.sourceforge.net/tora/?rev=4359&view=rev Author: ibre5041 Date: 2012-06-21 13:42:37 +0000 (Thu, 21 Jun 2012) Log Message: ----------- more tooltips Modified Paths: -------------- branches/tora3/src/connection/tooracleconnection.cpp Modified: branches/tora3/src/connection/tooracleconnection.cpp =================================================================== --- branches/tora3/src/connection/tooracleconnection.cpp 2012-06-20 17:09:21 UTC (rev 4358) +++ branches/tora3/src/connection/tooracleconnection.cpp 2012-06-21 13:42:37 UTC (rev 4359) @@ -62,6 +62,7 @@ #include <QInputDialog> #include <QLineEdit> #include <QApplication> +#include <QVariant> #include <iomanip> void ThrowException(const ::trotl::OciException &exc) @@ -320,44 +321,50 @@ switch (d->whatIsThis()) { case ::trotl::Describe::O_SYNONYM: + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_PUBLIC_SYNONYM: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_VIEW: - ;; - break; case ::trotl::Describe::O_TABLE: { - trotl::DescribeTable *t = static_cast<trotl::DescribeTable*>(d); - retval->insert("TOOLTIP", QString(t->toString().c_str())); - foreach(::trotl::DescribeColumn *dc, t->_columns) - { - toCache::ColumnDescription *c = new toCache::ColumnDescription(); - c->Name = dc->_name.c_str(); - c->Null = dc->_is_null; - c->Datatype = dc->typeName().c_str(); - c->ToolTip = dc->toString().c_str(); + retval->insert("TOOLTIP", QString(d->toString().c_str())); + retval->insert("COLUMNLIST", QVariant::fromValue(toQColumnDescriptionList())); + toQColumnDescriptionList &targetCols = retval->value("COLUMNLIST").value<toQColumnDescriptionList>(); + + std::vector<trotl::DescribeColumn*> &sourceCols = (d->whatIsThis() == ::trotl::Describe::O_VIEW) ? + static_cast<trotl::DescribeView*>(d)->_columns : + static_cast<trotl::DescribeTable*>(d)->_columns; + + foreach(::trotl::DescribeColumn *dc, sourceCols) + { + targetCols.append(toCache::ColumnDescription()); + toCache::ColumnDescription &lastColumn = targetCols.last(); + lastColumn.Name = dc->_name.c_str(); + lastColumn.Null = dc->_is_null; + lastColumn.Datatype = dc->typeName().c_str(); + lastColumn.ToolTip = dc->toString().c_str(); + } } - } break; case ::trotl::Describe::O_COLUMN: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_TYPE: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_SEQUENCE: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_PROCEDURE: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_FUNCTION: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; case ::trotl::Describe::O_PACKAGE: - ;; + retval->insert("TOOLTIP", QString(d->toString().c_str())); break; default: break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |