Skip to content

Commit

Permalink
Refactor/252 ic account info (#266)
Browse files Browse the repository at this point in the history
* Literally just merged ICAuthenticationInfo with ICServerInfo. Had to change constructors of course

* Reworked the endpoint login and connection system to work with the new AccountInfo Class. This caused a lot of change in the test code

* Fixed renaming issue

* Removed unused method

* Removed unused method

* Renamed ICAccountInfo contructor (legacy artifact)

* Review Requests on #254

* Recategorization and little code beautification

* name-attribut artifact replacement

* Made everything use anAccountINfo instead of Dictionary
Made everything use 'accountName' instead of 'name'

* Fixed "Account edit"

* Fixed Test Defaults

* 255 folder name attribute (#262)

* Made ICFolder use 'folderName' instead of 'name'

* Changed ToolBuilder textfield from 'name' to 'accountName'

* Typo fix
  • Loading branch information
timgarrels authored Jul 19, 2019
1 parent a970f83 commit 81c0e15
Show file tree
Hide file tree
Showing 24 changed files with 49 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ createEmailsWith: maildirDirectory andName: directoryName and: relativeRootFolde
"for each directory create Folder"
(serverDirectory directoryNames) do: [:foldername |
folder := (ICFolder new)
name: foldername;
folderName: foldername;
endpoint: self;
yourself.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ currentUIDsFor: anICFolder
removeFirst;
yourself)]
ifTrue: [
Transcript show: (anICFolder name), ' is an empty folder!'.
Transcript show: (anICFolder folderName), ' is an empty folder!'.
^ OrderedCollection new]
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"errorInvalidAuthenticationConfiguration" : "js 5/15/2016 16:16",
"errorInvalidConnectionConfiguration" : "js 5/15/2016 16:15",
"errorLoginFailed" : "js 5/15/2016 14:57",
"errorNoConnection" : "js 5/15/2016 13:50",
"errorNoConnection" : "tg 7/19/2019 09:39",
"errorNoPasswordSet" : "js 5/15/2016 13:51",
"errorNoUsernameSet" : "js 5/15/2016 13:51",
"expungeEmail" : "C.G. 7/25/2018 14:10",
Expand Down Expand Up @@ -56,11 +56,11 @@
"connect" : "tg 7/15/2019 13:27",
"connectAndLoginWith:" : "tg 7/15/2019 12:28",
"connectWith:" : "tg 7/18/2019 23:00",
"createEmailsWith:andName:and:" : "C.G. 6/26/2018 10:51",
"createEmailsWith:andName:and:" : "tg 7/19/2019 09:18",
"currentFolderName" : "C.G. 7/25/2018 13:50",
"currentFolderName:" : "C.G. 7/25/2018 13:50",
"currentUIDs" : "pm 6/3/2019 18:35",
"currentUIDsFor:" : "pm 6/3/2019 18:35",
"currentUIDsFor:" : "tg 7/19/2019 09:30",
"deleteEmail:" : "tg 7/15/2019 12:42",
"expungeEmail" : "mw 6/22/2018 23:00",
"fatalErrorOccured" : "pm 6/9/2019 13:10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ named: name in: parent
| newFolder |

newFolder := self new.
newFolder name: name.
newFolder folderName: name.

parent addFolder: newFolder.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ named: name in: parent with: endpoint
| newFolder |

newFolder := (self new)
name: name;
folderName: name;
endpoint: endpoint.

parent addFolder: newFolder.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
folder hierarchy
childFolderNamed: name ifAbsent: block
childFolderNamed: childFolderName ifAbsent: block

^ self childFolders
detect: [:child | child name = name]
detect: [:child | child folderName = childFolderName]
ifNone: [block value]
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
folder hierarchy
childFolderNamed: name with: delimiter ifAbsent: block
childFolderNamed: childFolderName with: delimiter ifAbsent: block

^ self childFolders
detect: [:child | child name = name]
detect: [:child | child folderName = childFolderName]
ifNone: [
| rootPart childPart child parts |
"splice at delimiter and ask child"
parts := name subStrings: delimiter.
parts := childFolderName subStrings: delimiter.
(parts size > 1)
ifTrue: [
rootPart := parts first.
childPart := parts allButFirst joinSeparatedBy: delimiter.
child := self childFolders detect: [ :childFolder | childFolder name = rootPart].
child := self childFolders detect: [ :childFolder | childFolder folderName = rootPart].
child ifNotNil: [^ child childFolderNamed: childPart with: delimiter ifAbsent: block]].
^ block value]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
folderName: aString

folderName := aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
folderName

^ folderName ifNil: [folderName := self class defaultName]

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ folder hierarchy
path

^ (self parent == self endpoint rootFolder)
ifTrue: [ self name ]
ifFalse: [ self parent path, self endpoint hierarchyDelimiter, self name]
ifTrue: [ self folderName ]
ifFalse: [ self parent path, self endpoint hierarchyDelimiter, self folderName]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
updateEmails
startUpdateProcess: anUID

(self name = 'root') ifTrue: [^self].
(self folderName = 'root') ifTrue: [^self].

[anUID
ifNil: [self latestEmails: self class numberOfHeadersToFetchAtTheBeginning]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ update: aBlock

ProgressNotification
signal: (aBlock value)
extra: (self endpoint accountInfo accountName, ' Mailbox. Folder: ', self name).
extra: (self endpoint accountInfo accountName, ' Mailbox. Folder: ', self folderName).

self startUpdateProcess: self highestUniqueID.
self childFolders do: [:anICFolder | anICFolder update: aBlock]
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"class" : {
"defaultName" : "js 6/7/2016 11:49",
"errorChildDoesNotExist" : "js 6/14/2016 09:27",
"named:in:" : "C.G. 7/25/2018 14:12",
"named:in:with:" : "C.G. 7/4/2018 13:07",
"named:in:" : "tg 7/19/2019 09:27",
"named:in:with:" : "tg 7/19/2019 09:19",
"newRootFolderWith:" : "C.G. 7/25/2018 14:12",
"numberOfHeadersToFetchAtLoadOlderMails" : "DH 7/22/2018 22:37",
"numberOfHeadersToFetchAtTheBeginning" : "DH 7/22/2018 22:37" },
"instance" : {
"addFolder:" : "js 6/7/2016 13:09",
"checkTopicality" : "pm 6/3/2019 18:34",
"childFolderNamed:" : "C.G. 7/25/2018 14:02",
"childFolderNamed:ifAbsent:" : "C.G. 6/26/2018 10:58",
"childFolderNamed:ifAbsent:" : "tg 7/19/2019 09:19",
"childFolderNamed:with:" : "C.G. 6/26/2018 11:01",
"childFolderNamed:with:ifAbsent:" : "DH 7/9/2018 00:23",
"childFolderNamed:with:ifAbsent:" : "tg 7/19/2019 12:58",
"childFolders" : "pm 6/9/2019 13:12",
"childFolders:" : "js 6/7/2016 11:32",
"countFolders" : "C.G. 7/25/2018 14:02",
Expand All @@ -22,19 +22,19 @@
"endpoint" : "ms 7/10/2016 13:24",
"endpoint:" : "pm 6/9/2019 16:56",
"fetchHeadersFrom:" : "pm 6/3/2019 18:33",
"folderName" : "tg 7/19/2019 09:17",
"folderName:" : "tg 7/19/2019 09:17",
"highestUniqueID" : "pm 6/3/2019 18:34",
"latestEmails:" : "pm 6/3/2019 18:34",
"loadOlderMails" : "pm 6/3/2019 18:34",
"lowestUniqueID" : "pm 6/3/2019 18:34",
"name" : "pm 6/9/2019 13:13",
"name:" : "js 6/7/2016 11:48",
"numOfUnseenMails" : "C.G. 7/25/2018 14:03",
"parent" : "tg 6/25/2019 21:21",
"parent:" : "js 6/7/2016 11:32",
"path" : "C.G. 7/25/2018 14:03",
"path" : "tg 7/19/2019 09:20",
"removeFolder:" : "C.G. 7/25/2018 14:03",
"removeFolder:ifAbsent:" : "C.G. 7/25/2018 14:04",
"retrieveFlagsFrom:to:" : "C.G. 7/25/2018 14:04",
"startUpdateProcess:" : "pm 6/3/2019 18:34",
"startUpdateProcess:" : "tg 7/19/2019 09:19",
"update" : "pm 6/3/2019 18:34",
"update:" : "tg 7/10/2019 17:37" } }
"update:" : "tg 7/19/2019 09:19" } }
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"instvars" : [
"parent",
"childFolders",
"name",
"folderName",
"emails",
"endpoint" ],
"name" : "ICFolder",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ testRetrieveBody

