michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsQtNetworkManager.h" michael@0: #include "nsAutodialQt.h" michael@0: #include "nsNetCID.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIPrefBranch.h" michael@0: #include "nsIPrefService.h" michael@0: #include "nsIServiceManager.h" michael@0: michael@0: michael@0: nsAutodial::nsAutodial() michael@0: { michael@0: } michael@0: michael@0: nsAutodial::~nsAutodial() michael@0: { michael@0: } michael@0: michael@0: nsresult michael@0: nsAutodial::Init() michael@0: { michael@0: return NS_OK; michael@0: } michael@0: michael@0: nsresult michael@0: nsAutodial::DialDefault(const char16_t* hostName) michael@0: { michael@0: if (nsQtNetworkManager::get()->openConnection(QString::fromUtf16((const ushort*)hostName))) { michael@0: return NS_OK; michael@0: } michael@0: michael@0: return NS_ERROR_FAILURE; michael@0: } michael@0: michael@0: bool michael@0: nsAutodial::ShouldDialOnNetworkError() michael@0: { michael@0: if (nsQtNetworkManager::get()->isOnline()) { michael@0: return false; michael@0: } michael@0: michael@0: return true; michael@0: }