summaryrefslogtreecommitdiffstats
path: root/kioslave/http
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-25 00:35:07 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-01-25 00:35:07 -0600
commit703fb0c89c2eee56a1e613e67a446db9d4287929 (patch)
treedd8c5ca66075cd89c2638a2b48cf78386a9870a7 /kioslave/http
parent818e7abec3d5d3809b6b77293558678371c16b71 (diff)
downloadtdelibs-703fb0c89c2eee56a1e613e67a446db9d4287929.tar.gz
tdelibs-703fb0c89c2eee56a1e613e67a446db9d4287929.zip
Rename KCModule, KConfig, KIO, KServer, and KSocket to avoid conflicts with KDE4
Diffstat (limited to 'kioslave/http')
-rw-r--r--kioslave/http/http.cc62
-rw-r--r--kioslave/http/http.h24
-rw-r--r--kioslave/http/kcookiejar/kcookiejar.cpp6
-rw-r--r--kioslave/http/kcookiejar/kcookiejar.h6
-rw-r--r--kioslave/http/kcookiejar/kcookieserver.cpp2
-rw-r--r--kioslave/http/kcookiejar/kcookieserver.h4
-rw-r--r--kioslave/http/kcookiejar/tests/kcookiejartest.cpp4
7 files changed, 54 insertions, 54 deletions
diff --git a/kioslave/http/http.cc b/kioslave/http/http.cc
index f6e714988..cbff13fdf 100644
--- a/kioslave/http/http.cc
+++ b/kioslave/http/http.cc
@@ -90,7 +90,7 @@
#include <misc/kntlm/kntlm.h>
-using namespace KIO;
+using namespace TDEIO;
extern "C" {
KDE_EXPORT int kdemain(int argc, char **argv);
@@ -185,7 +185,7 @@ static TQString sanitizeCustomHTTPHeader(const TQString& _header)
}
-#define NO_SIZE ((KIO::filesize_t) -1)
+#define NO_SIZE ((TDEIO::filesize_t) -1)
#ifdef HAVE_STRTOLL
#define STRTOLL strtoll
@@ -465,7 +465,7 @@ bool HTTPProtocol::checkRequestURL( const KURL& u )
if (m_request.hostname.isEmpty())
{
- error( KIO::ERR_UNKNOWN_HOST, i18n("No host specified."));
+ error( TDEIO::ERR_UNKNOWN_HOST, i18n("No host specified."));
return false;
}
@@ -619,15 +619,15 @@ void HTTPProtocol::stat(const KURL& url)
// When downloading we assume it exists
UDSEntry entry;
UDSAtom atom;
- atom.m_uds = KIO::UDS_NAME;
+ atom.m_uds = TDEIO::UDS_NAME;
atom.m_str = url.fileName();
entry.append( atom );
- atom.m_uds = KIO::UDS_FILE_TYPE;
+ atom.m_uds = TDEIO::UDS_FILE_TYPE;
atom.m_long = S_IFREG; // a file
entry.append( atom );
- atom.m_uds = KIO::UDS_ACCESS;
+ atom.m_uds = TDEIO::UDS_ACCESS;
atom.m_long = S_IRUSR | S_IRGRP | S_IROTH; // readable by everybody
entry.append( atom );
@@ -762,7 +762,7 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat )
KURL thisURL ( urlStr, encoding );
- atom.m_uds = KIO::UDS_NAME;
+ atom.m_uds = TDEIO::UDS_NAME;
if ( thisURL.isValid() ) {
// don't list the base dir of a listDir()
@@ -811,7 +811,7 @@ void HTTPProtocol::davStatList( const KURL& url, bool stat )
}
}
-void HTTPProtocol::davGeneric( const KURL& url, KIO::HTTP_METHOD method )
+void HTTPProtocol::davGeneric( const KURL& url, TDEIO::HTTP_METHOD method )
{
kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::davGeneric " << url.url()
<< endl;
@@ -877,7 +877,7 @@ void HTTPProtocol::davParsePropstats( const TQDomNodeList& propstats, UDSEntry&
if ( hasMetaData( "davRequestResponse" ) )
{
- atom.m_uds = KIO::UDS_XML_PROPERTIES;
+ atom.m_uds = TDEIO::UDS_XML_PROPERTIES;
TQDomDocument doc;
doc.appendChild(prop);
atom.m_str = doc.toString();
@@ -899,14 +899,14 @@ void HTTPProtocol::davParsePropstats( const TQDomNodeList& propstats, UDSEntry&
if ( property.tagName() == "creationdate" )
{
// Resource creation date. Should be is ISO 8601 format.
- atom.m_uds = KIO::UDS_CREATION_TIME;
+ atom.m_uds = TDEIO::UDS_CREATION_TIME;
atom.m_long = parseDateTime( property.text(), property.attribute("dt") );
entry.append( atom );
}
else if ( property.tagName() == "getcontentlength" )
{
// Content length (file size)
- atom.m_uds = KIO::UDS_SIZE;
+ atom.m_uds = TDEIO::UDS_SIZE;
atom.m_long = property.text().toULong();
entry.append( atom );
}
@@ -952,7 +952,7 @@ void HTTPProtocol::davParsePropstats( const TQDomNodeList& propstats, UDSEntry&
else if ( property.tagName() == "getlastmodified" )
{
// Last modification date
- atom.m_uds = KIO::UDS_MODIFICATION_TIME;
+ atom.m_uds = TDEIO::UDS_MODIFICATION_TIME;
atom.m_long = parseDateTime( property.text(), property.attribute("dt") );
entry.append( atom );
@@ -1009,27 +1009,27 @@ void HTTPProtocol::davParsePropstats( const TQDomNodeList& propstats, UDSEntry&
setMetaData( "davLockCount", TQString("%1").arg(lockCount) );
setMetaData( "davSupportedLockCount", TQString("%1").arg(supportedLockCount) );
- atom.m_uds = KIO::UDS_FILE_TYPE;
+ atom.m_uds = TDEIO::UDS_FILE_TYPE;
atom.m_long = isDirectory ? S_IFDIR : S_IFREG;
entry.append( atom );
if ( foundExecutable || isDirectory )
{
// File was executable, or is a directory.
- atom.m_uds = KIO::UDS_ACCESS;
+ atom.m_uds = TDEIO::UDS_ACCESS;
atom.m_long = 0700;
entry.append(atom);
}
else
{
- atom.m_uds = KIO::UDS_ACCESS;
+ atom.m_uds = TDEIO::UDS_ACCESS;
atom.m_long = 0600;
entry.append(atom);
}
if ( !isDirectory && !mimeType.isEmpty() )
{
- atom.m_uds = KIO::UDS_MIME_TYPE;
+ atom.m_uds = TDEIO::UDS_MIME_TYPE;
atom.m_str = mimeType;
entry.append( atom );
}
@@ -1553,7 +1553,7 @@ TQString HTTPProtocol::davError( int code /* = -1 */, TQString url )
url = m_request.url.url();
TQString action, errorString;
- KIO::Error kError;
+ TDEIO::Error kError;
// for 412 Precondition Failed
TQString ow = i18n( "Otherwise, the request would have succeeded." );
@@ -1742,7 +1742,7 @@ TQString HTTPProtocol::davError( int code /* = -1 */, TQString url )
void HTTPProtocol::httpError()
{
TQString action, errorString;
- KIO::Error kError;
+ TDEIO::Error kError;
switch ( m_request.method ) {
case HTTP_PUT:
@@ -2187,10 +2187,10 @@ bool HTTPProtocol::httpOpen()
{
m_request.fcache = checkCacheEntry( );
- bool bCacheOnly = (m_request.cache == KIO::CC_CacheOnly);
+ bool bCacheOnly = (m_request.cache == TDEIO::CC_CacheOnly);
bool bOffline = isOffline(m_request.doProxy ? m_proxyURL : m_request.url);
- if (bOffline && (m_request.cache != KIO::CC_Reload))
- m_request.cache = KIO::CC_CacheOnly;
+ if (bOffline && (m_request.cache != TDEIO::CC_Reload))
+ m_request.cache = TDEIO::CC_CacheOnly;
if (m_request.cache == CC_Reload && m_request.fcache)
{
@@ -2198,7 +2198,7 @@ bool HTTPProtocol::httpOpen()
fclose(m_request.fcache);
m_request.fcache = 0;
}
- if ((m_request.cache == KIO::CC_CacheOnly) || (m_request.cache == KIO::CC_Cache))
+ if ((m_request.cache == TDEIO::CC_CacheOnly) || (m_request.cache == TDEIO::CC_Cache))
m_request.bMustRevalidate = false;
m_request.bCachedWrite = true;
@@ -2429,8 +2429,8 @@ bool HTTPProtocol::httpOpen()
if ( m_request.offset > 0 )
{
- header += TQString("Range: bytes=%1-\r\n").arg(KIO::number(m_request.offset));
- kdDebug(7103) << "kio_http : Range = " << KIO::number(m_request.offset) << endl;
+ header += TQString("Range: bytes=%1-\r\n").arg(TDEIO::number(m_request.offset));
+ kdDebug(7103) << "kio_http : Range = " << TDEIO::number(m_request.offset) << endl;
}
if ( m_request.cache == CC_Reload )
@@ -4092,7 +4092,7 @@ void HTTPProtocol::special( const TQByteArray &data )
KURL url;
int method;
stream >> url >> method;
- davGeneric( url, (KIO::HTTP_METHOD) method );
+ davGeneric( url, (TDEIO::HTTP_METHOD) method );
break;
}
case 99: // Close Connection
@@ -4343,7 +4343,7 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ )
bool useMD5 = !m_sContentMD5.isEmpty();
// Deal with the size of the file.
- KIO::filesize_t sz = m_request.offset;
+ TDEIO::filesize_t sz = m_request.offset;
if ( sz )
m_iSize += sz;
@@ -4354,7 +4354,7 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ )
if ( !dataInternal ) {
if ( (m_iSize > 0) && (m_iSize != NO_SIZE)) {
totalSize(m_iSize);
- infoMessage( i18n( "Retrieving %1 from %2...").arg(KIO::convertSize(m_iSize))
+ infoMessage( i18n( "Retrieving %1 from %2...").arg(TDEIO::convertSize(m_iSize))
.arg( m_request.hostname ) );
}
else
@@ -4411,7 +4411,7 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ )
m_iBytesLeft = NO_SIZE;
kdDebug(7113) << "(" << m_pid << ") HTTPProtocol::readBody: retrieve data. "
- << KIO::number(m_iBytesLeft) << " left." << endl;
+ << TDEIO::number(m_iBytesLeft) << " left." << endl;
// Main incoming loop... Gather everything while we can...
m_cpMimeBuffer = false;
@@ -4527,7 +4527,7 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ )
if (m_iBytesLeft == 0)
{
- kdDebug(7113) << "("<<m_pid<<") EOD received! Left = "<< KIO::number(m_iBytesLeft) << endl;
+ kdDebug(7113) << "("<<m_pid<<") EOD received! Left = "<< TDEIO::number(m_iBytesLeft) << endl;
break;
}
}
@@ -4554,13 +4554,13 @@ bool HTTPProtocol::readBody( bool dataInternal /* = false */ )
}
else
{
- kdDebug(7113) << "(" << m_pid << ") still "<< KIO::number(m_iBytesLeft)
+ kdDebug(7113) << "(" << m_pid << ") still "<< TDEIO::number(m_iBytesLeft)
<< " bytes left! can't close cache entry!\n";
}
if (sz <= 1)
{
- /* kdDebug(7113) << "(" << m_pid << ") readBody: sz = " << KIO::number(sz)
+ /* kdDebug(7113) << "(" << m_pid << ") readBody: sz = " << TDEIO::number(sz)
<< ", responseCode =" << m_responseCode << endl; */
if (m_responseCode >= 500 && m_responseCode <= 599)
error(ERR_INTERNAL_SERVER, m_state.hostname);
diff --git a/kioslave/http/http.h b/kioslave/http/http.h
index 2985eb938..ccbb60ce6 100644
--- a/kioslave/http/http.h
+++ b/kioslave/http/http.h
@@ -42,11 +42,11 @@ class DCOPClient;
class TQDomElement;
class TQDomNodeList;
-namespace KIO {
+namespace TDEIO {
class AuthInfo;
}
-class HTTPProtocol : public TQObject, public KIO::TCPSlaveBase
+class HTTPProtocol : public TQObject, public TDEIO::TCPSlaveBase
{
Q_OBJECT
public:
@@ -103,7 +103,7 @@ public:
HTTPRequest ()
{
port = 0;
- method = KIO::HTTP_UNKNOWN;
+ method = TDEIO::HTTP_UNKNOWN;
offset = 0;
doProxy = false;
allowCompressedPage = false;
@@ -128,9 +128,9 @@ public:
TQString passwd;
TQString path;
TQString query;
- KIO::HTTP_METHOD method;
- KIO::CacheControl cache;
- KIO::filesize_t offset;
+ TDEIO::HTTP_METHOD method;
+ TDEIO::CacheControl cache;
+ TDEIO::filesize_t offset;
bool doProxy;
KURL url;
TQString window; // Window Id this request is related to.
@@ -205,7 +205,7 @@ public:
bool davHostOk();
// send generic DAV request
- void davGeneric( const KURL& url, KIO::HTTP_METHOD method );
+ void davGeneric( const KURL& url, TDEIO::HTTP_METHOD method );
// Send requests to lock and unlock resources
void davLock( const KURL& url, const TQString& scope,
@@ -307,7 +307,7 @@ protected:
*/
void davSetRequest( const TQCString& requestXML );
void davStatList( const KURL& url, bool stat = true );
- void davParsePropstats( const TQDomNodeList& propstats, KIO::UDSEntry& entry );
+ void davParsePropstats( const TQDomNodeList& propstats, TDEIO::UDSEntry& entry );
void davParseActiveLocks( const TQDomNodeList& activeLocks,
uint& lockCount );
@@ -463,7 +463,7 @@ protected:
/**
* Creates authorization prompt info.
*/
- void promptInfo( KIO::AuthInfo& info );
+ void promptInfo( TDEIO::AuthInfo& info );
protected:
HTTPState m_state;
@@ -481,9 +481,9 @@ protected:
// Processing related
bool m_bChunked; // Chunked tranfer encoding
- KIO::filesize_t m_iSize; // Expected size of message
- KIO::filesize_t m_iBytesLeft; // # of bytes left to receive in this message.
- KIO::filesize_t m_iContentLeft; // # of content bytes left
+ TDEIO::filesize_t m_iSize; // Expected size of message
+ TDEIO::filesize_t m_iBytesLeft; // # of bytes left to receive in this message.
+ TDEIO::filesize_t m_iContentLeft; // # of content bytes left
TQByteArray m_bufReceive; // Receive buffer
bool m_dataInternal; // Data is for internal consumption
char m_lineBuf[1024];
diff --git a/kioslave/http/kcookiejar/kcookiejar.cpp b/kioslave/http/kcookiejar/kcookiejar.cpp
index e70c97e54..f115a6da6 100644
--- a/kioslave/http/kcookiejar/kcookiejar.cpp
+++ b/kioslave/http/kcookiejar/kcookiejar.cpp
@@ -257,7 +257,7 @@ KCookieJar::KCookieJar()
m_configChanged = false;
m_cookiesChanged = false;
- KConfig cfg("khtml/domain_info", true, false, "data");
+ TDEConfig cfg("khtml/domain_info", true, false, "data");
TQStringList countries = cfg.readListEntry("twoLevelTLD");
for(TQStringList::ConstIterator it = countries.begin();
it != countries.end(); ++it)
@@ -1479,7 +1479,7 @@ bool KCookieJar::loadCookies(const TQString &_filename)
// Save the cookie configuration
//
-void KCookieJar::saveConfig(KConfig *_config)
+void KCookieJar::saveConfig(TDEConfig *_config)
{
if (!m_configChanged)
return;
@@ -1515,7 +1515,7 @@ void KCookieJar::saveConfig(KConfig *_config)
// Load the cookie configuration
//
-void KCookieJar::loadConfig(KConfig *_config, bool reparse )
+void KCookieJar::loadConfig(TDEConfig *_config, bool reparse )
{
if ( reparse )
_config->reparseConfiguration();
diff --git a/kioslave/http/kcookiejar/kcookiejar.h b/kioslave/http/kcookiejar/kcookiejar.h
index eb64485ea..bb16d75d3 100644
--- a/kioslave/http/kcookiejar/kcookiejar.h
+++ b/kioslave/http/kcookiejar/kcookiejar.h
@@ -31,7 +31,7 @@
#include <tqptrlist.h>
#include <time.h>
-class KConfig;
+class TDEConfig;
class KCookieJar;
class KHttpCookie;
class KHttpCookieList;
@@ -146,12 +146,12 @@ public:
/**
* Save the cookie configuration
*/
- void saveConfig(KConfig *_config);
+ void saveConfig(TDEConfig *_config);
/**
* Load the cookie configuration
*/
- void loadConfig(KConfig *_config, bool reparse = false);
+ void loadConfig(TDEConfig *_config, bool reparse = false);
/**
* Looks for cookies in the cookie jar which are appropriate for _url.
diff --git a/kioslave/http/kcookiejar/kcookieserver.cpp b/kioslave/http/kcookiejar/kcookieserver.cpp
index da9c16ce7..94df40b63 100644
--- a/kioslave/http/kcookiejar/kcookieserver.cpp
+++ b/kioslave/http/kcookiejar/kcookieserver.cpp
@@ -88,7 +88,7 @@ KCookieServer::KCookieServer(const TQCString &name)
mAdvicePending = false;
mTimer = new TQTimer();
connect( mTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotSave()));
- mConfig = new KConfig("kcookiejarrc");
+ mConfig = new TDEConfig("kcookiejarrc");
mCookieJar->loadConfig( mConfig );
TQString filename = locateLocal("data", "kcookiejar/cookies");
diff --git a/kioslave/http/kcookiejar/kcookieserver.h b/kioslave/http/kcookiejar/kcookieserver.h
index 0c36f10b1..2cbb9ccf1 100644
--- a/kioslave/http/kcookiejar/kcookieserver.h
+++ b/kioslave/http/kcookiejar/kcookieserver.h
@@ -34,7 +34,7 @@ class KHttpCookie;
class TQTimer;
class RequestList;
class DCOPClient;
-class KConfig;
+class TDEConfig;
class KCookieServer : public KDEDModule
{
@@ -86,7 +86,7 @@ protected:
TQTimer *mTimer;
bool mAdvicePending;
DCOPClient *mOldCookieServer;
- KConfig *mConfig;
+ TDEConfig *mConfig;
private:
virtual int newInstance(TQValueList<TQCString>) { return 0; }
diff --git a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp
index 05f0ac0ea..236e2406b 100644
--- a/kioslave/http/kcookiejar/tests/kcookiejartest.cpp
+++ b/kioslave/http/kcookiejar/tests/kcookiejartest.cpp
@@ -36,7 +36,7 @@ static const char *description = "KCookiejar regression test";
static KCookieJar *jar;
static TQCString *lastYear;
static TQCString *nextYear;
-static KConfig *config = 0;
+static TDEConfig *config = 0;
static KCmdLineOptions options[] =
@@ -87,7 +87,7 @@ static void clearConfig()
delete config;
TQString file = locateLocal("config", "kcookiejar-testconfig");
TQFile::remove(file);
- config = new KConfig(file);
+ config = new TDEConfig(file);
config->setGroup("Cookie Policy");
config->writeEntry("RejectCrossDomainCookies", false);
config->writeEntry("AcceptSessionCookies", false);