Always show debug output when opening native fd
This commit is contained in:
parent
3b833e474b
commit
5b9e63785a
|
@ -13,7 +13,7 @@
|
||||||
#ifndef QT_NO_CLIPBOARD
|
#ifndef QT_NO_CLIPBOARD
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#endif
|
#endif
|
||||||
#ifdef DEBUG_BUILD
|
#if defined(DEBUG_BUILD) || (defined(Q_OS_ANDROID) && defined(CPP_UTILITIES_USE_NATIVE_FILE_BUFFER))
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#endif
|
#endif
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@ -214,7 +214,7 @@ void Controller::save()
|
||||||
m_file.close();
|
m_file.close();
|
||||||
|
|
||||||
// open new file descriptor to replace existing file and allow writing
|
// open new file descriptor to replace existing file and allow writing
|
||||||
IF_DEBUG_BUILD(qDebug() << "Opening new fd for saving, native url: " << m_nativeUrl;)
|
qDebug() << "Opening new fd for saving, native url: " << m_nativeUrl;
|
||||||
const auto newFileDescriptor = openFileDescriptorFromAndroidContentUrl(m_nativeUrl, QStringLiteral("wt"));
|
const auto newFileDescriptor = openFileDescriptorFromAndroidContentUrl(m_nativeUrl, QStringLiteral("wt"));
|
||||||
if (newFileDescriptor < 0) {
|
if (newFileDescriptor < 0) {
|
||||||
emit fileError(tr("Unable to open file descriptor for saving the file."));
|
emit fileError(tr("Unable to open file descriptor for saving the file."));
|
||||||
|
@ -271,6 +271,7 @@ void Controller::handleFileSelectionAccepted(const QString &filePath, bool exist
|
||||||
void Controller::handleFileSelectionAcceptedDescriptor(const QString &nativeUrl, const QString &fileName, int fileDescriptor, bool existing)
|
void Controller::handleFileSelectionAcceptedDescriptor(const QString &nativeUrl, const QString &fileName, int fileDescriptor, bool existing)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
qDebug() << "Opening fd for native url: " << nativeUrl;
|
||||||
m_file.setPath(fileName.toStdString());
|
m_file.setPath(fileName.toStdString());
|
||||||
m_file.fileStream().openFromFileDescriptor(fileDescriptor, ios_base::in | ios_base::binary);
|
m_file.fileStream().openFromFileDescriptor(fileDescriptor, ios_base::in | ios_base::binary);
|
||||||
m_file.opened();
|
m_file.opened();
|
||||||
|
|
Loading…
Reference in New Issue