Skip to content
Permalink
Browse files

variable names, doc and delete dialog

  • Loading branch information
signedav committed Jul 3, 2020
1 parent 83ec606 commit dc0039aa6a53fb2b10d5c28b187d075c6243a649
Showing with 12 additions and 10 deletions.
  1. +6 −8 src/app/qgisapp.cpp
  2. +6 −2 src/app/qgisapp.h
@@ -10217,9 +10217,6 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer )
QgsAttributeEditorContext context( createAttributeEditorContext() );
context.setAllowCustomUi( false );
context.setFormMode( QgsAttributeEditorContext::StandaloneDialog );
context.setVectorLayerTools( mVectorLayerTools );
context.setCadDockWidget( mAdvancedDigitizingDockWidget );
context.setMapCanvas( mMapCanvas );

QgsFixAttributeDialog *dialog = new QgsFixAttributeDialog( pasteVectorLayer, invalidFeatures, this, context );

@@ -10238,6 +10235,7 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer )
break;
}
pasteFeatures( pasteVectorLayer, invalidGeometriesCount, nTotalFeatures, features );
dialog->deleteLater();
} );
dialog->show();
return;
@@ -10247,12 +10245,12 @@ void QgisApp::pasteFromClipboard( QgsMapLayer *destinationLayer )
pasteFeatures( pasteVectorLayer, invalidGeometriesCount, nTotalFeatures, newFeatures );
}

void QgisApp::pasteFeatures( QgsVectorLayer *pasteVectorLayer, int invalidGeometriesCount, int nTotalFeatures, QgsFeatureList &newFeatures )
void QgisApp::pasteFeatures( QgsVectorLayer *pasteVectorLayer, int invalidGeometriesCount, int nTotalFeatures, QgsFeatureList &features )
{
pasteVectorLayer->addFeatures( newFeatures );
pasteVectorLayer->addFeatures( features );
QgsFeatureIds newIds;
newIds.reserve( newFeatures.size() );
for ( const QgsFeature &f : qgis::as_const( newFeatures ) )
newIds.reserve( features.size() );
for ( const QgsFeature &f : qgis::as_const( features ) )
{
newIds << f.id();
}
@@ -10261,7 +10259,7 @@ void QgisApp::pasteFeatures( QgsVectorLayer *pasteVectorLayer, int invalidGeomet
pasteVectorLayer->endEditCommand();
pasteVectorLayer->updateExtents();

int nCopiedFeatures = newFeatures.count();
int nCopiedFeatures = features.count();
Qgis::MessageLevel level = ( nCopiedFeatures == 0 || invalidGeometriesCount > 0 ) ? Qgis::Warning : Qgis::Info;
QString message;
if ( nCopiedFeatures == 0 )
@@ -928,8 +928,6 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
*/
void pasteFromClipboard( QgsMapLayer *destinationLayer = nullptr );

void pasteFeatures( QgsVectorLayer *pasteVectorLayer, int invalidGeometriesCount, int nTotalFeatures, QgsFeatureList &newFeatures );

//! copies features on the clipboard to a new vector layer
void pasteAsNewVector();
//! copies features on the clipboard to a new memory vector layer
@@ -2189,6 +2187,12 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
*/
void resolveVectorLayerWeakRelations( QgsVectorLayer *vectorLayer );

/**
* Pastes the \a features to the \a pasteVectorLayer and gives feedback to the user
* according to \a invalidGeometryCount and \a nTotalFeatures
*/
void pasteFeatures( QgsVectorLayer *pasteVectorLayer, int invalidGeometriesCount, int nTotalFeatures, QgsFeatureList &features );


QgisAppStyleSheet *mStyleSheetBuilder = nullptr;

0 comments on commit dc0039a

Please sign in to comment.
You can’t perform that action at this time.