Fix typos found via `codespell --skip .git -w`

This commit is contained in:
Martchus 2021-07-03 19:54:06 +02:00
parent 5e42ba07ca
commit e4c5b23546
10 changed files with 43 additions and 43 deletions

View File

@ -23,6 +23,6 @@ by YouTube which currently need to be downloaded separately and then muxed toget
## Build instructions
The video downloader depends on c++utilities and qtutilities and is built in the same
way as these libaries.
way as these libraries.
The following Qt modules are requried: core gui widgets network
The following Qt modules are required: core gui widgets network

View File

@ -99,7 +99,7 @@ void download(int argc, char *argv[], const ArgumentOccurrence &, const Argument
}
++specifiedDownloads;
}
// check whether downloads could be instantiated, print appropiate error messages if not
// check whether downloads could be instantiated, print appropriate error messages if not
if (!specifiedDownloads) {
cout << "No downloads have been specified." << endl;
} else if (downloads.isEmpty()) {

View File

@ -59,7 +59,7 @@ void DownloadInteraction::downloadRequiresOutputDevice(Download *download, size_
&& (TargetPage::targetDirectory().isEmpty() || QDir(TargetPage::targetDirectory()).exists()) // and the default directory exists or is empty
&& !fileName.isEmpty()) { // and the file name is not empty
download->provideOutputDevice(optionIndex, new QFile(TargetPage::targetDirectory() % QChar('/') % fileName), true);
} else { // aks the user for the target path otherwise
} else { // ask the user for the target path otherwise
QFileDialog *dlg = new QFileDialog(m_parentWidget);
#ifndef Q_OS_WIN
// the native dialog can only be shown modal under Windows
@ -227,7 +227,7 @@ void DownloadInteraction::downloadHasSslErrors(Download *download, size_t option
}
auto *dlg = new QMessageBox(m_parentWidget);
dlg->setModal(false);
dlg->setWindowTitle(tr("SSL errors occured") % QStringLiteral(" - ") % QCoreApplication::applicationName());
dlg->setWindowTitle(tr("SSL errors occurred") % QStringLiteral(" - ") % QCoreApplication::applicationName());
dlg->setTextFormat(Qt::RichText);
dlg->setText(tr("The download <i>%1</i> has SSL errors.").arg(downloadName));
dlg->setInformativeText(tr("Do you want to ignore the SSL errors for this download?"));

View File

@ -339,7 +339,7 @@ void MainWindow::startOrStopSelectedDownloads()
download->init();
break;
case DownloadStatus::Initiating:
// when the download is retireving initial information it can be stopped
// when the download is retrieving initial information it can be stopped
download->stop();
break;
case DownloadStatus::Downloading:
@ -474,7 +474,7 @@ void MainWindow::updateStartStopControls()
int toInterrupt = 0;
int noCommand = 0;
int downloadLinksAvailable = 0;
int removeable = 0;
int removable = 0;
int withTargetPath = 0;
bool downloadsSelected = !selectedDownloads.isEmpty();
if (downloadsSelected) {
@ -482,7 +482,7 @@ void MainWindow::updateStartStopControls()
switch (download->status()) {
case DownloadStatus::None:
++toInit;
++removeable;
++removable;
break;
case DownloadStatus::Initiating:
++toStop;
@ -497,7 +497,7 @@ void MainWindow::updateStartStopControls()
break;
case DownloadStatus::Ready:
++downloadLinksAvailable;
++removeable;
++removable;
if (download->supportsRange() && download->range().currentOffset() > 0) {
++toResume;
} else {
@ -511,10 +511,10 @@ void MainWindow::updateStartStopControls()
} else {
++toInit;
}
++removeable;
++removable;
break;
case DownloadStatus::Interrupted:
++removeable;
++removable;
++downloadLinksAvailable;
if (download->supportsRange()) {
++toResume;
@ -523,7 +523,7 @@ void MainWindow::updateStartStopControls()
case DownloadStatus::Finished:
++downloadLinksAvailable;
++toRestart;
++removeable;
++removable;
break;
case DownloadStatus::Interrupting:
case DownloadStatus::Aborting:
@ -610,12 +610,12 @@ void MainWindow::updateStartStopControls()
if (m_ui->toolBar->minimumWidth() < m_ui->toolBar->width()) {
m_ui->toolBar->setMinimumWidth(m_ui->toolBar->width());
}
if (removeable == 1) {
if (removable == 1) {
m_ui->actionRemove_selected_downloads_from_list->setText(tr("Remove selected download from list"));
} else if (removeable > 1) {
m_ui->actionRemove_selected_downloads_from_list->setText(tr("Remove selected downloads (%1) from list").arg(removeable));
} else if (removable > 1) {
m_ui->actionRemove_selected_downloads_from_list->setText(tr("Remove selected downloads (%1) from list").arg(removable));
}
m_ui->actionRemove_selected_downloads_from_list->setEnabled(removeable > 0);
m_ui->actionRemove_selected_downloads_from_list->setEnabled(removable > 0);
if (downloadLinksAvailable > 0) {
if (downloadLinksAvailable == 1) {
m_ui->actionCopy_download_url->setText(tr("Copy download url"));
@ -710,7 +710,7 @@ void MainWindow::setDownloadRange()
} else if (!downloads.size()) {
QMessageBox::warning(this, windowTitle(), tr("There is no download selected."));
} else {
QMessageBox::warning(this, windowTitle(), tr("You can only set the range of a singe download at once."));
QMessageBox::warning(this, windowTitle(), tr("You can only set the range of a single download at once."));
}
}
@ -726,7 +726,7 @@ void MainWindow::setTargetPath()
} else if (!downloads.size()) {
QMessageBox::warning(this, windowTitle(), tr("There is no download selected."));
} else {
QMessageBox::warning(this, windowTitle(), tr("You can only set the target of a singe download at once."));
QMessageBox::warning(this, windowTitle(), tr("You can only set the target of a single download at once."));
}
}

View File

@ -52,7 +52,7 @@ namespace Network {
* - reportNewDataToBeWritten(): Reports that there is new data to be written available.
* - reportRedirectionAvailable(): Reports that there is a redirection available.
* - reportAuthenticationRequired(): Reports that authentication credentials are required.
* - reportSslErrors(): Reports that one or more SSL errors occured.
* - reportSslErrors(): Reports that one or more SSL errors occurred.
* - reportDownloadComplete(): Reports that the download is complete.
* - reportFinalDownloadStatus(): Reports the final download status.
* - addDownloadUrl(): Makes a download URL under the specified option name available. Meant to be called during initialization.
@ -350,7 +350,7 @@ void Download::interrupt()
}
/*!
* \brief Constructs a new donwload with the specified \a url.
* \brief Constructs a new download with the specified \a url.
*/
Download::Download(const QUrl &url, QObject *parent)
: QObject(parent)
@ -429,11 +429,11 @@ void Download::init()
/*!
* \brief Reports the initialization status.
*
* Needs to be called when subclassing after the initialzation ended.
* Needs to be called when subclassing after the initialization ended.
*
* \param success Specifies whether the initialization succeeded.
* \param reasonIfNot Specifies the reason if the initialization failed; ignored otherwise.
* \param networkError Specifies if and what kind of network error occured.
* \param networkError Specifies if and what kind of network error occurred.
*/
void Download::reportInitiated(bool success, const QString &reasonIfNot, const QNetworkReply::NetworkError &networkError)
{
@ -612,7 +612,7 @@ void Download::finalizeOutputDevice(size_t optionIndex)
* \param optionIndex Specifies the concerning option.
* \param success Specifies whether the download was successful.
* \param statusDescription Specifies a status description.
* \param networkError Specifies if or what kind of network error occured.
* \param networkError Specifies if or what kind of network error occurred.
*/
void Download::reportFinalDownloadStatus(size_t optionIndex, bool success, const QString &statusDescription, QNetworkReply::NetworkError networkError)
{
@ -802,7 +802,7 @@ void Download::reportRedirectionAvailable(size_t originalOptionIndex)
optionData.m_downloadComplete = false;
setStatus(DownloadStatus::Downloading);
} else {
reportFinalDownloadStatus(originalOptionIndex, false, tr("Follwing redirection failed."));
reportFinalDownloadStatus(originalOptionIndex, false, tr("Following redirection failed."));
}
break;
case PermissionStatus::Refused:
@ -833,14 +833,14 @@ void Download::reportAuthenticationRequired(size_t optionIndex, const QString &r
}
/*!
* \brief Reports that SSL errors occured.
* \brief Reports that SSL errors occurred.
*
* \param optionIndex Specifies the concerning option index. Use a negative value when the
* errors occured during initialization.
* errors occurred during initialization.
* \param reply Specifies the concerning reply.
* \param sslErrors Specifies which SSL errors occured.
* \param sslErrors Specifies which SSL errors occurred.
*
* Needs to be called when subclassing if SSL errors occured.
* Needs to be called when subclassing if SSL errors occurred.
*/
void Download::reportSslErrors(size_t optionIndex, QNetworkReply *reply, const QList<QSslError> &sslErrors)
{
@ -940,7 +940,7 @@ void Download::changeDownloadUrl(size_t optionIndex, const QUrl &value)
* \brief Provides an output device.
* \param optionIndex Specifies the index of the option the output device is provided for.
* \param device Specifies the output device.
* \param giveOwnership Specifies whether the ownership is transfered to download.
* \param giveOwnership Specifies whether the ownership is transferred to download.
*
* Use this method to provide an output device after the outputDeviceRequired() signal has
* been emitted.

View File

@ -538,7 +538,7 @@ inline int Download::positionInCollection() const
}
/*!
* \brief Returns the status update interval in miliseconds.
* \brief Returns the status update interval in milliseconds.
*/
inline int Download::progressUpdateInterval() const
{
@ -547,7 +547,7 @@ inline int Download::progressUpdateInterval() const
/*!
* \brief Sets the status interval.
* \param value Specifies the status inverval in miliseconds.
* \param value Specifies the status interval in milliseconds.
*/
inline void Download::setProgressUpdateInterval(int value)
{
@ -674,7 +674,7 @@ inline void Download::setTitle(const QString &value)
* does nothing if a title has been set previously using the setTitle() method.
* This might be useful since title information which is only derived from a
* filename should generally not overwrite a title which has been obtained previously
* from a better souce (for example the video meta data returned by YouTube in
* from a better source (for example the video meta data returned by YouTube in
* case of a YouTube download).
*
* \sa setTitle()
@ -763,7 +763,7 @@ inline void Download::setCollectionName(const QString &value)
* \brief Returns an indication whether the download is initiated.
*
* \remarks A download which has been failed might be initiated or not - depending
* whether the failure occured during initialization or during the acutal download.
* whether the failure occurred during initialization or during the actual download.
*/
inline bool Download::isInitiated() const
{
@ -878,7 +878,7 @@ inline CppUtilities::TimeSpan Download::shiftRemainingTime()
}
/*!
* \brief Returns the number of bytes received since the downlod has been started.
* \brief Returns the number of bytes received since the download has been started.
*/
inline qint64 Download::bytesReceived() const
{
@ -917,7 +917,7 @@ inline qint64 Download::newBytesToReceive()
}
/*!
* \brief Returns the number of miliseconds since the last progress update.
* \brief Returns the number of milliseconds since the last progress update.
*/
inline int Download::lastProgressUpdate() const
{
@ -958,9 +958,9 @@ inline void Download::setStatusInfo(const QString &value)
}
/*!
* \brief Returns what kind of network error occured.
* \brief Returns what kind of network error occurred.
*
* If no network error occured QNetworkReply::NoError is returned.
* If no network error occurred QNetworkReply::NoError is returned.
*/
inline QNetworkReply::NetworkError Download::networkError() const
{

View File

@ -47,7 +47,7 @@ protected:
* \brief Specifies possible return values of the evalResults() method.
*/
enum class ParsingResult {
Error, /**< Indicates that an error occured. reasonForFail might hold an error message. */
Error, /**< Indicates that an error occurred. reasonForFail might hold an error message. */
Success, /**< Indicates that the results could be parsed correctly. */
AnotherRequestRequired /**< Indicates that the results could be parsed correctly but there are still results to be fetched. */
};

View File

@ -145,13 +145,13 @@ void HttpDownload::checkStatusAndClear(size_t optionIndex)
// wrong to report a failed download here?
reportFinalDownloadStatus(optionIndex, false, reasonForFail, error);
} else {
// some other error occured
// some other error occurred
reply->deleteLater();
m_replies.removeAll(reply);
reportFinalDownloadStatus(optionIndex, false, reasonForFail, error);
}
} else {
// no error occured
// no error occurred
// check if there's a redirection
QVariant redirectionTarget = reply->attribute(QNetworkRequest::RedirectionTargetAttribute);
reply->deleteLater();

View File

@ -65,7 +65,7 @@ void HttpDownloadWithInfoRequst::infoRequestChangedStatus(Download *download)
{
switch (download->status()) {
case DownloadStatus::Failed:
reportInitiated(false, tr("Couldn't retieve the video information. %1").arg(statusInfo()));
reportInitiated(false, tr("Couldn't retrieve the video information. %1").arg(statusInfo()));
break;
case DownloadStatus::Ready:
if (m_infoDownload->isValidOptionChosen()) {

View File

@ -167,10 +167,10 @@ void YoutubeDownload::evalVideoInformation(Download *, QBuffer *videoInfoBuffer)
QString reason = m_fields.value("reason");
if (reason.isEmpty()) {
reportInitiated(false,
tr("Failed to retieve the video info. The reason couldn't be identified. It seems like YouTube changed something in their API."));
tr("Failed to retrieve the video info. The reason couldn't be identified. It seems like YouTube changed something in their API."));
} else {
reportInitiated(false,
tr("Failed to retieve the video info. The reason returned by Youtube is: \"%1\".").arg(reason.replace(QChar('+'), QChar(' '))));
tr("Failed to retrieve the video info. The reason returned by Youtube is: \"%1\".").arg(reason.replace(QChar('+'), QChar(' '))));
}
}
}