Skip to content
Snippets Groups Projects
Commit d4b5d85d authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Some qDebug() messages removed.

parent 96e673d9
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,6 @@
#include "GUIHelpers.h"
#include "ProjectUtils.h"
#include <QDir>
#include <QDebug>
namespace
{
......@@ -35,17 +34,17 @@ AutosaveController::AutosaveController(QObject* parent)
void AutosaveController::setDocument(ProjectDocument* document)
{
if(document == m_document)
if (document == m_document)
return;
m_timer->reset();
if(m_document)
if (m_document)
setDocumentConnected(false);
m_document = document;
if(m_document)
if (m_document)
setDocumentConnected(true);
onDocumentModified();
......@@ -75,10 +74,9 @@ QString AutosaveController::autosaveName() const
return QString();
}
void AutosaveController::removeAutosaveDir()
{
if(autosaveDir().isEmpty())
if (autosaveDir().isEmpty())
return;
QDir dir(autosaveDir());
......@@ -100,15 +98,11 @@ void AutosaveController::onDocumentDestroyed(QObject* object)
void AutosaveController::onDocumentModified()
{
if(!m_document)
if (!m_document)
return;
qDebug() << "AutosaveController::onDocumentModified() isModified:"
<< m_document->isModified() << " hasValidName:" << m_document->hasValidNameAndPath();
if (m_document->isModified() && m_document->hasValidNameAndPath()) {
qDebug() << "AutosaveController::onDocumentModified() -> scheduleUpdate()";
if (m_document->isModified() && m_document->hasValidNameAndPath())
m_timer->scheduleUpdate();
}
}
void AutosaveController::autosave()
......@@ -116,26 +110,23 @@ void AutosaveController::autosave()
QString name = autosaveName();
if (!name.isEmpty()) {
GUIHelpers::createSubdir(m_document->projectDir(), ProjectUtils::autosaveSubdir());
qDebug() << " AutosaveService::autosave() -> emitting autosave request";
emit autosaveRequest();
}
}
void AutosaveController::setDocumentConnected(bool set_connected)
{
if(!m_document)
if (!m_document)
return;
if(set_connected) {
connect(m_document, SIGNAL(destroyed(QObject*)),
this, SLOT(onDocumentDestroyed(QObject*)), Qt::UniqueConnection);
connect(m_document, SIGNAL(modified()), this,
SLOT(onDocumentModified()), Qt::UniqueConnection);
if (set_connected) {
connect(m_document, SIGNAL(destroyed(QObject*)), this, SLOT(onDocumentDestroyed(QObject*)),
Qt::UniqueConnection);
connect(m_document, SIGNAL(modified()), this, SLOT(onDocumentModified()),
Qt::UniqueConnection);
} else {
disconnect(m_document, SIGNAL(destroyed(QObject*)),
this, SLOT(onDocumentDestroyed(QObject*)));
disconnect(m_document, SIGNAL(modified()), this,
SLOT(onDocumentModified()));
disconnect(m_document, SIGNAL(destroyed(QObject*)), this,
SLOT(onDocumentDestroyed(QObject*)));
disconnect(m_document, SIGNAL(modified()), this, SLOT(onDocumentModified()));
}
}
......@@ -18,17 +18,14 @@
#include "IntensityDataItem.h"
#include "JobItemUtils.h"
#include "ProjectUtils.h"
#include <QDebug>
OutputDataIOService::OutputDataIOService(QObject* parent)
: QObject(parent)
, m_applicationModels(nullptr)
: QObject(parent), m_applicationModels(nullptr)
{
}
OutputDataIOService::OutputDataIOService(ApplicationModels* models, QObject* parent)
: QObject(parent)
, m_applicationModels(nullptr)
: QObject(parent), m_applicationModels(nullptr)
{
setApplicationModels(models);
}
......@@ -47,10 +44,9 @@ void OutputDataIOService::save(const QString& projectDir)
for (auto item : dataItems()) {
if (m_history.wasModifiedSinceLastSave(projectDir, item)) {
if (m_history.wasModifiedSinceLastSave(projectDir, item))
JobItemUtils::saveIntensityData(item, projectDir);
qDebug() << "OutputDataIOService::data saved";
}
newHistory.markAsSaved(item);
}
......@@ -77,16 +73,16 @@ void OutputDataIOService::load(const QString& projectDir)
//! Returns all IntensityDataItems available for save/load.
QVector<IntensityDataItem *> OutputDataIOService::dataItems() const
QVector<IntensityDataItem*> OutputDataIOService::dataItems() const
{
QVector<IntensityDataItem *> result;
QVector<IntensityDataItem*> result;
if (!m_applicationModels)
return result;
for (auto item : m_applicationModels->nonXMLData()) {
if (auto intensityItem = dynamic_cast<IntensityDataItem*>(item))
result.push_back(intensityItem);
result.push_back(intensityItem);
}
return result;
......@@ -95,10 +91,9 @@ QVector<IntensityDataItem *> OutputDataIOService::dataItems() const
//! Clean old saved files.
//! All files in oldSaves list, which are not in newSaves list, will be removed.
void OutputDataIOService::cleanOldFiles(const QString &projectDir, const QStringList &oldSaves,
const QStringList &newSaves)
void OutputDataIOService::cleanOldFiles(const QString& projectDir, const QStringList& oldSaves,
const QStringList& newSaves)
{
QStringList to_remove = ProjectUtils::substract(oldSaves, newSaves);
ProjectUtils::removeFiles(projectDir, to_remove);
}
......@@ -15,7 +15,6 @@
#include "SaveThread.h"
#include "projectdocument.h"
#include <QDebug>
SaveThread::SaveThread(QObject* parent)
: QThread(parent)
......@@ -26,23 +25,18 @@ SaveThread::SaveThread(QObject* parent)
SaveThread::~SaveThread()
{
qDebug() << "SaveThread::~SaveThread() -> waiting";
wait();
qDebug() << "SaveThread::~SaveThread() -> done";
}
void SaveThread::run()
{
qDebug() << "SaveThread::run() -> " << m_projectFile;
Q_ASSERT(m_document);
m_document->save_project_data(m_projectFile);
qDebug() << "SaveThread::run() -> Ready. Emitting saveReady()";
emit saveReady();
}
void SaveThread::setSaveContext(ProjectDocument* document, const QString& project_file_name)
{
qDebug() << "SaveThread::setSaveContext" << project_file_name;
m_document = document;
m_projectFile = project_file_name;
}
......@@ -105,7 +105,6 @@ void ProjectDocument::save(const QString& project_file_name, bool autoSave)
void ProjectDocument::save_project_file(const QString& project_file_name, bool autoSave)
{
qDebug() << "ProjectDocument::save_project_file() -> " << project_file_name;
QElapsedTimer timer;
timer.start();
......@@ -123,25 +122,24 @@ void ProjectDocument::save_project_file(const QString& project_file_name, bool a
emit modified();
}
qDebug() << " saved. Project file save time:" << timer.elapsed();
qDebug() << "ProjectDocument::save_project_file() -> " << project_file_name
<< timer.elapsed() << "msec";
}
void ProjectDocument::save_project_data(const QString& project_file_name)
{
qDebug() << "ProjectDocument::save_project_data() -> " << project_file_name;
QElapsedTimer timer;
timer.start();
m_dataService->save(ProjectUtils::projectDir(project_file_name));
qDebug() << "saved. Project data save time:" << timer.elapsed();
qDebug() << "ProjectDocument::save_project_data() -> " << project_file_name
<< timer.elapsed() << "msec";
}
void ProjectDocument::load(const QString& project_file_name)
{
qDebug() << "ProjectDocument loading...";
QElapsedTimer timer1, timer2;
timer1.start();
......@@ -171,7 +169,8 @@ void ProjectDocument::load(const QString& project_file_name)
m_messageService->send_message(this, EXCEPTION_THROW, QString(ex.what()));
}
qDebug() << "loaded. Project load time:" << (timer1.elapsed() - timer2.elapsed()) << ";"
qDebug() << "ProjectDocument::load() -> Project load time:"
<< (timer1.elapsed() - timer2.elapsed()) << ";"
<< "nonXML load time:" << timer2.elapsed();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment