1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

docs(net): Added leading stars

This commit is contained in:
Diadlo 2016-08-01 11:21:49 +03:00
parent 902828fcc2
commit 956a04af8d
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727
5 changed files with 199 additions and 199 deletions

View File

@ -40,10 +40,10 @@
#endif
/**
@file autoupdate.cpp
For now we only support auto updates on Windows and OS X, although extending it is not a technical issue.
Linux users are expected to use their package managers or update manually through official channels.
* @file autoupdate.cpp
*
* For now we only support auto updates on Windows and OS X, although extending it is not a technical issue.
* Linux users are expected to use their package managers or update manually through official channels.
*/
#ifdef Q_OS_WIN
@ -80,46 +80,46 @@ unsigned char AutoUpdater::key[crypto_sign_PUBLICKEYBYTES];
#endif
/**
@var unsigned char AutoUpdater::UpdateFileMeta::sig[crypto_sign_BYTES]
@brief Signature of the file (ed25519)
@var QString AutoUpdater::UpdateFileMeta::id
@brief Unique id of the file
@var QString AutoUpdater::UpdateFileMeta::installpath
@brief Local path including the file name. May be relative to qtox-updater or absolute
@var uint64_t AutoUpdater::UpdateFileMeta::size
@brief Size in bytes of the file
* @var unsigned char AutoUpdater::UpdateFileMeta::sig[crypto_sign_BYTES]
* @brief Signature of the file (ed25519)
*
* @var QString AutoUpdater::UpdateFileMeta::id
* @brief Unique id of the file
*
* @var QString AutoUpdater::UpdateFileMeta::installpath
* @brief Local path including the file name. May be relative to qtox-updater or absolute
*
* @var uint64_t AutoUpdater::UpdateFileMeta::size
* @brief Size in bytes of the file
*/
/**
@var static const QString AutoUpdater::updateServer
@brief Hostname of the qTox update server
@var static const QString AutoUpdater::platform
@brief Name of platform we're trying to get updates for
@var static const QString AutoUpdater::checkURI
@brief URI of the file containing the latest version string
@var static const QString AutoUpdater::flistURI
@brief URI of the file containing info on each file (hash, signature, size, name, ..)
@var static const QString AutoUpdater::filesURI
@brief URI of the actual files of the latest version
@var static const QString AutoUpdater::updaterBin
@brief Path to the qtox-updater binary
@var static std::atomic_bool AutoUpdater::abortFlag
@brief If true, try to abort everything.
@var static std::atomic_bool AutoUpdater::isDownloadingUpdate
@brief We'll pretend there's no new update available if we're already updating
@var static QMutex AutoUpdater::progressVersionMutex
@brief No, we can't just make the QString atomic
* @var static const QString AutoUpdater::updateServer
* @brief Hostname of the qTox update server
*
* @var static const QString AutoUpdater::platform
* @brief Name of platform we're trying to get updates for
*
* @var static const QString AutoUpdater::checkURI
* @brief URI of the file containing the latest version string
*
* @var static const QString AutoUpdater::flistURI
* @brief URI of the file containing info on each file (hash, signature, size, name, ..)
*
* @var static const QString AutoUpdater::filesURI
* @brief URI of the actual files of the latest version
*
* @var static const QString AutoUpdater::updaterBin
* @brief Path to the qtox-updater binary
*
* @var static std::atomic_bool AutoUpdater::abortFlag
* @brief If true, try to abort everything.
*
* @var static std::atomic_bool AutoUpdater::isDownloadingUpdate
* @brief We'll pretend there's no new update available if we're already updating
*
* @var static QMutex AutoUpdater::progressVersionMutex
* @brief No, we can't just make the QString atomic
*/
const QString AutoUpdater::checkURI = AutoUpdater::updateServer+"/qtox/"+AutoUpdater::platform+"/version";
@ -132,17 +132,17 @@ QString AutoUpdater::progressVersion;
QMutex AutoUpdater::progressVersionMutex;
/**
@class AutoUpdater
@brief Handles checking and applying updates for qTox.
@note Do *NOT* use auto update unless AUTOUPDATE_ENABLED is defined to 1.
* @class AutoUpdater
* @brief Handles checking and applying updates for qTox.
* @note Do *NOT* use auto update unless AUTOUPDATE_ENABLED is defined to 1.
*/
/**
@brief Checks if an update is available for download.
@return True if an update is available for download, false otherwise.
Connects to the qTox update server, and check if an update is available for download
Will call getUpdateVersion, and as such may block and processEvents.
* @brief Checks if an update is available for download.
* @return True if an update is available for download, false otherwise.
*
* Connects to the qTox update server, and check if an update is available for download
* Will call getUpdateVersion, and as such may block and processEvents.
*/
bool AutoUpdater::isUpdateAvailable()
{
@ -159,9 +159,9 @@ bool AutoUpdater::isUpdateAvailable()
}
/**
@brief Fetch the version info of the last update available from the qTox update server
@note Will try to follow qTox's proxy settings, may block and processEvents
@return Avaliable version info.
* @brief Fetch the version info of the last update available from the qTox update server
* @note Will try to follow qTox's proxy settings, may block and processEvents
* @return Avaliable version info.
*/
AutoUpdater::VersionInfo AutoUpdater::getUpdateVersion()
{
@ -228,9 +228,9 @@ AutoUpdater::VersionInfo AutoUpdater::getUpdateVersion()
}
/**
@brief Parses and validates a flist file.
@param flistData Install file data.
@return An empty list on error.
* @brief Parses and validates a flist file.
* @param flistData Install file data.
* @return An empty list on error.
*/
QList<AutoUpdater::UpdateFileMeta> AutoUpdater::parseFlist(QByteArray flistData)
{
@ -292,9 +292,9 @@ QList<AutoUpdater::UpdateFileMeta> AutoUpdater::parseFlist(QByteArray flistData)
}
/**
@brief Gets the update server's flist.
@note Will try to follow qTox's proxy settings, may block and processEvents
@return An empty array on error
* @brief Gets the update server's flist.
* @note Will try to follow qTox's proxy settings, may block and processEvents
* @return An empty array on error
*/
QByteArray AutoUpdater::getUpdateFlist()
{
@ -326,9 +326,9 @@ QByteArray AutoUpdater::getUpdateFlist()
}
/**
@brief Generates a list of files we need to update.
@param updateFlist List of files available to update.
@return List of files we need to update.
* @brief Generates a list of files we need to update.
* @param updateFlist List of files available to update.
* @return List of files we need to update.
*/
QList<AutoUpdater::UpdateFileMeta> AutoUpdater::genUpdateDiff(QList<UpdateFileMeta> updateFlist)
{
@ -342,9 +342,9 @@ QList<AutoUpdater::UpdateFileMeta> AutoUpdater::genUpdateDiff(QList<UpdateFileMe
}
/**
@brief Checks if we have an up to date version of this file locally installed.
@param fileMeta File to check.
@return True if file doesn't need updates, false if need.
* @brief Checks if we have an up to date version of this file locally installed.
* @param fileMeta File to check.
* @return True if file doesn't need updates, false if need.
*/
bool AutoUpdater::isUpToDate(AutoUpdater::UpdateFileMeta fileMeta)
{
@ -362,12 +362,12 @@ bool AutoUpdater::isUpToDate(AutoUpdater::UpdateFileMeta fileMeta)
}
/**
@brief Tries to fetch the file from the update server.
@note Note that a file with an empty but non-null QByteArray is not an error, merely a file of size 0.
@note Will try to follow qTox's proxy settings, may block and processEvents.
@param fileMeta Meta data fo file to update.
@param progressCallback Callback function, which will connected with QNetworkReply::downloadProgress
@return A file with a null QByteArray on error.
* @brief Tries to fetch the file from the update server.
* @note Note that a file with an empty but non-null QByteArray is not an error, merely a file of size 0.
* @note Will try to follow qTox's proxy settings, may block and processEvents.
* @param fileMeta Meta data fo file to update.
* @param progressCallback Callback function, which will connected with QNetworkReply::downloadProgress
* @return A file with a null QByteArray on error.
*/
AutoUpdater::UpdateFile AutoUpdater::getUpdateFile(UpdateFileMeta fileMeta,
std::function<void(int,int)> progressCallback)
@ -402,9 +402,9 @@ AutoUpdater::UpdateFile AutoUpdater::getUpdateFile(UpdateFileMeta fileMeta,
}
/**
@brief Will try to download an update, if successful qTox will apply it after a restart
@note Will try to follow qTox's proxy settings, may block and processEvents
@result True if successful and qTox will apply it after a restart
* @brief Will try to download an update, if successful qTox will apply it after a restart
* @note Will try to follow qTox's proxy settings, may block and processEvents
* @result True if successful and qTox will apply it after a restart
*/
bool AutoUpdater::downloadUpdate()
{
@ -534,11 +534,11 @@ fail:
}
/**
@brief Checks if an update is downloaded and ready to be installed.
@note If result is true, call installLocalUpdate,
@return True if an update is downloaded, false if partially downloaded.
If an update was partially downloaded, the function will resume asynchronously and return false.
* @brief Checks if an update is downloaded and ready to be installed.
* @note If result is true, call installLocalUpdate,
* @return True if an update is downloaded, false if partially downloaded.
*
* If an update was partially downloaded, the function will resume asynchronously and return false.
*/
bool AutoUpdater::isLocalUpdateReady()
{
@ -580,11 +580,11 @@ bool AutoUpdater::isLocalUpdateReady()
}
/**
@brief Launches the qTox updater to try to install the local update and exits immediately.
@note Will not check that the update actually exists, use isLocalUpdateReady first for that.
The qTox updater will restart us after the update is done.
If we fail to start the qTox updater, we will delete the update and exit.
* @brief Launches the qTox updater to try to install the local update and exits immediately.
*
* @note Will not check that the update actually exists, use isLocalUpdateReady first for that.
* The qTox updater will restart us after the update is done.
* If we fail to start the qTox updater, we will delete the update and exit.
*/
void AutoUpdater::installLocalUpdate()
{
@ -626,12 +626,12 @@ void AutoUpdater::installLocalUpdate()
}
/**
@brief Checks update an show dialog asking to download it.
@note Runs asynchronously in its own thread, and will return immediatly
Will call isUpdateAvailable, and as such may processEvents.
Connects to the qTox update server, if an update is found
shows a dialog to the user asking to download it.
* @brief Checks update an show dialog asking to download it.
* @note Runs asynchronously in its own thread, and will return immediatly
*
* Will call isUpdateAvailable, and as such may processEvents.
* Connects to the qTox update server, if an update is found
* shows a dialog to the user asking to download it.
*/
void AutoUpdater::checkUpdatesAsyncInteractive()
{
@ -642,9 +642,9 @@ void AutoUpdater::checkUpdatesAsyncInteractive()
}
/**
@brief Does the actual work for checkUpdatesAsyncInteractive
Blocking, but otherwise has the same properties than checkUpdatesAsyncInteractive
* @brief Does the actual work for checkUpdatesAsyncInteractive
*
* Blocking, but otherwise has the same properties than checkUpdatesAsyncInteractive
*/
void AutoUpdater::checkUpdatesAsyncInteractiveWorker()
{
@ -685,8 +685,8 @@ void AutoUpdater::checkUpdatesAsyncInteractiveWorker()
}
/**
@brief Thread safe setter
@param version Version to set.
* @brief Thread safe setter
* @param version Version to set.
*/
void AutoUpdater::setProgressVersion(QString version)
{
@ -695,10 +695,10 @@ void AutoUpdater::setProgressVersion(QString version)
}
/**
@brief Abort update process.
@note Aborting will make some functions try to return early.
Call before qTox exits to avoid the updater running in the background.
* @brief Abort update process.
*
* @note Aborting will make some functions try to return early.
* Call before qTox exits to avoid the updater running in the background.
*/
void AutoUpdater::abortUpdates()
{
@ -707,8 +707,8 @@ void AutoUpdater::abortUpdates()
}
/**
@brief Functions giving info on the progress of update downloads.
@return Version as string.
* @brief Functions giving info on the progress of update downloads.
* @return Version as string.
*/
QString AutoUpdater::getProgressVersion()
{

View File

@ -24,11 +24,11 @@
#include <QDebug>
/**
@class AvatarBroadcaster
Takes care of broadcasting avatar changes to our friends in a smart way
Cache a copy of our current avatar and friends who have received it
so we don't spam avatar transfers to a friend who already has it.
* @class AvatarBroadcaster
*
* Takes care of broadcasting avatar changes to our friends in a smart way
* Cache a copy of our current avatar and friends who have received it
* so we don't spam avatar transfers to a friend who already has it.
*/
QByteArray AvatarBroadcaster::avatarData;
@ -41,8 +41,8 @@ static auto autoBroadcast = [](uint32_t friendId, Status)
};
/**
@brief Set our current avatar.
@param data Byte array on avater.
* @brief Set our current avatar.
* @param data Byte array on avater.
*/
void AvatarBroadcaster::setAvatar(QByteArray data)
{
@ -58,8 +58,8 @@ void AvatarBroadcaster::setAvatar(QByteArray data)
}
/**
@brief Send our current avatar to this friend, if not already sent
@param friendId Id of friend to send avatar.
* @brief Send our current avatar to this friend, if not already sent
* @param friendId Id of friend to send avatar.
*/
void AvatarBroadcaster::sendAvatarTo(uint32_t friendId)
{
@ -72,8 +72,8 @@ void AvatarBroadcaster::sendAvatarTo(uint32_t friendId)
}
/**
@brief Setup auto broadcast sending avatar.
@param state If true, we automatically broadcast our avatar to friends when they come online.
* @brief Setup auto broadcast sending avatar.
* @param state If true, we automatically broadcast our avatar to friends when they come online.
*/
void AvatarBroadcaster::enableAutoBroadcast(bool state)
{

View File

@ -30,19 +30,19 @@
#define TOX_HEX_ID_LENGTH 2*TOX_ADDRESS_SIZE
/**
@class ToxDNS
@brief Handles tox1 and tox3 DNS queries.
* @class ToxDNS
* @brief Handles tox1 and tox3 DNS queries.
*/
/**
@struct tox3_server
@brief Represents a tox3 server.
@var const char* tox3_server::name
@brief Hostname of the server, e.g. toxme.se.
@var uint8_t* tox3_server::pubkey
@brief Public key of the tox3 server, usually 256bit long.
* @struct tox3_server
* @brief Represents a tox3 server.
*
* @var const char* tox3_server::name
* @brief Hostname of the server, e.g. toxme.se.
*
* @var uint8_t* tox3_server::pubkey
* @brief Public key of the tox3 server, usually 256bit long.
*/
const ToxDNS::tox3_server ToxDNS::pinnedServers[]
@ -67,10 +67,10 @@ void ToxDNS::showWarning(const QString &message)
}
/**
@brief Try to fetch the first entry of the given TXT record.
@param record Record to search.
@param silent May display message boxes on error if silent is false.
@return An empty object on failure. May block for up to ~3s.
* @brief Try to fetch the first entry of the given TXT record.
* @param record Record to search.
* @param silent May display message boxes on error if silent is false.
* @return An empty object on failure. May block for up to ~3s.
*/
QByteArray ToxDNS::fetchLastTextRecord(const QString& record, bool silent)
{
@ -131,12 +131,12 @@ QByteArray ToxDNS::fetchLastTextRecord(const QString& record, bool silent)
}
/**
@brief Send query to DNS to find Tox Id.
@note Will *NOT* fallback on queryTox1 anymore.
@param server Server to sending query.
@param record Should look like user@domain.tld.
@param silent If true, there will be no output on error.
@return Tox Id string.
* @brief Send query to DNS to find Tox Id.
* @note Will *NOT* fallback on queryTox1 anymore.
* @param server Server to sending query.
* @param record Should look like user@domain.tld.
* @param silent If true, there will be no output on error.
* @return Tox Id string.
*/
QString ToxDNS::queryTox3(const tox3_server& server, const QString &record, bool silent)
{
@ -218,10 +218,10 @@ fallbackOnTox1:
}
/**
@brief Tries to map a text string to a ToxId struct, will query Tox DNS records if necessary.
@param address Adress to search for Tox ID.
@param silent If true, there will be no output on error.
@return Found Tox Id.
* @brief Tries to map a text string to a ToxId struct, will query Tox DNS records if necessary.
* @param address Adress to search for Tox ID.
* @param silent If true, there will be no output on error.
* @return Found Tox Id.
*/
ToxId ToxDNS::resolveToxAddress(const QString &address, bool silent)
{

View File

@ -31,11 +31,11 @@
#include <ctime>
/**
@class Toxme
@brief This class implements a client for the toxme.se API
@note The class is thread safe
@note May process events while waiting for blocking calls
* @class Toxme
* @brief This class implements a client for the toxme.se API
*
* @note The class is thread safe
* @note May process events while waiting for blocking calls
*/
QByteArray Toxme::makeJsonRequest(QString url, QString json, QNetworkReply::NetworkError &error)
@ -145,9 +145,9 @@ QByteArray Toxme::prepareEncryptedJson(QString url, int action, QString payload)
}
/**
@brief Converts a toxme address to a Tox ID.
@param address Toxme address.
@return Found ToxId (an empty ID on error).
* @brief Converts a toxme address to a Tox ID.
* @param address Toxme address.
* @return Found ToxId (an empty ID on error).
*/
ToxId Toxme::lookup(QString address)
{
@ -218,14 +218,14 @@ Toxme::ExecCode Toxme::extractError(QString json)
}
/**
@brief Creates a new toxme address associated with a Tox ID.
@param[out] code Tox error code @see getErrorMessage.
@param[in] server Create toxme account on this server.
@param[in] id ToxId of current user.
@param[in] address Create toxme account with this adress.
@param[in] keepPrivate If true, the address will not be published on toxme site.
@param[in] bio A short optional description of yourself if you want to publish your address.
@return password on success, else sets code parameter and returns an empty QString.
* @brief Creates a new toxme address associated with a Tox ID.
* @param[out] code Tox error code @see getErrorMessage.
* @param[in] server Create toxme account on this server.
* @param[in] id ToxId of current user.
* @param[in] address Create toxme account with this adress.
* @param[in] keepPrivate If true, the address will not be published on toxme site.
* @param[in] bio A short optional description of yourself if you want to publish your address.
* @return password on success, else sets code parameter and returns an empty QString.
*/
QString Toxme::createAddress(ExecCode &code, QString server, ToxId id, QString address,
bool keepPrivate, QString bio)
@ -295,10 +295,10 @@ QString Toxme::getPass(QString json, ExecCode &code) {
}
/**
@brief Deletes the address associated with your current Tox ID.
@param server Server to delete the address from.
@param id ToxId to delete.
@return Status code returned from server.
* @brief Deletes the address associated with your current Tox ID.
* @param server Server to delete the address from.
* @param id ToxId to delete.
* @return Status code returned from server.
*/
Toxme::ExecCode Toxme::deleteAddress(QString server, ToxId id)
{
@ -318,9 +318,9 @@ Toxme::ExecCode Toxme::deleteAddress(QString server, ToxId id)
}
/**
@brief Return string of the corresponding error code
@param errorCode Code to get error message
@return Source error message
* @brief Return string of the corresponding error code
* @param errorCode Code to get error message
* @return Source error message
*/
QString Toxme::getErrorMessage(int errorCode)
{
@ -365,9 +365,9 @@ QString Toxme::getErrorMessage(int errorCode)
}
/**
@brief Return translated error message
@param errorCode Code to translate
@return Translated Toxme error message
* @brief Return translated error message
* @param errorCode Code to translate
* @return Translated Toxme error message
*/
QString Toxme::translateErrorMessage(int errorCode)
{

View File

@ -45,10 +45,10 @@ bool toxURIEventHandler(const QByteArray& eventData)
}
/**
@brief Shows a dialog asking whether or not to add this tox address as a friend.
@note Will wait until the core is ready first.
@param toxURI Tox URI to try to add.
@return True, if tox URI is correct, false otherwise.
* @brief Shows a dialog asking whether or not to add this tox address as a friend.
* @note Will wait until the core is ready first.
* @param toxURI Tox URI to try to add.
* @return True, if tox URI is correct, false otherwise.
*/
bool handleToxURI(const QString &toxURI)
{