Skip to content

Commit

Permalink
Improve tags, name, description because it's not given that file down…
Browse files Browse the repository at this point in the history
…load is an http request and you can use this alogrithm for http requests and don't care about the file (just create a tmp file).

Don't allow the filename as optional because it fails without it anyway in the QgsFileDownloader.
  • Loading branch information
signedav authored and nyalldawson committed Aug 27, 2024
1 parent fee8084 commit 7290a7a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/analysis/processing/qgsalgorithmfiledownloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ QString QgsFileDownloaderAlgorithm::name() const

QString QgsFileDownloaderAlgorithm::displayName() const
{
return tr( "Download file" );
return tr( "Download file (HTTP request)" );
}

QStringList QgsFileDownloaderAlgorithm::tags() const
{
return tr( "file,downloader,internet,url,fetch,get,https" ).split( ',' );
return tr( "file,downloader,internet,url,fetch,get,post,request,https" ).split( ',' );
}

QString QgsFileDownloaderAlgorithm::group() const
Expand All @@ -55,7 +55,7 @@ QString QgsFileDownloaderAlgorithm::groupId() const

QString QgsFileDownloaderAlgorithm::shortHelpString() const
{
return tr( "This algorithm downloads a URL on the file system." );
return tr( "This algorithm downloads a URL on the file system with an HTTP GET or POST request" );
}

QgsFileDownloaderAlgorithm *QgsFileDownloaderAlgorithm::createInstance() const
Expand Down Expand Up @@ -85,9 +85,8 @@ void QgsFileDownloaderAlgorithm::initAlgorithm( const QVariantMap & )
dataParam->setHelp( QObject::tr( "The data to add in the body if the request is a POST" ) );
dataParam->setFlags( dataParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
addParameter( dataParam.release() );

addParameter( new QgsProcessingParameterFileDestination( QStringLiteral( "OUTPUT" ),
tr( "File destination" ), QObject::tr( "All files (*.*)" ), QVariant(), true ) );
tr( "File destination" ), QObject::tr( "All files (*.*)" ), QVariant(), false ) );
}

QVariantMap QgsFileDownloaderAlgorithm::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
Expand Down

0 comments on commit 7290a7a

Please sign in to comment.