From c0d112499ba2805e4e75f2ba3574d412c5db8be1 Mon Sep 17 00:00:00 2001 From: Niklas Date: Thu, 1 Sep 2011 18:04:05 +0200 Subject: some comments to the LogReceiver methods --- LogReceiver/logreceiver.cpp | 55 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/LogReceiver/logreceiver.cpp b/LogReceiver/logreceiver.cpp index 1256bfe..f618e90 100644 --- a/LogReceiver/logreceiver.cpp +++ b/LogReceiver/logreceiver.cpp @@ -450,6 +450,34 @@ void LogReceiver::handleNewInputLine(QLocalSocket * client, QString data) { } } +/** + * This Method is called when a process is finished. + * + * This Method is called when a process is finished. This slot is connected + * with the signal finished() of the QProcess class. + * If the process finishes, it will be checked if the process exited normal + * or if an unexpected error occurred. For this, we determine the sender (which is a + * QProcess), get the corresponding interface (which is stored in a map), and check + * the exitCode. Further actions are taken according to the exitCode check. + * Normal exit: + * emit changeProgressBar() to 100% + * emit updateStatusLabel() to check connection + * checkConnectivity() @see LogReceiver::checkConnectivity() + * Unexpected exit: + * emit updateStatusLabel() to process exited unexpected + * TODO:: the reason for the unexpected exit should be presented in the logfile. + * + * @param exitCode + * + * @param exitStatus + * + * @return bool + * returns true: if the interface name i starts with a letter in the blacklist. + * + * returns false: else + * + * @see LogReceiver::getListOfNetworkInterfaces() + */ void LogReceiver::handleProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { QProcess* p = qobject_cast (QObject::sender()); @@ -466,7 +494,7 @@ void LogReceiver::handleProcessFinished(int exitCode, emit updateStatusLabel(ifName, "process exited unexpected"); } else { qDebug() << "process normal exit"; - qDebug() << "check internet connction"; + qDebug() << "check internet connection"; emit changeProgressBarValue(ifName, 100); emit @@ -485,13 +513,36 @@ void LogReceiver::handleProcessFinished(int exitCode, emit allProcessesFinished(); } } - +/** + * This Method is called when a process is started. + * + * This Method is called when a process is started. + * It prints the message: "process started for interface: ". + */ void LogReceiver::handleProcessStarted() { QProcess* p = qobject_cast (QObject::sender()); QString ifName = clientProcessToIfNameMap.value(p, "ifName"); qDebug() << "process started for interface:" << ifName; } +/** + * This Method implements a blacklist. + * + * This Method implements a blacklist. We check the fist character + * of the interface name. if this letter is in the list, we return true. + * True means, that this interface won't be put into the result list of + * getListOfNetworkInterfaces(). + * + * @param i + * is a interface name. + * + * @return bool + * returns true: if the interface name i starts with a letter in the blacklist. + * + * returns false: else + * + * @see LogReceiver::getListOfNetworkInterfaces() + */ bool LogReceiver::checkBlackList(QString i) { if (i.startsWith("v", Qt::CaseInsensitive)) { return true; -- cgit v1.2.3-55-g7522