Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
enzevalos_iphone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
enzevalos
enzevalos_iphone
Commits
21d98464
Commit
21d98464
authored
6 years ago
by
jakobsbode
Browse files
Options
Downloads
Patches
Plain Diff
clean up code
parent
feed49a3
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
enzevalos_iphone/QRDiashowScannerView.swift
+3
-35
3 additions, 35 deletions
enzevalos_iphone/QRDiashowScannerView.swift
with
3 additions
and
35 deletions
enzevalos_iphone/QRDiashowScannerView.swift
+
3
−
35
View file @
21d98464
...
@@ -240,7 +240,7 @@ class QRDiashowScannerView: ViewControllerPannable, AVCaptureMetadataOutputObjec
...
@@ -240,7 +240,7 @@ class QRDiashowScannerView: ViewControllerPannable, AVCaptureMetadataOutputObjec
var
password
:
String
?
var
password
:
String
?
var
imapServer
:
String
?
var
imapServer
:
String
?
var
imapPort
:
Int
?
var
imapPort
:
Int
?
var
imapAuth
:
Int
?
var
imapAuth
:
Int
?
//TODO: combine auth- and transportType in one int, since there are only few values each and the qr-code size is limited.
var
imapTransportType
:
Int
?
var
imapTransportType
:
Int
?
var
smtpServer
:
String
?
var
smtpServer
:
String
?
var
smtpPort
:
Int
?
var
smtpPort
:
Int
?
...
@@ -318,43 +318,11 @@ class QRDiashowScannerView: ViewControllerPannable, AVCaptureMetadataOutputObjec
...
@@ -318,43 +318,11 @@ class QRDiashowScannerView: ViewControllerPannable, AVCaptureMetadataOutputObjec
}
}
private
func
handleData
(
user
:
String
?,
name
:
String
?,
mailaddr
:
String
?,
pw
:
String
?,
imapServer
:
String
?,
imapPort
:
Int
?,
imapAuth
:
Int
?,
imapTransport
:
Int
?,
smtpServer
:
String
?,
smtpPort
:
Int
?,
smtpAuth
:
Int
?,
smtpTransport
:
Int
?,
keys
:
[
String
]){
private
func
handleData
(
user
:
String
?,
name
:
String
?,
mailaddr
:
String
?,
pw
:
String
?,
imapServer
:
String
?,
imapPort
:
Int
?,
imapAuth
:
Int
?,
imapTransport
:
Int
?,
smtpServer
:
String
?,
smtpPort
:
Int
?,
smtpAuth
:
Int
?,
smtpTransport
:
Int
?,
keys
:
[
String
]){
if
let
server
=
imapServer
{
// UserManager.storeServerConfig(type: .IMAP, server: server, port: UInt32(imapPort), authType: imapAuth, connectionType: imapTransport)
}
if
let
server
=
smtpServer
{
// UserManager.storeServerConfig(type: .SMTP, server: server, port: UInt32(smtpPort), authType: smtpAuth, connectionType: smtpTransport)
}
if
let
adr
=
mailaddr
{
let
handler
=
OnboardingDataHandler
.
handler
UserManager
.
storeUserValue
(
adr
as
AnyObject
,
attribute
:
.
userAddr
)
}
if
let
pw
=
pw
{
UserManager
.
storeUserValue
(
pw
as
AnyObject
,
attribute
:
.
userPW
)
}
if
let
name
=
name
{
UserManager
.
storeUserValue
(
name
as
AnyObject
,
attribute
:
Attribute
.
userName
)
}
else
if
let
adr
=
mailaddr
{
UserManager
.
storeUserValue
(
adr
as
AnyObject
as
AnyObject
,
attribute
:
Attribute
.
userName
)
}
else
if
let
user
=
user
{
UserManager
.
storeUserValue
(
user
as
AnyObject
,
attribute
:
Attribute
.
userName
)
}
handler
.
setSettings
(
with
:
mailaddr
??
""
,
password
:
pw
??
""
,
username
:
name
??
mailaddr
??
user
??
""
,
imapServer
:
imapServer
??
""
,
imapPort
:
imapPort
??
0
,
imapConnectionType
:
imapTransport
??
0
,
imapAuthenticationType
:
imapAuth
??
0
,
smtpServer
:
smtpServer
??
""
,
smtpPort
:
smtpPort
??
0
,
smtpConnectionType
:
smtpTransport
??
0
,
smtpAuthenticationType
:
smtpAuth
??
0
)
if
let
user
=
user
{
UserManager
.
storeUserValue
(
user
as
AnyObject
,
attribute
:
Attribute
.
accountname
)
}
else
if
let
adr
=
mailaddr
{
UserManager
.
storeUserValue
(
adr
as
AnyObject
,
attribute
:
Attribute
.
accountname
)
}
else
if
let
name
=
name
{
UserManager
.
storeUserValue
(
name
as
AnyObject
,
attribute
:
Attribute
.
accountname
)
}
let
pgp
=
SwiftPGP
()
let
pgp
=
SwiftPGP
()
var
keyIds
=
[
String
]
()
var
keyIds
=
[
String
]
()
for
key
in
keys
{
for
key
in
keys
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment