[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/kexi/plugins/tables
From: Jaroslaw Staniek <js () iidea ! pl>
Date: 2006-06-04 21:29:49
Message-ID: 1149456589.318312.6565.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 548211 by staniek:
Table Designer
- update for the new kexidb utils
M +3 -0 kexitabledesignercommands.cpp
M +1 -0 kexitabledesignercommands.h
M +13 -2 kexitabledesignerview.cpp
--- trunk/koffice/kexi/plugins/tables/kexitabledesignercommands.cpp #548210:548211
@@ -110,6 +110,9 @@
KexiDB::AlterTableHandler::ActionBase* ChangeFieldPropertyCommand::createAction()
{
+ if (m_alterTableAction.propertyName()=="subType") {//skip these properties
+ return 0;
+ }
return new KexiDB::AlterTableHandler::ChangeFieldPropertyAction( m_alterTableAction );
}
--- trunk/koffice/kexi/plugins/tables/kexitabledesignercommands.h #548210:548211
@@ -48,6 +48,7 @@
virtual ~Command();
//! Used to collect actions data for AlterTableHandler
+ //! Can return 0 if the action should not be passed to AlterTableHandler
virtual KexiDB::AlterTableHandler::ActionBase* createAction() { return 0; }
virtual QString debugString() { return name(); }
--- trunk/koffice/kexi/plugins/tables/kexitabledesignerview.cpp #548210:548211
@@ -34,6 +34,7 @@
#include <kmessagebox.h>
#include <koproperty/set.h>
+#include <koproperty/utils.h>
#include <kexidb/cursor.h>
#include <kexidb/tableschema.h>
@@ -747,9 +748,11 @@
//todo: check uniqueness:
QString fieldName( KexiUtils::string2Identifier(fieldCaption) );
+ ;
+
KexiDB::Field field( //tmp
fieldName,
- (KexiDB::Field::Type)fieldType,
+ KexiDB::intToFieldType( fieldType ),
KexiDB::Field::NoConstraints,
KexiDB::Field::NoOptions,
/*length*/0,
@@ -991,6 +994,14 @@
KexiDB::Field * KexiTableDesignerView::buildField( const KoProperty::Set &set )
{
+ KexiDB::Field *field = new KexiDB::Field();
+ QMap<QCString, QVariant> values = KoProperty::propertyValues(set);
+ if (!KexiDB::setFieldProperties( *field, values )) {
+ delete field;
+ return 0;
+ }
+ return field;
+/*
kexipluginsdbg << set["subType"].value().toString() << endl;
QString subTypeString( set["subType"].value().toString() );
KexiDB::Field::Type type = KexiDB::Field::typeForString(subTypeString);
@@ -1031,7 +1042,7 @@
if (KexiDB::supportsVisibleDecimalPlacesProperty(f->type()) && set.contains("visibleDecimalPlaces"))
f->setVisibleDecimalPlaces(set["visibleDecimalPlaces"].value().toInt());
- return f;
+ return f;*/
}
tristate KexiTableDesignerView::buildSchema(KexiDB::TableSchema &schema)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic