From: <mrj...@us...> - 2010-04-25 21:14:17
|
Revision: 3517 http://tora.svn.sourceforge.net/tora/?rev=3517&view=rev Author: mrjohnson0 Date: 2010-04-25 21:14:11 +0000 (Sun, 25 Apr 2010) Log Message: ----------- small change to support table name completion Modified Paths: -------------- branches/teradata/tora/src/tohighlightedtext.cpp Modified: branches/teradata/tora/src/tohighlightedtext.cpp =================================================================== --- branches/teradata/tora/src/tohighlightedtext.cpp 2010-04-24 19:05:34 UTC (rev 3516) +++ branches/teradata/tora/src/tohighlightedtext.cpp 2010-04-25 21:14:11 UTC (rev 3517) @@ -1000,20 +1000,34 @@ try { toConnection &conn = toCurrentConnection(this); - toQDescList &desc = conn.columns(conn.realName(name, false)); - for (toQDescList::iterator i = desc.begin(); i != desc.end(); i++) + toConnection::objectName object = conn.realName(name, false); + if(object.Type == "DATABASE") { - QString t; - int ind = (*i).Name.indexOf("("); - if (ind < 0) - ind = (*i).Name.indexOf("RETURNING") - 1; //it could be a function or procedure without parameters. -1 to remove the space - if (ind >= 0) - t = conn.quote((*i).Name.mid(0, ind)) + (*i).Name.mid(ind); - else - t = conn.quote((*i).Name); - if (t.indexOf(*partial) == 0) - toReturn.append(t); + std::list<toConnection::objectName> list = conn.tables(object); + Q_FOREACH(toConnection::objectName table, list) + { + QString t = conn.quote(table.Name); + if(t.indexOf(*partial) == 0) + toReturn.append(t); + } } + else + { + toQDescList &desc = conn.columns(object); + for (toQDescList::iterator i = desc.begin(); i != desc.end(); i++) + { + QString t; + int ind = (*i).Name.indexOf("("); + if (ind < 0) + ind = (*i).Name.indexOf("RETURNING") - 1; //it could be a function or procedure without parameters. -1 to remove the space + if (ind >= 0) + t = conn.quote((*i).Name.mid(0, ind)) + (*i).Name.mid(ind); + else + t = conn.quote((*i).Name); + if (t.indexOf(*partial) == 0) + toReturn.append(t); + } + } } catch (QString e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mrj...@us...> - 2010-04-26 05:15:41
|
Revision: 3521 http://tora.svn.sourceforge.net/tora/?rev=3521&view=rev Author: mrjohnson0 Date: 2010-04-26 05:15:31 +0000 (Mon, 26 Apr 2010) Log Message: ----------- don't quote lower case in completion Modified Paths: -------------- branches/teradata/tora/src/tohighlightedtext.cpp Modified: branches/teradata/tora/src/tohighlightedtext.cpp =================================================================== --- branches/teradata/tora/src/tohighlightedtext.cpp 2010-04-25 21:15:57 UTC (rev 3520) +++ branches/teradata/tora/src/tohighlightedtext.cpp 2010-04-26 05:15:31 UTC (rev 3521) @@ -1006,7 +1006,7 @@ std::list<toConnection::objectName> list = conn.tables(object); Q_FOREACH(toConnection::objectName table, list) { - QString t = conn.quote(table.Name); + QString t = conn.quote(table.Name, false); if(t.indexOf(*partial) == 0) toReturn.append(t); } @@ -1021,9 +1021,9 @@ if (ind < 0) ind = (*i).Name.indexOf("RETURNING") - 1; //it could be a function or procedure without parameters. -1 to remove the space if (ind >= 0) - t = conn.quote((*i).Name.mid(0, ind)) + (*i).Name.mid(ind); + t = conn.quote((*i).Name.mid(0, ind), false) + (*i).Name.mid(ind); else - t = conn.quote((*i).Name); + t = conn.quote((*i).Name, false); if (t.indexOf(*partial) == 0) toReturn.append(t); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |