diff options
author | Christian Persch <chpe@src.gnome.org> | 2008-05-24 05:03:22 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2008-05-24 05:03:22 +0800 |
commit | 46f888e70dcfd13bcee783f65b4aa66e700a0359 (patch) | |
tree | 4e179499e82dad719ad81606fa8ca45d70fd85d7 | |
parent | bcbdd353b9d91163b334ebe1961cdb3217a40837 (diff) | |
download | gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.tar gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.tar.gz gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.tar.bz2 gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.tar.lz gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.tar.xz gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.tar.zst gsoc2013-epiphany-46f888e70dcfd13bcee783f65b4aa66e700a0359.zip |
Try to to fix the build on 1.8. Bug #534056.
svn path=/branches/gnome-2-22/; revision=8244
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 36ea3ca29..9558179ca 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -1073,7 +1073,7 @@ static void impl_remove_password (EphyPasswordManager *manager, EphyPasswordInfo *info) { - nsresult rv; +#ifdef HAVE_GECKO_1_9 nsString host; nsString userName; nsString userNameField; @@ -1082,77 +1082,55 @@ impl_remove_password (EphyPasswordManager *manager, nsString httpRealm; nsString formSubmitURL; - nsCOMPtr<nsIIDNService> idnService - (do_GetService ("@mozilla.org/network/idn-service;1")); - NS_ENSURE_TRUE (idnService, ); - if (info->username) NS_CStringToUTF16 (nsCString(info->host), NS_CSTRING_ENCODING_UTF8, userName); -#ifdef HAVE_GECKO_1_9 else host.SetIsVoid (PR_TRUE); -#endif if (info->username) NS_CStringToUTF16 (nsCString(info->username), NS_CSTRING_ENCODING_UTF8, userName); -#ifdef HAVE_GECKO_1_9 else userName.SetIsVoid (PR_TRUE); -#endif if (info->usernameField) NS_CStringToUTF16 (nsCString(info->usernameField), NS_CSTRING_ENCODING_UTF8, userNameField); -#ifdef HAVE_GECKO_1_9 else userNameField.SetIsVoid (PR_TRUE); -#endif if (info->host) NS_CStringToUTF16 (nsCString(info->host), NS_CSTRING_ENCODING_UTF8, host); -#ifdef HAVE_GECKO_1_9 else host.SetIsVoid (PR_TRUE); -#endif if (info->httpRealm) NS_CStringToUTF16 (nsCString(info->httpRealm), NS_CSTRING_ENCODING_UTF8, httpRealm); -#ifdef HAVE_GECKO_1_9 else userName.SetIsVoid (PR_TRUE); -#endif if (info->password) NS_CStringToUTF16 (nsCString(info->password), NS_CSTRING_ENCODING_UTF8, password); -#ifdef HAVE_GECKO_1_9 else password.SetIsVoid (PR_TRUE); -#endif if (info->passwordField) NS_CStringToUTF16 (nsCString(info->passwordField), NS_CSTRING_ENCODING_UTF8, passwordField); -#ifdef HAVE_GECKO_1_9 else passwordField.SetIsVoid (PR_TRUE); -#endif if (info->formSubmitURL) NS_CStringToUTF16 (nsCString(info->formSubmitURL), NS_CSTRING_ENCODING_UTF8, formSubmitURL); -#ifdef HAVE_GECKO_1_9 else formSubmitURL.SetIsVoid (PR_TRUE); -#endif - -#ifdef HAVE_GECKO_1_9 - nsCOMPtr<nsILoginManager> loginManager = + nsCOMPtr<nsILoginManager> loginManager = do_GetService (NS_LOGINMANAGER_CONTRACTID); NS_ENSURE_TRUE (loginManager, ); @@ -1167,13 +1145,18 @@ impl_remove_password (EphyPasswordManager *manager, login->SetPassword(password); login->SetPasswordField(passwordField); - rv = loginManager->RemoveLogin(login); + loginManager->RemoveLogin(login); #else /* !HAVE_GECKO_1_9 */ + if (!info->host) + return; + nsCOMPtr<nsIPasswordManager> pm = do_GetService (NS_PASSWORDMANAGER_CONTRACTID); if (!pm) return; + nsCString host (info->host); + nsCString userName (info->username ? info->username : ""); pm->RemoveUser (host, userName); #endif /* HAVE_GECKO_1_9 */ } |