Exemplo n.º 1
0
ObjectPtr StringDialog::createNewDataString() {
  const DataSourcePtr dataSource = _stringTab->dataSource();

  if (!dataSource)
    return 0;

  const QString field = _stringTab->field();

  Q_ASSERT(_document && _document->objectStore());

  DataStringPtr string = _document->objectStore()->createObject<DataString>();

  string->writeLock();
  string->change(dataSource, field);

  if (DataDialog::tagStringAuto()) {
     string->setDescriptiveName(QString());
  } else {
     string->setDescriptiveName(DataDialog::tagString());
  }

  string->registerChange();
  string->unlock();

  _dataObjectName = string->Name();

  //UpdateServer::self()->requestUpdateSignal();

  return string;
}
Exemplo n.º 2
0
PrimitivePtr DataString::_makeDuplicate() const {
  Q_ASSERT(store());
  DataStringPtr string = store()->createObject<DataString>();

  string->writeLock();
  string->change(_dp->dataSource(), _dp->_field);
  if (descriptiveNameIsManual()) {
    string->setDescriptiveName(descriptiveName());
  }

  string->registerChange();
  string->unlock();

  return kst_cast<Primitive>(string);
}