summaryrefslogtreecommitdiffstats
path: root/libkonq/konq_drag.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:33:34 +0000
commitc663b6440964f6ac48027143ac9e63298991f9d0 (patch)
tree6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /libkonq/konq_drag.cc
parenta061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff)
downloadtdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz
tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkonq/konq_drag.cc')
-rw-r--r--libkonq/konq_drag.cc102
1 files changed, 51 insertions, 51 deletions
diff --git a/libkonq/konq_drag.cc b/libkonq/konq_drag.cc
index 3333061c2..0fdca5722 100644
--- a/libkonq/konq_drag.cc
+++ b/libkonq/konq_drag.cc
@@ -21,8 +21,8 @@
#include <kdebug.h>
#include <kurldrag.h>
-KonqIconDrag::KonqIconDrag( QWidget * dragSource, const char* name )
- : QIconDrag( dragSource, name ),
+KonqIconDrag::KonqIconDrag( TQWidget * dragSource, const char* name )
+ : TQIconDrag( dragSource, name ),
m_bCutSelection( false )
{
}
@@ -47,31 +47,31 @@ const char* KonqIconDrag::format( int i ) const
else return 0;
}
-QByteArray KonqIconDrag::encodedData( const char* mime ) const
+TQByteArray KonqIconDrag::encodedData( const char* mime ) const
{
- QByteArray a;
- QCString mimetype( mime );
+ TQByteArray a;
+ TQCString mimetype( mime );
if ( mimetype == "application/x-qiconlist" )
- a = QIconDrag::encodedData( mime );
+ a = TQIconDrag::encodedData( mime );
else if ( mimetype == "text/uri-list" ) {
- QCString s = urls.join( "\r\n" ).latin1();
+ TQCString s = urls.join( "\r\n" ).latin1();
if( urls.count() > 0 )
s.append( "\r\n" );
a.resize( s.length() + 1 ); // trailing zero
memcpy( a.data(), s.data(), s.length() + 1 );
}
else if ( mimetype == "application/x-kde-cutselection" ) {
- QCString s ( m_bCutSelection ? "1" : "0" );
+ TQCString s ( m_bCutSelection ? "1" : "0" );
a.resize( s.length() + 1 ); // trailing zero
memcpy( a.data(), s.data(), s.length() + 1 );
}
else if ( mimetype == "text/plain" ) {
if (!urls.isEmpty())
{
- QStringList uris;
- for (QStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it)
+ TQStringList uris;
+ for (TQStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it)
uris.append(KURLDrag::stringToUrl((*it).latin1()).prettyURL());
- QCString s = uris.join( "\n" ).local8Bit();
+ TQCString s = uris.join( "\n" ).local8Bit();
if( uris.count() > 1 )
s.append( "\n" );
a.resize( s.length()); // no trailing zero in clipboard text
@@ -82,12 +82,12 @@ QByteArray KonqIconDrag::encodedData( const char* mime ) const
{
if (!urls.isEmpty())
{
- QStringList uris;
+ TQStringList uris;
- for (QStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it)
+ for (TQStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it)
uris.append(KURLDrag::stringToUrl((*it).latin1()).url(0, 4)); // 4 for latin1
- QCString s = uris.join( "\n" ).latin1();
+ TQCString s = uris.join( "\n" ).latin1();
if( uris.count() > 1 )
s.append( "\n" );
a.resize( s.length());
@@ -98,10 +98,10 @@ QByteArray KonqIconDrag::encodedData( const char* mime ) const
{
if (!urls.isEmpty())
{
- QStringList uris;
- for (QStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it)
+ TQStringList uris;
+ for (TQStringList::ConstIterator it = urls.begin(); it != urls.end(); ++it)
uris.append(KURLDrag::stringToUrl((*it).latin1()).prettyURL());
- QCString s = uris.join( "\n" ).utf8();
+ TQCString s = uris.join( "\n" ).utf8();
if( uris.count() > 1 )
s.append( "\n" );
a.resize( s.length());
@@ -111,29 +111,29 @@ QByteArray KonqIconDrag::encodedData( const char* mime ) const
return a;
}
-bool KonqIconDrag::canDecode( const QMimeSource* e )
+bool KonqIconDrag::canDecode( const TQMimeSource* e )
{
return e->provides( "application/x-qiconlist" ) ||
e->provides( "text/uri-list" ) ||
e->provides( "application/x-kde-cutselection" );
}
-void KonqIconDrag::append( const QIconDragItem &item, const QRect &pr,
- const QRect &tr, const QString &url )
+void KonqIconDrag::append( const TQIconDragItem &item, const TQRect &pr,
+ const TQRect &tr, const TQString &url )
{
- QIconDrag::append( item, pr, tr );
+ TQIconDrag::append( item, pr, tr );
urls.append( url );
}
-KonqIconDrag2::KonqIconDrag2( QWidget * dragSource )
+KonqIconDrag2::KonqIconDrag2( TQWidget * dragSource )
: KonqIconDrag( dragSource )
{
}
-void KonqIconDrag2::append( const QIconDragItem &item, const QRect &pr,
- const QRect &tr, const QString& url, const KURL &mostLocalURL )
+void KonqIconDrag2::append( const TQIconDragItem &item, const TQRect &pr,
+ const TQRect &tr, const TQString& url, const KURL &mostLocalURL )
{
- QString mostLocalURLStr = KURLDrag::urlToString(mostLocalURL);
+ TQString mostLocalURLStr = KURLDrag::urlToString(mostLocalURL);
m_kdeURLs.append( url );
KonqIconDrag::append( item, pr, tr, mostLocalURLStr );
}
@@ -145,15 +145,15 @@ const char* KonqIconDrag2::format( int i ) const
return KonqIconDrag::format( i );
}
-QByteArray KonqIconDrag2::encodedData( const char* mime ) const
+TQByteArray KonqIconDrag2::encodedData( const char* mime ) const
{
- QCString mimetype( mime );
+ TQCString mimetype( mime );
if ( mimetype == "application/x-kde-urilist" )
{
- QByteArray a;
+ TQByteArray a;
int c=0;
- for (QStringList::ConstIterator it = m_kdeURLs.begin(); it != m_kdeURLs.end(); ++it) {
- QCString url = (*it).utf8();
+ for (TQStringList::ConstIterator it = m_kdeURLs.begin(); it != m_kdeURLs.end(); ++it) {
+ TQCString url = (*it).utf8();
int l = url.length();
a.resize(c+l+2);
memcpy(a.data()+c, url.data(), l);
@@ -169,10 +169,10 @@ QByteArray KonqIconDrag2::encodedData( const char* mime ) const
//
-KonqDrag * KonqDrag::newDrag( const KURL::List & urls, bool cut, QWidget * dragSource, const char* name )
+KonqDrag * KonqDrag::newDrag( const KURL::List & urls, bool cut, TQWidget * dragSource, const char* name )
{
// See KURLDrag::newDrag
- QStrList uris;
+ TQStrList uris;
KURL::List::ConstIterator uit = urls.begin();
KURL::List::ConstIterator uEnd = urls.end();
// Get each URL encoded in utf8 - and since we get it in escaped
@@ -183,25 +183,25 @@ KonqDrag * KonqDrag::newDrag( const KURL::List & urls, bool cut, QWidget * dragS
}
// urls must be already checked to have hostname in file URLs
-KonqDrag::KonqDrag( const QStrList & urls, bool cut, QWidget * dragSource, const char* name )
- : QUriDrag( urls, dragSource, name ),
+KonqDrag::KonqDrag( const TQStrList & urls, bool cut, TQWidget * dragSource, const char* name )
+ : TQUriDrag( urls, dragSource, name ),
m_bCutSelection( cut ), m_urls( urls )
{}
// urls must be already checked to have hostname in file URLs
KonqDrag::KonqDrag( const KURL::List & urls, const KURL::List& mostLocalUrls,
- bool cut, QWidget * dragSource )
- : QUriDrag( dragSource ),
+ bool cut, TQWidget * dragSource )
+ : TQUriDrag( dragSource ),
m_bCutSelection( cut )
{
- QStrList uris;
+ TQStrList uris;
KURL::List::ConstIterator uit = urls.begin();
KURL::List::ConstIterator uEnd = urls.end();
// Get each URL encoded in utf8 - and since we get it in escaped
// form on top of that, .latin1() is fine.
for ( ; uit != uEnd ; ++uit )
uris.append( KURLDrag::urlToString( *uit ).latin1() );
- setUris( uris ); // we give the KDE uris to QUriDrag. TODO: do the opposite in KDE4 and add a m_mostLocalUris member.
+ setUris( uris ); // we give the KDE uris to TQUriDrag. TODO: do the opposite in KDE4 and add a m_mostLocalUris member.
uit = mostLocalUrls.begin();
uEnd = mostLocalUrls.end();
@@ -223,15 +223,15 @@ const char* KonqDrag::format( int i ) const
else return 0;
}
-QByteArray KonqDrag::encodedData( const char* mime ) const
+TQByteArray KonqDrag::encodedData( const char* mime ) const
{
- QByteArray a;
- QCString mimetype( mime );
+ TQByteArray a;
+ TQCString mimetype( mime );
if ( mimetype == "text/uri-list" )
{
- // Code taken from QUriDrag::setUris
+ // Code taken from TQUriDrag::setUris
int c=0;
- for (QStrListIterator it(m_urls); *it; ++it) {
+ for (TQStrListIterator it(m_urls); *it; ++it) {
int l = qstrlen(*it);
a.resize(c+l+2);
memcpy(a.data()+c,*it,l);
@@ -243,20 +243,20 @@ QByteArray KonqDrag::encodedData( const char* mime ) const
}
else if ( mimetype == "application/x-kde-urilist" )
{
- return QUriDrag::encodedData( "text/uri-list" );
+ return TQUriDrag::encodedData( "text/uri-list" );
}
else if ( mimetype == "application/x-kde-cutselection" )
{
- QCString s ( m_bCutSelection ? "1" : "0" );
+ TQCString s ( m_bCutSelection ? "1" : "0" );
a.resize( s.length() + 1 ); // trailing zero
memcpy( a.data(), s.data(), s.length() + 1 );
}
else if ( mimetype == "text/plain" )
{
- QStringList uris;
- for (QStrListIterator it(m_urls); *it; ++it)
+ TQStringList uris;
+ for (TQStrListIterator it(m_urls); *it; ++it)
uris.append(KURLDrag::stringToUrl(*it).prettyURL());
- QCString s = uris.join( "\n" ).local8Bit();
+ TQCString s = uris.join( "\n" ).local8Bit();
if( uris.count() > 1 )
s.append( "\n" );
a.resize( s.length() + 1 ); // trailing zero
@@ -269,14 +269,14 @@ QByteArray KonqDrag::encodedData( const char* mime ) const
// Used for KonqIconDrag too
-bool KonqDrag::decodeIsCutSelection( const QMimeSource *e )
+bool KonqDrag::decodeIsCutSelection( const TQMimeSource *e )
{
- QByteArray a = e->encodedData( "application/x-kde-cutselection" );
+ TQByteArray a = e->encodedData( "application/x-kde-cutselection" );
if ( a.isEmpty() )
return false;
else
{
- kdDebug(1203) << "KonqDrag::decodeIsCutSelection : a=" << QCString(a.data(), a.size() + 1) << endl;
+ kdDebug(1203) << "KonqDrag::decodeIsCutSelection : a=" << TQCString(a.data(), a.size() + 1) << endl;
return (a.at(0) == '1'); // true if 1
}
}