Skip to content

Commit

Permalink
Merge pull request #14 from PowerKiKi/typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
Ummon authored Apr 18, 2020
2 parents ecec8be + 2bf923a commit 4e7a226
Show file tree
Hide file tree
Showing 112 changed files with 238 additions and 238 deletions.
2 changes: 1 addition & 1 deletion application/5.build_installation_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ `uname -s` = "Linux" ] ; then
./linux_ubuntu_setup.sh
cd ../..
else
# MS.Windows. Inno Setup (isetup) + QuickStart Pack (ispack) must be both installed. The Inno Setup directory must be placed in the PATH variable environnment.
# MS.Windows. Inno Setup (isetup) + QuickStart Pack (ispack) must be both installed. The Inno Setup directory must be placed in the PATH variable environment.
cd Setups/Windows/
iscc windows_setup.iss
cd ../..
Expand Down
2 changes: 1 addition & 1 deletion application/Client/D-LAN_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ void D_LAN_Client::newCommandLine(QString line)
}
else
{
this->out << "Unkown command, type help for more information" << endl;
this->out << "Unknown command, type help for more information" << endl;
}
}

Expand Down
2 changes: 1 addition & 1 deletion application/Common/Constants.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const QString Constants::SERVICE_NAME("D-LAN Core");

const int Constants::PROTOBUF_STREAMING_BUFFER_SIZE(4 * 1024); ///< 4kB.

const QString Constants::BINARY_PREFIXS[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB"};
const QString Constants::BINARY_PREFIXES[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB"};

const int Constants::MAX_NB_HASHES_PER_ENTRY_GUI_BROWSE = 8;

Expand Down
2 changes: 1 addition & 1 deletion application/Common/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Common

static const int PROTOBUF_STREAMING_BUFFER_SIZE;

static const QString BINARY_PREFIXS[];
static const QString BINARY_PREFIXES[];

static const int MAX_NB_HASHES_PER_ENTRY_GUI_BROWSE;
static const int CHUNK_SIZE;
Expand Down
2 changes: 1 addition & 1 deletion application/Common/Containers/SortedArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ int Common::SortedArray<T, M>::size() const
}

/**
* Insert or update the given value. The update is done with assignement operator of T.
* Insert or update the given value. The update is done with assignment operator of T.
* @param exists Optional, set to 'true' if the value already exists.
* @return The position 'value'.
*/
Expand Down
2 changes: 1 addition & 1 deletion application/Common/Containers/SortedList.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* @class Common::SortedList
*
* A very simple sorted list, not very efficent, implemented as a simple linked list. A more efficient implementation should use a red-black tree or a B-tree.
* A very simple sorted list, not very efficient, implemented as a simple linked list. A more efficient implementation should use a red-black tree or a B-tree.
* Don't forget to call 'itemChanged(..)' if the data of one of the items has changed and the sorting function ('lesserThan') depends of this data.
* Do not allow multiple same item.
*/
Expand Down
4 changes: 2 additions & 2 deletions application/Common/Containers/Tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ namespace Common
/**
* @class Tree
* A tree data structure, can store data called 'item' of type 'ItemType'.
* To use this classe you have to inherit it and give your child class type as the second template parameter.
* To use this class you have to inherit it and give your child class type as the second template parameter.
* For example:
* MyTree : public Tree<int, MyTree> { .. };
*
* Some remarks:
* - To remove an element just delete it.
* - You can reimplement 'newTree(..)' to dynamically create new type of children.
* - You can re-implement 'newTree(..)' to dynamically create new type of children.
* - This class comes with a breadth-first and a depth-first iterators.
*
* If you don't want to inherit from Tree you can use the 'SimpleTree' class.
Expand Down
26 changes: 13 additions & 13 deletions application/Common/Global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,19 @@ int Global::nCombinations(int n, int k)
else
bytes = 0;
return QString::number(bytes).append(IS_BELOW_1024 ? "" : QString(".").append(QString::number(rest))).append(" ").append(Constants::BINARY_PREFIXS[current]);
return QString::number(bytes).append(IS_BELOW_1024 ? "" : QString(".").append(QString::number(rest))).append(" ").append(Constants::BINARY_PREFIXES[current]);
}*/

/**
* Will return a formated size with the unit prefix and one digit folowing the point.
* Will return a formatted size with the unit prefix and one digit following the point.
* For example:
* - 1 -> "1 B"
* - 1024 -> "1.0 KiB"
* - 1024^2 -> "1.0 MiB"
* - 1024^3 -> "1.0 GiB"
* - 1024^4 -> "1.0 TiB"
* - etc . . . to ZiB
* The speed of this implementation is equal to the old above : ~1 µs per call (mesured with 1 millions calls in release (-O2)).
* The speed of this implementation is equal to the old above : ~1 µs per call (measured with 1 millions calls in release (-O2)).
*/
QString Global::formatByteSize(qint64 bytes, int precision)
{
Expand All @@ -222,8 +222,8 @@ QString Global::formatByteSize(qint64 bytes, int precision)

if (bytes < 1024 * size)
return bytes < 1024 ?
QString::number(bytes <= 0 ? 0 : bytes).append(" ").append(Constants::BINARY_PREFIXS[i]) :
QString::number((double)bytes / size, 'f', precision).append(" ").append(Constants::BINARY_PREFIXS[i]);
QString::number(bytes <= 0 ? 0 : bytes).append(" ").append(Constants::BINARY_PREFIXES[i]) :
QString::number((double)bytes / size, 'f', precision).append(" ").append(Constants::BINARY_PREFIXES[i]);
}
return QString();
}
Expand Down Expand Up @@ -270,13 +270,13 @@ QString Global::formatTime(quint64 seconds)

