24QgsSimpleCopyExternalStorageStoredContent::QgsSimpleCopyExternalStorageStoredContent(
const QString &filePath,
const QString &url,
const QString &authcfg )
32 mUrl = mCopyTask->destination();
39 reportError( mCopyTask->errorString() );
44 emit progressChanged( progress );
48void QgsSimpleCopyExternalStorageStoredContent::store()
54void QgsSimpleCopyExternalStorageStoredContent::cancel()
69QString QgsSimpleCopyExternalStorageStoredContent::url()
const
74QgsSimpleCopyExternalStorageFetchedContent::QgsSimpleCopyExternalStorageFetchedContent(
const QString &filePath )
75 : mFilePath( filePath )
79void QgsSimpleCopyExternalStorageFetchedContent::fetch()
82 if ( !QFileInfo::exists( mFilePath ) )
84 reportError( tr(
"File '%1' does not exist" ).arg( mFilePath ) );
89 mResultFilePath = mFilePath;
94QString QgsSimpleCopyExternalStorageFetchedContent::filePath()
const
96 return mResultFilePath;
99QString QgsSimpleCopyExternalStorage::type()
const
101 return QStringLiteral(
"SimpleCopy" );
104QString QgsSimpleCopyExternalStorage::displayName()
const
106 return QObject::tr(
"Simple copy" );
111 return new QgsSimpleCopyExternalStorageStoredContent( filePath, url, authcfg );
116 Q_UNUSED( authConfig );
118 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....