In src/org/kde/kdeconnect/Helpers/SMSHelper.java:
getMessagesWithFilter() and getConversations() functions are now both using new function: getMessages().
Details
- Build android app and run it on android phone
- Pair it with the desktop and open sms app (kdeconnect-sms).
- Everything works as earlier, but now with refactored code.
Diff Detail
- Repository
- R225 KDE Connect - Android application
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 5141 Build 5159: arc lint + arc unit
This is good work! Thank you. Were you able to get the app with this patch working for your own phone? If not, could you share the full stack trace (paste.kde.org) so I can have a look?
Don't forget to mark the GCi task as completed so I can approve it once we get this merged.
src/org/kde/kdeconnect/Helpers/SMSHelper.java | ||
---|---|---|
122–123 ↗ | (On Diff #45776) | I missed this before (sorry). These comments still refer to one of the earlier revisions |
141–142 ↗ | (On Diff #45776) | This variable is unused because we pull threadID from the Message later, so might as well get rid of it |
152–158 ↗ | (On Diff #45776) | A common way to do this same check is: if (!toReturn.containsKey(threadID)) { toReturn.put(threadID, new ArrayList<Message>()); } toReturn.get(threadID).add(message); The code you currently have is fine, and if you like it this way then you should leave it this way. I only mention this because you are working on GCi, so I should share my wisdom :) |
157–158 ↗ | (On Diff #45776) | Even though you can have an else with no braces, I strongly recommend against it. The problem is that a future programmer might come along and try to add to this block (maybe he is more experienced with Python than C++) and the code will not get executed where he expects it to. Moreover, there is a possibility that could get get inserted by mistake, for instance by a git merge |
- Refactor Duplicated Code in KDE Connect Android-side SMS Helper v2
Small fixes, suggested by sredman, were made.