[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/kexi/kexidb
From: Jaroslaw Staniek <js () iidea ! pl>
Date: 2004-08-23 20:01:48
Message-ID: 20040823200148.F23013082 () office ! kde ! org
[Download RAW message or body]
CVS commit by staniek:
KexiDB
- KexiDB::idForObjectName() convenience function added
M +11 -0 utils.cpp 1.12
M +4 -0 utils.h 1.12
--- koffice/kexi/kexidb/utils.cpp #1.11:1.12
@@ -136,2 +136,13 @@ void KexiDB::getHTMLErrorMesage(Object*
}
+int KexiDB::idForObjectName( Connection &conn, const QString& objName, int objType )
+{
+ RowData data;
+ if (!conn.querySingleRecord(QString("select o_id from kexi__objects where \
o_name='%1' and o_type=%2") + .arg(objName.lower()).arg(objType), \
data)) + return 0;
+ bool ok;
+ int id = data[0].toInt(&ok);
+ return ok ? id : 0;
+}
+
--- koffice/kexi/kexidb/utils.h #1.11:1.12
@@ -128,4 +128,8 @@ namespace KexiDB
return fieldName + "=" + drv->valueToSQL( t, value );
}
+
+ /*! \return identifier for object \a objName of type \a objType
+ or 0 if such object does not exist. */
+ int idForObjectName( Connection &conn, const QString& objName, int objType \
); }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic