summaryrefslogtreecommitdiffstats
path: root/kexi/tests/newapi
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/tests/newapi
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/tests/newapi')
-rw-r--r--kexi/tests/newapi/dr_prop_test.h10
-rw-r--r--kexi/tests/newapi/main.cpp34
-rw-r--r--kexi/tests/newapi/mysqlcursor.cpp8
-rw-r--r--kexi/tests/newapi/parser_test.h12
-rw-r--r--kexi/tests/newapi/statements.txt2
-rw-r--r--kexi/tests/newapi/tables_test.h22
-rw-r--r--kexi/tests/newapi/tableview_test.h2
7 files changed, 45 insertions, 45 deletions
diff --git a/kexi/tests/newapi/dr_prop_test.h b/kexi/tests/newapi/dr_prop_test.h
index 71e882e3..d7bfd5b3 100644
--- a/kexi/tests/newapi/dr_prop_test.h
+++ b/kexi/tests/newapi/dr_prop_test.h
@@ -22,17 +22,17 @@
int drPropTest()
{
- QValueList<QCString> names = driver->propertyNames();
- kdDebug() << QString("%1 properties found:").arg(names.count()) << endl;
- for (QValueList<QCString>::ConstIterator it = names.constBegin(); it!=names.constEnd(); ++it) {
+ TQValueList<TQCString> names = driver->propertyNames();
+ kdDebug() << TQString("%1 properties found:").tqarg(names.count()) << endl;
+ for (TQValueList<TQCString>::ConstIterator it = names.constBegin(); it!=names.constEnd(); ++it) {
kdDebug() << " - " << (*it) << ":"
<< " caption=\"" << driver->propertyCaption(*it) << "\""
<< " type=" << driver->propertyValue(*it).typeName()
<< " value=\""<<driver->propertyValue(*it).toString()<<"\"" << endl;
}
-// QVariant propertyValue( const QCString& propName ) const;
+// TQVariant propertyValue( const TQCString& propName ) const;
-// QVariant propertyCaption( const QCString& propName ) const;
+// TQVariant propertyCaption( const TQCString& propName ) const;
return 0;
}
diff --git a/kexi/tests/newapi/main.cpp b/kexi/tests/newapi/main.cpp
index 514538f3..ba232d5f 100644
--- a/kexi/tests/newapi/main.cpp
+++ b/kexi/tests/newapi/main.cpp
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qfileinfo.h>
-#include <qguardedptr.h>
+#include <tqfileinfo.h>
+#include <tqguardedptr.h>
#include <kdebug.h>
#include <kcmdlineargs.h>
@@ -41,16 +41,16 @@
using namespace std;
-QCString prgname;
-QCString db_name;
-QCString drv_name;
-QCString test_name;
+TQCString prgname;
+TQCString db_name;
+TQCString drv_name;
+TQCString test_name;
int cursor_options = 0;
bool db_name_required = true;
KexiDB::ConnectionData conn_data;
-QGuardedPtr<KexiDB::Connection> conn;
-QGuardedPtr<KexiDB::Driver> driver;
+TQGuardedPtr<KexiDB::Connection> conn;
+TQGuardedPtr<KexiDB::Driver> driver;
KApplication *app = 0;
KInstance *instance = 0;
@@ -75,7 +75,7 @@ static KCmdLineOptions options[] =
" to be buffered", 0},
{ "query-params <params>", "Query parameters separated\n"
"by '|' character that will be passed to query\n"
- "statement to replace [...] placeholders.", 0 },
+ "statement to tqreplace [...] placeholders.", 0 },
{ "", " Notes:\n"
"1. 'dr_prop' requires <db_name> argument.\n"
"2. 'parser' test requires <db_name>,\n"
@@ -112,7 +112,7 @@ int main(int argc, char** argv)
usage();
RETURN(0);
}*/
- QFileInfo info=QFileInfo(argv[0]);
+ TQFileInfo info=TQFileInfo(argv[0]);
prgname = info.baseName().latin1();
KCmdLineArgs::init(argc, argv,
@@ -136,8 +136,8 @@ int main(int argc, char** argv)
RETURN(1);
}
test_name = args->getOption("test");
- if (!tests.contains(test_name)) {
- kdDebug() << QString("No such test \"%1\". Use --help.").arg(test_name) << endl;
+ if (!tests.tqcontains(test_name)) {
+ kdDebug() << TQString("No such test \"%1\". Use --help.").tqarg(test_name.data()) << endl;
RETURN(1);
}
@@ -152,7 +152,7 @@ int main(int argc, char** argv)
db_name_required = false;
}
if ((int)args->count()<minargs) {
- kdDebug() << QString("Not enough args (%1 required). Use --help.").arg(minargs) << endl;
+ kdDebug() << TQString("Not enough args (%1 required). Use --help.").tqarg(minargs) << endl;
RETURN(1);
}
@@ -168,9 +168,9 @@ int main(int argc, char** argv)
drv_name = args->arg(0);
KexiDB::DriverManager manager;
- QStringList names = manager.driverNames();
+ TQStringList names = manager.driverNames();
kdDebug() << "DRIVERS: " << endl;
- for (QStringList::ConstIterator it = names.constBegin(); it != names.constEnd() ; ++it)
+ for (TQStringList::ConstIterator it = names.constBegin(); it != names.constEnd() ; ++it)
kdDebug() << *it << endl;
if (manager.error() || names.isEmpty()) {
manager.debugError();
@@ -223,9 +223,9 @@ int main(int argc, char** argv)
else if (test_name == "tableview")
r=tableViewTest();
else if (test_name == "parser") {
- QStringList params;
+ TQStringList params;
if (args->isSet("query-params"))
- params = QStringList::split("|", args->getOption("query-params"));
+ params = TQStringList::split("|", args->getOption("query-params"));
r=parserTest(args->arg(2), params);
}
else if (test_name == "dr_prop")
diff --git a/kexi/tests/newapi/mysqlcursor.cpp b/kexi/tests/newapi/mysqlcursor.cpp
index 7f0e9223..091cc8a1 100644
--- a/kexi/tests/newapi/mysqlcursor.cpp
+++ b/kexi/tests/newapi/mysqlcursor.cpp
@@ -11,9 +11,9 @@ int main(int argc, char * argv[])
{
KInstance instance("newapi");
KexiDB::DriverManager manager;
- QStringList names = manager.driverNames();
+ TQStringList names = manager.driverNames();
kdDebug() << "DRIVERS: " << endl;
- for (QStringList::ConstIterator it = names.constBegin(); it != names.constEnd() ; ++it)
+ for (TQStringList::ConstIterator it = names.constBegin(); it != names.constEnd() ; ++it)
kdDebug() << *it << endl;
if (manager.error()) {
kdDebug() << manager.errorMsg() << endl;
@@ -58,10 +58,10 @@ int main(int argc, char * argv[])
KexiDB::Cursor *c2=conn->executeQuery("select * from Applications");
if (!c2) kdDebug()<<conn->errorMsg()<<endl;
- QStringList l=conn->databaseNames();
+ TQStringList l=conn->databaseNames();
if (l.isEmpty()) kdDebug()<<conn->errorMsg()<<endl;
kdDebug()<<"Databases:"<<endl;
- for (QStringList::ConstIterator it = l.constBegin(); it != l.constEnd() ; ++it)
+ for (TQStringList::ConstIterator it = l.constBegin(); it != l.constEnd() ; ++it)
kdDebug() << *it << endl;
if (c) {
diff --git a/kexi/tests/newapi/parser_test.h b/kexi/tests/newapi/parser_test.h
index 14409961..90c25d7c 100644
--- a/kexi/tests/newapi/parser_test.h
+++ b/kexi/tests/newapi/parser_test.h
@@ -20,7 +20,7 @@
#ifndef PARSER_TEST_H
#define PARSER_TEST_H
-int parserTest(const char *st, const QStringList& params)
+int parserTest(const char *st, const TQStringList& params)
{
int r = 0;
@@ -31,10 +31,10 @@ int parserTest(const char *st, const QStringList& params)
KexiDB::Parser parser(conn);
- const bool ok = parser.parse(QString::fromLocal8Bit( st ));
+ const bool ok = parser.parse(TQString::fromLocal8Bit( st ));
KexiDB::QuerySchema *q = parser.query();
- QValueList<QVariant> variantParams;
- foreach( QStringList::ConstIterator, it, params )
+ TQValueList<TQVariant> variantParams;
+ foreach( TQStringList::ConstIterator, it, params )
variantParams.append(*it);
if (ok && q) {
cout << q->debugString().latin1() << '\n';
@@ -42,8 +42,8 @@ int parserTest(const char *st, const QStringList& params)
}
else {
KexiDB::ParserError err = parser.error();
- kdDebug() << QString("Error = %1\ntype = %2\nat = %3").arg(err.error())
- .arg(err.type()).arg(err.at()) << endl;
+ kdDebug() << TQString("Error = %1\ntype = %2\nat = %3").tqarg(err.error())
+ .tqarg(err.type()).tqarg(err.at()) << endl;
r = 1;
}
delete q;
diff --git a/kexi/tests/newapi/statements.txt b/kexi/tests/newapi/statements.txt
index 3d108ce7..c0cc8e7c 100644
--- a/kexi/tests/newapi/statements.txt
+++ b/kexi/tests/newapi/statements.txt
@@ -47,7 +47,7 @@ select 2+3*4 from cars;
select (2+3)*4 from cars;
-- OK202: support for aliases for complex-expression columns
select (2+3)*4 from cars;
--- ER203: column names are invalidated inside a complex expressions
+-- ER203: column names are tqinvalidated inside a complex expressions
select one*two from persons;
-- ER204: like ER106, but ambiguous column is inside a complex expression
select id*2 from persons p, cars p;
diff --git a/kexi/tests/newapi/tables_test.h b/kexi/tests/newapi/tables_test.h
index 67516db0..9ad0f4ee 100644
--- a/kexi/tests/newapi/tables_test.h
+++ b/kexi/tests/newapi/tables_test.h
@@ -56,10 +56,10 @@ int tablesTest()
kdDebug() << "-- PERSONS created --" << endl;
t_persons->debug();
- if (!conn->insertRecord(*t_persons, QVariant(1), QVariant(27), QVariant("Jaroslaw"), QVariant("Staniek"))
- ||!conn->insertRecord(*t_persons, QVariant(2), QVariant(60), QVariant("Lech"), QVariant("Walesa"))
- ||!conn->insertRecord(*t_persons, QVariant(3), QVariant(45), QVariant("Bill"), QVariant("Gates"))
- ||!conn->insertRecord(*t_persons, QVariant(4), QVariant(35), QVariant("John"), QVariant("Smith"))
+ if (!conn->insertRecord(*t_persons, TQVariant(1), TQVariant(27), TQVariant("Jaroslaw"), TQVariant("Staniek"))
+ ||!conn->insertRecord(*t_persons, TQVariant(2), TQVariant(60), TQVariant("Lech"), TQVariant("Walesa"))
+ ||!conn->insertRecord(*t_persons, TQVariant(3), TQVariant(45), TQVariant("Bill"), TQVariant("Gates"))
+ ||!conn->insertRecord(*t_persons, TQVariant(4), TQVariant(35), TQVariant("John"), TQVariant("Smith"))
)
{
kdDebug() << "-- PERSONS data err. --" << endl;
@@ -81,11 +81,11 @@ int tablesTest()
return 1;
}
kdDebug() << "-- CARS created --" << endl;
- if (!conn->insertRecord(*t_cars, QVariant(1), QVariant(1), QVariant("Fiat"))
- ||!conn->insertRecord(*t_cars, QVariant(2), QVariant(2), QVariant("Syrena"))
- ||!conn->insertRecord(*t_cars, QVariant(3), QVariant(3), QVariant("Chrysler"))
- ||!conn->insertRecord(*t_cars, QVariant(4), QVariant(3), QVariant("BMW"))
- ||!conn->insertRecord(*t_cars, QVariant(5), QVariant(4), QVariant("Volvo"))
+ if (!conn->insertRecord(*t_cars, TQVariant(1), TQVariant(1), TQVariant("Fiat"))
+ ||!conn->insertRecord(*t_cars, TQVariant(2), TQVariant(2), TQVariant("Syrena"))
+ ||!conn->insertRecord(*t_cars, TQVariant(3), TQVariant(3), TQVariant("Chrysler"))
+ ||!conn->insertRecord(*t_cars, TQVariant(4), TQVariant(3), TQVariant("BMW"))
+ ||!conn->insertRecord(*t_cars, TQVariant(5), TQVariant(4), TQVariant("Volvo"))
)
{
kdDebug() << "-- CARS data err. --" << endl;
@@ -99,8 +99,8 @@ int tablesTest()
}
kdDebug() << "NOW, TABLE LIST: " << endl;
- QStringList tnames = conn->tableNames();
- for (QStringList::iterator it = tnames.begin(); it!=tnames.end(); ++it) {
+ TQStringList tnames = conn->tableNames();
+ for (TQStringList::iterator it = tnames.begin(); it!=tnames.end(); ++it) {
kdDebug() << " - " << (*it) << endl;
}
diff --git a/kexi/tests/newapi/tableview_test.h b/kexi/tests/newapi/tableview_test.h
index 2b5ef6c8..aad6314d 100644
--- a/kexi/tests/newapi/tableview_test.h
+++ b/kexi/tests/newapi/tableview_test.h
@@ -49,7 +49,7 @@ int tableViewTest()
KexiDataTableView *tv = new KexiDataTableView(0, "tv", cursor);
app->setMainWidget(tv);
- tv->move((qApp->desktop()->width() - tv->width())/2, (qApp->desktop()->height() - tv->height())/2);
+ tv->move((tqApp->desktop()->width() - tv->width())/2, (tqApp->desktop()->height() - tv->height())/2);
tv->show();
tv->setFocus();