25QgsSimpleCopyExternalStorageStoredContent::QgsSimpleCopyExternalStorageStoredContent(
const QString &filePath,
const QString &url,
const QString &authcfg )
33 mUrl = mCopyTask->destination();
40 reportError( mCopyTask->errorString() );
45 emit progressChanged( progress );
49void QgsSimpleCopyExternalStorageStoredContent::store()
55void QgsSimpleCopyExternalStorageStoredContent::cancel()
70QString QgsSimpleCopyExternalStorageStoredContent::url()
const
75QgsSimpleCopyExternalStorageFetchedContent::QgsSimpleCopyExternalStorageFetchedContent(
const QString &filePath )
76 : mFilePath( filePath )
80void QgsSimpleCopyExternalStorageFetchedContent::fetch()
83 if ( !QFileInfo::exists( mFilePath ) )
85 reportError( tr(
"File '%1' does not exist" ).arg( mFilePath ) );
90 mResultFilePath = mFilePath;
95QString QgsSimpleCopyExternalStorageFetchedContent::filePath()
const
97 return mResultFilePath;
100QString QgsSimpleCopyExternalStorage::type()
const
102 return QStringLiteral(
"SimpleCopy" );
105QString QgsSimpleCopyExternalStorage::displayName()
const
107 return QObject::tr(
"Simple copy" );
112 return new QgsSimpleCopyExternalStorageStoredContent( filePath, url, authcfg );
117 Q_UNUSED( authConfig );
119 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.
Class for QgsExternalStorage fetched content.
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....