Skip to content

Commit 811bcc7

Browse files
committed
finished doc v1.0
error check still missing
1 parent a86a9be commit 811bcc7

File tree

5 files changed

+218
-14
lines changed

5 files changed

+218
-14
lines changed

AutoUpdater/updater.dox

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ a gui and the Core-Library.
1010

1111
## Core-Library:
1212
- Updater : The main updater class
13-
- UpdateScheduler : Responsilbe for update-scheduling. Mainly internal, but public
14-
accessible
13+
- UpdateScheduler : Responsilbe for update-scheduling. Internal class, indirectly accessible
14+
by the Updater (and UpdateController)
1515
- UpdateTask : Base class for all update tasks. The most useful are:
1616
- TimeSpan : Represents a timespan with a timeunit
1717
- BasicLoopUpdateTask : An (optinally) repeated timespan
@@ -299,16 +299,13 @@ Schedules an update to be run after `delayMinutes` minutes. If `repeated` is `tr
299299
updater will not just be run once, but every `delayMinutes` minutes (infinitly, until
300300
this instance is destroyed or the task canceled).
301301

302-
To cancel the update task, call Updater::cancelScheduledUpdate.
303-
304302
@overloads{
305303
@povElem{scheduleUpdate(UpdateTask *)}
306304
@ovElem{scheduleUpdate(qint64 , bool)}
307305
@ovElem{scheduleUpdate(const QDateTime &)}
308306
}
309307

310-
@sa Updater::cancelScheduledUpdate, UpdateScheduler, UpdateTask
311-
}
308+
@sa Updater::cancelScheduledUpdate, BasicLoopUpdateTask, Updater::checkForUpdates
312309
*/
313310

314311
/*!
@@ -322,15 +319,13 @@ Schedules an update to be run at `when`. If `when` lays in the past, nothing wil
322319
The update will be started once that time is reached (assuming that this updater instance
323320
is still alive at that timepoint).
324321

325-
To cancel the update task, call Updater::cancelScheduledUpdate.
326-
327322
@overloads{
328323
@povElem{scheduleUpdate(UpdateTask *)}
329324
@ovElem{scheduleUpdate(qint64 , bool)}
330325
@ovElem{scheduleUpdate(const QDateTime &)}
331326
}
332327

333-
@sa Updater::cancelScheduledUpdate, UpdateScheduler, UpdateTask
328+
@sa Updater::cancelScheduledUpdate, TimePointUpdateTask, Updater::checkForUpdates
334329
*/
335330

336331
/*!
@@ -362,7 +357,22 @@ To cancel the update task, call Updater::cancelScheduledUpdate.
362357
@ovElem{scheduleUpdate(const QDateTime &)}
363358
}
364359

365-
@sa Updater::cancelScheduledUpdate, UpdateScheduler, UpdateTask
360+
@sa Updater::cancelScheduledUpdate, UpdateTask, Updater::checkForUpdates
361+
*/
362+
363+
/*!
364+
@fn QtAutoUpdater::Updater::cancelScheduledUpdate
365+
366+
@param taskId The id of the task to be canceled
367+
368+
Cancels the task with the id `taskId`. If there was a task with that ID, you can be shure
369+
that it will be canceled.
370+
371+
@attention The canceling will happen, but may be a little delayed (because of
372+
multithreading). This means that it's possible that a canceled task fires one or more
373+
updates that have reached their timepoint before they could be canceled.
374+
375+
@sa Updater::scheduleUpdate(UpdateTask *)
366376
*/
367377

368378
/*!

AutoUpdater/updatetask.dox

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ is registered as a storable task. This can be done by calling
8686
`UpdateSchedulerController::registerStoredTask<MyUpdateTask>();`. In addition to
8787
that, your task needs to provide a public constructor that takes a QByteArray as parameter.
8888

89-
@sa UpdateScheduler, LoopUpdateTask, BasicLoopUpdateTask, TimePointUpdateTask,
89+
@sa LoopUpdateTask, BasicLoopUpdateTask, TimePointUpdateTask,
9090
UpdateTaskList, Updater::scheduleUpdate(UpdateTask *),
91-
UpdaterController::scheduleUpdate(UpdateTask *, DisplayLevel)
91+
UpdateController::scheduleUpdate(UpdateTask *, DisplayLevel)
9292
*/
9393

9494
/*!

AutoUpdaterWidgets/updatecontroller.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void UpdateController::resetUpdateRunArgs()
104104
d->runArgs = QStringList(QStringLiteral("--updater"));
105105
}
106106

107-
Updater *UpdateController::getUpdater() const
107+
const Updater * UpdateController::getUpdater() const
108108
{
109109
const Q_D(UpdateController);
110110
return d->mainUpdater;

AutoUpdaterWidgets/updatecontroller.dox

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,197 @@ change them)
354354

355355
@sa UpdateController::runAsAdmin
356356
*/
357+
358+
/*!
359+
@fn QtAutoUpdater::UpdateController::getUpdater
360+
361+
@returns The Updater object this controller uses internally to check for updates
362+
363+
The returned object is owned by the controller and should not be deleted. The returned
364+
object is `const` because manually changing the updater (e.g. by calling
365+
Updater::checkForUpdates) could break the controller and lead to a crash! You may only
366+
use this function to e.g. get extended error information.
367+
368+
@note Some functions, like Updater::abortUpdateCheck or Updater::cancelExitRun may be safe
369+
to call, even though they are not `const` However, I will give no guarantee for any of the
370+
unconstant functions. If you need to do something like that, you can cast the returned
371+
point and try it out.
372+
373+
@sa Updater
374+
*/
375+
376+
/*!
377+
@fn QtAutoUpdater::UpdateController::parentWidget
378+
379+
@returns The parent widget, if available
380+
381+
This function will only return a value if the parent of the updater is a widget. If thats
382+
not the case, `NULL` will be returned.
383+
384+
@note Even if `NULL` is returned, the controller can have an object parent. Check
385+
QObject::parent if you want to now whether the controller has any parent or not.
386+
387+
@sa QObject::parent, UpdateController::setParent(QWidget *), UpdateController::setParent(QObject *)
388+
*/
389+
390+
/*!
391+
@fn QtAutoUpdater::UpdateController::setParent(QWidget *)
392+
393+
@overload
394+
@param parent The new parent widget for the controller and it's windows
395+
396+
Sets the parent for this object to `parent` **and** sets `parent` to be the parent window for
397+
all dialogs of the controller.
398+
399+
@overloads{
400+
@ovElem{setParent(QWidget *)}
401+
@ovElem{setParent(QObject *)}
402+
}
403+
404+
@sa QObject::parent, UpdateController::parentWidget, UpdateController::UpdateController(QWidget *)
405+
*/
406+
407+
/*!
408+
@fn QtAutoUpdater::UpdateController::setParent(QObject *)
409+
410+
@overload
411+
@param parent The new parent object for the controller
412+
413+
Sets the parent for this object to `parent` **and** sets parent widget of all the
414+
controllers dialogs to `NULL`! This means they will become top-level windows without a
415+
parent.
416+
417+
@overloads{
418+
@ovElem{setParent(QWidget *)}
419+
@ovElem{setParent(QObject *)}
420+
}
421+
422+
@sa QObject::parent, UpdateController::parentWidget, UpdateController::UpdateController(QObject *)
423+
*/
424+
425+
/*!
426+
@fn QtAutoUpdater::UpdateController::start
427+
428+
@param displayLevel The DisplayLevel to be used for this run
429+
@return `true`, if the controller started, `false` if it already was running
430+
431+
start will only work if the updater isn't already running, but if it isn't, this function
432+
will always succeed.
433+
434+
@note This function will not return until the maintenancetool has started checking for
435+
updates (or immediatly if already running). If the level is for example
436+
UpdateController::AskLevel, this function will block while the question box is shown to
437+
the user.
438+
439+
@sa UpdateController::running, UpdateController::cancelUpdate
440+
*/
441+
442+
/*!
443+
@fn QtAutoUpdater::UpdateController::cancelUpdate
444+
445+
@param maxDelay the maximal (asynchrounus) delay to wait
446+
@return `true`, if the canceling was started, `false` if not
447+
448+
This function will only return `true` if the canceling was **started** successfully. It
449+
will not wait for the controller to be actually canceled. However, you can be shure that
450+
the controller will be canceled before `maxDelay` has passed.
451+
452+
If `false` is returned, this can either mean that the controller is currently not running
453+
(user UpdateController::running to check that) or that it is showing an "uncancelable" dialog
454+
to the user (Any dialog but the progress dialog is "uncancelable"). If thats the case, you
455+
have no other choice but to wait for the user to close all those dialogs.
456+
457+
@sa UpdateController::running, UpdateController::start
458+
*/
459+
460+
/*!
461+
@fn QtAutoUpdater::UpdateController::scheduleUpdate(qint64 , bool, DisplayLevel)
462+
463+
@overload
464+
@param delayMinutes The time (in minutes) to wait until the update is started
465+
@param repeated Specifies, whether the updater should be started every `delayMinutes`
466+
or only once
467+
@param displayLevel The display-level to be used by the controller
468+
@returns The internal ID of this update task. Can be used to cancel the task
469+
470+
Schedules an update to be run after `delayMinutes` minutes. If `repeated` is `true`, the
471+
controller will not just be run once, but every `delayMinutes` minutes (infinitly, until
472+
this instance is destroyed or the task canceled).
473+
474+
@overloads{
475+
@povElem{scheduleUpdate(UpdateTask *, DisplayLevel)}
476+
@ovElem{scheduleUpdate(qint64 , bool, DisplayLevel)}
477+
@ovElem{scheduleUpdate(const QDateTime &, DisplayLevel)}
478+
}
479+
480+
@sa UpdateController::cancelScheduledUpdate, BasicLoopUpdateTask, UpdateController::start
481+
*/
482+
483+
/*!
484+
@fn QtAutoUpdater::UpdateController::scheduleUpdate(const QDateTime &, DisplayLevel)
485+
486+
@overload
487+
@param when The timepoint where the update should be started
488+
@param displayLevel The display-level to be used by the controller
489+
@returns The internal ID of this update task. Can be used to cancel the task
490+
491+
Schedules an update to be run at `when`. If `when` lays in the past, nothing will happen.
492+
The update will be started once that time is reached (assuming that this controller instance
493+
is still alive at that timepoint).
494+
495+
@overloads{
496+
@povElem{scheduleUpdate(UpdateTask *, DisplayLevel)}
497+
@ovElem{scheduleUpdate(qint64 , bool, DisplayLevel)}
498+
@ovElem{scheduleUpdate(const QDateTime &, DisplayLevel)}
499+
}
500+
501+
@sa UpdateController::cancelScheduledUpdate, TimePointUpdateTask, UpdateController::start
502+
*/
503+
504+
/*!
505+
@fn QtAutoUpdater::UpdateController::scheduleUpdate(UpdateTask *, DisplayLevel)
506+
507+
@overload
508+
@param task The task to be scheduled
509+
@param displayLevel The display-level to be used by the controller
510+
@returns The internal ID of this update task. Can be used to cancel the task
511+
512+
Uses `task` to schedule updates. For more details about the different tasks, check
513+
the UpdateTask documentation.
514+
515+
@warning The scheduler will take ownership of `task`. Since `task` will be used in a
516+
different thread, you must not access it after passing it to this function
517+
518+
Scheduling an update means that the controller will use the UpdateScheduler to schedule an
519+
update. as soons as the UpdateTask reached the point where it "matched" (meets the
520+
timepoint it was scheduled for), the scheduler will notify the controller, and the
521+
controller will autmatically start checking for updates.
522+
523+
@note After scheduling the update, you will have no way to take track of the schedule.
524+
If the controller is already running while the task is triggered, nothing will happend.
525+
526+
To cancel the update task, call UpdateController::cancelScheduledUpdate.
527+
528+
@overloads{
529+
@povElem{scheduleUpdate(UpdateTask *, DisplayLevel)}
530+
@ovElem{scheduleUpdate(qint64 , bool, DisplayLevel)}
531+
@ovElem{scheduleUpdate(const QDateTime &, DisplayLevel)}
532+
}
533+
534+
@sa UpdateController::cancelScheduledUpdate, UpdateTask, UpdateController::start
535+
*/
536+
537+
/*!
538+
@fn QtAutoUpdater::UpdateController::cancelScheduledUpdate
539+
540+
@param taskId The id of the task to be canceled
541+
542+
Cancels the task with the id `taskId`. If there was a task with that ID, you can be shure
543+
that it will be canceled.
544+
545+
@attention The canceling will happen, but may be a little delayed (because of
546+
multithreading). This means that it's possible that a canceled task fires one or more
547+
updates that have reached their timepoint before they could be canceled.
548+
549+
@sa UpdateController::scheduleUpdate(UpdateTask *, DisplayLevel)
550+
*/

AutoUpdaterWidgets/updatecontroller.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace QtAutoUpdater
7373
void resetUpdateRunArgs();
7474

7575
//! Returns the Updater object used by the controller
76-
Updater *getUpdater() const;
76+
const Updater * getUpdater() const;
7777

7878
//! Returns the parent window
7979
QWidget* parentWidget() const;

0 commit comments

Comments
 (0)