ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #00174
[Merge] lp:~mzanetti/reminders-app/unify-errors into lp:reminders-app
Michael Zanetti has proposed merging lp:~mzanetti/reminders-app/unify-errors into lp:reminders-app.
Commit message:
unify error handling, drop old entered error label from tags page too
Requested reviews:
Ubuntu Reminders app developers (reminders-app-dev)
For more details, see:
https://code.launchpad.net/~mzanetti/reminders-app/unify-errors/+merge/251351
--
Your team Ubuntu Reminders app developers is requested to review the proposed merge of lp:~mzanetti/reminders-app/unify-errors into lp:reminders-app.
=== modified file 'src/app/qml/reminders.qml'
--- src/app/qml/reminders.qml 2015-02-24 18:33:04 +0000
+++ src/app/qml/reminders.qml 2015-02-28 04:01:08 +0000
@@ -415,7 +415,7 @@
anchors { left: parent.left; right: parent.right; top: parent.top; topMargin: units.gu(9) }
color: root.backgroundColor
shown: text
- text: EvernoteConnection.error || NotesStore.error || NotesStore.notebooksError
+ text: EvernoteConnection.error || NotesStore.error || NotesStore.notebooksError || NotesStore.tagsError
iconName: "sync-error"
}
=== modified file 'src/app/qml/ui/RemindersPage.qml'
--- src/app/qml/ui/RemindersPage.qml 2015-02-13 00:10:26 +0000
+++ src/app/qml/ui/RemindersPage.qml 2015-02-28 04:01:08 +0000
@@ -100,12 +100,11 @@
}
Label {
anchors.centerIn: parent
- visible: !notes.loading && (notes.error || remindersListView.count == 0)
+ visible: !notes.loading && remindersListView.count == 0
width: parent.width - units.gu(4)
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
- text: notes.error ? notes.error :
- i18n.tr("No reminders available. You can create new reminders by setting a reminder when viewing a note.")
+ text: i18n.tr("No reminders available. You can create new reminders by setting a reminder when viewing a note.")
}
Scrollbar {
=== modified file 'src/app/qml/ui/TagsPage.qml'
--- src/app/qml/ui/TagsPage.qml 2014-12-14 22:31:00 +0000
+++ src/app/qml/ui/TagsPage.qml 2015-02-28 04:01:08 +0000
@@ -136,10 +136,10 @@
Label {
anchors.centerIn: parent
- visible: !tags.loading && (tags.error || tagsListView.count == 0)
+ visible: !tags.loading && tagsListView.count == 0
width: parent.width - units.gu(4)
wrapMode: Text.WordWrap
horizontalAlignment: Text.AlignHCenter
- text: tags.error ? tags.error : i18n.tr("No tags available. You can tag notes while viewing them.")
+ text: i18n.tr("No tags available. You can tag notes while viewing them.")
}
}
=== modified file 'src/libqtevernote/notesstore.cpp'
--- src/libqtevernote/notesstore.cpp 2015-02-27 11:46:17 +0000
+++ src/libqtevernote/notesstore.cpp 2015-02-28 04:01:08 +0000
@@ -885,23 +885,15 @@
qWarning() << "FetchNotebooksJobDone: EDAMUserException:" << errorMessage;
// silently discarding...
return;
+ case EvernoteConnection::ErrorCodeConnectionLost:
+ qWarning() << "FetchNotebooksJobDone: Connection lost:" << errorMessage;
+ return; // silently discarding
default:
qWarning() << "FetchNotebooksJobDone: Failed to fetch notes list:" << errorMessage << errorCode;
- m_error = tr("Error refreshing notebooks: %1").arg(errorMessage);
- emit errorChanged();
- return;
- }
-
- if (errorCode != EvernoteConnection::ErrorCodeNoError) {
- qWarning() << "Error fetching notebooks:" << errorMessage;
m_notebooksError = tr("Error refreshing notebooks: %1").arg(errorMessage);
emit notebooksErrorChanged();
return;
}
- if (!m_notebooksError.isEmpty()) {
- m_notebooksError.clear();
- emit notebooksErrorChanged();
- }
QList<Notebook*> unhandledNotebooks = m_notebooks;
@@ -980,16 +972,27 @@
m_tagsLoading = false;
emit tagsLoadingChanged();
- if (errorCode != EvernoteConnection::ErrorCodeNoError) {
- qWarning() << "Error fetching tags:" << errorMessage;
+ switch (errorCode) {
+ case EvernoteConnection::ErrorCodeNoError:
+ // All is well, reset error code.
+ if (!m_tagsError.isEmpty()) {
+ m_tagsError.clear();
+ emit tagsErrorChanged();
+ }
+ break;
+ case EvernoteConnection::ErrorCodeUserException:
+ qWarning() << "FetchTagsJobDone: EDAMUserException:" << errorMessage;
+ // silently discarding...
+ return;
+ case EvernoteConnection::ErrorCodeConnectionLost:
+ qWarning() << "FetchTagsJobDone: Connection lost:" << errorMessage;
+ return; // silently discarding
+ default:
+ qWarning() << "FetchTagsJobDone: Failed to fetch notes list:" << errorMessage << errorCode;
m_tagsError = tr("Error refreshing tags: %1").arg(errorMessage);
emit tagsErrorChanged();
return;
}
- if (!m_tagsError.isEmpty()) {
- m_tagsError.clear();
- emit tagsErrorChanged();
- }
QHash<QString, Tag*> unhandledTags = m_tagsHash;
for (unsigned int i = 0; i < results.size(); ++i) {
Follow ups