Improve debug messages

This commit is contained in:
Martchus 2018-09-08 19:59:15 +02:00
parent 6048e7d561
commit 65d41276e8
2 changed files with 7 additions and 6 deletions

View File

@ -461,6 +461,9 @@ bool EntryModel::moveRows(const QModelIndex &sourceParent, int sourceRow, int co
// determine the source parent entry and dest parent entry as node entries
auto *const srcParentEntry = static_cast<NodeEntry *>(sourceParent.internalPointer());
auto *const destParentEntry = static_cast<NodeEntry *>(destinationParent.internalPointer());
#if DEBUG_BUILD
cout << "destinationChild: " << destinationChild << endl;
#endif
// source rows must be within the valid range
if (static_cast<size_t>(sourceRow + count) > srcParentEntry->children().size()
// if source and destination parent are the same the destination child mustn't be in the source range

View File

@ -13,6 +13,9 @@
#ifndef QT_NO_CLIPBOARD
#include <QClipboard>
#endif
#if DEBUG_BUILD
#include <QDebug>
#endif
#include <QDir>
#include <QFileInfo>
#include <QGuiApplication>
@ -20,8 +23,6 @@
#include <QSettings>
#include <QStringBuilder>
#include <QDebug>
#include <stdexcept>
using namespace std;
@ -178,7 +179,7 @@ void Controller::save()
m_file.close();
// open new file descriptor to replace existing file and allow writing
qDebug() << "opening new fd for saving, native url: " << m_nativeUrl;
IF_DEBUG_BUILD(qDebug() << "Opening new fd for saving, native url: " << m_nativeUrl;)
const auto newFileDescriptor = openFileDescriptorFromAndroidContentUrl(m_nativeUrl, QStringLiteral("wt"));
if (newFileDescriptor < 0) {
emit fileError(tr("Unable to open file descriptor for saving the file."));
@ -186,13 +187,10 @@ void Controller::save()
}
m_file.fileStream().openFromFileDescriptor(newFileDescriptor, ios_base::out | ios_base::trunc | ios_base::binary);
qDebug() << "file re-opened for saving";
m_file.write(useEncryption);
} else {
#endif
// let libpasswordfile handle everything
qDebug() << "let libpasswordfile handle saving";
m_file.save(useEncryption);
#if defined(Q_OS_ANDROID) && defined(CPP_UTILITIES_USE_NATIVE_FILE_BUFFER)
}