~mzanetti/reminders-app/switch-to-cmake

« back to all changes in this revision

Viewing changes to src/plugin/Evernote/note.cpp

  • Committer: Michael Zanetti
  • Date: 2013-12-19 00:00:00 UTC
  • mfrom: (38.1.3 reminders-app-use-webview)
  • Revision ID: michael.zanetti@canonical.com-20131219000000-gz82utnzes4s5gpw
merge prerequisite branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
208
208
    return m_resources.value(hash);
209
209
}
210
210
 
211
 
void Note::addResource(const QString &hash, const QImage &image, const QString &type)
 
211
QString Note::resourceName(const QString &hash)
 
212
{
 
213
    return m_resourceNames.value(hash);
 
214
}
 
215
 
 
216
void Note::addResource(const QString &hash, const QString &fileName, const QString &type, const QImage &image)
212
217
{
213
218
    image.save(QStandardPaths::standardLocations(QStandardPaths::CacheLocation).first() + "/" + hash + "." + type.split('/').last());
214
 
    m_resources.insert(hash, image);
 
219
    if (!image.isNull()) {
 
220
        m_resources.insert(hash, image);
 
221
    }
215
222
    m_resourceTypes.insert(hash, type);
 
223
    m_resourceNames.insert(hash, fileName);
216
224
}
217
225
 
218
226
void Note::markTodo(const QString &todoId, bool checked)