Commit 0cee9428 authored by Viktor Porvaznik's avatar Viktor Porvaznik Committed by Viktor Porvaznik

Removed lone log messages

parent 51228c01
......@@ -21,7 +21,6 @@
#ifndef FILESYNC_DAEMOM_H
#define FILESYNC_DAEMOM_H
#include <qdebug.h>
#include <QJsonArray>
#include <QObject>
#include <QDBusAbstractAdaptor>
......
......@@ -73,26 +73,26 @@ void FileSync::Executor::run()
QJsonObject syncItem = value.toObject();
synchronizeEntry(fileSyncList, syncItem, true);
}
qDebug() << "File check completeed " << endl;
D(LOG_EXECUTOR, "File check completeed ");
QStringList hashRequestList;
for (const QJsonValue &value: toSync)
{
hashRequestList.append(value.toObject().value("remotePath").toString());
}
qDebug() << "Sending hash requestd " << endl;
D(LOG_EXECUTOR, "Sending hash requestd ");
DeviceFilesyncDbusInterface *deviceFilesyncDbusInterface = new DeviceFilesyncDbusInterface(
m_deviceId, parent());
deviceFilesyncDbusInterface->requestHashes(hashRequestList);
qDebug() << "Thread waiting " << endl;
D(LOG_EXECUTOR, "Thread waiting ");
// m_hashRequestWaitLoop.exec();
m_hashesReadyMutex.lock();
m_hashesReady.wait(&m_hashesReadyMutex);
m_hashesReadyMutex.unlock();
qDebug() << "Thread Continue " << endl;
D(LOG_EXECUTOR, "Thread Continue ");
// This will continue only after wake up signal
for (const QJsonValue &hash: m_hashList)
......@@ -104,18 +104,16 @@ void FileSync::Executor::run()
SyncResult syncResult(
determineAndPerformSyncOperation(*fileSyncList, m_hashList));
qDebug() << "Signal emitted ..." << endl;
D(LOG_EXECUTOR, "Signal emitted ...");
Q_EMIT notifyDaemon(syncResult);
qDebug() << "Signal emitted." << endl;
D(LOG_EXECUTOR, "Signal emitted.");
m_runningMutex.lock();
m_running = false;
m_runningMutex.unlock();
QString syncCompletedMsg("Sync %1!");
// SyncLog::instance().logInfo(syncCompletedMsg.arg(m_executionResult.syncStatus()));
qCInfo(LOG_EXECUTOR)
<< syncCompletedMsg.arg(m_executionResult.syncStatus());
LOG_I(LOG_EXECUTOR, syncCompletedMsg.arg(m_executionResult.syncStatus()));
}
FileSync::SyncResult FileSync::Executor::determineAndPerformSyncOperation(
......@@ -219,7 +217,7 @@ FileSync::Executor::synchronizeEntry(QJsonArray *syncFileList,
m_remoteSystemMountPoint,
remotePath);
}
qCDebug(LOG_EXECUTOR) << "Checking" << localPath << "and" << remotePath;
LOG_D(LOG_EXECUTOR, "Checking" << localPath << "and" << remotePath);
QString postSyncScript = entry.value("postSyncScript").toString();
......@@ -230,26 +228,24 @@ FileSync::Executor::synchronizeEntry(QJsonArray *syncFileList,
{
if (!localPathInfo.exists() && !localPathInfo.dir().exists())
{
qCDebug(LOG_EXECUTOR)
<< "Parent directory not existing, creating one "
<< localPathInfo.dir().absolutePath();
LOG_D(LOG_EXECUTOR, "Parent directory not existing, creating one "
<< localPathInfo.dir().absolutePath());
QDir root("");
root.mkpath(localPathInfo.dir().absolutePath());
}
else if (!remotePathInfo.exists() && !remotePathInfo.dir().exists())
{
qCDebug(LOG_EXECUTOR)
<< "Parent directory not existing, creating one "
<< remotePathInfo.dir().absolutePath();
LOG_D(LOG_EXECUTOR, "Parent directory not existing, creating one "
<< remotePathInfo.dir().absolutePath());
QDir root("");
root.mkpath(remotePathInfo.dir().absolutePath());
}
}
qCDebug(LOG_EXECUTOR) << "Pass" << remotePath;
LOG_D(LOG_EXECUTOR, "Pass" << remotePath);
if (localPathInfo.exists() && remotePathInfo.exists())
{
qCDebug(LOG_EXECUTOR) << "Pass1" << remotePath;
LOG_D(LOG_EXECUTOR, "Pass1" << remotePath);
if (localPathInfo.isDir() && !remotePathInfo.isDir())
{
LOG_W(LOG_EXECUTOR, FileSync::INCONSISTENT_PATHS_ERROR.arg(localPath,
......@@ -267,9 +263,7 @@ FileSync::Executor::synchronizeEntry(QJsonArray *syncFileList,
postSyncScript);
for (QJsonObject dirEntry : dirEntries)
{
qCDebug(LOG_EXECUTOR)
<< "Synchronizing nested entry"
<< dirEntry;
LOG_D(LOG_EXECUTOR, "Synchronizing nested entry" << dirEntry);
synchronizeEntry(syncFileList, dirEntry, false);
}
}
......@@ -303,53 +297,39 @@ FileSync::Executor::synchronizeEntry(QJsonArray *syncFileList,
// errorOccured = true;
}
qCDebug(LOG_EXECUTOR) << "Passx" << remotePath;
LOG_D(LOG_EXECUTOR, "Passx" << remotePath);
}
bool FileSync::Executor::performSyncOperation(
const FileSync::SyncOperation &operation, const QString &localFilePath,
const QString &remoteFilePath, const QString &postSyncScript)
{
qCDebug(LOG_EXECUTOR) << "Processing sync path"
<< localFilePath
<< "and" << remoteFilePath;
LOG_D(LOG_EXECUTOR, "Processing sync path"
<< localFilePath
<< "and" << remoteFilePath);
bool operationResult = true;
if (operation.getType() == SyncOperation::UNKNOWN)
{
// Log::instance().logError(
// FileSync::SYNC_OPERATION_UNKNOWN.arg(localFilePath,
// remoteFilePath));
// qCDebug(LOG_EXECUTOR)
// << FileSync::SYNC_OPERATION_UNKNOWN.arg(localFilePath,
// remoteFilePath);
LOG_D(LOG_EXECUTOR, FileSync::SYNC_OPERATION_UNKNOWN.arg(localFilePath,
remoteFilePath));
operationResult = false;
}
else if (operation.getType() == SyncOperation::NONE)
{
// Log::instance().logInfo(
// FileSync::NO_SYNC.arg(localFilePath, remoteFilePath));
// qCDebug(LOG_EXECUTOR)
// << FileSync::NO_SYNC.arg(localFilePath, remoteFilePath);
LOG_D(LOG_EXECUTOR, FileSync::NO_SYNC.arg(localFilePath,
remoteFilePath));
}
else if (operation.getType() == SyncOperation::CONFLICT)
{
// Log::instance().logError(
// FileSync::SYNC_OPERATION_CONFLICT.arg(localFilePath,
// remoteFilePath));
// qCDebug(LOG_EXECUTOR)
// << FileSync::SYNC_OPERATION_CONFLICT.arg(localFilePath,
// remoteFilePath);
LOG_D(LOG_EXECUTOR, FileSync::SYNC_OPERATION_CONFLICT.arg(localFilePath,
remoteFilePath));
operationResult = false;
}
else if (operation.getType() == SyncOperation::FROM_LOCAL)
{
// Log::instance().logInfo(
// FileSync::SYNC_OPERATION_FROM_LOCAL.arg(localFilePath,
// remoteFilePath));
// qCDebug(LOG_EXECUTOR)
// << FileSync::SYNC_OPERATION_FROM_LOCAL.arg(localFilePath,
// remoteFilePath);
LOG_D(LOG_EXECUTOR, FileSync::SYNC_OPERATION_FROM_LOCAL.arg(localFilePath,
remoteFilePath));
if (!copyFile(localFilePath, remoteFilePath))
{
operationResult = false;
......@@ -358,12 +338,8 @@ bool FileSync::Executor::performSyncOperation(
}
else if (operation.getType() == SyncOperation::FROM_REMOTE)
{
// Log::instance().logInfo(
// FileSync::SYNC_OPERATION_FROM_REMOTE.arg(remoteFilePath,
// localFilePath));
// qCDebug(LOG_EXECUTOR)
// << FileSync::SYNC_OPERATION_FROM_REMOTE.arg(remoteFilePath,
// localFilePath);
LOG_D(LOG_EXECUTOR, FileSync::SYNC_OPERATION_FROM_REMOTE.arg(remoteFilePath,
localFilePath));
if (!copyFile(remoteFilePath, localFilePath))
{
operationResult = false;
......@@ -388,17 +364,17 @@ bool FileSync::Executor::copyFile(QString sourceFilePath, QString destFilePath)
if (result)
{
qCDebug(LOG_EXECUTOR) << "File copy from '"
<< sourceFilePath
<< " to " << destFilePath
<< " successful";
LOG_D(LOG_EXECUTOR, "File copy from '"
<< sourceFilePath
<< " to " << destFilePath
<< " successful");
}
else
{
qCDebug(LOG_EXECUTOR) << "File copy from '"
<< sourceFilePath
<< " to " << destFilePath
<< " failed";
LOG_D(LOG_EXECUTOR, "File copy from '"
<< sourceFilePath
<< " to " << destFilePath
<< " failed");
copyResult = false;
}
......@@ -462,12 +438,8 @@ FileSync::Executor::determineSyncOperation(const QString &localPath,
// Both files / directories exist
if (existingLocalRemotePairHash == "")
{
// Log::instance().logInfo(
// FileSync::SYNC_DETERMINATION_BY_MTIME.arg(localPath,
// remotePath));
// qCDebug(LOG_EXECUTOR)
// << FileSync::SYNC_DETERMINATION_BY_MTIME.arg(localPath,
// remotePath);
LOG_D(LOG_EXECUTOR, FileSync::SYNC_DETERMINATION_BY_MTIME.arg(localPath,
remotePath));
if (localPathInfo.lastModified().toMSecsSinceEpoch() ==
remotePathInfo.lastModified().toMSecsSinceEpoch())
{
......
......@@ -21,7 +21,6 @@
#ifndef FILESYNC_EXECUTOR_H
#define FILESYNC_EXECUTOR_H
#include <qdebug.h>
#include <QObject>
#include <QPair>
#include <QList>
......@@ -56,7 +55,8 @@ namespace FileSync
bool m_errorOccured;
QJsonArray m_hashList;
SyncResult determineAndPerformSyncOperation(const QJsonArray &fileSyncList, const QJsonArray &fileHashList);
SyncResult determineAndPerformSyncOperation(const QJsonArray &fileSyncList,
const QJsonArray &fileHashList);
public:
Executor(const QString &deviceId, const QStringList &syncList);
......@@ -89,8 +89,8 @@ namespace FileSync
QString remoteFilePath);
void synchronizeEntry(QJsonArray *syncFileList,
const QJsonObject &entry,
bool remotePathIsRelative);
const QJsonObject &entry,
bool remotePathIsRelative);
bool
performSyncOperation(const SyncOperation &operation,
......
......@@ -20,7 +20,6 @@
#include <QtCore/QFile>
#include <QtCore/QException>
#include <qdebug.h>
#include "log.h"
#include "common.h"
......
......@@ -18,7 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qdebug.h>
#include <QCommandLineParser>
#include <QDBusConnection>
#include <qdbuserror.h>
......
......@@ -21,7 +21,6 @@
#ifndef FILESYNC_SFTP_MOUNTER_H
#define FILESYNC_SFTP_MOUNTER_H
#include <qdebug.h>
#include <QObject>
#include <QDBusAbstractAdaptor>
#include <QStandardPaths>
......
......@@ -23,7 +23,6 @@
#import <QString>
#import <QMap>
#import <qdebug.h>
namespace FileSync
{
......
......@@ -22,7 +22,6 @@
#define FILESYNC_DBUS_ADAPTOR_H
#include <QJsonArray>
#include <qdebug.h>
#include <QObject>
#include <QDBusAbstractAdaptor>
#include <QDBusConnection>
......
......@@ -19,7 +19,6 @@
*/
#include "json_types.h"
#include "qdebug.h"
#include <QDBusArgument>
#include <QJsonObject>
#include <QJsonArray>
......
......@@ -21,7 +21,6 @@
#ifndef FILESYNC_JSON_TYPES_H
#define FILESYNC_JSON_TYPES_H
#include <qdebug.h>
#include <QJsonObject>
#include <QVariantMap>
#include <QDBusArgument>
......
......@@ -21,7 +21,6 @@
#ifndef FILESYNC_SYNC_RESULT_H
#define FILESYNC_SYNC_RESULT_H
#include <qdebug.h>
#include <QObject>
#include <QDBusAbstractAdaptor>
#include <QDBusMetaType>
......
......@@ -27,8 +27,6 @@
#include <QDBusConnection>
#include <QProcess>
#include <qdebug.h>
#include "interfaces/dbusinterfaces.h"
#include "filesync_constants.h"
#include "filesync_plugin.h"
......@@ -110,7 +108,8 @@ bool FileSyncPlugin::Plugin::receivePacket(const NetworkPacket &np)
hashArray.toVariantList();
QJsonDocument document;
document.setArray(hashArray);
qDebug() << "Processing hashArray." << document.toJson() << endl;
qCDebug(KDECONNECT_PLUGIN_SYNC) << "Processing hashArray."
<< document.toJson() << endl;
fileSyncAppInterface->setHashes(device()->id(), hashArray.toVariantList());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment