diff --git a/src/ioslaves/ftp/ftp.cpp b/src/ioslaves/ftp/ftp.cpp --- a/src/ioslaves/ftp/ftp.cpp +++ b/src/ioslaves/ftp/ftp.cpp @@ -317,7 +317,7 @@ qCDebug(KIO_FTP) << _host << "port=" << _port << "user=" << _user; m_proxyURL.clear(); - m_proxyUrls = q->config()->readEntry("ProxyUrls", QStringList()); + m_proxyUrls = q->mapConfig().value(QStringLiteral("ProxyUrls"), QStringList()).toStringList(); qCDebug(KIO_FTP) << "proxy urls:" << m_proxyUrls; if (m_host != _host || m_port != _port || @@ -372,7 +372,7 @@ } } - m_bTextMode = q->config()->readEntry("textmode", false); + m_bTextMode = q->configValue(QStringLiteral("textmode"), false); q->connected(); // Redirected due to credential change... @@ -506,11 +506,11 @@ QString user(m_user); QString pass(m_pass); - if (q->config()->readEntry("EnableAutoLogin", false)) { - QString au = q->config()->readEntry("autoLoginUser"); + if (q->configValue(QStringLiteral("EnableAutoLogin"), false)) { + QString au = q->configValue(QStringLiteral("autoLoginUser")); if (!au.isEmpty()) { user = au; - pass = q->config()->readEntry("autoLoginPass"); + pass = q->configValue(QStringLiteral("autoLoginPass")); } } @@ -526,7 +526,7 @@ // Check for cached authentication first and fallback to // anonymous login when no stored credentials are found. - if (!q->config()->readEntry("TryAnonymousLoginFirst", false) && + if (!q->configValue(QStringLiteral("TryAnonymousLoginFirst"), false) && pass.isEmpty() && q->checkCachedAuthentication(info)) { user = info.username; pass = info.password; @@ -573,7 +573,7 @@ info.keepPassword = true; // Prompt the user for persistence as well. info.setModified(false); // Default the modified flag since we reuse authinfo. - const bool disablePassDlg = q->config()->readEntry("DisablePassDlg", false); + const bool disablePassDlg = q->configValue(QStringLiteral("DisablePassDlg"), false); if (disablePassDlg) { return Result::fail(ERR_USER_CANCELED, m_host); } @@ -673,7 +673,7 @@ qCWarning(KIO_FTP) << "SYST failed"; } - if (q->config()->readEntry("EnableAutoLoginMacro", false)) { + if (q->configValue(QStringLiteral("EnableAutoLoginMacro"), false)) { ftpAutoLoginMacro(); } @@ -949,15 +949,15 @@ int iErrCodePASV = 0; // Remember error code from PASV // First try passive (EPSV & PASV) modes - if (!q->config()->readEntry("DisablePassiveMode", false)) { + if (!q->configValue(QStringLiteral("DisablePassiveMode"), false)) { iErrCode = ftpOpenPASVDataConnection(); if (iErrCode == 0) { return 0; // success } iErrCodePASV = iErrCode; ftpCloseDataConnection(); - if (!q->config()->readEntry("DisableEPSV", false)) { + if (!q->configValue(QStringLiteral("DisableEPSV"), false)) { iErrCode = ftpOpenEPSVDataConnection(); if (iErrCode == 0) { return 0; // success @@ -2070,7 +2070,7 @@ if (m_user.isEmpty() || m_user == QLatin1String(FTP_LOGIN)) { bMarkPartial = false; } else { - bMarkPartial = q->config()->readEntry("MarkPartial", true); + bMarkPartial = q->configValue(QStringLiteral("MarkPartial"), true); } QString dest_orig = dest_url.path(); @@ -2179,7 +2179,7 @@ if (bMarkPartial) { // Remove if smaller than minimum size if (ftpSize(dest, 'I') && - (processed_size < q->config()->readEntry("MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE))) { + (processed_size < q->configValue(QStringLiteral("MinimumKeepSize"), DEFAULT_MINIMUM_KEEP_SIZE))) { const QByteArray cmd = "DELE " + q->remoteEncoding()->encode(dest); (void) ftpSendCmd(cmd); } @@ -2400,7 +2400,7 @@ bool bResume = false; QFileInfo sPartInfo(sPart); const bool bPartExists = sPartInfo.exists(); - const bool bMarkPartial = q->config()->readEntry("MarkPartial", true); + const bool bMarkPartial = q->configValue(QStringLiteral("MarkPartial"), true); const QString dest = bMarkPartial ? sPart : sCopyFile; if (bMarkPartial && bPartExists && sPartInfo.size() > 0) { // must not be a folder! please fix a similar bug in kio_file!! @@ -2472,7 +2472,7 @@ } else { sPartInfo.refresh(); if (sPartInfo.exists()) { // should a very small ".part" be deleted? - int size = q->config()->readEntry("MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE); + int size = q->configValue(QStringLiteral("MinimumKeepSize"), DEFAULT_MINIMUM_KEEP_SIZE); if (sPartInfo.size() < size) { QFile::remove(sPart); }