Various compilation fixes.

Most are to specify types where ambiguity is present,
so for example 'T' becomes (QChar)'T'


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1159657 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 15 years ago
parent 6d1c49c8bd
commit 229a34d015

@ -410,11 +410,11 @@ TQStringList dcopSessionList( const TQString &user, const TQString &home )
d.setFilter( TQDir::Files | TQDir::Hidden | TQDir::NoSymLinks ); d.setFilter( TQDir::Files | TQDir::Hidden | TQDir::NoSymLinks );
d.setNameFilter( ".DCOPserver*" ); d.setNameFilter( ".DCOPserver*" );
const QFileInfoList *list = d.entryInfoList(); const TQFileInfoList *list = d.entryInfoList();
if( !list ) if( !list )
return result; return result;
QFileInfoListIterator it( *list ); TQFileInfoListIterator it( *list );
TQFileInfo *fi; TQFileInfo *fi;
while ( ( fi = it.current() ) != 0 ) while ( ( fi = it.current() ) != 0 )

@ -3,6 +3,7 @@
#include <tqdatastream.h> #include <tqdatastream.h>
#ifdef USE_QT3
inline TQDataStream & operator << (TQDataStream & str, bool b) inline TQDataStream & operator << (TQDataStream & str, bool b)
{ {
str << Q_INT8(b); str << Q_INT8(b);
@ -16,6 +17,7 @@ inline TQDataStream & operator >> (TQDataStream & str, bool & b)
b = bool(l); b = bool(l);
return str; return str;
} }
#endif // USE_QT3
#if QT_VERSION < 0x030200 && !defined(Q_WS_WIN) && !defined(Q_WS_MAC) #if QT_VERSION < 0x030200 && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
inline TQDataStream & operator << (TQDataStream & str, long long int ll) inline TQDataStream & operator << (TQDataStream & str, long long int ll)