folder := ICFolder new.
folder endpoint: endpoint;
name: 'dummy';
folderName: 'dummy';
parent: nil.

self email folder: folder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"testDateInSecondsSince1980" : "tg 7/19/2019 09:26",
"testDateInSecondsSinceSqueakEpoch" : "tg 7/19/2019 09:27",
"testMinimalHeaderAsString" : "C.G. 7/25/2018 17:53",
"testRetrieveBody" : "DH 7/9/2018 15:39" } }
"testRetrieveBody" : "tg 7/19/2019 09:31" } }
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ emailListMenu: aMenu
ifTrue: ['Unflag']
ifFalse: ['Mark as flagged'])
action: [self modifyFlag: #flagged];
add: (self labelForDeletionAction: self selectedEmail folder name)
add: (self labelForDeletionAction: self selectedEmail folder folderName)
action: #deleteEmail;
add: 'Move to ...' subMenu: self folderListMenu.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ folderNameOf: folder

1 to: levelCounter do: [ :i | offset := offset , ' '].

^ offset, folder name
^ offset, folder folderName
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ labelForFolder: anICFolder

countOfUnseenMails := anICFolder numOfUnseenMails.
countOfUnseenMails > 0
ifTrue: [^ anICFolder name, Character tab, '[', countOfUnseenMails asString, ']']
ifFalse: [^ anICFolder name, Character tab, '']
ifTrue: [^ anICFolder folderName, Character tab, '[', countOfUnseenMails asString, ']']
ifFalse: [^ anICFolder folderName, Character tab, '']
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"instance" : {
"accountsComplete" : "pm 6/3/2019 18:47",
"addAccount:" : "tg 7/18/2019 23:04",
"addPasswordToCollection:" : "tg 7/18/2019 23:09",
"addPasswordToCollection:" : "tg 7/19/2019 09:24",
"buildAddAccountButton:" : "fr 7/7/2019 10:15",
"buildEmailButton:" : "ok 6/20/2019 12:18",
"buildEmailList:" : "pm 6/26/2019 14:31",
Expand All @@ -33,7 +33,7 @@
"emailAccounts:" : "C.G. 7/25/2018 14:16",
"emailListKeyPress:" : "pm 5/27/2019 14:00",
"emailListKeyPressMapping" : "pm 5/27/2019 14:00",
"emailListMenu:" : "pm 6/26/2019 14:34",
"emailListMenu:" : "tg 7/19/2019 09:30",
"emailSearchHelp" : "lvm 7/3/2018 16:09",
"emailsOfSelectedFolder" : "pm 6/26/2019 14:32",
"emphasizeUnseenAccounts:" : "lvm 7/4/2018 11:18",
Expand All @@ -42,15 +42,15 @@
"filterString" : "lvm 6/26/2018 14:05",
"filterString:" : "fr 6/3/2019 15:50",
"folderListMenu" : "C.G. 7/12/2018 08:14",
"folderNameOf:" : "C.G. 7/25/2018 14:18",
"folderNameOf:" : "tg 7/19/2019 09:30",
"folderWith:" : "pm 6/3/2019 18:47",
"initialize" : "tg 7/8/2019 14:56",
"initializedAccounts" : "C.G. 7/25/2018 14:18",
"initializedAccounts:" : "pm 6/9/2019 17:02",
"labelForAccount:" : "tg 7/10/2019 18:39",
"labelForDeletionAction:" : "C.G. 7/25/2018 14:19",
"labelForFolder:" : "C.G. 7/25/2018 14:19",
"labelForMail:" : "tg 7/19/2019 11:57",
"labelForFolder:" : "tg 7/19/2019 09:19",
"labelForMail:" : "pm 6/26/2019 14:34",
"loadOlderEmails" : "C.G. 7/25/2018 14:19",
"loadOlderEmailsProcess" : "DH 7/22/2018 22:02",
"modifyFlag:" : "DH 7/19/2018 19:52",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
symbolArray

^ symbolArray ifNil: [symbolArray := {#name. #serverAddress. #serverPort. #username. #password} as: OrderedCollection]
^ symbolArray ifNil: [symbolArray := {#accountName. #serverAddress. #serverPort. #username. #password} as: OrderedCollection]
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"ssl" : "ok 7/9/2019 18:58",
"ssl:" : "ms 7/13/2016 17:25",
"sslCheckBoxLabel" : "ms 7/12/2016 11:00",
"symbolArray" : "pm 6/9/2019 13:21",
"symbolArray" : "tg 7/19/2019 09:48",
"symbolArray:" : "C.G. 7/25/2018 14:24",
"toggleSSL" : "ms 7/13/2016 17:37",
"updateMode" : "pm 6/9/2019 13:21",
Expand Down

0 comments on commit 81c0e15

Please sign in to comment.