Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove executeExport* methods from QgsWindowManagerInterface
No longer required, and of limited value anyway
  • Loading branch information
nyalldawson committed Nov 4, 2018
1 parent f455b9e commit a890622
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 90 deletions.
34 changes: 0 additions & 34 deletions python/gui/auto_generated/qgswindowmanagerinterface.sip.in
Expand Up @@ -45,40 +45,6 @@ existing instance to the foreground.

Returns the dialog if shown, or None if the dialog either could not be
created or is not supported by the window manager implementation.
%End

virtual QString executeExportVectorLayerDialog( QgsVectorLayer *layer );
%Docstring
Executes the standard "Export Vector Layer" dialog for the specified ``layer``,
and performs an export using the settings accepted in the dialog.

The created vector file name is returned.

Depending on the window manager implementation the actual export of the
layer may occur in a background task, in which case calling this method
will immediately return after the dialog has been accepted, but before
the exported layer has been finalized.

.. seealso:: :py:func:`executeExportRasterLayerDialog`

.. versionadded:: 3.6
%End

virtual QString executeExportRasterLayerDialog( QgsRasterLayer *layer );
%Docstring
Executes the standard "Export Raster Layer" dialog for the specified ``layer``,
and performs an export using the settings accepted in the dialog.

The created raster file name is returned.

Depending on the window manager implementation the actual export of the
layer may occur in a background task, in which case calling this method
will immediately return after the dialog has been accepted, but before
the exported layer has been finalized.

.. seealso:: :py:func:`executeExportVectorLayerDialog`

.. versionadded:: 3.6
%End

};
Expand Down
4 changes: 2 additions & 2 deletions src/app/browser/qgsinbuiltdataitemproviders.cpp
Expand Up @@ -335,7 +335,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
std::unique_ptr<QgsVectorLayer> layer( new QgsVectorLayer( layerItem->uri(), layerItem->name(), layerItem->providerKey() ) );
if ( layer && layer->isValid() )
{
QgsGui::instance()->windowManager()->executeExportVectorLayerDialog( layer.get() );
QgisApp::instance()->saveAsFile( layer.get(), false, false );
}
break;
}
Expand All @@ -345,7 +345,7 @@ void QgsLayerItemGuiProvider::populateContextMenu( QgsDataItem *item, QMenu *men
std::unique_ptr<QgsRasterLayer> layer( new QgsRasterLayer( layerItem->uri(), layerItem->name(), layerItem->providerKey() ) );
if ( layer && layer->isValid() )
{
QgsGui::instance()->windowManager()->executeExportRasterLayerDialog( layer.get() );
QgisApp::instance()->saveAsFile( layer.get(), false, false );
}
break;
}
Expand Down
10 changes: 0 additions & 10 deletions src/app/qgsappwindowmanager.cpp
Expand Up @@ -47,16 +47,6 @@ QWidget *QgsAppWindowManager::openStandardDialog( QgsWindowManagerInterface::Sta
return nullptr;
}

QString QgsAppWindowManager::executeExportVectorLayerDialog( QgsVectorLayer *layer )
{
return QgisApp::instance()->saveAsFile( layer, false, false );
}

QString QgsAppWindowManager::executeExportRasterLayerDialog( QgsRasterLayer *layer )
{
return QgisApp::instance()->saveAsFile( layer, false, false );
}

QWidget *QgsAppWindowManager::openApplicationDialog( QgsAppWindowManager::ApplicationDialog dialog )
{
switch ( dialog )
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgsappwindowmanager.h
Expand Up @@ -41,8 +41,6 @@ class QgsAppWindowManager : public QgsWindowManagerInterface
~QgsAppWindowManager();

QWidget *openStandardDialog( QgsWindowManagerInterface::StandardDialog dialog ) override;
QString executeExportVectorLayerDialog( QgsVectorLayer *layer ) override;
QString executeExportRasterLayerDialog( QgsRasterLayer *layer ) override;

/**
* Opens an instance of a application QGIS dialog. Depending on the dialog,
Expand Down
42 changes: 0 additions & 42 deletions src/gui/qgswindowmanagerinterface.h
Expand Up @@ -56,48 +56,6 @@ class GUI_EXPORT QgsWindowManagerInterface
*/
virtual QWidget *openStandardDialog( StandardDialog dialog ) = 0;

/**
* Executes the standard "Export Vector Layer" dialog for the specified \a layer,
* and performs an export using the settings accepted in the dialog.
*
* The created vector file name is returned.
*
* Depending on the window manager implementation the actual export of the
* layer may occur in a background task, in which case calling this method
* will immediately return after the dialog has been accepted, but before
* the exported layer has been finalized.
*
* \see executeExportRasterLayerDialog()
*
* \since QGIS 3.6
*/
virtual QString executeExportVectorLayerDialog( QgsVectorLayer *layer )
{
Q_UNUSED( layer );
return QString();
}

/**
* Executes the standard "Export Raster Layer" dialog for the specified \a layer,
* and performs an export using the settings accepted in the dialog.
*
* The created raster file name is returned.
*
* Depending on the window manager implementation the actual export of the
* layer may occur in a background task, in which case calling this method
* will immediately return after the dialog has been accepted, but before
* the exported layer has been finalized.
*
* \see executeExportVectorLayerDialog()
*
* \since QGIS 3.6
*/
virtual QString executeExportRasterLayerDialog( QgsRasterLayer *layer )
{
Q_UNUSED( layer );
return QString();
}

};

///@endcond
Expand Down

0 comments on commit a890622

Please sign in to comment.