Skip to content

Commit

Permalink
Merge pull request #143 in ITERATE/cyberduck from feature/fixCrossThr…
Browse files Browse the repository at this point in the history
…eadOperation to master

* commit '96af08253bc1c9dcbc43a9d086d7b2f7d79390d2 [formerly 7b9f8ecda74fe3a130d8ba436284e7d61f9d27fd]':
  Fix cross thread operation exception.
  Fix compile.


Former-commit-id: 2571e9879e140e64f390bbc13756a65d806ccabd
  • Loading branch information
automerge committed Jan 20, 2016
2 parents 6aa00ee + 96af082 commit 9c57a35
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
@@ -1,20 +1,20 @@
//
// Copyright (c) 2010-2014 Yves Langisch. All rights reserved.
// http://cyberduck.ch/
//
//
// Copyright (c) 2010-2016 Yves Langisch. All rights reserved.
// http://cyberduck.io/
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// Bug fixes, suggestions and comments should be sent to:
// yves@cyberduck.ch
//
// feedback@cyberduck.io
//

using System.Collections.Generic;
using System.Media;
Expand All @@ -27,7 +27,6 @@
using ch.cyberduck.core.sftp;
using ch.cyberduck.core.threading;
using Ch.Cyberduck.Core;
using Ch.Cyberduck.Ui.Core.Preferences;
using Ch.Cyberduck.Ui.Winforms.Controls;
using java.lang;
using org.apache.log4j;
Expand All @@ -47,8 +46,7 @@ public sealed class ConnectionController : WindowController<IConnectionView>
private readonly Object _syncRootReachability = new Object();
private readonly Timer _ticklerReachability;

private HostPasswordStore keychain
= PasswordStoreFactory.get();
private readonly HostPasswordStore keychain = PasswordStoreFactory.get();

private ConnectionController(IConnectionView view)
{
Expand Down Expand Up @@ -272,8 +270,10 @@ public void ReadPasswordFromKeychain()
return;
}
Protocol protocol = View.SelectedProtocol;
string password = keychain.getPassword(protocol.getScheme(), Integer.parseInt(View.Port), View.Hostname, View.Username);
if (Utils.IsBlank(password)) {
string password = keychain.getPassword(protocol.getScheme(), Integer.parseInt(View.Port), View.Hostname,
View.Username);
if (Utils.IsBlank(password))
{
View.Password = password;
}
}
Expand Down Expand Up @@ -383,7 +383,8 @@ private void UpdateIdentity()
if (Utils.IsNotBlank(View.Hostname))
{
Credentials credentials =
CredentialsConfiguratorFactory.get(View.SelectedProtocol).configure(new Host(new SFTPProtocol(), View.Hostname));
CredentialsConfiguratorFactory.get(View.SelectedProtocol)
.configure(new Host(new SFTPProtocol(), View.Hostname));
if (credentials.isPublicKeyAuthentication())
{
// No previously manually selected key
Expand Down Expand Up @@ -437,15 +438,15 @@ private void View_ToggleOptions()
}

private void OnReachability(object state)
{
background(new ReachabilityAction(this, View.SelectedProtocol, View.Hostname));
{
Invoke(delegate { background(new ReachabilityAction(this, View.SelectedProtocol, View.Hostname)); });
}

private class ReachabilityAction : AbstractBackgroundAction
{
private readonly ConnectionController _controller;
private readonly Protocol _protocol;
private readonly string _hostname;
private readonly Protocol _protocol;
private bool _reachable;

public ReachabilityAction(ConnectionController controller, Protocol protocol, String hostname)
Expand Down
Expand Up @@ -16,6 +16,7 @@
// yves@cyberduck.ch
//

using System;
using System.Drawing;
using System.Windows.Forms;
using ch.cyberduck.core;
Expand Down

0 comments on commit 9c57a35

Please sign in to comment.