diff --git a/src/ioslaves/file/file.cpp b/src/ioslaves/file/file.cpp --- a/src/ioslaves/file/file.cpp +++ b/src/ioslaves/file/file.cpp @@ -338,7 +338,7 @@ void FileProtocol::redirect(const QUrl &url) { QUrl redir(url); - redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb")); + redir.setScheme(mapConfig().value(QStringLiteral("DefaultRemoteProtocol"), QStringLiteral("smb")).toString()); // if we would redirect into the Windows world, let's also check for the // DavWWWRoot "token" which in the Windows world tells win explorer to access @@ -595,7 +595,8 @@ QT_STATBUF buff_orig; const bool bOrigExists = (QT_LSTAT(QFile::encodeName(dest_orig).constData(), &buff_orig) != -1); bool bPartExists = false; - const bool bMarkPartial = config()->readEntry("MarkPartial", true); + const bool bMarkPartial = mapConfig().value(QStringLiteral("MarkPartial"), QVariant(true)).toBool(); + // = mapConfig().value(QStringLiteral(""), QVariant(true)).toBool(); if (bMarkPartial) { QT_STATBUF buff_part; @@ -723,7 +724,7 @@ QT_STATBUF buff; if (QT_STAT(QFile::encodeName(dest).constData(), &buff) == 0) { - int size = config()->readEntry("MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE); + int size = mapConfig().value(QStringLiteral("MinimumKeepSize"), QVariant(DEFAULT_MINIMUM_KEEP_SIZE)).toInt(); if (buff.st_size < size) { QFile::remove(dest); } diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp --- a/src/ioslaves/file/file_unix.cpp +++ b/src/ioslaves/file/file_unix.cpp @@ -494,7 +494,7 @@ { if (!isLocalFileSameHost(url)) { QUrl redir(url); - redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb")); + redir.setScheme(mapConfig().value(QStringLiteral("DefaultRemoteProtocol"), QStringLiteral("smb")).toString()); redirection(redir); // qDebug() << "redirecting to " << redir; finished(); diff --git a/src/ioslaves/file/file_win.cpp b/src/ioslaves/file/file_win.cpp --- a/src/ioslaves/file/file_win.cpp +++ b/src/ioslaves/file/file_win.cpp @@ -191,7 +191,7 @@ if (!url.isLocalFile()) { QUrl redir(url); - redir.setScheme(config()->readEntry("DefaultRemoteProtocol", "smb")); + redir.setScheme(mapConfig().value(QStringLiteral("DefaultRemoteProtocol"), QStringLiteral("smb")).toString()); redirection(redir); // qDebug() << "redirecting to " << redir; finished(); 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 @@ -327,7 +327,7 @@ qCDebug(KIO_FTP) << _host << "port=" << _port << "user=" << _user; m_proxyURL.clear(); - m_proxyUrls = config()->readEntry("ProxyUrls", QStringList()); + m_proxyUrls = mapConfig().value(QStringLiteral("MarkPartial"), QVariant(QStringList())).toStringList(); qCDebug(KIO_FTP) << "proxy urls:" << m_proxyUrls; if (m_host != _host || m_port != _port || @@ -381,7 +381,7 @@ } } - m_bTextMode = config()->readEntry("textmode", false); + m_bTextMode = mapConfig().value(QStringLiteral("textMode"), QVariant(false)).toBool(); connected(); // Redirected due to credential change... @@ -518,11 +518,11 @@ QString user(m_user); QString pass(m_pass); - if (config()->readEntry("EnableAutoLogin", false)) { - QString au = config()->readEntry("autoLoginUser"); + if (mapConfig().value(QStringLiteral("EnableAutoLogin"), QVariant(false)).toBool()) { + QString au = mapConfig().value(QStringLiteral("autoLoginUser"), QVariant("")).toString(); if (!au.isEmpty()) { user = au; - pass = config()->readEntry("autoLoginPass"); + pass = mapConfig().value(QStringLiteral("autoLoginPass"), QVariant("")).toString(); } } @@ -538,7 +538,7 @@ // Check for cached authentication first and fallback to // anonymous login when no stored credentials are found. - if (!config()->readEntry("TryAnonymousLoginFirst", false) && + if (!mapConfig().value(QStringLiteral("TryAnonymousLoginFirst"), QVariant(false)).toBool() && pass.isEmpty() && checkCachedAuthentication(info)) { user = info.username; pass = info.password; @@ -585,7 +585,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 = config()->readEntry("DisablePassDlg", false); + const bool disablePassDlg = mapConfig().value(QStringLiteral("DisablePassDlg"), QVariant(false)).toBool(); if (disablePassDlg) { error(ERR_USER_CANCELED, m_host); return false; @@ -686,7 +686,7 @@ qCWarning(KIO_FTP) << "SYST failed"; } - if (config()->readEntry("EnableAutoLoginMacro", false)) { + if (mapConfig().value(QStringLiteral("EnableAutoLoginMacro"), QVariant(false)).toBool()) { ftpAutoLoginMacro(); } @@ -954,15 +954,15 @@ int iErrCodePASV = 0; // Remember error code from PASV // First try passive (EPSV & PASV) modes - if (!config()->readEntry("DisablePassiveMode", false)) { + if (!mapConfig().value(QStringLiteral("DisablePassiveMode"), QVariant(false)).toBool()) { iErrCode = ftpOpenPASVDataConnection(); if (iErrCode == 0) { return 0; // success } iErrCodePASV = iErrCode; ftpCloseDataConnection(); - if (!config()->readEntry("DisableEPSV", false)) { + if (!mapConfig().value(QStringLiteral("DisableEPSV"), QVariant(false)).toBool()) { iErrCode = ftpOpenEPSVDataConnection(); if (iErrCode == 0) { return 0; // success @@ -2095,7 +2095,7 @@ if (m_user.isEmpty() || m_user == QLatin1String(FTP_LOGIN)) { bMarkPartial = false; } else { - bMarkPartial = config()->readEntry("MarkPartial", true); + bMarkPartial = mapConfig().value(QStringLiteral("MarkPartial"), QVariant(true)).toBool(); } QString dest_orig = dest_url.path(); @@ -2207,7 +2207,7 @@ if (bMarkPartial) { // Remove if smaller than minimum size if (ftpSize(dest, 'I') && - (processed_size < config()->readEntry("MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE))) { + (processed_size < mapConfig().value(QStringLiteral("MinimumKeepSize"), QVariant(DEFAULT_MINIMUM_KEEP_SIZE)).toInt())) { const QByteArray cmd = "DELE " + remoteEncoding()->encode(dest); (void) ftpSendCmd(cmd); } @@ -2432,7 +2432,7 @@ bool bResume = false; QFileInfo sPartInfo(sPart); const bool bPartExists = sPartInfo.exists(); - const bool bMarkPartial = config()->readEntry("MarkPartial", true); + const bool bMarkPartial = mapConfig().value(QStringLiteral("MarkPartial"), QVariant(true)).toBool(); 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!! @@ -2505,7 +2505,7 @@ } else { sPartInfo.refresh(); if (sPartInfo.exists()) { // should a very small ".part" be deleted? - int size = config()->readEntry("MinimumKeepSize", DEFAULT_MINIMUM_KEEP_SIZE); + int size = mapConfig().value(QStringLiteral("MinimumKeepSize"), QVariant(DEFAULT_MINIMUM_KEEP_SIZE)).toInt(); if (sPartInfo.size() < size) { QFile::remove(sPart); } diff --git a/src/ioslaves/http/http.cpp b/src/ioslaves/http/http.cpp --- a/src/ioslaves/http/http.cpp +++ b/src/ioslaves/http/http.cpp @@ -443,9 +443,9 @@ m_request.keepAliveTimeout = 0; m_request.redirectUrl = QUrl(); - m_request.useCookieJar = config()->readEntry("Cookies", false); - m_request.cacheTag.useCache = config()->readEntry("UseCache", true); - m_request.preferErrorPage = config()->readEntry("errorPage", true); + m_request.useCookieJar = mapConfig().value(QStringLiteral("Cookies"), QVariant(false)).toBool(); + m_request.cacheTag.useCache = mapConfig().value(QStringLiteral("UseCache"), QVariant(true)).toBool(); + m_request.preferErrorPage = mapConfig().value(QStringLiteral("errorPage"), QVariant(true)).toBool(); const bool noAuth = config()->readEntry("no-auth", false); m_request.doNotWWWAuthenticate = config()->readEntry("no-www-auth", noAuth); m_request.doNotProxyAuthenticate = config()->readEntry("no-proxy-auth", noAuth); @@ -462,7 +462,7 @@ m_request.referrer.clear(); // RFC 2616: do not send the referrer if the referrer page was served using SSL and // the current page does not use SSL. - if (config()->readEntry("SendReferrer", true) && + if (mapConfig().value(QStringLiteral("SendReferrer"), QVariant(true)).toBool() && (isEncryptedHttpVariety(m_protocol) || metaData(QStringLiteral("ssl_was_in_use")) != QLatin1String("TRUE"))) { QUrl refUrl(metaData(QStringLiteral("referrer"))); if (refUrl.isValid()) { @@ -479,7 +479,7 @@ } } - if (config()->readEntry("SendLanguageSettings", true)) { + if (mapConfig().value(QStringLiteral("SendLanguageSettings"), QVariant(true)).toBool()) { m_request.charsets = config()->readEntry("Charsets", DEFAULT_PARTIAL_CHARSET_HEADER); if (!m_request.charsets.contains(QLatin1String("*;"), Qt::CaseInsensitive)) { m_request.charsets += QLatin1String(",*;q=0.5"); @@ -511,12 +511,12 @@ m_request.endoffset = 0; } - m_request.disablePassDialog = config()->readEntry("DisablePassDlg", false); - m_request.allowTransferCompression = config()->readEntry("AllowCompressedPage", true); + m_request.disablePassDialog = mapConfig().value(QStringLiteral("DisablePassDlg"), QVariant(false)).toBool(); + m_request.allowTransferCompression = mapConfig().value(QStringLiteral("AllowCompressedPage"), QVariant(true)).toBool(); m_request.id = metaData(QStringLiteral("request-id")); // Store user agent for this host. - if (config()->readEntry("SendUserAgent", true)) { + if (mapConfig().value(QStringLiteral("SendUserAgent"), QVariant(true)).toBool()) { m_request.userAgent = metaData(QStringLiteral("UserAgent")); } else { m_request.userAgent.clear(); @@ -2582,7 +2582,7 @@ } // DoNotTrack feature... - if (config()->readEntry("DoNotTrack", false)) { + if (mapConfig().value(QStringLiteral("DoNotTrack"), QVariant(false)).toBool()) { header += QLatin1String("DNT: 1\r\n"); } @@ -2662,7 +2662,7 @@ void HTTPProtocol::forwardHttpResponseHeader(bool forwardImmediately) { // Send the response header if it was requested... - if (!config()->readEntry("PropagateHttpHeader", false)) { + if (!mapConfig().value(QStringLiteral("PropagateHttpHeader"), QVariant(false)).toBool()) { return; } @@ -3511,7 +3511,7 @@ return parseHeaderFromCache(); } - if (config()->readEntry("PropagateHttpHeader", false) || + if (mapConfig().value(QStringLiteral("PropagateHttpHeader"), QVariant(false)).toBool() || m_request.cacheTag.ioMode == WriteToCache) { // store header lines if they will be used; note that the tokenizer removing // line continuation special cases is probably more good than bad.