예제 #1
0
bool QgsTransaction::rollback( QString& errorMsg )
{
  if ( !mTransactionActive )
  {
    return false;
  }

  Q_FOREACH ( QgsVectorLayer* l, mLayers )
  {
    if ( l->isEditable() )
    {
      return false;
    }
  }

  if ( !rollbackTransaction( errorMsg ) )
  {
    return false;
  }

  setLayerTransactionIds( 0 );
  mTransactionActive = false;

  emit afterRollback();

  return true;
}
예제 #2
0
bool QgsTransaction::commit( QString& errorMsg )
{
  if ( !mTransactionActive )
    return false;

  if ( !commitTransaction( errorMsg ) )
    return false;

  setLayerTransactionIds( nullptr );
  mTransactionActive = false;
  return true;
}
예제 #3
0
bool QgsTransaction::begin( QString& errorMsg, int statementTimeout )
{
  if ( mTransactionActive )
    return false;

  //Set all layers to direct edit mode
  if ( !beginTransaction( errorMsg, statementTimeout ) )
    return false;

  setLayerTransactionIds( this );
  mTransactionActive = true;
  return true;
}
예제 #4
0
bool QgsTransaction::rollback( QString& errorMsg )
{
  if ( !mTransactionActive )
    return false;

  if ( !rollbackTransaction( errorMsg ) )
    return false;

  setLayerTransactionIds( nullptr );
  mTransactionActive = false;

  emit afterRollback();

  return true;
}
예제 #5
0
bool QgsTransaction::commit( QString& errorMsg )
{
  if ( !mTransactionActive )
  {
    return false;
  }

  Q_FOREACH ( QgsVectorLayer* l, mLayers )
  {
    if ( !l || l->isEditable() )
    {
      return false;
    }
  }

  if ( !commitTransaction( errorMsg ) )
  {
    return false;
  }

  setLayerTransactionIds( 0 );
  mTransactionActive = false;
  return true;
}
예제 #6
0
QgsTransaction::~QgsTransaction()
{
  setLayerTransactionIds( 0 );
}
예제 #7
0
QgsTransaction::~QgsTransaction()
{
  setLayerTransactionIds( nullptr );
}