23using namespace Qt::StringLiterals;
27QgsSimpleCopyExternalStorageStoredContent::QgsSimpleCopyExternalStorageStoredContent(
const QString &filePath,
const QString &url,
const QString &authcfg )
35 mUrl = mCopyTask->destination();
42 reportError( mCopyTask->errorString() );
47 emit progressChanged( progress );
51void QgsSimpleCopyExternalStorageStoredContent::store()
57void QgsSimpleCopyExternalStorageStoredContent::cancel()
72QString QgsSimpleCopyExternalStorageStoredContent::url()
const
77QgsSimpleCopyExternalStorageFetchedContent::QgsSimpleCopyExternalStorageFetchedContent(
const QString &filePath )
78 : mFilePath( filePath )
82void QgsSimpleCopyExternalStorageFetchedContent::fetch()
85 if ( !QFileInfo::exists( mFilePath ) )
87 reportError( tr(
"File '%1' does not exist" ).arg( mFilePath ) );
92 mResultFilePath = mFilePath;
97QString QgsSimpleCopyExternalStorageFetchedContent::filePath()
const
99 return mResultFilePath;
102QString QgsSimpleCopyExternalStorage::type()
const
104 return u
"SimpleCopy"_s;
107QString QgsSimpleCopyExternalStorage::displayName()
const
109 return QObject::tr(
"Simple copy" );
114 return new QgsSimpleCopyExternalStorageStoredContent( filePath, url, authcfg );
119 Q_UNUSED( authConfig );
121 return new QgsSimpleCopyExternalStorageFetchedContent( url );
@ Canceled
Content fetching/storing has been canceled.
@ Running
Content fetching/storing is in progress.
@ Finished
Content fetching/storing is finished and successful.
static QgsTaskManager * taskManager()
Returns the application's task manager, used for managing application wide background task handling.
Task to copy a file on disk.
Abstract base class for QgsExternalStorage fetched content.
Abstract base class for QgsExternalStorage stored content.
long addTask(QgsTask *task, int priority=0)
Adds a task to the manager.
void taskCompleted()
Will be emitted by task to indicate its successful completion.
void progressChanged(double progress)
Will be emitted by task when its progress changes.
void taskTerminated()
Will be emitted by task if it has terminated for any reason other then completion (e....