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