From: Nathan N. <nn...@us...> - 2005-04-20 02:18:11
|
Update of /cvsroot/tora/tora In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7622 Modified Files: NEWS toscript.cpp toscript.h Log Message: apply patch 1186247 Index: NEWS =================================================================== RCS file: /cvsroot/tora/tora/NEWS,v retrieving revision 1.981 retrieving revision 1.982 diff -C2 -d -r1.981 -r1.982 *** NEWS 20 Apr 2005 02:16:03 -0000 1.981 --- NEWS 20 Apr 2005 02:18:01 -0000 1.982 *************** *** 10,13 **** --- 10,14 ---- 2005-04-02: Fix bug with NVARCHAR2/NCHAR2 fields not displaying properly (Bug# 1115326) 2005-05-19: Applied patch 1175927 to fix memory leak. + 2005-05-19: Applied patch 1186247 to convert more code to STL. 1.3.16: 2005-03-04 Index: toscript.h =================================================================== RCS file: /cvsroot/tora/tora/toscript.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** toscript.h 19 Apr 2005 10:30:39 -0000 1.33 --- toscript.h 20 Apr 2005 02:18:01 -0000 1.34 *************** *** 44,47 **** --- 44,48 ---- #include <list> + #include <algorithm> class QTextView; *************** *** 69,72 **** --- 70,84 ---- void fillDifference(std::list<QString> &objects, QListView *list); void readOwnerObjects(QListViewItem *item, toConnection &conn); + + struct PrefixString + { + public: + PrefixString(std::list<QString> & l, QString s); + void operator()(QString& tmp); + private: + std::list<QString> & _l; + QString _s; + }; + public: toScript(QWidget *parent, toConnection &connection); *************** *** 104,106 **** --- 116,126 ---- }; + inline void toScript::PrefixString::operator()(QString& txt) + { + _l.push_back(_s + txt); + } + + inline toScript::PrefixString::PrefixString(std::list<QString> & l, QString s) : _l(l), _s(s) + {} + #endif Index: toscript.cpp =================================================================== RCS file: /cvsroot/tora/tora/toscript.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** toscript.cpp 19 Apr 2005 10:30:42 -0000 1.73 --- toscript.cpp 20 Apr 2005 02:18:01 -0000 1.74 *************** *** 441,521 **** if (ScriptUI->IncludeDDL->isChecked()) { ! { ! for (std::list<QString>::iterator i = tableSpace.begin();i != tableSpace.end();i++) ! toPush(lst, *i); ! } ! { ! for (std::list<QString>::iterator i = profiles.begin();i != profiles.end();i++) ! toPush(lst, *i); ! } ! { ! for (std::list<QString>::iterator i = otherGlobal.begin();i != otherGlobal.end();i++) ! toPush(lst, *i); ! } ! { ! for (std::list<QString>::iterator i = roles.begin();i != roles.end();i++) ! { ! QString line = QString::fromLatin1("ROLE:"); ! line += *i; ! toPush(lst, line); ! } ! } ! { ! for (std::list<QString>::iterator i = users.begin();i != users.end();i++) ! { ! QString line = QString::fromLatin1("USER:"); ! line += *i; ! toPush(lst, line); ! } ! } ! { ! for (std::list<QString>::iterator i = tables.begin();i != tables.end();i++) ! { ! QString line = QString::fromLatin1("TABLE FAMILY:"); ! line += *i; ! toPush(lst, line); ! } ! } ! { ! for (std::list<QString>::iterator i = userViews.begin();i != userViews.end();i++) ! toPush(lst, *i); ! } ! { ! for (std::list<QString>::iterator i = userOther.begin();i != userOther.end();i++) ! toPush(lst, *i); ! } ! } ! for (std::list<QString>::iterator i = tables.begin();i != tables.end();i++) ! { ! QString line = QString::fromLatin1("TABLE CONTENTS:"); ! line += *i; ! toPush(lst, line); } if (ScriptUI->IncludeDDL->isChecked()) { ! { ! for (std::list<QString>::iterator i = tables.begin();i != tables.end();i++) ! { ! QString line = QString::fromLatin1("TABLE REFERENCES:"); ! line += *i; ! toPush(lst, line); ! } ! } ! { ! for (std::list<QString>::iterator i = roles.begin();i != roles.end();i++) ! { ! QString line = QString::fromLatin1("ROLE GRANTS:"); ! line += *i; ! toPush(lst, line); ! } ! } ! { ! for (std::list<QString>::iterator i = users.begin();i != users.end();i++) ! { ! QString line = QString::fromLatin1("USER GRANTS:"); ! line += *i; ! toPush(lst, line); ! } ! } } return lst; --- 441,459 ---- if (ScriptUI->IncludeDDL->isChecked()) { ! copy(tableSpace.begin(), tableSpace.end(), back_inserter(lst)); ! copy(profiles.begin(), profiles.end(), back_inserter(lst)); ! copy(otherGlobal.begin(), otherGlobal.end(), back_inserter(lst)); ! for_each(roles.begin(), roles.end(), PrefixString(lst, QString::fromLatin1("ROLE:"))); ! for_each(users.begin(), users.end(), PrefixString(lst, QString::fromLatin1("USER:"))); ! for_each(tables.begin(), tables.end(), PrefixString(lst, QString::fromLatin1("TABLE FAMILY:"))); ! copy(userViews.begin(), userViews.end(), back_inserter(lst)); ! copy(userOther.begin(), userOther.end(), back_inserter(lst)); } + for_each(tables.begin(), tables.end(), PrefixString(lst, QString::fromLatin1("TABLE CONTENTS:"))); if (ScriptUI->IncludeDDL->isChecked()) { ! for_each(tables.begin(), tables.end(), PrefixString(lst, QString::fromLatin1("TABLE REFERENCES:"))); ! for_each(roles.begin(), roles.end(), PrefixString(lst, QString::fromLatin1("ROLE GRANTS:"))); ! for_each(users.begin(), users.end(), PrefixString(lst, QString::fromLatin1("USER GRANTS:"))); } return lst; |