Closed kurahaupo closed 2 years ago
Resolves issue #295
As mentioned in #295 I amended the original patch to reverse several inadvertent changes, in line with that discussion.
Ok, @kurahaupo @MCMrARM , I am finally addressing this thread, valuable comments, will be addressed soon in #297 since I "moved" from diff to git. This message could be responded to in #297 or here.
Here are some points, referring to my commit from today, v4, not the one referred to in this thread!:
README.md
and app/build.gradle
can be done but I prefer to keep those as I pasted them. A merge-clean branch with these reverted will be made if requested. But I usually bump versionCode and Name liberally to keep changes visible. Please never ever decrement version numbers for any reason. Reverting "my" version number used for debugging is perfectly fine on merge, of course.//
globs with ??
or with no brackets (default), seems to work well. The hint strings in the Ignore Entry screen have been edited so they show Any /regexp/ or ?glob?, i.e. no surprise to the user.pattCompile()
is written is the C way, as I intend to use the code elsewhere too. The goal is to set up the call to the real pattern compile function only once, since that is the expensive call usually. The int j
is used to offset / cut the head and tail of the string, thus values 0 or 1 and it is not a boolean for the same reason. Could have named it i
for index, j
is also used as an index integer frequently. Initially I used i
for isRe
but then renamed it and it became a boolean. This is how it stayed j
and definitely int. The way @MCMrARM coded it in #296 is a more Java esque idiom and terser, I think his version is better, for Java. Similarly, the compile()
function name is imo not reflecting the true nature of the function. But it could be reverted, or ... see 9. below.isBad
is not transient and is saved in the .zip
exported settings and in persistent settings. Note there's a transient badCount
too, which is used to pass the count of bad entries from the compile / check function back up to the caller which can raise the toast. badCount
counts the number of set isBad
flags / entries. isBad
is used to mark the Ignore List entries @bad:
in the ListAdapter among other things, which could (should?) be available for edit before connecting to a server, but isn't currently so, hope it will be some day. This means that the list adapter is able to display the updated marked bad re containing entries without calling the check/compile function itself. Note that the syntax check is triggered from 2 places now: 1) from connect()
and 2) from exit from an Ignore Entry edit. The latter only checks the current screen's re's, not all, the former checks all. Without a persistent isBad
, it would have been necessary for the list adapter to call the compile / check function.isBad
and badCount
are both Integer
but could be int
and might become int
's.app/src/main/java/io/mrarm/irc/ServerConnectionInfo.java
@~L153.app/src/main/java/io/mrarm/irc/EditIgnoreEntryActivity.java
@~L95: Indeed that toast could use Android strings and with that also the pluralization mechanism (6. above).At this point, it would be nice if someone else would also build and test the code as is, to find further bugs if any. After that, I am willing to incorporate the necessary beautification of the code before I'll move on to other projects, hoping for a merge soon. Tia.
Please review the code in #297 commit when commenting, #296 is "obsolete" but we can still talk here, or move the discussion to #297.
Direct link to commit: 612dda3
Apply the patch file supplied by pickeduname.