summaryrefslogtreecommitdiffstats
path: root/kexi
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2019-05-28 23:09:09 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2019-05-28 23:09:09 +0900
commit04a12485219f38e113932e8aa20b6bc12d8fa715 (patch)
tree68ee6acef9dfadc11fe8bd4d94f52d020cd8b7a1 /kexi
parent03eee956313fe6172f719669a1bd3d5739e023ba (diff)
downloadkoffice-04a12485219f38e113932e8aa20b6bc12d8fa715.tar.gz
koffice-04a12485219f38e113932e8aa20b6bc12d8fa715.zip
Adjusted to latest TQVariant::TQVariant(bool) function.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'kexi')
-rw-r--r--kexi/formeditor/editlistviewdialog.cpp12
-rw-r--r--kexi/formeditor/formIO.cpp8
-rw-r--r--kexi/formeditor/widgetpropertyset.cpp6
-rw-r--r--kexi/kexidb/driver_p.cpp8
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxcursor.cpp2
-rw-r--r--kexi/kexidb/drivers/sqlite/sqlitecursor.cpp6
-rw-r--r--kexi/kexidb/utils.cpp4
-rw-r--r--kexi/migration/pqxx/pqxxmigrate.cpp2
-rw-r--r--kexi/plugins/forms/kexiformpart.cpp2
-rw-r--r--kexi/plugins/forms/widgets/kexidbcheckbox.cpp2
-rw-r--r--kexi/plugins/forms/widgets/kexidblineedit.cpp2
-rw-r--r--kexi/plugins/macros/tests/testaction.cpp2
-rw-r--r--kexi/plugins/queries/kexiquerydesignerguieditor.cpp24
-rw-r--r--kexi/plugins/scripting/kexidb/kexidbconnection.cpp8
-rw-r--r--kexi/plugins/tables/kexitabledesignerview.cpp82
-rw-r--r--kexi/widget/kexiqueryparameters.cpp2
-rw-r--r--kexi/widget/tableview/kexibooltableedit.cpp16
-rw-r--r--kexi/widget/tableview/kexitextformatter.cpp2
18 files changed, 92 insertions, 98 deletions
diff --git a/kexi/formeditor/editlistviewdialog.cpp b/kexi/formeditor/editlistviewdialog.cpp
index 44bc8096..5dfc176a 100644
--- a/kexi/formeditor/editlistviewdialog.cpp
+++ b/kexi/formeditor/editlistviewdialog.cpp
@@ -109,9 +109,9 @@ EditListViewDialog::EditListViewDialog(TQWidget *parent)
m_propSet = new KoProperty::Set(TQT_TQOBJECT(this), "columns");
m_propSet->addProperty(new KoProperty::Property("caption", "Caption", i18n("Caption"),i18n("Caption")));
m_propSet->addProperty(new KoProperty::Property("width", 100, i18n("Width"), i18n("Width")));
- m_propSet->addProperty(new KoProperty::Property("clickable", TQVariant(true, 3), i18n("Clickable"), i18n("Clickable") ));
- m_propSet->addProperty(new KoProperty::Property("resizable", TQVariant(true, 3), i18n("Resizable"), i18n("Resizable") ));
- m_propSet->addProperty(new KoProperty::Property("fullwidth", TQVariant(false, 3), i18n("Full Width"), i18n("Full Width") ));
+ m_propSet->addProperty(new KoProperty::Property("clickable", TQVariant(true), i18n("Clickable"), i18n("Clickable") ));
+ m_propSet->addProperty(new KoProperty::Property("resizable", TQVariant(true), i18n("Resizable"), i18n("Resizable") ));
+ m_propSet->addProperty(new KoProperty::Property("fullwidth", TQVariant(false), i18n("Full Width"), i18n("Full Width") ));
m_editor->changeSet(m_propSet);
connect(m_propSet, TQT_SIGNAL(propertyChanged(KoProperty::Set & KoProperty::Property&)),
this, TQT_SLOT(changeProperty(KoProperty::Set & KoProperty::Property&)));
@@ -256,9 +256,9 @@ EditListViewDialog::updateItemProperties(TQListBoxItem *item)
m_propSet->blockSignals(true); // we don't want changeProperty to be called
(*m_propSet)["caption"].setValue(m_listview->columnText(id), false);
(*m_propSet)["width"].setValue(m_listview->columnWidth(id), false);
- (*m_propSet)["clickable"].setValue(TQVariant(m_listview->header()->isClickEnabled(id), 4), false);
- (*m_propSet)["resizable"].setValue(TQVariant(m_listview->header()->isResizeEnabled(id), 4), false);
- (*m_propSet)["fullwidth"].setValue(TQVariant(m_listview->header()->isStretchEnabled(id), 4), false);
+ (*m_propSet)["clickable"].setValue(TQVariant(m_listview->header()->isClickEnabled(id)), false);
+ (*m_propSet)["resizable"].setValue(TQVariant(m_listview->header()->isResizeEnabled(id)), false);
+ (*m_propSet)["fullwidth"].setValue(TQVariant(m_listview->header()->isStretchEnabled(id)), false);
m_propSet->blockSignals(false);
m_editor->changeSet(m_propSet);
}
diff --git a/kexi/formeditor/formIO.cpp b/kexi/formeditor/formIO.cpp
index 3d6fc8ca..657c5ccd 100644
--- a/kexi/formeditor/formIO.cpp
+++ b/kexi/formeditor/formIO.cpp
@@ -771,10 +771,10 @@ FormIO::readPropertyValue(TQDomNode node, TQObject *obj, const TQString &name)
else if(type == "bool")
{
if(text == "true")
- return TQVariant(true, 3);
+ return TQVariant(true);
else if(text == "false")
- return TQVariant(false, 3);
- return TQVariant(text.toInt(), 3);
+ return TQVariant(false);
+ return TQVariant(text.toInt());
}
else if(type == "number")
{
@@ -1076,7 +1076,7 @@ FormIO::saveWidget(ObjectTreeItem *item, TQDomElement &parent, TQDomDocument &do
// save some special properties
savePropertyElement(layout, domDoc, "property", "customLayout", Container::layoutTypeToString(item->container()->layoutType()) );
- savePropertyElement(layout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->layout())->isJustified(), 3) );
+ savePropertyElement(layout, domDoc, "property", "justify", TQVariant(static_cast<KexiFlowLayout*>(item->container()->layout())->isJustified()) );
// fill the widget's grid info, ie just simulate grid layout
item->container()->createGridLayout(true);
diff --git a/kexi/formeditor/widgetpropertyset.cpp b/kexi/formeditor/widgetpropertyset.cpp
index 74b1a4f6..64c61112 100644
--- a/kexi/formeditor/widgetpropertyset.cpp
+++ b/kexi/formeditor/widgetpropertyset.cpp
@@ -378,7 +378,7 @@ WidgetPropertySet::createPropertiesForWidget(TQWidget *w)
}
(*this)["name"].setAutoSync(false); // name should be updated only when pressing Enter
- (*this)["enabled"].setValue( TQVariant(tree->isEnabled(), 3));
+ (*this)["enabled"].setValue( TQVariant(tree->isEnabled()));
if (winfo) {
form->library()->setPropertyOptions(*this, *winfo, w);
@@ -664,7 +664,7 @@ WidgetPropertySet::saveEnabledProperty(bool value)
(*it)->setPalette(p);
tree->setEnabled(value);
- emit widgetPropertyChanged((*it), "enabled", TQVariant(value, 3));
+ emit widgetPropertyChanged((*it), "enabled", TQVariant(value));
}
}
@@ -837,7 +837,7 @@ WidgetPropertySet::createAlignProperty(const TQMetaProperty *meta, TQWidget *wid
) {
// Create the wordbreak property
KoProperty::Property *p = new KoProperty::Property("wordbreak",
- TQVariant(alignment & TQt::WordBreak, 3), i18n("Word Break"), i18n("Word Break") );
+ TQVariant(alignment & TQt::WordBreak), i18n("Word Break"), i18n("Word Break") );
d->set.addProperty(p);
updatePropertyValue(tree, "wordbreak");
if (!KFormDesigner::FormManager::self()->activeForm()->library()->isPropertyVisible(
diff --git a/kexi/kexidb/driver_p.cpp b/kexi/kexidb/driver_p.cpp
index 462ce608..fcbadb5c 100644
--- a/kexi/kexidb/driver_p.cpp
+++ b/kexi/kexidb/driver_p.cpp
@@ -55,7 +55,7 @@ DriverPrivate::DriverPrivate()
void DriverPrivate::initInternalProperties()
{
- properties["is_file_database"] = TQVariant(isFileDriver, 1);
+ properties["is_file_database"] = TQVariant(isFileDriver);
propertyCaptions["is_file_database"] = i18n("File-based database driver");
if (isFileDriver) {
properties["file_database_mimetype"] = fileDBDriverMimeType;
@@ -77,11 +77,11 @@ void DriverPrivate::initInternalProperties()
#endif
// properties["transaction_support"] = features & Driver::TransactionsMask;
// propertyCaptions["transaction_support"] = i18n("Transaction support");
- properties["transaction_single"] = TQVariant(features & Driver::SingleTransactions, 1);
+ properties["transaction_single"] = TQVariant(features & Driver::SingleTransactions);
propertyCaptions["transaction_single"] = i18n("Single transactions support");
- properties["transaction_multiple"] = TQVariant(features & Driver::MultipleTransactions, 1);
+ properties["transaction_multiple"] = TQVariant(features & Driver::MultipleTransactions);
propertyCaptions["transaction_multiple"] = i18n("Multiple transactions support");
- properties["transaction_nested"] = TQVariant(features & Driver::NestedTransactions, 1);
+ properties["transaction_nested"] = TQVariant(features & Driver::NestedTransactions);
propertyCaptions["transaction_nested"] = i18n("Nested transactions support");
properties["kexidb_driver_version"] =
diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp
index 048d6685..77746a13 100644
--- a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp
+++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp
@@ -239,7 +239,7 @@ TQVariant pqxxSqlCursor::pValue(uint pos)const
}
else if (f->type() == Field::Boolean )
{
- return QString((*m_res)[at()][pos].c_str()).lower() == "t" ? TQVariant(true, 1) : TQVariant(false, 1);
+ return QString((*m_res)[at()][pos].c_str()).lower() == "t" ? TQVariant(true) : TQVariant(false);
}
else if (f->typeGroup() == Field::BLOBGroup)
{
diff --git a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
index c8282963..6a80f76d 100644
--- a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
+++ b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp
@@ -151,7 +151,7 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal
return TQDateTime::fromString( tmp, Qt::ISODate );
}
case Field::Boolean:
- return TQVariant(sqliteStringToBool(GET_sqlite3_column_text), 1);
+ return TQVariant(sqliteStringToBool(GET_sqlite3_column_text));
default:
return TQVariant(); //TODO
}
@@ -166,7 +166,7 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal
case Field::BigInteger:
return TQVariant( (TQ_LLONG)sqlite3_column_int64(prepared_st_handle, i) );
case Field::Boolean:
- return TQVariant( sqlite3_column_int(prepared_st_handle, i)!=0, 1 );
+ return TQVariant( sqlite3_column_int(prepared_st_handle, i)!=0 );
default:;
}
if (f->isFPNumericType()) //WEIRD, YEAH?
@@ -480,7 +480,7 @@ void SQLiteCursor::storeCurrentRow(RowData &data) const
case Field::BigInteger:
data[i] = TQVariant( TQString::fromLatin1(*col).toLongLong() );
case Field::Boolean:
- data[i] = TQVariant( sqliteStringToBool(TQString::fromLatin1(*col)), 1 );
+ data[i] = TQVariant( sqliteStringToBool(TQString::fromLatin1(*col)) );
break;
case Field::Date:
data[i] = TQDate::fromString( TQString::fromLatin1(*col), Qt::ISODate );
diff --git a/kexi/kexidb/utils.cpp b/kexi/kexidb/utils.cpp
index 4baa0d8b..b7e6a2ed 100644
--- a/kexi/kexidb/utils.cpp
+++ b/kexi/kexidb/utils.cpp
@@ -939,7 +939,7 @@ TQVariant KexiDB::loadPropertyValueFromDom( const TQDomNode& node )
}
}
else if (valueType == "bool") {
- return TQVariant(text.lower()=="true" || text=="1", 1);
+ return TQVariant(text.lower()=="true" || text=="1");
}
//! @todo add more TQVariant types
KexiDBWarn << "loadPropertyValueFromDom(): unknown type '" << valueType << "'" << endl;
@@ -983,7 +983,7 @@ TQVariant KexiDB::emptyValueForType( KexiDB::Field::Type type )
ADD(Field::ShortInteger, 0);
ADD(Field::Integer, 0);
ADD(Field::BigInteger, 0);
- ADD(Field::Boolean, TQVariant(false, 0));
+ ADD(Field::Boolean, TQVariant(false));
ADD(Field::Float, 0.0);
ADD(Field::Double, 0.0);
//! @todo ok? we have no better defaults
diff --git a/kexi/migration/pqxx/pqxxmigrate.cpp b/kexi/migration/pqxx/pqxxmigrate.cpp
index 9460462c..1511bbe0 100644
--- a/kexi/migration/pqxx/pqxxmigrate.cpp
+++ b/kexi/migration/pqxx/pqxxmigrate.cpp
@@ -543,7 +543,7 @@ bool PqxxMigrate::drv_copyTable(const TQString& srcTable, KexiDB::Connection *de
}
else if (fieldsExpanded.at(index)->field->type()==KexiDB::Field::Boolean )
{
- vals.append(QString((*i).c_str()).lower() == "t" ? TQVariant(true, 1) : TQVariant(false, 1));
+ vals.append(QString((*i).c_str()).lower() == "t" ? TQVariant(true) : TQVariant(false));
}
else
{
diff --git a/kexi/plugins/forms/kexiformpart.cpp b/kexi/plugins/forms/kexiformpart.cpp
index c53212fb..0b5f83ef 100644
--- a/kexi/plugins/forms/kexiformpart.cpp
+++ b/kexi/plugins/forms/kexiformpart.cpp
@@ -400,7 +400,7 @@ void KexiFormPart::slotAutoTabStopsSet(KFormDesigner::Form *form, bool set)
KoProperty::Property &p = (*KFormDesigner::FormManager::self()->propertySet())["autoTabStops"];
if (!p.isNull())
- p.setValue(TQVariant(set, 4));
+ p.setValue(TQVariant(set));
}
void KexiFormPart::slotAssignAction()
diff --git a/kexi/plugins/forms/widgets/kexidbcheckbox.cpp b/kexi/plugins/forms/widgets/kexidbcheckbox.cpp
index c1a8f5d4..5d123d4d 100644
--- a/kexi/plugins/forms/widgets/kexidbcheckbox.cpp
+++ b/kexi/plugins/forms/widgets/kexidbcheckbox.cpp
@@ -78,7 +78,7 @@ KexiDBCheckBox::value()
{
if (state()==NoChange)
return TQVariant();
- return TQVariant(state()==On, 1);
+ return TQVariant(state()==On);
}
void KexiDBCheckBox::slotStateChanged(int )
diff --git a/kexi/plugins/forms/widgets/kexidblineedit.cpp b/kexi/plugins/forms/widgets/kexidblineedit.cpp
index 815adca9..8e74324a 100644
--- a/kexi/plugins/forms/widgets/kexidblineedit.cpp
+++ b/kexi/plugins/forms/widgets/kexidblineedit.cpp
@@ -163,7 +163,7 @@ TQVariant KexiDBLineEdit::value()
return text().toLongLong();
case KexiDB::Field::Boolean:
//! @todo temporary solution for booleans!
- return text() == "1" ? TQVariant(true,1) : TQVariant(false,0);
+ return text() == "1" ? TQVariant(true) : TQVariant(false);
case KexiDB::Field::Date:
return dateFormatter()->stringToVariant( text() );
case KexiDB::Field::Time:
diff --git a/kexi/plugins/macros/tests/testaction.cpp b/kexi/plugins/macros/tests/testaction.cpp
index 3e4d2816..fecec632 100644
--- a/kexi/plugins/macros/tests/testaction.cpp
+++ b/kexi/plugins/macros/tests/testaction.cpp
@@ -36,7 +36,7 @@ TestAction::TestAction()
setVariable("teststring", "Stringtest", TQString("testString"));
setVariable("testint", "Inttest", int(0));
setVariable("testdouble", "Doubletest", double(0.5));
- setVariable("testbool", "Booltest", TQVariant(true,0));
+ setVariable("testbool", "Booltest", TQVariant(true));
}
TestAction::~TestAction()
diff --git a/kexi/plugins/queries/kexiquerydesignerguieditor.cpp b/kexi/plugins/queries/kexiquerydesignerguieditor.cpp
index 45ea8e1d..582d79e6 100644
--- a/kexi/plugins/queries/kexiquerydesignerguieditor.cpp
+++ b/kexi/plugins/queries/kexiquerydesignerguieditor.cpp
@@ -222,7 +222,7 @@ KexiQueryDesignerGuiEditor::initTableColumns()
KexiTableViewColumn *col3 = new KexiTableViewColumn("visible", KexiDB::Field::Boolean, i18n("Visible"),
i18n("Describes visibility for a given field or expression."));
- col3->field()->setDefaultValue( TQVariant(false, 0) );
+ col3->field()->setDefaultValue( TQVariant(false) );
col3->field()->setNotNull( true );
d->data->addColumn(col3);
@@ -264,7 +264,7 @@ void KexiQueryDesignerGuiEditor::initTableRows()
for (int i=0; i<(int)d->sets->size(); i++) {
KexiTableItem* item;
d->data->append(item = d->data->createItem());
- item->at(COLUMN_ID_VISIBLE) = TQVariant(false, 0);
+ item->at(COLUMN_ID_VISIBLE) = TQVariant(false);
}
d->dataTable->dataAwareObject()->setData(d->data);
@@ -992,7 +992,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
d->data->saveRowChanges(*rowItem, true);
(*rowPropertySet)["sorting"].clearModifiedFlag(); // this property should look "fresh"
if (!rowItem->at(COLUMN_ID_VISIBLE).toBool()) //update
- (*rowPropertySet)["visible"].setValue(TQVariant(false,0), false/*rememberOldValue*/);
+ (*rowPropertySet)["visible"].setValue(TQVariant(false), false/*rememberOldValue*/);
}
}
@@ -1052,7 +1052,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(
//! @todo set["alias"].setValue(columnAlias, false);
//// if (!criteriaString.isEmpty())
set["criteria"].setValue( criteriaString, false );
- set["visible"].setValue( TQVariant(false,1), false );
+ set["visible"].setValue( TQVariant(false), false );
}
//current property set has most probably changed
@@ -1199,7 +1199,7 @@ KexiQueryDesignerGuiEditor::createNewRow(const TQString& tableName, const TQStri
}
(*newItem)[COLUMN_ID_COLUMN]=key;
(*newItem)[COLUMN_ID_TABLE]=tableName;
- (*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1);
+ (*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible);
#ifndef KEXI_NO_QUERY_TOTALS
(*newItem)[COLUMN_ID_TOTALS]=TQVariant(0);
#endif
@@ -1236,7 +1236,7 @@ void KexiQueryDesignerGuiEditor::slotNewItemAppendedForAfterDeletingInSpreadShee
{
KexiTableItem *item = d->data->last();
if (item)
- item->at(COLUMN_ID_VISIBLE) = TQVariant(false, 0); //the same init as in initTableRows()
+ item->at(COLUMN_ID_VISIBLE) = TQVariant(false); //the same init as in initTableRows()
}
void KexiQueryDesignerGuiEditor::slotRowInserted(KexiTableItem* item, uint row, bool /*repaint*/)
@@ -1420,7 +1420,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
if (colnum == COLUMN_ID_COLUMN) {
if (newValue.isNull()) {
d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/);
- d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
+ d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false));//invisible
d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant());
#ifndef KEXI_NO_QUERY_TOTALS
d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
@@ -1499,7 +1499,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
propertySetSwitched();
}
d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/);
- d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1));
+ d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true));
#ifndef KEXI_NO_QUERY_TOTALS
d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));
#endif
@@ -1517,7 +1517,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
if (alias.isEmpty()) //-generate smallest unique alias
alias = generateUniqueAlias();
}
- (*set)["isExpression"].setValue(TQVariant(isExpression,1), saveOldValue);
+ (*set)["isExpression"].setValue(TQVariant(isExpression), saveOldValue);
if (!alias.isEmpty()) {
(*set)["alias"].setValue(alias, saveOldValue);
//pretty printed "alias: expr"
@@ -1532,7 +1532,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int
if (newValue.isNull()) {
if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty())
d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/);
- d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible
+ d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false));//invisible
#ifndef KEXI_NO_QUERY_TOTALS
d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals
#endif
@@ -1721,7 +1721,7 @@ KexiQueryDesignerGuiEditor::createPropertySet( int row,
set->addProperty(prop = new KoProperty::Property("alias", TQVariant(TQString()), i18n("Alias")) );
- set->addProperty(prop = new KoProperty::Property("visible", TQVariant(true, 4)) );
+ set->addProperty(prop = new KoProperty::Property("visible", TQVariant(true)) );
prop->setVisible(false);
/*TODO:
@@ -1739,7 +1739,7 @@ KexiQueryDesignerGuiEditor::createPropertySet( int row,
set->addProperty(prop = new KoProperty::Property("criteria", TQVariant(TQString())) );
prop->setVisible(false);
- set->addProperty(prop = new KoProperty::Property("isExpression", TQVariant(false, 1)) );
+ set->addProperty(prop = new KoProperty::Property("isExpression", TQVariant(false)) );
prop->setVisible(false);
connect(set, TQT_SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)),
diff --git a/kexi/plugins/scripting/kexidb/kexidbconnection.cpp b/kexi/plugins/scripting/kexidb/kexidbconnection.cpp
index 9d577ec1..2a5f5a92 100644
--- a/kexi/plugins/scripting/kexidb/kexidbconnection.cpp
+++ b/kexi/plugins/scripting/kexidb/kexidbconnection.cpp
@@ -167,14 +167,10 @@ Kross::Api::Object::Ptr KexiDBConnection::insertRecord(Kross::Api::List::Ptr arg
if(obj->getClassName() == "Kross::KexiDB::KexiDBFieldList")
return new Kross::Api::Variant(
TQVariant(connection()->insertRecord(
- *Kross::Api::Object::fromObject<KexiDBFieldList>(obj)->fieldlist(),
- values
- ), 0));
+ *Kross::Api::Object::fromObject<KexiDBFieldList>(obj)->fieldlist(), values)));
return new Kross::Api::Variant(
TQVariant(connection()->insertRecord(
- *Kross::Api::Object::fromObject<KexiDBTableSchema>(obj)->tableschema(),
- values
- ), 0));
+ *Kross::Api::Object::fromObject<KexiDBTableSchema>(obj)->tableschema(), values)));
}
bool KexiDBConnection::createDatabase(const TQString& dbname) { return connection()->createDatabase(dbname); }
diff --git a/kexi/plugins/tables/kexitabledesignerview.cpp b/kexi/plugins/tables/kexitabledesignerview.cpp
index 767b5733..4b68a7de 100644
--- a/kexi/plugins/tables/kexitabledesignerview.cpp
+++ b/kexi/plugins/tables/kexitabledesignerview.cpp
@@ -325,7 +325,7 @@ KexiTableDesignerView::createPropertySet( int row, const KexiDB::Field& field, b
));
prop->setVisible(false);
set->addProperty(prop = new KoProperty::Property("this:useCaptionAsObjectName",
- TQVariant(true, 1), TQString())); //we want "caption" to be displayed in the header, not name
+ TQVariant(true), TQString())); //we want "caption" to be displayed in the header, not name
prop->setVisible(false);
//name
@@ -376,7 +376,7 @@ KexiTableDesignerView::createPropertySet( int row, const KexiDB::Field& field, b
prop->setVisible(false);//always hidden
set->addProperty(prop
- = new KoProperty::Property("unsigned", TQVariant(field.isUnsigned(), 4), i18n("Unsigned Number")));
+ = new KoProperty::Property("unsigned", TQVariant(field.isUnsigned()), i18n("Unsigned Number")));
set->addProperty( prop
= new KoProperty::Property("length", (int)field.length()/*200?*/, i18n("Length")));
@@ -407,24 +407,24 @@ KexiTableDesignerView::createPropertySet( int row, const KexiDB::Field& field, b
// prop->setVisible(false);
set->addProperty( prop
- = new KoProperty::Property("primaryKey", TQVariant(field.isPrimaryKey(), 4), i18n("Primary Key")));
+ = new KoProperty::Property("primaryKey", TQVariant(field.isPrimaryKey()), i18n("Primary Key")));
prop->setIcon("key");
set->addProperty( prop
- = new KoProperty::Property("unique", TQVariant(field.isUniqueKey(), 4), i18n("Unique")));
+ = new KoProperty::Property("unique", TQVariant(field.isUniqueKey()), i18n("Unique")));
set->addProperty( prop
- = new KoProperty::Property("notNull", TQVariant(field.isNotNull(), 4), i18n("Required")));
+ = new KoProperty::Property("notNull", TQVariant(field.isNotNull()), i18n("Required")));
set->addProperty( prop
- = new KoProperty::Property("allowEmpty", TQVariant(!field.isNotEmpty(), 4), i18n("Allow Zero\nSize")));
+ = new KoProperty::Property("allowEmpty", TQVariant(!field.isNotEmpty()), i18n("Allow Zero\nSize")));
set->addProperty( prop
- = new KoProperty::Property("autoIncrement", TQVariant(field.isAutoIncrement(), 4), i18n("Autonumber")));
+ = new KoProperty::Property("autoIncrement", TQVariant(field.isAutoIncrement()), i18n("Autonumber")));
prop->setIcon("autonumber");
set->addProperty( prop
- = new KoProperty::Property("indexed", TQVariant(field.isIndexed(), 4), i18n("Indexed")));
+ = new KoProperty::Property("indexed", TQVariant(field.isIndexed()), i18n("Indexed")));
//- properties related to lookup columns (used and set by the "lookup column" tab in the property pane)
KexiDB::LookupFieldSchema *lookupFieldSchema = field.table() ? field.table()->lookupFieldSchema(field) : 0;
@@ -491,7 +491,7 @@ void KexiTableDesignerView::slotTogglePrimaryKey()
return;
KoProperty::Set &set = *propertySet();
bool isSet = !set["primaryKey"].value().toBool();
- set.changeProperty("primaryKey", TQVariant(isSet,1)); //this will update all related properties as well
+ set.changeProperty("primaryKey", TQVariant(isSet)); //this will update all related properties as well
/* CommandGroup *setPrimaryKeyCommand;
if (isSet) {
setPrimaryKeyCommand = new CommandGroup(i18n("Set primary key for field \"%1\"")
@@ -510,8 +510,8 @@ void KexiTableDesignerView::switchPrimaryKey(KoProperty::Set &propertySet,
bool set, bool aWasPKey, CommandGroup* commandGroup)
{
const bool was_pkey = aWasPKey || propertySet["primaryKey"].value().toBool();
-// propertySet["primaryKey"] = TQVariant(set, 1);
- d->setPropertyValueIfNeeded( propertySet, "primaryKey", TQVariant(set,1), commandGroup );
+// propertySet["primaryKey"] = TQVariant(set);
+ d->setPropertyValueIfNeeded( propertySet, "primaryKey", TQVariant(set), commandGroup );
if (&propertySet==this->propertySet()) {
//update action and icon @ column 0 (only if we're changing current property set)
d->action_toggle_pkey->setChecked(set);
@@ -537,10 +537,10 @@ void KexiTableDesignerView::switchPrimaryKey(KoProperty::Set &propertySet,
break;
}
if (i<count) {//remove
- //(*s)["autoIncrement"] = TQVariant(false, 0);
- d->setPropertyValueIfNeeded( *s, "autoIncrement", TQVariant(false,0), commandGroup );
- //(*s)["primaryKey"] = TQVariant(false, 0);
- d->setPropertyValueIfNeeded( *s, "primaryKey", TQVariant(false,0), commandGroup );
+ //(*s)["autoIncrement"] = TQVariant(false);
+ d->setPropertyValueIfNeeded( *s, "autoIncrement", TQVariant(false), commandGroup );
+ //(*s)["primaryKey"] = TQVariant(false);
+ d->setPropertyValueIfNeeded( *s, "primaryKey", TQVariant(false), commandGroup );
//remove key from table
d->view->KexiDataAwareObjectInterface::data()->clearRowEditBuffer();
KexiTableItem *item = d->view->itemAt(i);
@@ -560,8 +560,8 @@ void KexiTableDesignerView::switchPrimaryKey(KoProperty::Set &propertySet,
//propertySet["subType"] = KexiDB::Field::typeString(KexiDB::Field::BigInteger);
d->setPropertyValueIfNeeded( propertySet, "subType", KexiDB::Field::typeString(KexiDB::Field::BigInteger),
commandGroup );
- //propertySet["unsigned"] = TQVariant(true,4);
- d->setPropertyValueIfNeeded( propertySet, "unsigned", TQVariant(true,4), commandGroup );
+ //propertySet["unsigned"] = TQVariant(true);
+ d->setPropertyValueIfNeeded( propertySet, "unsigned", TQVariant(true), commandGroup );
/*todo*/
d->slotBeforeCellChanged_enabled = true;
}
@@ -780,9 +780,9 @@ void KexiTableDesignerView::slotBeforeCellChanged(
// notNull and defaultValue=false is reasonable for boolean type
if (fieldType == KexiDB::Field::Boolean) {
//! @todo maybe this is good for other data types as well?
- d->setPropertyValueIfNeeded( set, "notNull", TQVariant(true, 1), changeDataTypeCommand,
+ d->setPropertyValueIfNeeded( set, "notNull", TQVariant(true), changeDataTypeCommand,
false /*!forceAddCommand*/, false /*!rememberOldValue*/);
- d->setPropertyValueIfNeeded( set, "defaultValue", TQVariant(false, 1), changeDataTypeCommand,
+ d->setPropertyValueIfNeeded( set, "defaultValue", TQVariant(false), changeDataTypeCommand,
false /*!forceAddCommand*/, false /*!rememberOldValue*/);
}
@@ -799,8 +799,8 @@ void KexiTableDesignerView::slotBeforeCellChanged(
/*not needed, line below will do the work
d->view->KexiDataAwareObjectInterface::data()->updateRowEditBuffer(item, COLUMN_ID_ICON, TQVariant());
d->view->KexiDataAwareObjectInterface::data()->saveRowChanges(*item); */
- //set["primaryKey"] = TQVariant(false, 1);
- d->setPropertyValueIfNeeded( set, "primaryKey", TQVariant(false, 1), changeDataTypeCommand );
+ //set["primaryKey"] = TQVariant(false);
+ d->setPropertyValueIfNeeded( set, "primaryKey", TQVariant(false), changeDataTypeCommand );
//! @todo should we display (passive?) dialog informing about cleared pkey?
}
}
@@ -884,7 +884,7 @@ void KexiTableDesignerView::slotRowUpdated(KexiTableItem *item)
// reasonable case for boolean type: set notNull flag and "false" as default value
if (fieldType == KexiDB::Field::Boolean) {
field.setNotNull( true );
- field.setDefaultValue( TQVariant(false, 0) );
+ field.setDefaultValue( TQVariant(false) );
}
kexipluginsdbg << "KexiTableDesignerView::slotRowUpdated(): " << field.debugString() << endl;
@@ -970,15 +970,15 @@ void KexiTableDesignerView::slotPropertyChanged(KoProperty::Set& set, KoProperty
setAutonumberCommand = new CommandGroup(
i18n("Assign autonumber for field \"%1\"").arg(set["name"].value().toString()) );
toplevelCommand = setAutonumberCommand;
- d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(true,1), setAutonumberCommand );
+ d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(true), setAutonumberCommand );
}
else {
setAutonumberCommand = new CommandGroup(
i18n("Remove autonumber from field \"%1\"").arg(set["name"].value().toString()) );
//d->slotPropertyChanged_enabled = false;
-// set["autoIncrement"].setValue( TQVariant(false,1), false/*don't save old*/);
+// set["autoIncrement"].setValue( TQVariant(false), false/*don't save old*/);
// d->slotPropertyChanged_enabled = true;
- d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(false,1), setAutonumberCommand,
+ d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(false), setAutonumberCommand,
true /*forceAddCommand*/, false/*rememberOldValue*/ );
addHistoryCommand( setAutonumberCommand, false /* !execute */ );
return;
@@ -997,10 +997,10 @@ void KexiTableDesignerView::slotPropertyChanged(KoProperty::Set& set, KoProperty
CommandGroup *unsetIndexedOrUniquOrNotNullCommand = new CommandGroup(
i18n("Set \"%1\" property for field \"%2\"").arg(property.caption()).arg(set["name"].value().toString()) );
toplevelCommand = unsetIndexedOrUniquOrNotNullCommand;
- d->setPropertyValueIfNeeded( set, pname, TQVariant(false,1), unsetIndexedOrUniquOrNotNullCommand );
+ d->setPropertyValueIfNeeded( set, pname, TQVariant(false), unsetIndexedOrUniquOrNotNullCommand );
if (pname=="notNull") {
-//? d->setPropertyValueIfNeeded( set, "notNull", TQVariant(true,1), unsetIndexedOrUniquOrNotNullCommand );
- d->setPropertyValueIfNeeded( set, "unique", TQVariant(false,1), unsetIndexedOrUniquOrNotNullCommand );
+//? d->setPropertyValueIfNeeded( set, "notNull", TQVariant(true), unsetIndexedOrUniquOrNotNullCommand );
+ d->setPropertyValueIfNeeded( set, "unique", TQVariant(false), unsetIndexedOrUniquOrNotNullCommand );
}
}
@@ -1091,19 +1091,19 @@ void KexiTableDesignerView::slotPropertyChanged(KoProperty::Set& set, KoProperty
else
toplevelCommand = setPrimaryKeyCommand;
- d->setPropertyValueIfNeeded( set, "primaryKey", TQVariant(true,1), setPrimaryKeyCommand, true /*forceAddCommand*/ );
- d->setPropertyValueIfNeeded( set, "unique", TQVariant(true,1), setPrimaryKeyCommand );
- d->setPropertyValueIfNeeded( set, "notNull", TQVariant(true,1), setPrimaryKeyCommand );
- d->setPropertyValueIfNeeded( set, "allowEmpty", TQVariant(false,1), setPrimaryKeyCommand );
- d->setPropertyValueIfNeeded( set, "indexed", TQVariant(true,1), setPrimaryKeyCommand );
+ d->setPropertyValueIfNeeded( set, "primaryKey", TQVariant(true), setPrimaryKeyCommand, true /*forceAddCommand*/ );
+ d->setPropertyValueIfNeeded( set, "unique", TQVariant(true), setPrimaryKeyCommand );
+ d->setPropertyValueIfNeeded( set, "notNull", TQVariant(true), setPrimaryKeyCommand );
+ d->setPropertyValueIfNeeded( set, "allowEmpty", TQVariant(false), setPrimaryKeyCommand );
+ d->setPropertyValueIfNeeded( set, "indexed", TQVariant(true), setPrimaryKeyCommand );
//! \todo: add setting for this: "Integer PKeys have autonumber set by default"
- d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(true,1), setPrimaryKeyCommand );
+ d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(true), setPrimaryKeyCommand );
-/* set["unique"] = TQVariant(true,1);
- set["notNull"] = TQVariant(true,1);
- set["allowEmpty"] = TQVariant(false,1);
- set["indexed"] = TQVariant(true,1);
- set["autoIncrement"] = TQVariant(true,1);*/
+/* set["unique"] = TQVariant(true);
+ set["notNull"] = TQVariant(true);
+ set["allowEmpty"] = TQVariant(false);
+ set["indexed"] = TQVariant(true);
+ set["autoIncrement"] = TQVariant(true);*/
// d->addHistoryCommand_in_slotPropertyChanged_enabled = prev_addHistoryCommand_in_slotPropertyChanged_enabled;
//down addHistoryCommand( toplevelCommand, false /* !execute */ );
}
@@ -1117,8 +1117,8 @@ void KexiTableDesignerView::slotPropertyChanged(KoProperty::Set& set, KoProperty
else
toplevelCommand = setPrimaryKeyCommand;
- d->setPropertyValueIfNeeded( set, "primaryKey", TQVariant(false,1), setPrimaryKeyCommand, true /*forceAddCommand*/ );
- d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(false,1), setPrimaryKeyCommand );
+ d->setPropertyValueIfNeeded( set, "primaryKey", TQVariant(false), setPrimaryKeyCommand, true /*forceAddCommand*/ );
+ d->setPropertyValueIfNeeded( set, "autoIncrement", TQVariant(false), setPrimaryKeyCommand );
// set["autoIncrement"] = TQVariant(false,1);
//down addHistoryCommand( toplevelCommand, false /* !execute */ );
diff --git a/kexi/widget/kexiqueryparameters.cpp b/kexi/widget/kexiqueryparameters.cpp
index 171df484..a3ecdb81 100644
--- a/kexi/widget/kexiqueryparameters.cpp
+++ b/kexi/widget/kexiqueryparameters.cpp
@@ -61,7 +61,7 @@ TQValueList<TQVariant> KexiQueryParameters::getParameters(TQWidget *parent,
caption, (*it).message, list, 0/*current*/, false /*!editable*/, &ok, parent);
if (!ok || result.isEmpty())
return TQValueList<TQVariant>(); //cancelled
- values.append( TQVariant( result==list.first(), 1 ) );
+ values.append( TQVariant( result==list.first() ) );
break;
}
case KexiDB::Field::Date: {
diff --git a/kexi/widget/tableview/kexibooltableedit.cpp b/kexi/widget/tableview/kexibooltableedit.cpp
index 2bc14f4a..f0527a95 100644
--- a/kexi/widget/tableview/kexibooltableedit.cpp
+++ b/kexi/widget/tableview/kexibooltableedit.cpp
@@ -71,7 +71,7 @@ TQVariant KexiBoolTableEdit::value()
void KexiBoolTableEdit::clear()
{
if (field()->isNotNull())
- m_currentValue = TQVariant(false, 0);
+ m_currentValue = TQVariant(false);
else
m_currentValue = TQVariant();
}
@@ -120,13 +120,13 @@ void KexiBoolTableEdit::setupContents( TQPainter *p, bool focused, const TQVaria
void KexiBoolTableEdit::clickedOnContents()
{
if (field()->isNotNull())
- m_currentValue = TQVariant( !m_currentValue.toBool(), 0 );
+ m_currentValue = TQVariant( !m_currentValue.toBool() );
else {
// null allowed: use the cycle: true -> false -> null
if (m_currentValue.isNull())
- m_currentValue = TQVariant( true, 1 );
+ m_currentValue = TQVariant( true );
else
- m_currentValue = m_currentValue.toBool() ? TQVariant( false, 1 ) : TQVariant();
+ m_currentValue = m_currentValue.toBool() ? TQVariant( false ) : TQVariant();
}
}
@@ -137,12 +137,11 @@ void KexiBoolTableEdit::handleAction(const TQString& actionName)
bool ok;
const int value = tqApp->clipboard()->text( TQClipboard::Clipboard ).toInt(&ok);
if (ok) {
- m_currentValue = (value==0) ? TQVariant(false, 0) : TQVariant(true, 1);
+ m_currentValue = (value==0) ? TQVariant(false) : TQVariant(true);
}
else {
m_currentValue = field()->isNotNull()
- ? TQVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/
- : TQVariant();
+ ? TQVariant(false) : TQVariant();
}
repaintRelatedCell();
}
@@ -150,8 +149,7 @@ void KexiBoolTableEdit::handleAction(const TQString& actionName)
emit editRequested();
//! @todo handle defaultValue...
m_currentValue = field()->isNotNull()
- ? TQVariant(0, false)/*0 instead of NULL - handle case when null is not allowed*/
- : TQVariant();
+ ? TQVariant(false) : TQVariant();
handleCopyAction(m_origValue, TQVariant());
repaintRelatedCell();
}
diff --git a/kexi/widget/tableview/kexitextformatter.cpp b/kexi/widget/tableview/kexitextformatter.cpp
index 5ff28920..b9208d43 100644
--- a/kexi/widget/tableview/kexitextformatter.cpp
+++ b/kexi/widget/tableview/kexitextformatter.cpp
@@ -157,7 +157,7 @@ TQVariant KexiTextFormatter::textToValue(const TQString& text) const
return text.toLongLong();
case KexiDB::Field::Boolean:
//! @todo temporary solution for booleans!
- return text == "1" ? TQVariant(true,1) : TQVariant(false,0);
+ return text == "1" ? TQVariant(true) : TQVariant(false);
case KexiDB::Field::Date:
return d->dateFormatter->stringToVariant( text );
case KexiDB::Field::Time: