Rename tqencodedData to fix bindings

pull/16/head
Timothy Pearson 13 years ago
parent d4e11a5f48
commit ca1f1a08ec

@ -54,8 +54,8 @@ KBookmarkDrag::KBookmarkDrag( const TQValueList<KBookmark> & bookmarks, const TQ
: TQUriDrag( urls, dragSource, name ), m_bookmarks( bookmarks ), m_doc("xbel") : TQUriDrag( urls, dragSource, name ), m_bookmarks( bookmarks ), m_doc("xbel")
{ {
// We need to create the XML for this drag right now and not // We need to create the XML for this drag right now and not
// in tqencodedData because when cutting a folder, the children // in encodedData because when cutting a folder, the children
// wouldn't be part of the bookmarks anymore, when tqencodedData // wouldn't be part of the bookmarks anymore, when encodedData
// is requested. // is requested.
TQDomElement elem = m_doc.createElement("xbel"); TQDomElement elem = m_doc.createElement("xbel");
m_doc.appendChild( elem ); m_doc.appendChild( elem );
@ -76,16 +76,16 @@ const char* KBookmarkDrag::format( int i ) const
else return 0; else return 0;
} }
TQByteArray KBookmarkDrag::tqencodedData( const char* mime ) const TQByteArray KBookmarkDrag::encodedData( const char* mime ) const
{ {
TQByteArray a; TQByteArray a;
TQCString mimetype( mime ); TQCString mimetype( mime );
if ( mimetype == "text/uri-list" ) if ( mimetype == "text/uri-list" )
return TQUriDrag::tqencodedData( mime ); return TQUriDrag::encodedData( mime );
else if ( mimetype == "application/x-xbel" ) else if ( mimetype == "application/x-xbel" )
{ {
a = m_doc.toCString(); a = m_doc.toCString();
//kdDebug(7043) << "KBookmarkDrag::tqencodedData " << m_doc.toCString() << endl; //kdDebug(7043) << "KBookmarkDrag::encodedData " << m_doc.toCString() << endl;
} }
else if ( mimetype == "text/plain" ) else if ( mimetype == "text/plain" )
{ {
@ -117,7 +117,7 @@ TQValueList<KBookmark> KBookmarkDrag::decode( const TQMimeSource * e )
TQValueList<KBookmark> bookmarks; TQValueList<KBookmark> bookmarks;
if ( e->provides("application/x-xbel") ) if ( e->provides("application/x-xbel") )
{ {
TQByteArray s( e->tqencodedData("application/x-xbel") ); TQByteArray s( e->encodedData("application/x-xbel") );
//kdDebug(7043) << "KBookmarkDrag::decode s=" << TQCString(s) << endl; //kdDebug(7043) << "KBookmarkDrag::decode s=" << TQCString(s) << endl;
TQDomDocument doc; TQDomDocument doc;
doc.setContent( s ); doc.setContent( s );

@ -43,7 +43,7 @@ public:
virtual ~KBookmarkDrag() {} virtual ~KBookmarkDrag() {}
virtual const char* format( int i ) const; virtual const char* format( int i ) const;
virtual TQByteArray tqencodedData( const char* mime ) const; virtual TQByteArray encodedData( const char* mime ) const;
static bool canDecode( const TQMimeSource * e ); static bool canDecode( const TQMimeSource * e );
static TQValueList<KBookmark> decode( const TQMimeSource * e ); static TQValueList<KBookmark> decode( const TQMimeSource * e );

@ -137,7 +137,7 @@ static KIO::CopyJob* chooseAndPaste( const KURL& u, TQMimeSource* data,
if ( clipboard ) { if ( clipboard ) {
data = TQApplication::tqclipboard()->data(); data = TQApplication::tqclipboard()->data();
} }
const TQByteArray ba = data->tqencodedData( chosenFormat ); const TQByteArray ba = data->encodedData( chosenFormat );
return pasteDataAsyncTo( new_url, ba ); return pasteDataAsyncTo( new_url, ba );
} }
#endif #endif
@ -147,7 +147,7 @@ KIO_EXPORT bool KIO::isClipboardEmpty()
{ {
#ifndef QT_NO_MIMECLIPBOARD #ifndef QT_NO_MIMECLIPBOARD
TQMimeSource *data = TQApplication::tqclipboard()->data(); TQMimeSource *data = TQApplication::tqclipboard()->data();
if ( data->provides( "text/uri-list" ) && data->tqencodedData( "text/uri-list" ).size() > 0 ) if ( data->provides( "text/uri-list" ) && data->encodedData( "text/uri-list" ).size() > 0 )
return false; return false;
#else #else
// Happens with some versions of Qt Embedded... :/ // Happens with some versions of Qt Embedded... :/
@ -194,7 +194,7 @@ KIO::CopyJob* KIO::pasteMimeSource( TQMimeSource* data, const KURL& dest_url,
if ( formats.size() > 1 ) { if ( formats.size() > 1 ) {
return chooseAndPaste( dest_url, data, formats, dialogText, widget, clipboard ); return chooseAndPaste( dest_url, data, formats, dialogText, widget, clipboard );
} }
ba = data->tqencodedData( formats.first() ); ba = data->encodedData( formats.first() );
} }
if ( ba.size() == 0 ) if ( ba.size() == 0 )
{ {

@ -56,7 +56,7 @@ public:
while ( (format = src->format( i++ )) ) while ( (format = src->format( i++ )) )
{ {
byteArray = new TQByteArray(); byteArray = new TQByteArray();
*byteArray = src->tqencodedData( format ).copy(); *byteArray = src->encodedData( format ).copy();
m_data.append( byteArray ); m_data.append( byteArray );
m_formats.append( format ); m_formats.append( format );
} }
@ -74,7 +74,7 @@ public:
virtual bool provides( const char *mimeType ) const { virtual bool provides( const char *mimeType ) const {
return ( m_formats.find( mimeType ) > -1 ); return ( m_formats.find( mimeType ) > -1 );
} }
virtual TQByteArray tqencodedData( const char *format ) const virtual TQByteArray encodedData( const char *format ) const
{ {
int index = m_formats.find( format ); int index = m_formats.find( format );
if ( index > -1 ) if ( index > -1 )

@ -39,9 +39,9 @@ void KMultipleDrag::addDragObject( TQDragObject *dragObject )
m_numberFormats.append( i ); // e.g. if it supports two formats, 0 and 1, store 2. m_numberFormats.append( i ); // e.g. if it supports two formats, 0 and 1, store 2.
} }
TQByteArray KMultipleDrag::tqencodedData( const char *mime ) const TQByteArray KMultipleDrag::encodedData( const char *mime ) const
{ {
//kdDebug() << "KMultipleDrag::tqencodedData " << mime << endl; //kdDebug() << "KMultipleDrag::encodedData " << mime << endl;
// Iterate over the drag objects, and find the format in the right one // Iterate over the drag objects, and find the format in the right one
TQPtrListIterator<TQDragObject> it( m_dragObjects ); TQPtrListIterator<TQDragObject> it( m_dragObjects );
for ( ; it.current(); ++it ) for ( ; it.current(); ++it )
@ -49,7 +49,7 @@ TQByteArray KMultipleDrag::tqencodedData( const char *mime ) const
for ( int i = 0; it.current()->format( i ); ++i ) for ( int i = 0; it.current()->format( i ); ++i )
{ {
if ( ::qstrcmp( it.current()->format( i ), mime ) == 0 ) if ( ::qstrcmp( it.current()->format( i ), mime ) == 0 )
return it.current()->tqencodedData( mime ); return it.current()->encodedData( mime );
} }
} }
return TQByteArray(); return TQByteArray();

@ -80,7 +80,7 @@ public:
* @return the data, or a null byte array if not found * @return the data, or a null byte array if not found
* @reimp * @reimp
*/ */
virtual TQByteArray tqencodedData( const char *mime ) const; virtual TQByteArray encodedData( const char *mime ) const;
/** /**
* Returns the @p i'th supported format, or 0. * Returns the @p i'th supported format, or 0.

@ -87,7 +87,7 @@ KURLDrag * KURLDrag::newDrag( const KURL::List &urls, const TQMap<TQString, TQSt
bool KURLDrag::decode( const TQMimeSource *e, KURL::List &uris ) bool KURLDrag::decode( const TQMimeSource *e, KURL::List &uris )
{ {
if ( e->provides( "application/x-kde-urilist" ) ) { if ( e->provides( "application/x-kde-urilist" ) ) {
TQByteArray payload = e->tqencodedData( "application/x-kde-urilist" ); TQByteArray payload = e->encodedData( "application/x-kde-urilist" );
if ( payload.size() ) { if ( payload.size() ) {
uint c=0; uint c=0;
const char* d = payload.data(); const char* d = payload.data();
@ -128,7 +128,7 @@ bool KURLDrag::decode( const TQMimeSource *e, KURL::List &uris, TQMap<TQString,T
{ {
if ( decode( e, uris ) ) // first decode the URLs (see above) if ( decode( e, uris ) ) // first decode the URLs (see above)
{ {
TQByteArray ba = e->tqencodedData( "application/x-kio-metadata" ); TQByteArray ba = e->encodedData( "application/x-kio-metadata" );
if ( ba.size() ) if ( ba.size() )
{ {
TQString s = ba.data(); TQString s = ba.data();
@ -187,12 +187,12 @@ const char * KURLDrag::format( int i ) const
else return 0; else return 0;
} }
TQByteArray KURLDrag::tqencodedData( const char* mime ) const TQByteArray KURLDrag::encodedData( const char* mime ) const
{ {
TQByteArray a; TQByteArray a;
TQCString mimetype( mime ); TQCString mimetype( mime );
if ( mimetype == "text/uri-list" ) if ( mimetype == "text/uri-list" )
return TQUriDrag::tqencodedData( mime ); return TQUriDrag::encodedData( mime );
else if ( mimetype == "text/plain" ) else if ( mimetype == "text/plain" )
{ {
TQStringList uris; TQStringList uris;

@ -145,7 +145,7 @@ public:
/// @reimp /// @reimp
virtual const char * format( int i ) const; virtual const char * format( int i ) const;
/// @reimp /// @reimp
virtual TQByteArray tqencodedData( const char* mime ) const; virtual TQByteArray encodedData( const char* mime ) const;
protected: protected:
/** /**

@ -40,7 +40,7 @@ void
KColorDrag::setColor( const TQColor &color) KColorDrag::setColor( const TQColor &color)
{ {
TQColorDrag tmp(color, 0, 0); TQColorDrag tmp(color, 0, 0);
setEncodedData(tmp.tqencodedData(color_mime_string)); setEncodedData(tmp.encodedData(color_mime_string));
TQPixmap colorpix( 25, 20); TQPixmap colorpix( 25, 20);
colorpix.fill( color); colorpix.fill( color);
@ -59,7 +59,7 @@ const char *KColorDrag::format(int i) const
return TQStoredDrag::format(i); return TQStoredDrag::format(i);
} }
TQByteArray KColorDrag::tqencodedData ( const char * m ) const TQByteArray KColorDrag::encodedData ( const char * m ) const
{ {
if (!qstrcmp(m, text_mime_string) ) if (!qstrcmp(m, text_mime_string) )
{ {
@ -69,7 +69,7 @@ TQByteArray KColorDrag::tqencodedData ( const char * m ) const
((TQByteArray&)result).resize(result.length()); ((TQByteArray&)result).resize(result.length());
return result; return result;
} }
return TQStoredDrag::tqencodedData(m); return TQStoredDrag::encodedData(m);
} }
bool bool
@ -91,7 +91,7 @@ KColorDrag::decode( TQMimeSource *e, TQColor &color)
if (TQColorDrag::decode(e, color)) if (TQColorDrag::decode(e, color))
return true; return true;
TQByteArray data = e->tqencodedData( text_mime_string); TQByteArray data = e->encodedData( text_mime_string);
TQString colorName = TQString::tqfromLatin1(data.data(), data.size()); TQString colorName = TQString::tqfromLatin1(data.data(), data.size());
if ((colorName.length() < 4) || (colorName[0] != '#')) if ((colorName.length() < 4) || (colorName[0] != '#'))
return false; return false;

@ -48,7 +48,7 @@ public:
virtual ~KColorDrag() {} virtual ~KColorDrag() {}
virtual const char *format(int i) const; virtual const char *format(int i) const;
virtual TQByteArray tqencodedData ( const char * m ) const; virtual TQByteArray encodedData ( const char * m ) const;
/** /**
* Sets the color of the drag to @p col. * Sets the color of the drag to @p col.

@ -155,7 +155,7 @@ public:
if (!e) if (!e)
return false; return false;
TQByteArray data = e->tqencodedData(TOOLBARITEMMIMETYPE); TQByteArray data = e->encodedData(TOOLBARITEMMIMETYPE);
if ( data.isEmpty() ) if ( data.isEmpty() )
return false; return false;

Loading…
Cancel
Save