ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #00078
[Merge] lp:~mzanetti/reminders-app/fix-nameless-files into lp:reminders-app
Michael Zanetti has proposed merging lp:~mzanetti/reminders-app/fix-nameless-files into lp:reminders-app with lp:~mzanetti/reminders-app/jobqueue-tweaks as a prerequisite.
Commit message:
Set a filename if we don't get one from the api.
In some cases evernote doesn't give us a filename. Let's set "Unnamed" ourselves and guess the filename extension from the mimetype
Requested reviews:
Ubuntu Reminders app developers (reminders-app-dev)
For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/fix-nameless-files/+merge/251194
--
Your team Ubuntu Reminders app developers is requested to review the proposed merge of lp:~mzanetti/reminders-app/fix-nameless-files into lp:reminders-app.
=== modified file 'src/libqtevernote/resource.cpp'
--- src/libqtevernote/resource.cpp 2015-02-24 22:21:04 +0000
+++ src/libqtevernote/resource.cpp 2015-02-27 00:47:37 +0000
@@ -34,7 +34,10 @@
m_fileName(fileName),
m_type(type)
{
-
+ if (m_fileName.isEmpty()) {
+ // TRANSLATORS: A default file name if we don't get one from the server. Avoid weird characters.
+ m_fileName = tr("Unnamed") + "." + m_type.split("/").last();
+ }
m_filePath = NotesStore::instance()->storageLocation() + hash + "." + m_fileName.split('.').last();
QFile file(m_filePath);
Follow ups