~mzanetti/reminders-app/edit-note-improvements

« back to all changes in this revision

Viewing changes to src/libqtevernote/resource.cpp

clean up debug prints.

Approved by Riccardo Padovani, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include "resource.h"
22
22
#include "notesstore.h"
 
23
#include "logging.h"
23
24
 
24
25
#include <QFile>
25
26
#include <QStandardPaths>
26
 
#include <QDebug>
27
27
#include <QCryptographicHash>
28
28
#include <QFileInfo>
29
29
#include <QDir>
44
44
    if (!data.isEmpty() && !file.exists()) {
45
45
 
46
46
        if (!file.open(QFile::WriteOnly)) {
47
 
            qWarning() << "error writing file" << m_filePath;
 
47
            qCWarning(dcNotesStore) << "error writing file" << m_filePath;
48
48
            return;
49
49
        }
50
50
        file.write(data);
69
69
 
70
70
    QFile file(path);
71
71
    if (!file.open(QFile::ReadOnly)) {
72
 
        qWarning() << "Cannot open file for reading...";
 
72
        qCWarning(dcNotesStore) << "Cannot open file for reading...";
73
73
        return;
74
74
    }
75
75
    QByteArray fileContent = file.readAll();
84
84
    } else if (m_fileName.endsWith(".gif")) {
85
85
        m_type = "image/gif";
86
86
    } else {
87
 
        qWarning() << "cannot determine mime type of file" << m_fileName;
 
87
        qCWarning(dcNotesStore) << "cannot determine mime type of file" << m_fileName;
88
88
    }
89
89
 
90
90
    m_filePath = NotesStore::instance()->storageLocation() + m_hash + "." + m_fileName.split('.').last();
93
93
    if (!copy.exists()) {
94
94
 
95
95
        if (!copy.open(QFile::WriteOnly)) {
96
 
            qWarning() << "error writing file" << m_filePath;
 
96
            qCWarning(dcNotesStore) << "error writing file" << m_filePath;
97
97
            return;
98
98
        }
99
99
        copy.write(fileContent);