QString Global::formatIP(const QHostAddress& address, quint16 port)
{
QString formatedIP;
QString formattedIP;
if (address.protocol() == QAbstractSocket::IPv4Protocol)
formatedIP.append(address.toString());
formattedIP.append(address.toString());
else
formatedIP.append("[").append(address.toString()).append("]");
formatedIP.append(":").append(QString::number(port));
return formatedIP;
formattedIP.append("[").append(address.toString()).append("]");
formattedIP.append(":").append(QString::number(port));
return formattedIP;
}

/**
Expand Down Expand Up @@ -509,7 +509,7 @@ QString Global::getDataSystemFolder(DataFolderType type)
#endif
}

QString Global::getCurrenUserName()
QString Global::getCurrentUserName()
{
#if defined(Q_OS_WIN32)
TCHAR userName[UNLEN + 1]; // UNLEN is from Lmcons.h
Expand All @@ -527,7 +527,7 @@ QString Global::getCurrenUserName()
#endif
}

QString Global::getCurrenMachineName()
QString Global::getCurrentMachineName()
{
#if defined(Q_OS_WIN32)
TCHAR machineName[MAX_COMPUTERNAME_LENGTH + 1];
Expand All @@ -547,7 +547,7 @@ QString Global::getCurrenMachineName()
/**
* Create a file containing its name. Parents directories are created if needed.
* For testing purpose.
* @return true if the file has been created successfuly or false if an error has occured.
* @return true if the file has been created successfully or false if an error has occurred.
*/
bool Global::createFile(const QString& path)
{
Expand Down
4 changes: 2 additions & 2 deletions application/Common/Global.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ namespace Common
static QString getDataServiceFolder(DataFolderType type);
static QString getDataSystemFolder(DataFolderType type);

static QString getCurrenUserName();
static QString getCurrenMachineName();
static QString getCurrentUserName();
static QString getCurrentMachineName();

static bool createFile(const QString& path);
static bool recursiveDeleteDirectoryContent(const QString& dir);
Expand Down
6 changes: 3 additions & 3 deletions application/Common/Hash_noShare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ Hash::Hash() noexcept :
/**
* Build a new hash from a char*, 'h' is not a readable string, @see fromStr.
* 'h' must have a length equal or bigger to HASH_SIZE!
* The data are copied, no pointer is keept to 'h'.
* 'h' can be a null pointer, in this case a null hashe will be built.
* The data are copied, no pointer is kept to 'h'.
* 'h' can be a null pointer, in this case a null hash will be built.
*/
Hash::Hash(const char* h)
{
Expand All @@ -68,7 +68,7 @@ Hash::Hash(const std::string& str)
/**
* Build a new hash from a QByteArray.
* 'a' must have a length equal or bigger to HASH_SIZE!
* The data are copied, no pointer is keept to 'a'.
* The data are copied, no pointer is kept to 'a'.
*/
Hash::Hash(const QByteArray& a)
{
Expand Down
6 changes: 3 additions & 3 deletions application/Common/Hash_share.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ Hash::Hash(Hash&& h) noexcept
/**
* Build a new hash from a char*, 'h' is not a readable string, @see fromStr.
* 'h' must have a length equal or bigger to HASH_SIZE!
* The data are copied, no pointer is keept to 'h'.
* 'h' can be a null pointer, in this case a null hashe will be built.
* The data are copied, no pointer is kept to 'h'.
* 'h' can be a null pointer, in this case a null hash will be built.
*/
Hash::Hash(const char* h)
{
Expand Down Expand Up @@ -102,7 +102,7 @@ Hash::Hash(const std::string& str)
/**
* Build a new hash from a QByteArray.
* 'a' must have a length equal or bigger to HASH_SIZE!
* The data are copied, no pointer is keept to 'a'.
* The data are copied, no pointer is kept to 'a'.
*/
Hash::Hash(const QByteArray& a)
{
Expand Down
6 changes: 3 additions & 3 deletions application/Common/KnownExtensions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ExtensionCategory KnownExtensions::getCategoryFrom(const QString& extension)
return *i;
}

int KnownExtensions::getBeginingExtension(const QString& filename)
int KnownExtensions::getBeginningExtension(const QString& filename)
{
int i = 0;
while ((i = filename.indexOf('.', i + 1)) != -1)
Expand All @@ -45,7 +45,7 @@ int KnownExtensions::getBeginingExtension(const QString& filename)

QString KnownExtensions::removeExtension(const QString& filename)
{
int i = getBeginingExtension(filename);
int i = getBeginningExtension(filename);
if (i != -1)
return filename.left(i - 1);
else
Expand All @@ -54,7 +54,7 @@ QString KnownExtensions::removeExtension(const QString& filename)

QString KnownExtensions::getExtension(const QString& filename)
{
int i = getBeginingExtension(filename);
int i = getBeginningExtension(filename);
if (i != -1)
return filename.right(filename.length() - i);
else
Expand Down
2 changes: 1 addition & 1 deletion application/Common/KnownExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Common
* Returns '-1' if there is no extension.
* For example: "abc.zip" may return 4.
*/
static int getBeginingExtension(const QString& filename);
static int getBeginningExtension(const QString& filename);
static QString removeExtension(const QString& filename);
static QString getExtension(const QString& filename);

Expand Down
2 changes: 1 addition & 1 deletion application/Common/LogManager/priv/Builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ QSharedPointer<ILogger> Builder::newLogger(const QString& name)
}

/**
* Return an hook to grap all log message for the given severities.
* Return an hook to grep all log message for the given severities.
*/
QSharedPointer<ILoggerHook> Builder::newLoggerHook(Severity severities)
{
Expand Down
10 changes: 5 additions & 5 deletions application/Common/LogManager/priv/Entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace LM;

const QString Entry::DATE_TIME_FORMAT("yyyy-MM-dd HH:mm:ss");
const QString Entry::DATE_TIME_FORMAT_WITH_MS("yyyy-MM-dd HH:mm:ss.zzz");
const QString Entry::SEVERITIES_STR[] = {"Fatal", "Error", "Warning", "Debug", "User", "Unkown"};
const QString Entry::SEVERITIES_STR[] = {"Fatal", "Error", "Warning", "Debug", "User", "Unknown"};
QRegExp Entry::lineRegExp("(\\S{10} \\S{8})\\.(\\d{3}) \\[(.+)\\] \\{(.+)\\} \\((\\w+)\\) (?:<(\\S+:\\d+)> )?: (.*)");

Entry::Entry(const QString& line) :
Expand Down Expand Up @@ -64,11 +64,11 @@ Entry::Entry(const QDateTime& dateTime, Severity severity, const QString& name,
}

/**
* Message endlines ('\n') are replaced by "<lf>" to guaranted one line per entry.
* Message endlines ('\n') are replaced by "<lf>" to guaranteed one line per entry.
*/
QString Entry::toStrLine() const
{
QString formatedMessage =
QString formattedMessage =
QString(!this->source.isNull() ? "%1 [%2] {%3} (%4) <%5> : %6" : "%1 [%2] {%3} (%4) : %5").arg
(
this->getDateStr(),
Expand All @@ -78,9 +78,9 @@ QString Entry::toStrLine() const
);

if (!this->source.isNull())
formatedMessage = formatedMessage.arg(this->source);
formattedMessage = formattedMessage.arg(this->source);

return formatedMessage.arg(this->message);
return formattedMessage.arg(this->message);
}

QDateTime Entry::getDate() const
Expand Down
2 changes: 1 addition & 1 deletion application/Common/LogManager/priv/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void Logger::addALoggerHook(QSharedPointer<LoggerHook> loggerHook)
}

/**
* We can't use 'Logger::mutex' in constructor and destructor because we don't know if the object already exist (contructor) or
* We can't use 'Logger::mutex' in constructor and destructor because we don't know if the object already exist (constructor) or
* if it has been already deleted (destructor).
*/
Logger::Logger(const QString& name) :
Expand Down
6 changes: 3 additions & 3 deletions application/Common/LogManager/priv/QtLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ using namespace LM;
/**
* @class LM::QtLogger
*
* A special objet is create to handle all Qt message. For example
* A special object is create to handle all Qt message. For example
* when a signal is connected to an unknown slot, the warning will be
* catched and logged here.
* Warning, the Qt messages are not catched during unit tesing because 'QTest::qExec(..)'
* caught and logged here.
* Warning, the Qt messages are not caught during unit testing because 'QTest::qExec(..)'
* will create its own handle and discard the current one.
*/

Expand Down
2 changes: 1 addition & 1 deletion application/Common/Network/MessageSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using namespace Common;
* @class Common::MessageSocket
*
* An abstract class which is able to send and receive protocol buffer messages over a QAbstractSocket.
* It is designed to be sublcassed,
* It is designed to be subclassed,
*/

/**
Expand Down
2 changes: 1 addition & 1 deletion application/Common/PersistentData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void PersistentData::setValue(const QString& directory, const QString& name, con
/**
* Retrieve the data associated to a given name.
* @exception PersistentDataIOException
* @exception UnknownValueException Throwed if the value doesn't exist
* @exception UnknownValueException Thrown if the value doesn't exist
*/
void PersistentData::getValue(const QString& name, google::protobuf::Message& data, Global::DataFolderType dataFolderType, bool humanReadable)
{
Expand Down
2 changes: 1 addition & 1 deletion application/Common/ProtoHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace Common
static QHostAddress getIP(const Protos::Common::IP& ipMess);

/**
* Return the relative path of an entry, for exemple:
* Return the relative path of an entry, for example:
* - entry is a root: "/" (with 'prependSharedDir == false')
* - entry is a root: "/root_dir/" ('prependSharedDir == true')
* - entry is a directory: "/abc/xyz/" (with 'entriesToAppend == DIR' and 'prependSharedDir == false').
Expand Down
6 changes: 3 additions & 3 deletions application/Common/RemoteCoreController/ICoreConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace RCC

/**
* The main interface to control a remote core.
* The signal 'newState' is periodically emitted, for exemple each second. It can be emitted right after certain action, like 'setCoreSettings(..)'.
* The signal 'newState' is periodically emitted, for example each second. It can be emitted right after certain action, like 'setCoreSettings(..)'.
* See the prototype file "application/Protos/gui_protocol.proto" for more information.
*
* Connection process:
Expand Down Expand Up @@ -92,7 +92,7 @@ namespace RCC
/**
* Connect to a remote core. Password is mendatory and should be hashed and salted, see the class 'Common::Hasher'.
* If the given address is a local one it may try to launch a local core.
* @param address the IP adress, it can be an IPv4 or IPv6 address.
* @param address the IP address, it can be an IPv4 or IPv6 address.
*/
virtual void connectToCore(const QString& address, quint16 port, Common::Hash password) = 0;

Expand Down Expand Up @@ -168,7 +168,7 @@ namespace RCC
/**
* Get files and folders from some folders. Plus the root folders if asked.
* @param peerID Can be yourself.
* @param entries One or more folders frome the remote peer.
* @param entries One or more folders from the remote peer.
* @param withRoots
*/
virtual QSharedPointer<IBrowseResult> browse(const Common::Hash& peerID, const Protos::Common::Entries& entries, bool withRoots = true) = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void InternalCoreConnection::connectToCore(const QString& address, quint16 port,
if (this->currentHostLookupID != -1)
QHostInfo::abortHostLookup(this->currentHostLookupID);

this->currentHostLookupID = QHostInfo::lookupHost(this->connectionInfo.address, this, SLOT(adressResolved(QHostInfo)));
this->currentHostLookupID = QHostInfo::lookupHost(this->connectionInfo.address, this, SLOT(addressResolved(QHostInfo)));
}

void InternalCoreConnection::connectToCore(const QString& address, quint16 port, const QString& password)
Expand Down Expand Up @@ -300,7 +300,7 @@ ICoreConnection::ConnectionInfo InternalCoreConnection::getConnectionInfo() cons
return this->connectionInfo;
}

void InternalCoreConnection::adressResolved(QHostInfo hostInfo)
void InternalCoreConnection::addressResolved(QHostInfo hostInfo)
{
this->currentHostLookupID = -1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace RCC
void searchResult(const Protos::Common::FindResult& findResult);

private slots:
void adressResolved(QHostInfo hostInfo);
void addressResolved(QHostInfo hostInfo);
void tryToConnectToTheNextAddress();
void stateChanged(QAbstractSocket::SocketState socketState);

Expand All @@ -135,7 +135,7 @@ namespace RCC

int currentHostLookupID;

QList<QHostAddress> addressesToTry; // When a name is resolved many addresses can be returned, we will try all of them until a connection is successfuly established.
QList<QHostAddress> addressesToTry; // When a name is resolved many addresses can be returned, we will try all of them until a connection is successfully established.
QList<QHostAddress> addressesToRetry;
int nbRetries;

Expand Down
Loading

0 comments on commit 4e7a226

Please sign in to comment.