Permalink
Browse files

Fixed permission generation for Views (issue

Changed SRID digit count to 5 (issue #181)

Fixed bug on textbox with unicode texts (issue

Minor fixes on Index and Rule editing forms to
handle correctly unicode expressions.
  • Loading branch information...
1 parent 9415f19 commit 9a0222e56323f7a71c7a0d0916469b23b2bfbf58 @rkhaotix rkhaotix committed Mar 21, 2013
@@ -330,7 +330,11 @@ QString Permission::getCodeDefinition(unsigned def_type)
attributes[ParsersAttributes::OBJECT]=object->getName(true);
if(def_type==SchemaParser::SQL_DEFINITION)
- attributes[ParsersAttributes::TYPE]=BaseObject::getSQLName(object->getObjectType());
+ {
+ //Views and Tables uses the same key word when setting permission (TABLE)
+ attributes[ParsersAttributes::TYPE]=
+ (object->getObjectType()==OBJ_VIEW ? BaseObject::getSQLName(OBJ_TABLE): BaseObject::getSQLName(object->getObjectType()));
+ }
else
attributes[ParsersAttributes::TYPE]=BaseObject::getSchemaName(object->getObjectType());
@@ -194,7 +194,7 @@ void IndexWidget::handleElement(int elem_idx)
elem.setOperatorClass(dynamic_cast<OperatorClass *>(op_class_sel->getSelectedObject()));
if(expression_rb->isChecked())
- elem.setExpression(elem_expr_txt->toPlainText());
+ elem.setExpression(elem_expr_txt->toPlainText().toUtf8());
else
elem.setColumn(reinterpret_cast<Column *>(column_cmb->itemData(column_cmb->currentIndex()).value<void *>()));
@@ -224,7 +224,7 @@ void IndexWidget::editElement(int elem_idx)
else
{
expression_rb->setChecked(true);
- elem_expr_txt->setPlainText(elem.getExpression());
+ elem_expr_txt->setPlainText(Utf8String::create(elem.getExpression()));
}
if(elem.getSortingAttribute(IndexElement::ASC_ORDER))
@@ -297,7 +297,7 @@ void IndexWidget::setAttributes(DatabaseModel *model, Table *parent_obj, Operati
concurrent_chk->setChecked(index->getIndexAttribute(Index::CONCURRENT));
fast_update_chk->setChecked(index->getIndexAttribute(Index::FAST_UPDATE));
unique_chk->setChecked(index->getIndexAttribute(Index::UNIQUE));
- cond_expr_txt->setPlainText(index->getConditionalExpression());
+ cond_expr_txt->setPlainText(Utf8String::create(index->getConditionalExpression()));
elements_tab->blockSignals(true);
count=index->getElementCount();
@@ -325,7 +325,7 @@ void IndexWidget::applyConfiguration(void)
index->setIndexAttribute(Index::FAST_UPDATE, fast_update_chk->isChecked());
index->setIndexAttribute(Index::CONCURRENT, concurrent_chk->isChecked());
index->setIndexAttribute(Index::UNIQUE, unique_chk->isChecked());
- index->setConditionalExpression(cond_expr_txt->toPlainText());
+ index->setConditionalExpression(cond_expr_txt->toPlainText().toUtf8());
index->setIndexingType(IndexingType(indexing_cmb->currentText()));
if(fill_factor_chk->isChecked())
@@ -106,14 +106,14 @@ void RuleWidget::setAttributes(DatabaseModel *model, Table *parent_tab, Operatio
{
event_cmb->setCurrentIndex(event_cmb->findText(~rule->getEventType()));
exec_type_cmb->setCurrentIndex(exec_type_cmb->findText(~rule->getExecutionType()));
- cond_expr_txt->setPlainText(rule->getConditionalExpression());
+ cond_expr_txt->setPlainText(Utf8String::create(rule->getConditionalExpression()));
commands_tab->blockSignals(true);
qtd=rule->getCommandCount();
for(i=0; i < qtd; i++)
{
commands_tab->addRow();
- commands_tab->setCellText(rule->getCommand(i),i,0);
+ commands_tab->setCellText(Utf8String::create(rule->getCommand(i)),i,0);
}
commands_tab->blockSignals(false);
}
@@ -131,13 +131,13 @@ void RuleWidget::applyConfiguration(void)
rule=dynamic_cast<Rule *>(this->object);
rule->setEventType(EventType(event_cmb->currentText()));
rule->setExecutionType(ExecutionType(exec_type_cmb->currentText()));
- rule->setConditionalExpression(cond_expr_txt->toPlainText());
+ rule->setConditionalExpression(cond_expr_txt->toPlainText().toUtf8());
rule->removeCommands();
count=commands_tab->getRowCount();
for(i=0; i < count; i++)
- rule->addCommand(commands_tab->getCellText(i,0));
+ rule->addCommand(commands_tab->getCellText(i,0).toUtf8());
BaseObjectWidget::applyConfiguration();
finishConfiguration();
@@ -85,7 +85,7 @@ void TextboxWidget::applyConfiguration(void)
startConfiguration<Textbox>();
txtbox=dynamic_cast<Textbox *>(this->object);
- txtbox->setComment(text_txt->toPlainText());
+ txtbox->setComment(text_txt->toPlainText().toUtf8());
txtbox->setTextAttribute(Textbox::ITALIC_TXT, italic_chk->isChecked());
txtbox->setTextAttribute(Textbox::BOLD_TXT, bold_chk->isChecked());
txtbox->setTextAttribute(Textbox::UNDERLINE_TXT, underline_chk->isChecked());
@@ -129,7 +129,7 @@
<number>-1</number>
</property>
<property name="maximum">
- <number>9999</number>
+ <number>99999</number>
</property>
</widget>
</item>
@@ -59,7 +59,7 @@ namespace GlobalAttributes {
TEMPORARY_DIR=(getenv("PGMODELER_TMP_DIR") ? QString(getenv("PGMODELER_TMP_DIR")).replace("\\","/") : QString("./tmp"));
static const QString
- PGMODELER_VERSION="v0.4.1_r1",
+ PGMODELER_VERSION="0.4.1_r1",
PGMODELER_WIKI="http://www.pgmodeler.com.br/wiki",
CRASH_HANDLER_FILE="pgmodeler%1.crash",

0 comments on commit 9a0222e

Please sign in to comment.