@ -216,7 +216,7 @@ class KDECORE_EXPORT kdbgstream {
kdbgstream &operator<<(const TQString& string) { kdbgstream &operator<<(const TQString& string) {
if (!print) return *this; if (!print) return *this;
output += string; output += string;
if (output.at(output.length() -1 ) == '\n') if (output.at(output.length() -1 ) == (QChar)'\n')
flush(); flush();
return *this; return *this;
} }
@ -228,7 +228,7 @@ class KDECORE_EXPORT kdbgstream {
kdbgstream &operator<<(const char *string) { kdbgstream &operator<<(const char *string) {
if (!print) return *this; if (!print) return *this;
output += TQString::fromUtf8(string); output += TQString::fromUtf8(string);
if (output.at(output.length() - 1) == '\n') if (output.at(output.length() - 1) == (QChar)'\n')
flush(); flush();
return *this; return *this;
} }

@ -112,7 +112,7 @@ static TQString encode( const TQString& segment, int encoding_offset, int encodi
} }
else else
new_segment[ new_length++ ] = local[i]; new_segment[ new_length++ ] = (QChar)local[i];
} }
TQString result = TQString(new_segment, new_length); TQString result = TQString(new_segment, new_length);
@ -183,7 +183,7 @@ static TQString lazy_encode( const TQString& segment, bool encodeAt=true )
(character == '?') || // Start of query delimiter (character == '?') || // Start of query delimiter
((character == '@') && encodeAt) || // Username delimiter ((character == '@') && encodeAt) || // Username delimiter
(character == '#') || // Start of reference delimiter (character == '#') || // Start of reference delimiter
((character == 32) && (i+1 == old_length || segment[i+1] == ' '))) // A trailing space ((character == 32) && (i+1 == old_length || segment[i+1] == (QChar)' '))) // A trailing space
{ {
new_segment[ new_length++ ] = '%'; new_segment[ new_length++ ] = '%';
@ -657,7 +657,7 @@ void KURL::parse( const TQString& _url, int encoding_hint )
goto NodeErr; goto NodeErr;
if (alpha && buf[pos]==':' && (len==2 || (len>2 && (buf[pos+1]=='/' || buf[pos+1]=='\\')))) if (alpha && buf[pos]==':' && (len==2 || (len>2 && (buf[pos+1]=='/' || buf[pos+1]=='\\'))))
#else #else
if ( x == '/' ) if ( x == (QChar)'/' )
#endif #endif
{ {
// A slash means we immediately proceed to parse it as a file URL. // A slash means we immediately proceed to parse it as a file URL.
@ -673,9 +673,9 @@ void KURL::parse( const TQString& _url, int encoding_hint )
// '.' is not currently accepted, because current KURL may be confused. // '.' is not currently accepted, because current KURL may be confused.
// Proceed with :// :/ or : // Proceed with :// :/ or :
while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) ||
buf[pos] == '+' || buf[pos] == '-')) pos++; buf[pos] == (QChar)'+' || buf[pos] == (QChar)'-')) pos++;
if (pos < len && buf[pos] == ':' ) if (pos < len && buf[pos] == (QChar)':' )
{ {
m_strProtocol = TQString( orig, pos ).lower(); m_strProtocol = TQString( orig, pos ).lower();
if ( m_iUriMode == Auto ) if ( m_iUriMode == Auto )
@ -715,10 +715,10 @@ void KURL::parseRawURI( const TQString& _url, int encoding_hint )
// '.' is not currently accepted, because current KURL may be confused. // '.' is not currently accepted, because current KURL may be confused.
// Proceed with : // Proceed with :
while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) ||
buf[pos] == '+' || buf[pos] == '-')) pos++; buf[pos] == (QChar)'+' || buf[pos] == (QChar)'-')) pos++;
// Note that m_strProtocol is already set here, so we just skip over the protocol. // Note that m_strProtocol is already set here, so we just skip over the protocol.
if (pos < len && buf[pos] == ':' ) if (pos < len && buf[pos] == (QChar)':' )
pos++; pos++;
else { // can't happen, the caller checked all this already else { // can't happen, the caller checked all this already
reset(); reset();
@ -776,9 +776,9 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
const bool alpha = isalpha((int)x); const bool alpha = isalpha((int)x);
if (alpha && len<2) if (alpha && len<2)
goto NodeErr; goto NodeErr;
if (alpha && buf[pos]==':' && (len==2 || (len>2 && (buf[pos+1]=='/' || buf[pos+1]=='\\')))) if (alpha && buf[pos]==(QChar)':' && (len==2 || (len>2 && (buf[pos+1]==(QChar)'/' || buf[pos+1]==(QChar)'\\'))))
#else #else
if ( x == '/' ) if ( x == (QChar)'/' )
#endif #endif
goto Node9; goto Node9;
if ( !isalpha( (int)x ) ) if ( !isalpha( (int)x ) )
@ -788,14 +788,14 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
// '.' is not currently accepted, because current KURL may be confused. // '.' is not currently accepted, because current KURL may be confused.
// Proceed with :// :/ or : // Proceed with :// :/ or :
while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) || while( pos < len && (isalpha((int)buf[pos]) || isdigit((int)buf[pos]) ||
buf[pos] == '+' || buf[pos] == '-')) pos++; buf[pos] == (QChar)'+' || buf[pos] == (QChar)'-')) pos++;
// Note that m_strProtocol is already set here, so we just skip over the protocol. // Note that m_strProtocol is already set here, so we just skip over the protocol.
if ( pos+2 < len && buf[pos] == ':' && buf[pos+1] == '/' && buf[pos+2] == '/' ) if ( pos+2 < len && buf[pos] == (QChar)':' && buf[pos+1] == (QChar)'/' && buf[pos+2] == (QChar)'/' )
{ {
pos += 3; pos += 3;
} }
else if (pos+1 < len && buf[pos] == ':' ) // Need to always compare length()-1 otherwise KURL passes "http:" as legal!! else if (pos+1 < len && buf[pos] == (QChar)':' ) // Need to always compare length()-1 otherwise KURL passes "http:" as legal!!
{ {
pos++; pos++;
start = pos; start = pos;
@ -810,13 +810,13 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
start = pos; start = pos;
// Node 4: Accept any amount of characters. // Node 4: Accept any amount of characters.
if (buf[pos] == '[') // An IPv6 host follows. if (buf[pos] == (QChar)'[') // An IPv6 host follows.
goto Node8; goto Node8;
// Terminate on / or @ or ? or # or " or ; or < // Terminate on / or @ or ? or # or " or ; or <
x = buf[pos]; x = buf[pos];
while( (x != ':') && (x != '@') && (x != '/') && (x != '?') && (x != '#') ) while( (x != (QChar)':') && (x != (QChar)'@') && (x != (QChar)'/') && (x != (QChar)'?') && (x != (QChar)'#') )
{ {
if ((x == '\"') || (x == ';') || (x == '<')) if ((x == (QChar)'\"') || (x == (QChar)';') || (x == (QChar)'<'))
badHostName = true; badHostName = true;
if (++pos == len) if (++pos == len)
break; break;
@ -830,13 +830,13 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
setHost(decode(TQString( buf + start, pos - start ), encoding_hint)); setHost(decode(TQString( buf + start, pos - start ), encoding_hint));
goto NodeOk; goto NodeOk;
} }
if ( x == '@' ) if ( x == (QChar)'@' )
{ {
m_strUser = decode(TQString( buf + start, pos - start ), encoding_hint); m_strUser = decode(TQString( buf + start, pos - start ), encoding_hint);
pos++; pos++;
goto Node7; goto Node7;
} }
else if ( (x == '/') || (x == '?') || (x == '#')) else if ( (x == (QChar)'/') || (x == (QChar)'?') || (x == (QChar)'#'))
{ {
if (badHostName) if (badHostName)
goto NodeErr; goto NodeErr;
@ -845,7 +845,7 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
start = pos; start = pos;
goto Node9; goto Node9;
} }
else if ( x != ':' ) else if ( x != (QChar)':' )
goto NodeErr; goto NodeErr;
m_strUser = decode(TQString( buf + start, pos - start ), encoding_hint); m_strUser = decode(TQString( buf + start, pos - start ), encoding_hint);
pos++; pos++;
@ -857,13 +857,13 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
// Node 6: Read everything until @, /, ? or # // Node 6: Read everything until @, /, ? or #
while( (pos < len) && while( (pos < len) &&
(buf[pos] != '@') && (buf[pos] != (QChar)'@') &&
(buf[pos] != '/') && (buf[pos] != (QChar)'/') &&
(buf[pos] != '?') && (buf[pos] != (QChar)'?') &&
(buf[pos] != '#')) pos++; (buf[pos] != (QChar)'#')) pos++;
// If we now have a '@' the ':' seperates user and password. // If we now have a '@' the ':' seperates user and password.
// Otherwise it seperates host and port. // Otherwise it seperates host and port.
if ( (pos == len) || (buf[pos] != '@') ) if ( (pos == len) || (buf[pos] != (QChar)'@') )
{ {
// Ok the : was used to separate host and port // Ok the : was used to separate host and port
if (badHostName) if (badHostName)
@ -877,10 +877,10 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
goto NodeOk; goto NodeOk;
// there is more after the digits // there is more after the digits
pos -= strlen(endptr); pos -= strlen(endptr);
if ((buf[pos] != '@') && if ((buf[pos] != (QChar)'@') &&
(buf[pos] != '/') && (buf[pos] != (QChar)'/') &&
(buf[pos] != '?') && (buf[pos] != (QChar)'?') &&
(buf[pos] != '#')) (buf[pos] != (QChar)'#'))
goto NodeErr; goto NodeErr;
start = pos; start = pos;
@ -895,7 +895,7 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
goto NodeErr; goto NodeErr;
Node8: Node8:
if (buf[pos] == '[') if (buf[pos] == (QChar)'[')
{ {
// IPv6 address // IPv6 address
start = ++pos; // Skip '[' start = ++pos; // Skip '['
@ -908,9 +908,9 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
// Node 8a: Read everything until ] or terminate // Node 8a: Read everything until ] or terminate
badHostName = false; badHostName = false;
x = buf[pos]; x = buf[pos];
while( (x != ']') ) while( (x != (QChar)']') )
{ {
if ((x == '\"') || (x == ';') || (x == '<')) if ((x == (QChar)'\"') || (x == (QChar)';') || (x == (QChar)'<'))
badHostName = true; badHostName = true;
if (++pos == len) if (++pos == len)
{ {
@ -934,9 +934,9 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
// Node 8b: Read everything until / : or terminate // Node 8b: Read everything until / : or terminate
badHostName = false; badHostName = false;
x = buf[pos]; x = buf[pos];
while( (x != ':') && (x != '@') && (x != '/') && (x != '?') && (x != '#') ) while( (x != (QChar)':') && (x != (QChar)'@') && (x != (QChar)'/') && (x != (QChar)'?') && (x != (QChar)'#') )
{ {
if ((x == '\"') || (x == ';') || (x == '<')) if ((x == (QChar)'\"') || (x == (QChar)';') || (x == (QChar)'<'))
badHostName = true; badHostName = true;
if (++pos == len) if (++pos == len)
break; break;
@ -952,12 +952,12 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
setHost(decode(TQString( buf + start, pos - start ), encoding_hint)); setHost(decode(TQString( buf + start, pos - start ), encoding_hint));
} }
x = buf[pos]; x = buf[pos];
if ( x == '/' || x == '#' || x == '?' ) if ( x == (QChar)'/' || x == (QChar)'#' || x == (QChar)'?' )
{ {
start = pos; start = pos;
goto Node9; goto Node9;
} }
else if ( x != ':' ) else if ( x != (QChar)':' )
goto NodeErr; goto NodeErr;
pos++; pos++;
@ -978,7 +978,7 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
Node9: // parse path until query or reference reached Node9: // parse path until query or reference reached
while( pos < len && buf[pos] != '#' && buf[pos]!='?' ) pos++; while( pos < len && buf[pos] != (QChar)'#' && buf[pos]!=(QChar)'?' ) pos++;
tmp = TQString( buf + start, pos - start ); tmp = TQString( buf + start, pos - start );
//kdDebug(126)<<" setting encoded path to:"<<tmp<<endl; //kdDebug(126)<<" setting encoded path to:"<<tmp<<endl;
@ -988,14 +988,14 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
goto NodeOk; goto NodeOk;
//Node10: // parse query or reference depending on what comes first //Node10: // parse query or reference depending on what comes first
delim = (buf[pos++]=='#'?'?':'#'); delim = (buf[pos++]==(QChar)'#'?(QChar)'?':(QChar)'#');
start = pos; start = pos;
while(pos < len && buf[pos]!=delim ) pos++; while(pos < len && buf[pos]!=delim ) pos++;
tmp = TQString(buf + start, pos - start); tmp = TQString(buf + start, pos - start);
if (delim=='#') if (delim==(QChar)'#')
_setQuery(tmp, encoding_hint); _setQuery(tmp, encoding_hint);
else else
m_strRef_encoded = tmp; m_strRef_encoded = tmp;
@ -1005,7 +1005,7 @@ void KURL::parseURL( const TQString& _url, int encoding_hint )
//Node11: // feed the rest into the remaining variable //Node11: // feed the rest into the remaining variable
tmp = TQString( buf + pos + 1, len - pos - 1); tmp = TQString( buf + pos + 1, len - pos - 1);
if (delim == '#') if (delim == (QChar)'#')
m_strRef_encoded = tmp; m_strRef_encoded = tmp;
else else
_setQuery(tmp, encoding_hint); _setQuery(tmp, encoding_hint);
@ -1219,7 +1219,7 @@ void KURL::setFileName( const TQString& _txt )
{ {
m_strRef_encoded = TQString::null; m_strRef_encoded = TQString::null;
int i = 0; int i = 0;
while( _txt[i] == '/' ) ++i; while( _txt[i] == (QChar)'/' ) ++i;
TQString tmp; TQString tmp;
if ( i ) if ( i )
tmp = _txt.mid( i ); tmp = _txt.mid( i );
@ -1271,7 +1271,7 @@ static TQString trailingSlash( int _trailing, const TQString &path )
else if ( _trailing == 1 ) else if ( _trailing == 1 )
{ {
int len = result.length(); int len = result.length();
if ( (len == 0) || (result[ len - 1 ] != '/') ) if ( (len == 0) || (result[ len - 1 ] != (QChar)'/') )
result += "/"; result += "/";
return result; return result;
} }
@ -1280,7 +1280,7 @@ static TQString trailingSlash( int _trailing, const TQString &path )
if ( result == "/" ) if ( result == "/" )
return result; return result;
int len = result.length(); int len = result.length();
while (len > 1 && result[ len - 1 ] == '/') while (len > 1 && result[ len - 1 ] == (QChar)'/')
{ {
len--; len--;
} }
@ -1687,14 +1687,14 @@ TQString KURL::fileName( bool _strip_trailing_slash ) const
if ( _strip_trailing_slash ) if ( _strip_trailing_slash )
{ {
while ( len >= 1 && path[ len - 1 ] == '/' ) while ( len >= 1 && path[ len - 1 ] == (QChar)'/' )
len--; len--;
} }
else if ( path[ len - 1 ] == '/' ) else if ( path[ len - 1 ] == (QChar)'/' )
return fname; return fname;
// Does the path only consist of '/' characters ? // Does the path only consist of '/' characters ?
if ( len == 1 && path[ 0 ] == '/' ) if ( len == 1 && path[ 0 ] == (QChar)'/' )
return fname; return fname;
// Skip last n slashes // Skip last n slashes
@ -1704,13 +1704,13 @@ TQString KURL::fileName( bool _strip_trailing_slash ) const
// This is hairy, we need the last unencoded slash. // This is hairy, we need the last unencoded slash.
// Count in the encoded string how many encoded slashes follow the last // Count in the encoded string how many encoded slashes follow the last
// unencoded one. // unencoded one.
int i = m_strPath_encoded.findRev( '/', len - 1 ); int i = m_strPath_encoded.findRev( (QChar)'/', len - 1 );
TQString fileName_encoded = m_strPath_encoded.mid(i+1); TQString fileName_encoded = m_strPath_encoded.mid(i+1);
n += fileName_encoded.contains("%2f", false); n += fileName_encoded.contains("%2f", false);
} }
int i = len; int i = len;
do { do {
i = path.findRev( '/', i - 1 ); i = path.findRev( (QChar)'/', i - 1 );
} }
while (--n && (i > 0)); while (--n && (i > 0));
@ -1749,14 +1749,14 @@ void KURL::addPath( const TQString& _txt )
int i = 0; int i = 0;
int len = m_strPath.length(); int len = m_strPath.length();
// Add the trailing '/' if it is missing // Add the trailing '/' if it is missing
if ( _txt[0] != '/' && ( len == 0 || m_strPath[ len - 1 ] != '/' ) ) if ( _txt[0] != (QChar)'/' && ( len == 0 || m_strPath[ len - 1 ] != (QChar)'/' ) )
m_strPath += "/"; m_strPath += "/";
// No double '/' characters // No double '/' characters
i = 0; i = 0;
if ( len != 0 && m_strPath[ len - 1 ] == '/' ) if ( len != 0 && m_strPath[ len - 1 ] == (QChar)'/' )
{ {
while( _txt[i] == '/' ) while( _txt[i] == (QChar)'/' )
++i; ++i;
} }
@ -1812,7 +1812,7 @@ bool KURL::cd( const TQString& _dir )
} }
// absolute path ? // absolute path ?
if ( _dir[0] == '/' ) if ( _dir[0] == (QChar)'/' )
{ {
m_strPath_encoded = TQString::null; m_strPath_encoded = TQString::null;
m_strPath = _dir; m_strPath = _dir;
@ -1822,7 +1822,7 @@ bool KURL::cd( const TQString& _dir )
} }
// Users home directory on the local disk ? // Users home directory on the local disk ?
if ( ( _dir[0] == '~' ) && ( m_strProtocol == fileProt )) if ( ( _dir[0] == (QChar)'~' ) && ( m_strProtocol == fileProt ))
{ {
m_strPath_encoded = TQString::null; m_strPath_encoded = TQString::null;
m_strPath = TQDir::homeDirPath(); m_strPath = TQDir::homeDirPath();
@ -2011,7 +2011,7 @@ void KURL::setDirectory( const TQString &dir)
void KURL::setQuery( const TQString &_txt, int encoding_hint) void KURL::setQuery( const TQString &_txt, int encoding_hint)
{ {
if (_txt[0] == '?') if (_txt[0] == (QChar)'?')
_setQuery( _txt.length() > 1 ? _txt.mid(1) : "" /*empty, not null*/, encoding_hint ); _setQuery( _txt.length() > 1 ? _txt.mid(1) : "" /*empty, not null*/, encoding_hint );
else else
_setQuery( _txt, encoding_hint ); _setQuery( _txt, encoding_hint );
@ -2249,7 +2249,7 @@ KURL KURL::fromPathOrURL( const TQString& text )
static TQString _relativePath(const TQString &base_dir, const TQString &path, bool &isParent) static TQString _relativePath(const TQString &base_dir, const TQString &path, bool &isParent)
{ {
TQString _base_dir(TQDir::cleanDirPath(base_dir)); TQString _base_dir(TQDir::cleanDirPath(base_dir));
TQString _path(TQDir::cleanDirPath(path.isEmpty() || (path[0] != '/') ? _base_dir+"/"+path : path)); TQString _path(TQDir::cleanDirPath(path.isEmpty() || (path[0] != (QChar)'/') ? _base_dir+"/"+path : path));
if (_base_dir.isEmpty()) if (_base_dir.isEmpty())
return _path; return _path;
@ -2274,7 +2274,7 @@ static TQString _relativePath(const TQString &base_dir, const TQString &path, bo
for(uint i = level; i < list2.count(); i++) for(uint i = level; i < list2.count(); i++)
result.append(list2[i]).append("/"); result.append(list2[i]).append("/");
if ((level < list2.count()) && (path[path.length()-1] != '/')) if ((level < list2.count()) && (path[path.length()-1] != (QChar)'/'))
result.truncate(result.length()-1); result.truncate(result.length()-1);
isParent = (level == list1.count()); isParent = (level == list1.count());

@ -93,7 +93,12 @@ void KBufferedSocket::close()
} }
} }
#ifdef USE_QT3
Q_LONG KBufferedSocket::bytesAvailable() const Q_LONG KBufferedSocket::bytesAvailable() const
#endif
#ifdef USE_QT4
qint64 KBufferedSocket::bytesAvailable() const
#endif
{ {
if (!d->input) if (!d->input)
return KStreamSocket::bytesAvailable(); return KStreamSocket::bytesAvailable();
@ -279,7 +284,12 @@ KIOBufferBase* KBufferedSocket::outputBuffer()
return d->output; return d->output;
} }
#ifdef USE_QT3
Q_ULONG KBufferedSocket::bytesToWrite() const Q_ULONG KBufferedSocket::bytesToWrite() const
#endif
#ifdef USE_QT4
qint64 KBufferedSocket::bytesToWrite() const
#endif
{ {
if (!d->output) if (!d->output)
return 0; return 0;

@ -98,7 +98,12 @@ public:
/** /**
* Make use of the buffers. * Make use of the buffers.
*/ */
#ifdef USE_QT3
virtual Q_LONG bytesAvailable() const; virtual Q_LONG bytesAvailable() const;
#endif
#ifdef USE_QT4
virtual qint64 bytesAvailable() const;
#endif
/** /**
* Make use of buffers. * Make use of buffers.
@ -177,7 +182,12 @@ public:
/** /**
* Returns the length of the output buffer. * Returns the length of the output buffer.
*/ */
#ifdef USE_QT3
virtual Q_ULONG bytesToWrite() const; virtual Q_ULONG bytesToWrite() const;
#endif
#ifdef USE_QT4
virtual qint64 bytesToWrite() const;
#endif
/** /**
* Closes the socket and discards any output data that had been buffered * Closes the socket and discards any output data that had been buffered
@ -244,7 +254,12 @@ public:
* which required a call to reset() in order to be able to connect again * which required a call to reset() in order to be able to connect again
* using the same device. This is not necessary in KBufferedSocket any more. * using the same device. This is not necessary in KBufferedSocket any more.
*/ */
#ifdef USE_QT3
inline void reset() inline void reset()
#endif
#ifdef USE_QT4
inline bool reset()
#endif
{ closeNow(); } { closeNow(); }
}; };

@ -278,7 +278,12 @@ void KClientSocketBase::close()
} }
// This function is unlike all the others because it is const // This function is unlike all the others because it is const
#ifdef USE_QT3
Q_LONG KClientSocketBase::bytesAvailable() const Q_LONG KClientSocketBase::bytesAvailable() const
#endif
#ifdef USE_QT4
qint64 KClientSocketBase::bytesAvailable() const
#endif
{ {
return socketDevice()->bytesAvailable(); return socketDevice()->bytesAvailable();
} }

@ -292,7 +292,12 @@ public:
* Returns the number of bytes available on this socket. * Returns the number of bytes available on this socket.
* Reimplemented from KSocketBase. * Reimplemented from KSocketBase.
*/ */
#ifdef USE_QT3
virtual Q_LONG bytesAvailable() const; virtual Q_LONG bytesAvailable() const;
#endif
#ifdef USE_QT4
virtual qint64 bytesAvailable() const;
#endif
/** /**
* Waits for more data. Reimplemented from KSocketBase. * Waits for more data. Reimplemented from KSocketBase.

@ -72,7 +72,7 @@ using namespace KNetwork::Internal;
///////////////////////////////////////////// /////////////////////////////////////////////
// class KResolverEntry // class KResolverEntry
class KNetwork::KResolverEntryPrivate: public QShared class KNetwork::KResolverEntryPrivate: public TQShared
{ {
public: public:
KSocketAddress addr; KSocketAddress addr;

@ -532,7 +532,12 @@ public:
* Returns the number of bytes available for reading without * Returns the number of bytes available for reading without
* blocking. * blocking.
*/ */
#ifdef USE_QT3
virtual Q_LONG bytesAvailable() const = 0; virtual Q_LONG bytesAvailable() const = 0;
#endif
#ifdef USE_QT4
virtual qint64 bytesAvailable() const = 0;
#endif
/** /**
* Waits up to @p msecs for more data to be available on this socket. * Waits up to @p msecs for more data to be available on this socket.

@ -364,7 +364,12 @@ bool KSocketDevice::disconnect()
return true; // all is well return true; // all is well
} }
#ifdef USE_QT3
Q_LONG KSocketDevice::bytesAvailable() const Q_LONG KSocketDevice::bytesAvailable() const
#endif
#ifdef USE_QT4
qint64 KSocketDevice::bytesAvailable() const
#endif
{ {
if (m_sockfd == -1) if (m_sockfd == -1)
return -1; // there's nothing to read in a closed socket return -1; // there's nothing to read in a closed socket

@ -198,7 +198,12 @@ public:
/** /**
* Returns the number of bytes available for reading without blocking. * Returns the number of bytes available for reading without blocking.
*/ */
#ifdef USE_QT3
virtual Q_LONG bytesAvailable() const; virtual Q_LONG bytesAvailable() const;
#endif
#ifdef USE_QT4
virtual qint64 bytesAvailable() const;
#endif
/** /**
* Waits up to @p msecs for more data to be available on this socket. * Waits up to @p msecs for more data to be available on this socket.

@ -441,7 +441,7 @@ public:
{ {
// Scale, if needed // Scale, if needed
if(image.width() != (int) w || image.height() != (int) h) if(image.width() != (int) w || image.height() != (int) h)
image = image.smoothScale((int) w, (int) h, TQImage::ScaleFree); image = image.smoothScale((int) w, (int) h, TQImage_ScaleFree);
m_engine->painter()->drawImage(x, y, image); m_engine->painter()->drawImage(x, y, image);
} }

@ -516,6 +516,25 @@ int KStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget* /* widget */) c
return value; return value;
} }
// -----------------------------------------------------------------------------
#ifdef USE_QT4
void KStyle::drawPrimitive( ControlElement pe,
TQPainter* p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags,
const TQStyleOption& opt ) const
{
// FIXME:
// What should "widget" be in actuality? How should I get it? From where?
// Almost certainly it should not be null!
TQWidget *widget = 0;
drawControl(pe, p, widget, r, cg, flags, opt);
}
#endif // USE_QT4
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -999,7 +1018,7 @@ int KStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
case PM_SliderControlThickness: { case PM_SliderControlThickness: {
const TQSlider* slider = (const TQSlider*)widget; const TQSlider* slider = (const TQSlider*)widget;
TQSlider::TickSetting ts = slider->tickmarks(); TQSlider::TickSetting ts = slider->tickmarks();
int thickness = (slider->orientation() == Horizontal) ? int thickness = (slider->orientation() == TQ_Horizontal) ?
slider->height() : slider->width(); slider->height() : slider->width();
switch (ts) { switch (ts) {
case TQSlider::NoMarks: // Use total area. case TQSlider::NoMarks: // Use total area.

@ -281,6 +281,17 @@ class KDEFX_EXPORT KStyle: public QCommonStyle
SFlags flags = Style_Default, SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::TQSO_Default ) const; const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
#ifdef USE_QT4
void drawPrimitive( ControlElement pe,
TQPainter* p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::TQSO_Default ) const;
#endif // USE_QT4
void drawControl( ControlElement element, void drawControl( ControlElement element,
TQPainter* p, TQPainter* p,
const TQWidget* widget, const TQWidget* widget,

Loading…
Cancel
Save