diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kio/bookmarks | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kio/bookmarks')
29 files changed, 824 insertions, 824 deletions
diff --git a/kio/bookmarks/dptrtemplate.h b/kio/bookmarks/dptrtemplate.h index 26fd0b3a9..2a69d6a54 100644 --- a/kio/bookmarks/dptrtemplate.h +++ b/kio/bookmarks/dptrtemplate.h @@ -22,7 +22,7 @@ #ifndef __dptrtemplate_h__ #define __dptrtemplate_h__ -#include <qptrdict.h> +#include <tqptrdict.h> template<class Instance, class PrivateData> class dPtrTemplate { @@ -31,7 +31,7 @@ public: { if ( !d_ptr ) { cleanup_d_ptr(); - d_ptr = new QPtrDict<PrivateData>; + d_ptr = new TQPtrDict<PrivateData>; qAddPostRoutine( cleanup_d_ptr ); } PrivateData* ret = d_ptr->find( (void*) instance ); @@ -51,7 +51,7 @@ private: { delete d_ptr; } - static QPtrDict<PrivateData>* d_ptr; + static TQPtrDict<PrivateData>* d_ptr; }; #endif diff --git a/kio/bookmarks/kbookmark.cc b/kio/bookmarks/kbookmark.cc index 59cf10db3..44b8b496c 100644 --- a/kio/bookmarks/kbookmark.cc +++ b/kio/bookmarks/kbookmark.cc @@ -20,7 +20,7 @@ */ #include "kbookmark.h" -#include <qvaluestack.h> +#include <tqvaluestack.h> #include <kdebug.h> #include <kmimetype.h> #include <kstringhandler.h> @@ -33,16 +33,16 @@ #include <kbookmarkmanager.h> KBookmarkGroup::KBookmarkGroup() - : KBookmark( QDomElement() ) + : KBookmark( TQDomElement() ) { } -KBookmarkGroup::KBookmarkGroup( QDomElement elem ) +KBookmarkGroup::KBookmarkGroup( TQDomElement elem ) : KBookmark(elem) { } -QString KBookmarkGroup::groupAddress() const +TQString KBookmarkGroup::groupAddress() const { if (m_address.isEmpty()) m_address = address(); @@ -55,7 +55,7 @@ bool KBookmarkGroup::isOpen() const } // Returns first element node equal to or after node n -static QDomElement firstElement(QDomNode n) +static TQDomElement firstElement(TQDomNode n) { while(!n.isNull() && !n.isElement()) n = n.nextSibling(); @@ -63,7 +63,7 @@ static QDomElement firstElement(QDomNode n) } // Returns first element node equal to or before node n -static QDomElement lastElement(QDomNode n) +static TQDomElement lastElement(TQDomNode n) { while(!n.isNull() && !n.isElement()) n = n.previousSibling(); @@ -85,18 +85,18 @@ KBookmark KBookmarkGroup::next( const KBookmark & current ) const return KBookmark( nextKnownTag( firstElement(current.element.nextSibling()), true ) ); } -// KDE4: Change QDomElement to QDomNode so that we can get rid of +// KDE4: Change TQDomElement to TQDomNode so that we can get rid of // firstElement() and lastElement() -QDomElement KBookmarkGroup::nextKnownTag( QDomElement start, bool goNext ) const +TQDomElement KBookmarkGroup::nextKnownTag( TQDomElement start, bool goNext ) const { - static const QString & bookmark = KGlobal::staticQString("bookmark"); - static const QString & folder = KGlobal::staticQString("folder"); - static const QString & separator = KGlobal::staticQString("separator"); + static const TQString & bookmark = KGlobal::staticQString("bookmark"); + static const TQString & folder = KGlobal::staticQString("folder"); + static const TQString & separator = KGlobal::staticQString("separator"); - for( QDomNode n = start; !n.isNull(); ) + for( TQDomNode n = start; !n.isNull(); ) { - QDomElement elem = n.toElement(); - QString tag = elem.tagName(); + TQDomElement elem = n.toElement(); + TQString tag = elem.tagName(); if (tag == folder || tag == bookmark || tag == separator) return elem; if (goNext) @@ -104,30 +104,30 @@ QDomElement KBookmarkGroup::nextKnownTag( QDomElement start, bool goNext ) const else n = n.previousSibling(); } - return QDomElement(); + return TQDomElement(); } -KBookmarkGroup KBookmarkGroup::createNewFolder( KBookmarkManager* mgr, const QString & text, bool emitSignal ) +KBookmarkGroup KBookmarkGroup::createNewFolder( KBookmarkManager* mgr, const TQString & text, bool emitSignal ) { - QString txt( text ); + TQString txt( text ); if ( text.isEmpty() ) { bool ok; - QString caption = parentGroup().fullText().isEmpty() ? + TQString caption = parentGroup().fullText().isEmpty() ? i18n( "Create New Bookmark Folder" ) : i18n( "Create New Bookmark Folder in %1" ) .arg( parentGroup().text() ); txt = KInputDialog::getText( caption, i18n( "New folder:" ), - QString::null, &ok ); + TQString::null, &ok ); if ( !ok ) return KBookmarkGroup(); } Q_ASSERT(!element.isNull()); - QDomDocument doc = element.ownerDocument(); - QDomElement groupElem = doc.createElement( "folder" ); + TQDomDocument doc = element.ownerDocument(); + TQDomElement groupElem = doc.createElement( "folder" ); element.appendChild( groupElem ); - QDomElement textElem = doc.createElement( "title" ); + TQDomElement textElem = doc.createElement( "title" ); groupElem.appendChild( textElem ); textElem.appendChild( doc.createTextNode( txt ) ); @@ -145,25 +145,25 @@ KBookmarkGroup KBookmarkGroup::createNewFolder( KBookmarkManager* mgr, const QSt KBookmark KBookmarkGroup::createNewSeparator() { Q_ASSERT(!element.isNull()); - QDomDocument doc = element.ownerDocument(); + TQDomDocument doc = element.ownerDocument(); Q_ASSERT(!doc.isNull()); - QDomElement sepElem = doc.createElement( "separator" ); + TQDomElement sepElem = doc.createElement( "separator" ); element.appendChild( sepElem ); return KBookmark(sepElem); } bool KBookmarkGroup::moveItem( const KBookmark & item, const KBookmark & after ) { - QDomNode n; + TQDomNode n; if ( !after.isNull() ) n = element.insertAfter( item.element, after.element ); else // first child { if ( element.firstChild().isNull() ) // Empty element -> set as real first child - n = element.insertBefore( item.element, QDomElement() ); + n = element.insertBefore( item.element, TQDomElement() ); // we have to skip everything up to the first valid child - QDomElement firstChild = nextKnownTag(element.firstChild().toElement(), true); + TQDomElement firstChild = nextKnownTag(element.firstChild().toElement(), true); if ( !firstChild.isNull() ) n = element.insertBefore( item.element, firstChild ); else @@ -192,18 +192,18 @@ KBookmark KBookmarkGroup::addBookmark( KBookmarkManager* mgr, const KBookmark &b return bm; } -KBookmark KBookmarkGroup::addBookmark( KBookmarkManager* mgr, const QString & text, const KURL & url, const QString & icon, bool emitSignal ) +KBookmark KBookmarkGroup::addBookmark( KBookmarkManager* mgr, const TQString & text, const KURL & url, const TQString & icon, bool emitSignal ) { //kdDebug(7043) << "KBookmarkGroup::addBookmark " << text << " into " << m_address << endl; - QDomDocument doc = element.ownerDocument(); - QDomElement elem = doc.createElement( "bookmark" ); + TQDomDocument doc = element.ownerDocument(); + TQDomElement elem = doc.createElement( "bookmark" ); elem.setAttribute( "href", url.url( 0, 106 ) ); // write utf8 URL (106 is mib enum for utf8) - QString _icon = icon; + TQString _icon = icon; if ( _icon.isEmpty() ) _icon = KMimeType::iconForURL( url ); elem.setAttribute( "icon", _icon ); - QDomElement textElem = doc.createElement( "title" ); + TQDomElement textElem = doc.createElement( "title" ); elem.appendChild( textElem ); textElem.appendChild( doc.createTextNode( text ) ); @@ -220,13 +220,13 @@ bool KBookmarkGroup::isToolbarGroup() const return ( element.attribute("toolbar") == "yes" ); } -QDomElement KBookmarkGroup::findToolbar() const +TQDomElement KBookmarkGroup::findToolbar() const { if ( element.attribute("toolbar") == "yes" ) return element; - for (QDomNode n = element.firstChild(); !n.isNull() ; n = n.nextSibling() ) + for (TQDomNode n = element.firstChild(); !n.isNull() ; n = n.nextSibling() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); // Search among the "folder" children only if ( e.tagName() == "folder" ) { @@ -234,18 +234,18 @@ QDomElement KBookmarkGroup::findToolbar() const return e; else { - QDomElement result = KBookmarkGroup(e).findToolbar(); + TQDomElement result = KBookmarkGroup(e).findToolbar(); if (!result.isNull()) return result; } } } - return QDomElement(); + return TQDomElement(); } -QValueList<KURL> KBookmarkGroup::groupUrlList() const +TQValueList<KURL> KBookmarkGroup::groupUrlList() const { - QValueList<KURL> urlList; + TQValueList<KURL> urlList; for ( KBookmark bm = first(); !bm.isNull(); bm = next(bm) ) { if ( bm.isSeparator() || bm.isGroup() ) @@ -259,7 +259,7 @@ QValueList<KURL> KBookmarkGroup::groupUrlList() const bool KBookmark::isGroup() const { - QString tag = element.tagName(); + TQString tag = element.tagName(); return ( tag == "folder" || tag == "xbel" ); // don't forget the toplevel group } @@ -271,16 +271,16 @@ bool KBookmark::isSeparator() const bool KBookmark::hasParent() const { - QDomElement parent = element.parentNode().toElement(); + TQDomElement parent = element.parentNode().toElement(); return !parent.isNull(); } -QString KBookmark::text() const +TQString KBookmark::text() const { return KStringHandler::csqueeze( fullText() ); } -QString KBookmark::fullText() const +TQString KBookmark::fullText() const { if (isSeparator()) return i18n("--- separator ---"); @@ -293,9 +293,9 @@ KURL KBookmark::url() const return KURL(element.attribute("href"), 106); // Decode it from utf8 (106 is mib enum for utf8) } -QString KBookmark::icon() const +TQString KBookmark::icon() const { - QString icon = element.attribute("icon"); + TQString icon = element.attribute("icon"); if ( icon.isEmpty() ) // Default icon depends on URL for bookmarks, and is default directory // icon for groups. @@ -320,10 +320,10 @@ KBookmarkGroup KBookmark::toGroup() const return KBookmarkGroup(element); } -QString KBookmark::address() const +TQString KBookmark::address() const { if ( element.tagName() == "xbel" ) - return ""; // not QString::null ! + return ""; // not TQString::null ! else { // Use keditbookmarks's DEBUG_ADDRESSES flag to debug this code :) @@ -333,44 +333,44 @@ QString KBookmark::address() const return "ERROR"; // Avoid an infinite loop } KBookmarkGroup group = parentGroup(); - QString parentAddress = group.address(); + TQString parentAddress = group.address(); uint counter = 0; // Implementation note: we don't use QDomNode's childNode list because we // would have to skip "TEXT", which KBookmarkGroup already does for us. for ( KBookmark bk = group.first() ; !bk.isNull() ; bk = group.next(bk), ++counter ) { if ( bk.element == element ) - return parentAddress + "/" + QString::number(counter); + return parentAddress + "/" + TQString::number(counter); } kdWarning() << "KBookmark::address : this can't happen! " << parentAddress << endl; return "ERROR"; } } -KBookmark KBookmark::standaloneBookmark( const QString & text, const KURL & url, const QString & icon ) +KBookmark KBookmark::standaloneBookmark( const TQString & text, const KURL & url, const TQString & icon ) { - QDomDocument doc("xbel"); - QDomElement elem = doc.createElement("xbel"); + TQDomDocument doc("xbel"); + TQDomElement elem = doc.createElement("xbel"); doc.appendChild( elem ); KBookmarkGroup grp( elem ); grp.addBookmark( 0L, text, url, icon, false ); return grp.first(); } -// For some strange reason QString("").left(0) returns QString::null; +// For some strange reason TQString("").left(0) returns TQString::null; // That breaks commonParent() -QString KBookmark::left(const QString & str, uint len) +TQString KBookmark::left(const TQString & str, uint len) { - //kdDebug()<<"********"<<QString("").left(0).isNull()<<endl; + //kdDebug()<<"********"<<TQString("").left(0).isNull()<<endl; if(len == 0) - return QString(""); + return TQString(""); else return str.left(len); } -QString KBookmark::commonParent(QString A, QString B) +TQString KBookmark::commonParent(TQString A, TQString B) { - QString error("ERROR"); + TQString error("ERROR"); if(A == error || B == error) return error; @@ -389,9 +389,9 @@ QString KBookmark::commonParent(QString A, QString B) return left(A, lastCommonSlash); } -static QDomNode cd_or_create(QDomNode node, QString name) +static TQDomNode cd_or_create(TQDomNode node, TQString name) { - QDomNode subnode = node.namedItem(name); + TQDomNode subnode = node.namedItem(name); if (subnode.isNull()) { subnode = node.ownerDocument().createElement(name); @@ -400,9 +400,9 @@ static QDomNode cd_or_create(QDomNode node, QString name) return subnode; } -static QDomText get_or_create_text(QDomNode node) +static TQDomText get_or_create_text(TQDomNode node) { - QDomNode subnode = node.firstChild(); + TQDomNode subnode = node.firstChild(); if (subnode.isNull()) { subnode = node.ownerDocument().createTextNode(""); @@ -412,14 +412,14 @@ static QDomText get_or_create_text(QDomNode node) } // Look for a metadata with owner="http://www.kde.org" or without any owner (for compatibility) -static QDomNode findOrCreateMetadata( QDomNode& parent ) +static TQDomNode findOrCreateMetadata( TQDomNode& parent ) { static const char kdeOwner[] = "http://www.kde.org"; - QDomElement metadataElement; - for ( QDomNode _node = parent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) { - QDomElement elem = _node.toElement(); + TQDomElement metadataElement; + for ( TQDomNode _node = parent.firstChild(); !_node.isNull(); _node = _node.nextSibling() ) { + TQDomElement elem = _node.toElement(); if ( !elem.isNull() && elem.tagName() == "metadata" ) { - const QString owner = elem.attribute( "owner" ); + const TQString owner = elem.attribute( "owner" ); if ( owner == kdeOwner ) return elem; if ( owner.isEmpty() ) @@ -439,7 +439,7 @@ bool KBookmark::hasMetaData() const // ### NOTE: this code creates <info> and <metadata>, despite its name and the const. // It doesn't matter much in practice since it's only called for newly-created bookmarks, // which will get metadata soon after anyway. - QDomNode n = cd_or_create( internalElement(), "info" ); + TQDomNode n = cd_or_create( internalElement(), "info" ); return findOrCreateMetadata( n ).hasChildNodes(); } @@ -447,44 +447,44 @@ void KBookmark::updateAccessMetadata() { kdDebug(7043) << "KBookmark::updateAccessMetadata " << address() << " " << url().prettyURL() << endl; - const uint timet = QDateTime::currentDateTime().toTime_t(); - setMetaDataItem( "time_added", QString::number( timet ), DontOverwriteMetaData ); - setMetaDataItem( "time_visited", QString::number( timet ) ); + const uint timet = TQDateTime::currentDateTime().toTime_t(); + setMetaDataItem( "time_added", TQString::number( timet ), DontOverwriteMetaData ); + setMetaDataItem( "time_visited", TQString::number( timet ) ); - QString countStr = metaDataItem( "visit_count" ); // TODO use spec'ed name + TQString countStr = metaDataItem( "visit_count" ); // TODO use spec'ed name bool ok; int currentCount = countStr.toInt(&ok); if (!ok) currentCount = 0; currentCount++; - setMetaDataItem( "visit_count", QString::number( currentCount ) ); + setMetaDataItem( "visit_count", TQString::number( currentCount ) ); // TODO - for 4.0 - time_modified } -QString KBookmark::metaDataItem( const QString &key ) const +TQString KBookmark::metaDataItem( const TQString &key ) const { - QDomNode infoNode = cd_or_create( internalElement(), "info" ); + TQDomNode infoNode = cd_or_create( internalElement(), "info" ); infoNode = findOrCreateMetadata( infoNode ); - for ( QDomNode n = infoNode.firstChild(); !n.isNull(); n = n.nextSibling() ) { + for ( TQDomNode n = infoNode.firstChild(); !n.isNull(); n = n.nextSibling() ) { if ( !n.isElement() ) { continue; } - const QDomElement e = n.toElement(); + const TQDomElement e = n.toElement(); if ( e.tagName() == key ) { return e.text(); } } - return QString::null; + return TQString::null; } -void KBookmark::setMetaDataItem( const QString &key, const QString &value, MetaDataOverwriteMode mode ) +void KBookmark::setMetaDataItem( const TQString &key, const TQString &value, MetaDataOverwriteMode mode ) { - QDomNode infoNode = cd_or_create( internalElement(), "info" ); + TQDomNode infoNode = cd_or_create( internalElement(), "info" ); infoNode = findOrCreateMetadata( infoNode ); - QDomNode item = cd_or_create( infoNode, key ); - QDomText text = get_or_create_text( item ); + TQDomNode item = cd_or_create( infoNode, key ); + TQDomText text = get_or_create_text( item ); if ( mode == DontOverwriteMetaData && !text.data().isEmpty() ) { return; } @@ -495,7 +495,7 @@ void KBookmark::setMetaDataItem( const QString &key, const QString &value, MetaD void KBookmarkGroupTraverser::traverse(const KBookmarkGroup &root) { // non-recursive bookmark iterator - QValueStack<KBookmarkGroup> stack; + TQValueStack<KBookmarkGroup> stack; stack.push(root); KBookmark bk = stack.top().first(); for (;;) { diff --git a/kio/bookmarks/kbookmark.h b/kio/bookmarks/kbookmark.h index 9cb9b1fdf..84f177522 100644 --- a/kio/bookmarks/kbookmark.h +++ b/kio/bookmarks/kbookmark.h @@ -20,9 +20,9 @@ #ifndef __kbookmark_h #define __kbookmark_h -#include <qstring.h> -#include <qvaluelist.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqdom.h> #include <kurl.h> class KBookmarkManager; @@ -37,9 +37,9 @@ public: }; KBookmark( ) {} - KBookmark( QDomElement elem ) : element(elem) {} + KBookmark( TQDomElement elem ) : element(elem) {} - static KBookmark standaloneBookmark( const QString & text, const KURL & url, const QString & icon = QString::null ); + static KBookmark standaloneBookmark( const TQString & text, const KURL & url, const TQString & icon = TQString::null ); /** * Whether the bookmark is a group or a normal bookmark @@ -59,7 +59,7 @@ public: bool isNull() const {return element.isNull();} /** - * @return true if bookmark is contained by a QDomDocument, + * @return true if bookmark is contained by a TQDomDocument, * if not it is most likely that it has become separated and * is thus invalid and/or has been deleted from the bookmarks. * @since 3.2 @@ -71,12 +71,12 @@ public: * If bigger than 40, the text is shortened by * replacing middle characters with "..." (see KStringHandler::csqueeze) */ - QString text() const; + TQString text() const; /** * Text shown for the bookmark, not truncated. * You should not use this - this is mainly for keditbookmarks. */ - QString fullText() const; + TQString fullText() const; /** * URL contained by the bookmark */ @@ -85,7 +85,7 @@ public: * @return the pixmap file for this bookmark * (i.e. the name of the icon) */ - QString icon() const; + TQString icon() const; /** * @return the group containing this bookmark @@ -104,7 +104,7 @@ public: * in a given bookmark. The encoding of the address is "/4/2", for * instance, to design the 2nd child inside the 4th child of the root bk. */ - QString address() const; + TQString address() const; // Hard to decide. Good design would imply that each bookmark // knows about its manager, so that there can be several managers. @@ -115,7 +115,7 @@ public: /** * @internal for KEditBookmarks */ - QDomElement internalElement() const { return element; } + TQDomElement internalElement() const { return element; } /** * Updates the bookmarks access metadata @@ -129,47 +129,47 @@ public: /** * @return address of parent */ - static QString parentAddress( const QString & address ) + static TQString parentAddress( const TQString & address ) { return address.left( address.findRev('/') ); } /** * @return position in parent (e.g. /4/5/2 -> 2) */ - static uint positionInParent( const QString & address ) + static uint positionInParent( const TQString & address ) { return address.mid( address.findRev('/') + 1 ).toInt(); } /** * @return address of previous sibling (e.g. /4/5/2 -> /4/5/1) - * Returns QString::null for a first child + * Returns TQString::null for a first child */ - static QString previousAddress( const QString & address ) + static TQString previousAddress( const TQString & address ) { uint pp = positionInParent(address); - return pp>0 ? parentAddress(address) + '/' + QString::number(pp-1) : QString::null; + return pp>0 ? parentAddress(address) + '/' + TQString::number(pp-1) : TQString::null; } /** * @return address of next sibling (e.g. /4/5/2 -> /4/5/3) * This doesn't check whether it actually exists */ - static QString nextAddress( const QString & address ) - { return parentAddress(address) + '/' + QString::number(positionInParent(address)+1); } + static TQString nextAddress( const TQString & address ) + { return parentAddress(address) + '/' + TQString::number(positionInParent(address)+1); } /** * @return the common parent of both addresses which * has the greatest depth * @since 3.5 */ - static QString commonParent(QString A, QString B); + static TQString commonParent(TQString A, TQString B); /** * Get the value of a specific metadata item. * @param key Name of the metadata item - * @return Value of the metadata item. QString::null is returned in case + * @return Value of the metadata item. TQString::null is returned in case * the specified key does not exist. * @since 3.4 */ - QString metaDataItem( const QString &key ) const; + TQString metaDataItem( const TQString &key ) const; /** * Change the value of a specific metadata item, or create the given item @@ -179,18 +179,18 @@ public: * @param mode Whether to overwrite the item's value if it exists already or not. * @since 3.4 */ - void setMetaDataItem( const QString &key, const QString &value, MetaDataOverwriteMode mode = OverwriteMetaData ); + void setMetaDataItem( const TQString &key, const TQString &value, MetaDataOverwriteMode mode = OverwriteMetaData ); protected: - QDomElement element; + TQDomElement element; // Note: you can't add new member variables here. // The KBookmarks are created on the fly, as wrappers // around internal QDomElements. Any additional information - // has to be implemented as an attribute of the QDomElement. + // has to be implemented as an attribute of the TQDomElement. private: bool hasMetaData() const; - static QString left(const QString & str, uint len); + static TQString left(const TQString & str, uint len); }; /** @@ -200,7 +200,7 @@ class KIO_EXPORT KBookmarkGroup : public KBookmark { public: /** - * Create an invalid group. This is mostly for use in QValueList, + * Create an invalid group. This is mostly for use in TQValueList, * and other places where we need a null group. * Also used as a parent for a bookmark that doesn't have one * (e.g. Netscape bookmarks) @@ -210,13 +210,13 @@ public: /** * Create a bookmark group as specified by the given element */ - KBookmarkGroup( QDomElement elem ); + KBookmarkGroup( TQDomElement elem ); /** * Much like KBookmark::address, but caches the * address into m_address. */ - QString groupAddress() const; + TQString groupAddress() const; /** * @return true if the bookmark folder is opened in the bookmark editor @@ -244,7 +244,7 @@ public: * @param text for the folder. If empty, the user will be queried for it. * @param emitSignal if true emit KBookmarkNotifier signal */ - KBookmarkGroup createNewFolder( KBookmarkManager* mgr, const QString & text = QString::null, bool emitSignal = true ); + KBookmarkGroup createNewFolder( KBookmarkManager* mgr, const TQString & text = TQString::null, bool emitSignal = true ); /** * Create a new bookmark separator * Don't forget to use KBookmarkManager::self()->emitChanged( parentBookmark ); @@ -271,7 +271,7 @@ public: * will be determined from the URL if not specified. * @param emitSignal if true emit KBookmarkNotifier signal */ - KBookmark addBookmark( KBookmarkManager* mgr, const QString & text, const KURL & url, const QString & icon = QString::null, bool emitSignal = true ); + KBookmark addBookmark( KBookmarkManager* mgr, const TQString & text, const KURL & url, const TQString & icon = TQString::null, bool emitSignal = true ); /** * Moves @p item after @p after (which should be a child of ours). @@ -293,23 +293,23 @@ public: /** * @internal */ - QDomElement findToolbar() const; + TQDomElement findToolbar() const; /** * @return the list of urls of bookmarks at top level of the group * @since 3.2 */ - QValueList<KURL> groupUrlList() const; + TQValueList<KURL> groupUrlList() const; protected: - QDomElement nextKnownTag( QDomElement start, bool goNext ) const; + TQDomElement nextKnownTag( TQDomElement start, bool goNext ) const; private: - mutable QString m_address; + mutable TQString m_address; // Note: you can't add other member variables here, except for caching info. // The KBookmarks are created on the fly, as wrappers // around internal QDomElements. Any additional information - // has to be implemented as an attribute of the QDomElement. + // has to be implemented as an attribute of the TQDomElement. }; /** diff --git a/kio/bookmarks/kbookmarkbar.cc b/kio/bookmarks/kbookmarkbar.cc index d71069014..ec1e3e670 100644 --- a/kio/bookmarks/kbookmarkbar.cc +++ b/kio/bookmarks/kbookmarkbar.cc @@ -19,8 +19,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <qregexp.h> -#include <qfile.h> +#include <tqregexp.h> +#include <tqfile.h> #include <kbookmarkbar.h> #include <kbookmarkdrag.h> @@ -40,19 +40,19 @@ #include "dptrtemplate.h" -#include <qapplication.h> +#include <tqapplication.h> class KBookmarkBarPrivate : public dPtrTemplate<KBookmarkBar, KBookmarkBarPrivate> { public: - QPtrList<KAction> m_actions; + TQPtrList<KAction> m_actions; bool m_readOnly; KBookmarkManager* m_filteredMgr; KToolBar* m_sepToolBar; int m_sepIndex; bool m_atFirst; - QString m_dropAddress; - QString m_highlightedAddress; + TQString m_dropAddress; + TQString m_highlightedAddress; public: KBookmarkBarPrivate() { m_readOnly = false; @@ -62,7 +62,7 @@ public: m_atFirst = false; } }; -template<> QPtrDict<KBookmarkBarPrivate>* dPtrTemplate<KBookmarkBar, KBookmarkBarPrivate>::d_ptr = 0; +template<> TQPtrDict<KBookmarkBarPrivate>* dPtrTemplate<KBookmarkBar, KBookmarkBarPrivate>::d_ptr = 0; KBookmarkBarPrivate* KBookmarkBar::dptr() const { @@ -87,8 +87,8 @@ private: KBookmarkBar::KBookmarkBar( KBookmarkManager* mgr, KBookmarkOwner *_owner, KToolBar *_toolBar, KActionCollection *coll, - QObject *parent, const char *name ) - : QObject( parent, name ), m_pOwner(_owner), m_toolBar(_toolBar), + TQObject *parent, const char *name ) + : TQObject( parent, name ), m_pOwner(_owner), m_toolBar(_toolBar), m_actionCollection( coll ), m_pManager(mgr) { m_lstSubMenus.setAutoDelete( true ); @@ -98,16 +98,16 @@ KBookmarkBar::KBookmarkBar( KBookmarkManager* mgr, dptr()->m_actions.setAutoDelete( true ); - connect( mgr, SIGNAL( changed(const QString &, const QString &) ), - SLOT( slotBookmarksChanged(const QString &) ) ); + connect( mgr, TQT_SIGNAL( changed(const TQString &, const TQString &) ), + TQT_SLOT( slotBookmarksChanged(const TQString &) ) ); KBookmarkGroup toolbar = getToolbar(); fillBookmarkBar( toolbar ); } -QString KBookmarkBar::parentAddress() +TQString KBookmarkBar::parentAddress() { - return dptr()->m_filteredMgr ? QString::null : m_pManager->toolbar().address(); + return dptr()->m_filteredMgr ? TQString::null : m_pManager->toolbar().address(); } #define CURRENT_TOOLBAR() ( \ @@ -126,10 +126,10 @@ KBookmarkGroup KBookmarkBar::getToolbar() dptr()->m_filteredMgr = KBookmarkManager::createTempManager(); } else { KBookmarkGroup bkRoot = dptr()->m_filteredMgr->root(); - QValueList<KBookmark> bks; + TQValueList<KBookmark> bks; for (KBookmark bm = bkRoot.first(); !bm.isNull(); bm = bkRoot.next(bm)) bks << bm; - for ( QValueListConstIterator<KBookmark> it = bks.begin(); it != bks.end(); ++it ) + for ( TQValueListConstIterator<KBookmark> it = bks.begin(); it != bks.end(); ++it ) bkRoot.deleteBookmark( (*it) ); } ToolbarFilter filter; @@ -150,7 +150,7 @@ KBookmarkBar::~KBookmarkBar() void KBookmarkBar::clear() { - QPtrListIterator<KAction> it( dptr()->m_actions ); + TQPtrListIterator<KAction> it( dptr()->m_actions ); m_toolBar->clear(); for (; it.current(); ++it ) { (*it)->unplugAll(); @@ -159,7 +159,7 @@ void KBookmarkBar::clear() m_lstSubMenus.clear(); } -void KBookmarkBar::slotBookmarksChanged( const QString & group ) +void KBookmarkBar::slotBookmarksChanged( const TQString & group ) { KBookmarkGroup tb = getToolbar(); // heavy for non cached toolbar version kdDebug(7043) << "slotBookmarksChanged( " << group << " )" << endl; @@ -176,7 +176,7 @@ void KBookmarkBar::slotBookmarksChanged( const QString & group ) else { // Iterate recursively into child menus - QPtrListIterator<KBookmarkMenu> it( m_lstSubMenus ); + TQPtrListIterator<KBookmarkMenu> it( m_lstSubMenus ); for (; it.current(); ++it ) { it.current()->slotBookmarksChanged( group ); @@ -191,7 +191,7 @@ void KBookmarkBar::fillBookmarkBar(KBookmarkGroup & parent) for (KBookmark bm = parent.first(); !bm.isNull(); bm = parent.next(bm)) { - QString text = bm.text(); + TQString text = bm.text(); text.replace( '&', "&&" ); if (!bm.isGroup()) { @@ -200,8 +200,8 @@ void KBookmarkBar::fillBookmarkBar(KBookmarkGroup & parent) else { KAction *action = new KBookmarkAction( text, bm.icon(), 0, m_actionCollection, 0 ); - connect(action, SIGNAL( activated ( KAction::ActivationReason, Qt::ButtonState )), - this, SLOT( slotBookmarkSelected( KAction::ActivationReason, Qt::ButtonState ) )); + connect(action, TQT_SIGNAL( activated ( KAction::ActivationReason, Qt::ButtonState )), + this, TQT_SLOT( slotBookmarkSelected( KAction::ActivationReason, Qt::ButtonState ) )); action->setProperty( "url", bm.url().url() ); action->setProperty( "address", bm.address() ); @@ -229,10 +229,10 @@ void KBookmarkBar::fillBookmarkBar(KBookmarkGroup & parent) KBookmarkMenu *menu = new KBookmarkMenu(CURRENT_MANAGER(), m_pOwner, action->popupMenu(), m_actionCollection, false, addEntriesBookmarkBar, bm.address()); - connect(menu, SIGNAL( aboutToShowContextMenu(const KBookmark &, QPopupMenu * ) ), - this, SIGNAL( aboutToShowContextMenu(const KBookmark &, QPopupMenu * ) )); - connect(menu, SIGNAL( openBookmark( const QString &, Qt::ButtonState) ), - this, SIGNAL( openBookmark( const QString &, Qt::ButtonState) )); + connect(menu, TQT_SIGNAL( aboutToShowContextMenu(const KBookmark &, TQPopupMenu * ) ), + this, TQT_SIGNAL( aboutToShowContextMenu(const KBookmark &, TQPopupMenu * ) )); + connect(menu, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState) ), + this, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState) )); menu->fillBookmarkMenu(); action->plug(m_toolBar); m_lstSubMenus.append( menu ); @@ -259,7 +259,7 @@ void KBookmarkBar::slotBookmarkSelected( KAction::ActivationReason /*reason*/, Q const KAction* action = dynamic_cast<const KAction *>(sender()); if(action) { - const QString & url = sender()->property("url").toString(); + const TQString & url = sender()->property("url").toString(); m_pOwner->openBookmarkURL(url); emit openBookmark( url, state ); } @@ -282,9 +282,9 @@ static void removeTempSep(KBookmarkBarPrivate* p) } } -static KAction* findPluggedAction(QPtrList<KAction> actions, KToolBar *tb, int id) +static KAction* findPluggedAction(TQPtrList<KAction> actions, KToolBar *tb, int id) { - QPtrListIterator<KAction> it( actions ); + TQPtrListIterator<KAction> it( actions ); for (; (*it); ++it ) if ((*it)->isPlugged(tb, id)) return (*it); @@ -292,17 +292,17 @@ static KAction* findPluggedAction(QPtrList<KAction> actions, KToolBar *tb, int i } /** - * Handle a QDragMoveEvent event on a toolbar drop + * Handle a TQDragMoveEvent event on a toolbar drop * @return the address of the bookmark to be dropped after/before - * else a QString::null if event should be ignored - * @param pos the current QDragMoveEvent position + * else a TQString::null if event should be ignored + * @param pos the current TQDragMoveEvent position * @param the toolbar * @param actions the list of actions plugged into the bar * @param atFirst bool reference, when true the position before the * returned action was dropped on */ -static QString handleToolbarDragMoveEvent( - KBookmarkBarPrivate *p, KToolBar *tb, QPoint pos, QPtrList<KAction> actions, +static TQString handleToolbarDragMoveEvent( + KBookmarkBarPrivate *p, KToolBar *tb, TQPoint pos, TQPtrList<KAction> actions, bool &atFirst, KBookmarkManager *mgr ) { Q_UNUSED( mgr ); @@ -315,13 +315,13 @@ static QString handleToolbarDragMoveEvent( b = dynamic_cast<KToolBarButton*>(tb->childAt(pos)); KAction *a = 0; - QString address; + TQString address; atFirst = false; if (b) { index = tb->itemIndex(b->id()); - QRect r = b->geometry(); + TQRect r = b->geometry(); if (pos.x() < ((r.left() + r.right())/2)) { // if in first half of button then @@ -356,7 +356,7 @@ static QString handleToolbarDragMoveEvent( } if ( !b ) - return QString::null; // TODO Make it works for that case + return TQString::null; // TODO Make it works for that case a = findPluggedAction(actions, tb, b->id()); Q_ASSERT(a); @@ -382,8 +382,8 @@ skipact: } // TODO - document!!!! -static KAction* handleToolbarMouseButton(QPoint pos, QPtrList<KAction> actions, - KBookmarkManager * /*mgr*/, QPoint & pt) +static KAction* handleToolbarMouseButton(TQPoint pos, TQPtrList<KAction> actions, + KBookmarkManager * /*mgr*/, TQPoint & pt) { KAction *act = actions.first(); if (!act) { @@ -413,7 +413,7 @@ static KAction* handleToolbarMouseButton(QPoint pos, QPtrList<KAction> actions, // don't *ever* show the rmb on press, always relase, possible??? class KBookmarkBarRMBAssoc : public dPtrTemplate<KBookmarkBar, RMB> { }; -template<> QPtrDict<RMB>* dPtrTemplate<KBookmarkBar, RMB>::d_ptr = 0; +template<> TQPtrDict<RMB>* dPtrTemplate<KBookmarkBar, RMB>::d_ptr = 0; static RMB* rmbSelf(KBookmarkBar *m) { return KBookmarkBarRMBAssoc::d(m); } @@ -443,17 +443,17 @@ void KBookmarkBar::slotRMBActionRemove( int val ) void KBookmarkBar::slotRMBActionCopyLocation( int val ) { RMB::begin_rmb_action(this); rmbSelf(this)->slotRMBActionCopyLocation( val ); } -bool KBookmarkBar::eventFilter( QObject *o, QEvent *e ) +bool KBookmarkBar::eventFilter( TQObject *o, TQEvent *e ) { if (dptr()->m_readOnly || dptr()->m_filteredMgr) // note, we assume m_pManager in various places, // this shouldn't really be the case return false; // todo: make this limit the actions - if ( (e->type() == QEvent::MouseButtonRelease) || (e->type() == QEvent::MouseButtonPress) ) // FIXME, which one? + if ( (e->type() == TQEvent::MouseButtonRelease) || (e->type() == TQEvent::MouseButtonPress) ) // FIXME, which one? { - QMouseEvent *mev = (QMouseEvent*)e; + TQMouseEvent *mev = (TQMouseEvent*)e; - QPoint pt; + TQPoint pt; KAction *_a; // FIXME, see how this holds up on an empty toolbar @@ -473,18 +473,18 @@ bool KBookmarkBar::eventFilter( QObject *o, QEvent *e ) return !!_a; // ignore the event if we didn't find the button } - else if ( e->type() == QEvent::DragLeave ) + else if ( e->type() == TQEvent::DragLeave ) { removeTempSep(dptr()); - dptr()->m_dropAddress = QString::null; + dptr()->m_dropAddress = TQString::null; } - else if ( e->type() == QEvent::Drop ) + else if ( e->type() == TQEvent::Drop ) { removeTempSep(dptr()); - QDropEvent *dev = (QDropEvent*)e; + TQDropEvent *dev = (TQDropEvent*)e; if ( !KBookmarkDrag::canDecode( dev ) ) return false; - QValueList<KBookmark> list = KBookmarkDrag::decode( dev ); + TQValueList<KBookmark> list = KBookmarkDrag::decode( dev ); if (list.count() > 1) kdWarning(7043) << "Sorry, currently you can only drop one address " "onto the bookmark bar!" << endl; @@ -492,7 +492,7 @@ bool KBookmarkBar::eventFilter( QObject *o, QEvent *e ) KBookmark bookmark = m_pManager->findByAddress( dptr()->m_dropAddress ); Q_ASSERT(!bookmark.isNull()); kdDebug(7043) << "inserting " - << QString(dptr()->m_atFirst ? "before" : "after") + << TQString(dptr()->m_atFirst ? "before" : "after") << " dptr()->m_dropAddress == " << dptr()->m_dropAddress << endl; KBookmarkGroup parentBookmark = bookmark.parentGroup(); Q_ASSERT(!parentBookmark.isNull()); @@ -503,13 +503,13 @@ bool KBookmarkBar::eventFilter( QObject *o, QEvent *e ) m_pManager->emitChanged( parentBookmark ); return true; } - else if ( e->type() == QEvent::DragMove ) + else if ( e->type() == TQEvent::DragMove ) { - QDragMoveEvent *dme = (QDragMoveEvent*)e; + TQDragMoveEvent *dme = (TQDragMoveEvent*)e; if (!KBookmarkDrag::canDecode( dme )) return false; bool _atFirst; - QString dropAddress; + TQString dropAddress; KToolBar *tb = (KToolBar*)o; dropAddress = handleToolbarDragMoveEvent(dptr(), tb, dme->pos(), dptr()->m_actions, _atFirst, m_pManager); if (!dropAddress.isNull()) diff --git a/kio/bookmarks/kbookmarkbar.h b/kio/bookmarks/kbookmarkbar.h index 162d045bb..f8d2f689e 100644 --- a/kio/bookmarks/kbookmarkbar.h +++ b/kio/bookmarks/kbookmarkbar.h @@ -21,9 +21,9 @@ #ifndef KBOOKMARKBAR_H #define KBOOKMARKBAR_H -#include <qobject.h> -#include <qguardedptr.h> -#include <qptrlist.h> +#include <tqobject.h> +#include <tqguardedptr.h> +#include <tqptrlist.h> #include <kbookmark.h> #include <kaction.h> @@ -59,7 +59,7 @@ public: KBookmarkBar( KBookmarkManager* manager, KBookmarkOwner *owner, KToolBar *toolBar, KActionCollection *, - QObject *parent = 0L, const char *name = 0L); + TQObject *parent = 0L, const char *name = 0L); virtual ~KBookmarkBar(); @@ -76,22 +76,22 @@ public: /** * @since 3.2 */ - QString parentAddress(); + TQString parentAddress(); signals: /** * @since 3.2 */ - void aboutToShowContextMenu( const KBookmark &, QPopupMenu * ); + void aboutToShowContextMenu( const KBookmark &, TQPopupMenu * ); /** * @since 3.4 */ - void openBookmark( const QString& url, Qt::ButtonState state ); + void openBookmark( const TQString& url, Qt::ButtonState state ); public slots: void clear(); - void slotBookmarksChanged( const QString & ); + void slotBookmarksChanged( const TQString & ); void slotBookmarkSelected(); /** @@ -112,16 +112,16 @@ public slots: protected: void fillBookmarkBar( KBookmarkGroup & parent ); - virtual bool eventFilter( QObject *o, QEvent *e ); + virtual bool eventFilter( TQObject *o, TQEvent *e ); private: KBookmarkGroup getToolbar(); KBookmarkOwner *m_pOwner; - QGuardedPtr<KToolBar> m_toolBar; + TQGuardedPtr<KToolBar> m_toolBar; KActionCollection *m_actionCollection; KBookmarkManager *m_pManager; - QPtrList<KBookmarkMenu> m_lstSubMenus; + TQPtrList<KBookmarkMenu> m_lstSubMenus; private: class KBookmarkBarPrivate* dptr() const; diff --git a/kio/bookmarks/kbookmarkdombuilder.cc b/kio/bookmarks/kbookmarkdombuilder.cc index 7b6bad4e6..5c0882d05 100644 --- a/kio/bookmarks/kbookmarkdombuilder.cc +++ b/kio/bookmarks/kbookmarkdombuilder.cc @@ -35,37 +35,37 @@ KBookmarkDomBuilder::~KBookmarkDomBuilder() { m_stack.clear(); } -void KBookmarkDomBuilder::connectImporter(const QObject *importer) { - connect(importer, SIGNAL( newBookmark(const QString &, const QCString &, const QString &) ), - SLOT( newBookmark(const QString &, const QCString &, const QString &) )); - connect(importer, SIGNAL( newFolder(const QString &, bool, const QString &) ), - SLOT( newFolder(const QString &, bool, const QString &) )); - connect(importer, SIGNAL( newSeparator() ), - SLOT( newSeparator() ) ); - connect(importer, SIGNAL( endFolder() ), - SLOT( endFolder() ) ); +void KBookmarkDomBuilder::connectImporter(const TQObject *importer) { + connect(importer, TQT_SIGNAL( newBookmark(const TQString &, const TQCString &, const TQString &) ), + TQT_SLOT( newBookmark(const TQString &, const TQCString &, const TQString &) )); + connect(importer, TQT_SIGNAL( newFolder(const TQString &, bool, const TQString &) ), + TQT_SLOT( newFolder(const TQString &, bool, const TQString &) )); + connect(importer, TQT_SIGNAL( newSeparator() ), + TQT_SLOT( newSeparator() ) ); + connect(importer, TQT_SIGNAL( endFolder() ), + TQT_SLOT( endFolder() ) ); } void KBookmarkDomBuilder::newBookmark( - const QString &text, const QCString &url, const QString &additionalInfo + const TQString &text, const TQCString &url, const TQString &additionalInfo ) { KBookmark bk = m_stack.top().addBookmark( m_manager, text, - KURL( QString::fromUtf8(url), 106 /*utf8*/ ), - QString::null, false); + KURL( TQString::fromUtf8(url), 106 /*utf8*/ ), + TQString::null, false); // store additional info bk.internalElement().setAttribute("netscapeinfo", additionalInfo); } void KBookmarkDomBuilder::newFolder( - const QString & text, bool open, const QString & additionalInfo + const TQString & text, bool open, const TQString & additionalInfo ) { // we use a qvaluelist so that we keep pointers to valid objects in the stack KBookmarkGroup gp = m_stack.top().createNewFolder(m_manager, text, false); m_list.append(gp); m_stack.push(m_list.last()); // store additional info - QDomElement element = m_list.last().internalElement(); + TQDomElement element = m_list.last().internalElement(); element.setAttribute("netscapeinfo", additionalInfo); element.setAttribute("folded", (open?"no":"yes")); } diff --git a/kio/bookmarks/kbookmarkdombuilder.h b/kio/bookmarks/kbookmarkdombuilder.h index f570525f6..f1f712531 100644 --- a/kio/bookmarks/kbookmarkdombuilder.h +++ b/kio/bookmarks/kbookmarkdombuilder.h @@ -20,27 +20,27 @@ #ifndef __kbookmarkdombuilder_h #define __kbookmarkdombuilder_h -#include <qvaluestack.h> -#include <qobject.h> +#include <tqvaluestack.h> +#include <tqobject.h> #include <kbookmark.h> /** * @since 3.2 */ -class KIO_EXPORT KBookmarkDomBuilder : public QObject { +class KIO_EXPORT KBookmarkDomBuilder : public TQObject { Q_OBJECT public: KBookmarkDomBuilder(const KBookmarkGroup &group, KBookmarkManager *); virtual ~KBookmarkDomBuilder(); - void connectImporter(const QObject *); + void connectImporter(const TQObject *); protected slots: - void newBookmark(const QString &text, const QCString &url, const QString &additionalInfo); - void newFolder(const QString &text, bool open, const QString &additionalInfo); + void newBookmark(const TQString &text, const TQCString &url, const TQString &additionalInfo); + void newFolder(const TQString &text, bool open, const TQString &additionalInfo); void newSeparator(); void endFolder(); private: - QValueStack<KBookmarkGroup> m_stack; - QValueList<KBookmarkGroup> m_list; + TQValueStack<KBookmarkGroup> m_stack; + TQValueList<KBookmarkGroup> m_list; KBookmarkManager *m_manager; class KBookmarkDomBuilderPrivate *p; }; diff --git a/kio/bookmarks/kbookmarkdrag.cc b/kio/bookmarks/kbookmarkdrag.cc index 3e1db9c15..d13893eed 100644 --- a/kio/bookmarks/kbookmarkdrag.cc +++ b/kio/bookmarks/kbookmarkdrag.cc @@ -22,16 +22,16 @@ #include <kurldrag.h> #include <kdebug.h> -KBookmarkDrag * KBookmarkDrag::newDrag( const QValueList<KBookmark> & bookmarks, QWidget * dragSource, const char * name ) +KBookmarkDrag * KBookmarkDrag::newDrag( const TQValueList<KBookmark> & bookmarks, TQWidget * dragSource, const char * name ) { KURL::List urls; - for ( QValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it ) { + for ( TQValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it ) { urls.append( (*it).url() ); } // 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 @@ -42,24 +42,24 @@ KBookmarkDrag * KBookmarkDrag::newDrag( const QValueList<KBookmark> & bookmarks, return new KBookmarkDrag( bookmarks, uris, dragSource, name ); } -KBookmarkDrag * KBookmarkDrag::newDrag( const KBookmark & bookmark, QWidget * dragSource, const char * name ) +KBookmarkDrag * KBookmarkDrag::newDrag( const KBookmark & bookmark, TQWidget * dragSource, const char * name ) { - QValueList<KBookmark> bookmarks; + TQValueList<KBookmark> bookmarks; bookmarks.append( KBookmark(bookmark) ); return newDrag(bookmarks, dragSource, name); } -KBookmarkDrag::KBookmarkDrag( const QValueList<KBookmark> & bookmarks, const QStrList & urls, - QWidget * dragSource, const char * name ) - : QUriDrag( urls, dragSource, name ), m_bookmarks( bookmarks ), m_doc("xbel") +KBookmarkDrag::KBookmarkDrag( const TQValueList<KBookmark> & bookmarks, const TQStrList & urls, + TQWidget * dragSource, const char * name ) + : TQUriDrag( urls, dragSource, name ), m_bookmarks( bookmarks ), m_doc("xbel") { // We need to create the XML for this drag right now and not // in encodedData because when cutting a folder, the children // wouldn't be part of the bookmarks anymore, when encodedData // is requested. - QDomElement elem = m_doc.createElement("xbel"); + TQDomElement elem = m_doc.createElement("xbel"); m_doc.appendChild( elem ); - for ( QValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it ) { + for ( TQValueListConstIterator<KBookmark> it = bookmarks.begin(); it != bookmarks.end(); ++it ) { elem.appendChild( (*it).internalElement().cloneNode( true /* deep */ ) ); } //kdDebug(7043) << "KBookmarkDrag::KBookmarkDrag " << m_doc.toString() << endl; @@ -76,12 +76,12 @@ const char* KBookmarkDrag::format( int i ) const else return 0; } -QByteArray KBookmarkDrag::encodedData( const char* mime ) const +TQByteArray KBookmarkDrag::encodedData( const char* mime ) const { - QByteArray a; - QCString mimetype( mime ); + TQByteArray a; + TQCString mimetype( mime ); if ( mimetype == "text/uri-list" ) - return QUriDrag::encodedData( mime ); + return TQUriDrag::encodedData( mime ); else if ( mimetype == "application/x-xbel" ) { a = m_doc.toCString(); @@ -92,13 +92,13 @@ QByteArray KBookmarkDrag::encodedData( const char* mime ) const KURL::List m_lstDragURLs; if ( KURLDrag::decode( this, m_lstDragURLs ) ) { - QStringList uris; + TQStringList uris; KURL::List::ConstIterator uit = m_lstDragURLs.begin(); KURL::List::ConstIterator uEnd = m_lstDragURLs.end(); for ( ; uit != uEnd ; ++uit ) uris.append( (*uit).prettyURL() ); - QCString s = uris.join( "\n" ).local8Bit(); + TQCString s = uris.join( "\n" ).local8Bit(); a.resize( s.length() + 1 ); // trailing zero memcpy( a.data(), s.data(), s.length() + 1 ); } @@ -106,23 +106,23 @@ QByteArray KBookmarkDrag::encodedData( const char* mime ) const return a; } -bool KBookmarkDrag::canDecode( const QMimeSource * e ) +bool KBookmarkDrag::canDecode( const TQMimeSource * e ) { return e->provides("text/uri-list") || e->provides("application/x-xbel") || e->provides("text/plain"); } -QValueList<KBookmark> KBookmarkDrag::decode( const QMimeSource * e ) +TQValueList<KBookmark> KBookmarkDrag::decode( const TQMimeSource * e ) { - QValueList<KBookmark> bookmarks; + TQValueList<KBookmark> bookmarks; if ( e->provides("application/x-xbel") ) { - QByteArray s( e->encodedData("application/x-xbel") ); - //kdDebug(7043) << "KBookmarkDrag::decode s=" << QCString(s) << endl; - QDomDocument doc; + TQByteArray s( e->encodedData("application/x-xbel") ); + //kdDebug(7043) << "KBookmarkDrag::decode s=" << TQCString(s) << endl; + TQDomDocument doc; doc.setContent( s ); - QDomElement elem = doc.documentElement(); - QDomNodeList children = elem.childNodes(); + TQDomElement elem = doc.documentElement(); + TQDomNodeList children = elem.childNodes(); for ( uint childno = 0; childno < children.count(); childno++) { bookmarks.append( KBookmark( children.item(childno).cloneNode(true).toElement() )); @@ -149,13 +149,13 @@ QValueList<KBookmark> KBookmarkDrag::decode( const QMimeSource * e ) if( e->provides("text/plain") ) { //kdDebug(7043) << "KBookmarkDrag::decode text/plain" << endl; - QString s; - if(QTextDrag::decode( e, s )) + TQString s; + if(TQTextDrag::decode( e, s )) { - QStringList listDragURLs = QStringList::split(QChar('\n'), s); - QStringList::ConstIterator it = listDragURLs.begin(); - QStringList::ConstIterator end = listDragURLs.end(); + TQStringList listDragURLs = TQStringList::split(TQChar('\n'), s); + TQStringList::ConstIterator it = listDragURLs.begin(); + TQStringList::ConstIterator end = listDragURLs.end(); for( ; it!=end; ++it) { //kdDebug(7043)<<"KBookmarkDrag::decode string"<<(*it)<<endl; diff --git a/kio/bookmarks/kbookmarkdrag.h b/kio/bookmarks/kbookmarkdrag.h index fdaaf23f3..98aa3b881 100644 --- a/kio/bookmarks/kbookmarkdrag.h +++ b/kio/bookmarks/kbookmarkdrag.h @@ -21,36 +21,36 @@ #ifndef __kebdrag_h #define __kebdrag_h -#include <qdragobject.h> +#include <tqdragobject.h> #include <kbookmark.h> // Clipboard/dnd data : URLs + XML for bookmarks class KIO_EXPORT KBookmarkDrag : public QUriDrag { public: - static KBookmarkDrag * newDrag( const QValueList<KBookmark> & bookmarks, - QWidget * dragSource = 0, + static KBookmarkDrag * newDrag( const TQValueList<KBookmark> & bookmarks, + TQWidget * dragSource = 0, const char * name = 0 ); static KBookmarkDrag * newDrag( const KBookmark & bookmark, - QWidget * dragSource = 0, + TQWidget * dragSource = 0, const char * name = 0 ); protected: - KBookmarkDrag( const QValueList<KBookmark> & bookmarks, - const QStrList & urls, - QWidget * dragSource, + KBookmarkDrag( const TQValueList<KBookmark> & bookmarks, + const TQStrList & urls, + TQWidget * dragSource, const char * name ); public: virtual ~KBookmarkDrag() {} virtual const char* format( int i ) const; - virtual QByteArray encodedData( const char* mime ) const; + virtual TQByteArray encodedData( const char* mime ) const; - static bool canDecode( const QMimeSource * e ); - static QValueList<KBookmark> decode( const QMimeSource * e ); + static bool canDecode( const TQMimeSource * e ); + static TQValueList<KBookmark> decode( const TQMimeSource * e ); protected: - QValueList<KBookmark> m_bookmarks; - QDomDocument m_doc; + TQValueList<KBookmark> m_bookmarks; + TQDomDocument m_doc; class KBookmarkDragPrivate; KBookmarkDragPrivate * d; }; diff --git a/kio/bookmarks/kbookmarkexporter.cc b/kio/bookmarks/kbookmarkexporter.cc index 8ed394ad1..30c52bdb8 100644 --- a/kio/bookmarks/kbookmarkexporter.cc +++ b/kio/bookmarks/kbookmarkexporter.cc @@ -19,9 +19,9 @@ */ #include <stdio.h> -#include <qfile.h> -#include <qtextcodec.h> -#include <qstylesheet.h> +#include <tqfile.h> +#include <tqtextcodec.h> +#include <tqstylesheet.h> #include <kdebug.h> #include <klocale.h> diff --git a/kio/bookmarks/kbookmarkexporter.h b/kio/bookmarks/kbookmarkexporter.h index 19978b3dd..0943d6cbe 100644 --- a/kio/bookmarks/kbookmarkexporter.h +++ b/kio/bookmarks/kbookmarkexporter.h @@ -23,7 +23,7 @@ #ifndef __kbookmarkexporter_h #define __kbookmarkexporter_h -#include <qtextstream.h> +#include <tqtextstream.h> #include <kbookmark.h> /** @@ -32,13 +32,13 @@ class KIO_EXPORT KBookmarkExporterBase { public: - KBookmarkExporterBase(KBookmarkManager* mgr, const QString & fileName) + KBookmarkExporterBase(KBookmarkManager* mgr, const TQString & fileName) : m_fileName(fileName), m_pManager(mgr) { ; } virtual ~KBookmarkExporterBase() {} virtual void write(KBookmarkGroup) = 0; protected: - QString m_fileName; + TQString m_fileName; KBookmarkManager* m_pManager; private: class KBookmarkExporterBasePrivate *d; diff --git a/kio/bookmarks/kbookmarkimporter.cc b/kio/bookmarks/kbookmarkimporter.cc index b646b0626..8a31fa3d2 100644 --- a/kio/bookmarks/kbookmarkimporter.cc +++ b/kio/bookmarks/kbookmarkimporter.cc @@ -23,7 +23,7 @@ #include <klocale.h> #include <kdebug.h> #include <kcharsets.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <sys/types.h> #include <stddef.h> @@ -70,19 +70,19 @@ void KXBELBookmarkImporterImpl::visitLeave(const KBookmarkGroup &) emit endFolder(); } -void KBookmarkImporterBase::setupSignalForwards(QObject *src, QObject *dst) +void KBookmarkImporterBase::setupSignalForwards(TQObject *src, TQObject *dst) { - connect(src, SIGNAL( newBookmark( const QString &, const QCString &, const QString & ) ), - dst, SIGNAL( newBookmark( const QString &, const QCString &, const QString & ) )); - connect(src, SIGNAL( newFolder( const QString &, bool, const QString & ) ), - dst, SIGNAL( newFolder( const QString &, bool, const QString & ) )); - connect(src, SIGNAL( newSeparator() ), - dst, SIGNAL( newSeparator() ) ); - connect(src, SIGNAL( endFolder() ), - dst, SIGNAL( endFolder() ) ); + connect(src, TQT_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) ), + dst, TQT_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) )); + connect(src, TQT_SIGNAL( newFolder( const TQString &, bool, const TQString & ) ), + dst, TQT_SIGNAL( newFolder( const TQString &, bool, const TQString & ) )); + connect(src, TQT_SIGNAL( newSeparator() ), + dst, TQT_SIGNAL( newSeparator() ) ); + connect(src, TQT_SIGNAL( endFolder() ), + dst, TQT_SIGNAL( endFolder() ) ); } -KBookmarkImporterBase* KBookmarkImporterBase::factory( const QString &type ) +KBookmarkImporterBase* KBookmarkImporterBase::factory( const TQString &type ) { if (type == "netscape") return new KNSBookmarkImporterImpl; diff --git a/kio/bookmarks/kbookmarkimporter.h b/kio/bookmarks/kbookmarkimporter.h index f8f53ffa2..bf8d61137 100644 --- a/kio/bookmarks/kbookmarkimporter.h +++ b/kio/bookmarks/kbookmarkimporter.h @@ -21,9 +21,9 @@ #ifndef __kbookmarkimporter_h #define __kbookmarkimporter_h -#include <qdom.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include <ksimpleconfig.h> #include "kbookmark.h" @@ -41,27 +41,27 @@ public: KBookmarkImporterBase() {} virtual ~KBookmarkImporterBase() {} - void setFilename(const QString &filename) { m_fileName = filename; } + void setFilename(const TQString &filename) { m_fileName = filename; } virtual void parse() = 0; - virtual QString findDefaultLocation(bool forSaving = false) const = 0; + virtual TQString findDefaultLocation(bool forSaving = false) const = 0; // TODO - make this static? - void setupSignalForwards(QObject *src, QObject *dst); - static KBookmarkImporterBase *factory(const QString &type); + void setupSignalForwards(TQObject *src, TQObject *dst); + static KBookmarkImporterBase *factory(const TQString &type); signals: /** * Notify about a new bookmark * Use "html" for the icon */ - void newBookmark(const QString & text, const QCString & url, const QString & additionalInfo); + void newBookmark(const TQString & text, const TQCString & url, const TQString & additionalInfo); /** * Notify about a new folder * Use "bookmark_folder" for the icon */ - void newFolder(const QString & text, bool open, const QString & additionalInfo); + void newFolder(const TQString & text, bool open, const TQString & additionalInfo); /** * Notify about a new separator @@ -75,7 +75,7 @@ signals: void endFolder(); protected: - QString m_fileName; + TQString m_fileName; private: class KBookmarkImporterBasePrivate *d; @@ -90,7 +90,7 @@ class KIO_EXPORT KXBELBookmarkImporterImpl : public KBookmarkImporterBase, prote public: KXBELBookmarkImporterImpl() {} virtual void parse(); - virtual QString findDefaultLocation(bool = false) const { return QString::null; } + virtual TQString findDefaultLocation(bool = false) const { return TQString::null; } protected: virtual void visit(const KBookmark &); virtual void visitEnter(const KBookmarkGroup &); diff --git a/kio/bookmarks/kbookmarkimporter_crash.cc b/kio/bookmarks/kbookmarkimporter_crash.cc index b585df4c7..594dc0239 100644 --- a/kio/bookmarks/kbookmarkimporter_crash.cc +++ b/kio/bookmarks/kbookmarkimporter_crash.cc @@ -26,10 +26,10 @@ #include <kdebug.h> #include <kapplication.h> #include <kstandarddirs.h> -#include <qfile.h> -#include <qdir.h> -#include <qstring.h> -#include <qtextcodec.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqstring.h> +#include <tqtextcodec.h> #include <dcopclient.h> #include <sys/types.h> @@ -37,27 +37,27 @@ #include <dirent.h> #include <sys/stat.h> -typedef QMap<QString, QString> ViewMap; +typedef TQMap<TQString, TQString> ViewMap; // KDE 4.0: remove this BC keeping stub -void KCrashBookmarkImporter::parseCrashLog( QString /*filename*/, bool /*del*/ ) +void KCrashBookmarkImporter::parseCrashLog( TQString /*filename*/, bool /*del*/ ) { ; } -ViewMap KCrashBookmarkImporterImpl::parseCrashLog_noemit( const QString & filename, bool del ) +ViewMap KCrashBookmarkImporterImpl::parseCrashLog_noemit( const TQString & filename, bool del ) { static const int g_lineLimit = 16*1024; - QFile f( filename ); + TQFile f( filename ); ViewMap views; if ( !f.open( IO_ReadOnly ) ) return views; - QCString s( g_lineLimit ); + TQCString s( g_lineLimit ); - QTextCodec * codec = QTextCodec::codecForName( "UTF-8" ); + TQTextCodec * codec = TQTextCodec::codecForName( "UTF-8" ); Q_ASSERT( codec ); if ( !codec ) return views; @@ -69,8 +69,8 @@ ViewMap KCrashBookmarkImporterImpl::parseCrashLog_noemit( const QString & filena kdWarning() << "Crash bookmarks contain a line longer than " << g_lineLimit << ". Skipping." << endl; continue; } - QString t = codec->toUnicode( s.stripWhiteSpace() ); - QRegExp rx( "(.*)\\((.*)\\):(.*)$" ); + TQString t = codec->toUnicode( s.stripWhiteSpace() ); + TQRegExp rx( "(.*)\\((.*)\\):(.*)$" ); rx.setMinimal( true ); if ( !rx.exactMatch( t ) ) continue; @@ -88,28 +88,28 @@ ViewMap KCrashBookmarkImporterImpl::parseCrashLog_noemit( const QString & filena return views; } -QStringList KCrashBookmarkImporter::getCrashLogs() +TQStringList KCrashBookmarkImporter::getCrashLogs() { return KCrashBookmarkImporterImpl::getCrashLogs(); } -QStringList KCrashBookmarkImporterImpl::getCrashLogs() +TQStringList KCrashBookmarkImporterImpl::getCrashLogs() { - QMap<QString, bool> activeLogs; + TQMap<TQString, bool> activeLogs; DCOPClient* dcop = kapp->dcopClient(); QCStringList apps = dcop->registeredApplications(); for ( QCStringList::Iterator it = apps.begin(); it != apps.end(); ++it ) { - QCString &clientId = *it; + TQCString &clientId = *it; if ( qstrncmp(clientId, "konqueror", 9) != 0 ) continue; - QByteArray data, replyData; - QCString replyType; - QDataStream arg( data, IO_WriteOnly ); + TQByteArray data, replyData; + TQCString replyType; + TQDataStream arg( data, IO_WriteOnly ); if ( !dcop->call( clientId.data(), "KonquerorIface", "crashLogFile()", data, replyType, replyData) ) @@ -118,25 +118,25 @@ QStringList KCrashBookmarkImporterImpl::getCrashLogs() continue; } - if ( replyType != "QString" ) + if ( replyType != "TQString" ) continue; - QDataStream reply( replyData, IO_ReadOnly ); - QString ret; + TQDataStream reply( replyData, IO_ReadOnly ); + TQString ret; reply >> ret; activeLogs[ret] = true; } - QDir d( KCrashBookmarkImporterImpl().findDefaultLocation() ); - d.setSorting( QDir::Time ); - d.setFilter( QDir::Files ); + TQDir d( KCrashBookmarkImporterImpl().findDefaultLocation() ); + d.setSorting( TQDir::Time ); + d.setFilter( TQDir::Files ); d.setNameFilter( "konqueror-crash-*.log" ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); - QFileInfo *fi; - QStringList crashFiles; + TQFileInfo *fi; + TQStringList crashFiles; int count = 0; for ( ; (( fi = it.current() ) != 0) && (count < 20); ++it, ++count ) @@ -148,7 +148,7 @@ QStringList KCrashBookmarkImporterImpl::getCrashLogs() // Delete remaining ones for ( ; ( fi = it.current() ) != 0; ++it ) { - QFile::remove( fi->absFilePath() ); + TQFile::remove( fi->absFilePath() ); } return crashFiles; @@ -156,20 +156,20 @@ QStringList KCrashBookmarkImporterImpl::getCrashLogs() void KCrashBookmarkImporterImpl::parse() { - QDict<bool> signatureMap; - QStringList crashFiles = KCrashBookmarkImporterImpl::getCrashLogs(); + TQDict<bool> signatureMap; + TQStringList crashFiles = KCrashBookmarkImporterImpl::getCrashLogs(); int count = 1; - for ( QStringList::Iterator it = crashFiles.begin(); it != crashFiles.end(); ++it ) + for ( TQStringList::Iterator it = crashFiles.begin(); it != crashFiles.end(); ++it ) { ViewMap views; views = parseCrashLog_noemit( *it, m_shouldDelete ); - QString signature; + TQString signature; for ( ViewMap::Iterator vit = views.begin(); vit != views.end(); ++vit ) signature += "|"+vit.data(); if (signatureMap[signature]) { // Duplicate... throw away and skip - QFile::remove(*it); + TQFile::remove(*it); continue; } @@ -177,15 +177,15 @@ void KCrashBookmarkImporterImpl::parse() int outerFolder = ( crashFiles.count() > 1 ) && (views.count() > 0); if ( outerFolder ) - emit newFolder( QString("Konqueror Window %1").arg(count++), false, "" ); + emit newFolder( TQString("Konqueror Window %1").arg(count++), false, "" ); for ( ViewMap::Iterator vit = views.begin(); vit != views.end(); ++vit ) - emit newBookmark( vit.data(), vit.data().latin1(), QString("") ); + emit newBookmark( vit.data(), vit.data().latin1(), TQString("") ); if ( outerFolder ) emit endFolder(); } } -QString KCrashBookmarkImporter::crashBookmarksDir() +TQString KCrashBookmarkImporter::crashBookmarksDir() { static KCrashBookmarkImporterImpl *p = 0; if (!p) @@ -207,7 +207,7 @@ void KCrashBookmarkImporter::parseCrashBookmarks( bool del ) importer.parse(); } -QString KCrashBookmarkImporterImpl::findDefaultLocation( bool ) const +TQString KCrashBookmarkImporterImpl::findDefaultLocation( bool ) const { return locateLocal( "tmp", "" ); } diff --git a/kio/bookmarks/kbookmarkimporter_crash.h b/kio/bookmarks/kbookmarkimporter_crash.h index 701387b4e..e22ef1b9e 100644 --- a/kio/bookmarks/kbookmarkimporter_crash.h +++ b/kio/bookmarks/kbookmarkimporter_crash.h @@ -21,10 +21,10 @@ #ifndef __kbookmarkimporter_crash_h #define __kbookmarkimporter_crash_h -#include <qdom.h> -#include <qcstring.h> -#include <qstringlist.h> -#include <qmap.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqstringlist.h> +#include <tqmap.h> #include <ksimpleconfig.h> #include <kdemacros.h> @@ -38,19 +38,19 @@ class KIO_EXPORT_DEPRECATED KCrashBookmarkImporter : public QObject { Q_OBJECT public: - KCrashBookmarkImporter( const QString & fileName ) : m_fileName(fileName) {} + KCrashBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {} ~KCrashBookmarkImporter() {} void parseCrashBookmarks( bool del = true ); - static QString crashBookmarksDir( ); - static QStringList getCrashLogs(); // EMPTY! + static TQString crashBookmarksDir( ); + static TQStringList getCrashLogs(); // EMPTY! signals: - void newBookmark( const QString & text, const QCString & url, const QString & additionalInfo ); - void newFolder( const QString & text, bool open, const QString & additionalInfo ); + void newBookmark( const TQString & text, const TQCString & url, const TQString & additionalInfo ); + void newFolder( const TQString & text, bool open, const TQString & additionalInfo ); void newSeparator(); void endFolder(); protected: - QString m_fileName; - void parseCrashLog( QString filename, bool del ); // EMPTY! + TQString m_fileName; + void parseCrashLog( TQString filename, bool del ); // EMPTY! }; /** @@ -63,11 +63,11 @@ public: KCrashBookmarkImporterImpl() : m_shouldDelete(false) { } void setShouldDelete(bool); virtual void parse(); - virtual QString findDefaultLocation(bool forSaving = false) const; - static QStringList getCrashLogs(); + virtual TQString findDefaultLocation(bool forSaving = false) const; + static TQStringList getCrashLogs(); private: bool m_shouldDelete; - QMap<QString, QString> parseCrashLog_noemit( const QString & filename, bool del ); + TQMap<TQString, TQString> parseCrashLog_noemit( const TQString & filename, bool del ); class KCrashBookmarkImporterImplPrivate *d; }; diff --git a/kio/bookmarks/kbookmarkimporter_ie.cc b/kio/bookmarks/kbookmarkimporter_ie.cc index a2e863518..f37a6a4be 100644 --- a/kio/bookmarks/kbookmarkimporter_ie.cc +++ b/kio/bookmarks/kbookmarkimporter_ie.cc @@ -22,7 +22,7 @@ #include <kstringhandler.h> #include <klocale.h> #include <kdebug.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <sys/types.h> #include <stddef.h> @@ -32,15 +32,15 @@ #include "kbookmarkimporter.h" #include "kbookmarkimporter_ie.h" -/* antlarr: KDE 4: Make them const QString & */ -void KIEBookmarkImporter::parseIEBookmarks_url_file( QString filename, QString name ) { +/* antlarr: KDE 4: Make them const TQString & */ +void KIEBookmarkImporter::parseIEBookmarks_url_file( TQString filename, TQString name ) { static const int g_lineLimit = 16*1024; - QFile f(filename); + TQFile f(filename); if(f.open(IO_ReadOnly)) { - QCString s(g_lineLimit); + TQCString s(g_lineLimit); while(f.readLine(s.data(), g_lineLimit)>=0) { if ( s[s.length()-1] != '\n' ) // Gosh, this line is longer than g_lineLimit. Skipping. @@ -48,10 +48,10 @@ void KIEBookmarkImporter::parseIEBookmarks_url_file( QString filename, QString n kdWarning() << "IE bookmarks contain a line longer than " << g_lineLimit << ". Skipping." << endl; continue; } - QCString t = s.stripWhiteSpace(); - QRegExp rx( "URL=(.*)" ); + TQCString t = s.stripWhiteSpace(); + TQRegExp rx( "URL=(.*)" ); if (rx.exactMatch(t)) { - emit newBookmark( name, rx.cap(1).latin1(), QString("") ); + emit newBookmark( name, rx.cap(1).latin1(), TQString("") ); } } @@ -59,13 +59,13 @@ void KIEBookmarkImporter::parseIEBookmarks_url_file( QString filename, QString n } } -/* antlarr: KDE 4: Make them const QString & */ -void KIEBookmarkImporter::parseIEBookmarks_dir( QString dirname, QString foldername ) +/* antlarr: KDE 4: Make them const TQString & */ +void KIEBookmarkImporter::parseIEBookmarks_dir( TQString dirname, TQString foldername ) { - QDir dir(dirname); - dir.setFilter( QDir::Files | QDir::Dirs ); - dir.setSorting( QDir::Name | QDir::DirsFirst ); + TQDir dir(dirname); + dir.setFilter( TQDir::Files | TQDir::Dirs ); + dir.setSorting( TQDir::Name | TQDir::DirsFirst ); dir.setNameFilter("*.url"); // AK - possibly add ";index.ini" ? dir.setMatchAllDirs(true); @@ -76,7 +76,7 @@ void KIEBookmarkImporter::parseIEBookmarks_dir( QString dirname, QString foldern emit newFolder( foldername, false, "" ); QFileInfoListIterator it( *list ); - QFileInfo *fi; + TQFileInfo *fi; while ( (fi = it.current()) != 0 ) { ++it; @@ -88,7 +88,7 @@ void KIEBookmarkImporter::parseIEBookmarks_dir( QString dirname, QString foldern } else if (fi->isFile()) { if (fi->fileName().endsWith(".url")) { - QString name = fi->fileName(); + TQString name = fi->fileName(); name.truncate(name.length() - 4); // .url parseIEBookmarks_url_file(fi->absFilePath(), name); } @@ -106,7 +106,7 @@ void KIEBookmarkImporter::parseIEBookmarks( ) parseIEBookmarks_dir( m_fileName ); } -QString KIEBookmarkImporter::IEBookmarksDir() +TQString KIEBookmarkImporter::IEBookmarksDir() { static KIEBookmarkImporterImpl* p = 0; if (!p) @@ -120,7 +120,7 @@ void KIEBookmarkImporterImpl::parse() { importer.parseIEBookmarks(); } -QString KIEBookmarkImporterImpl::findDefaultLocation(bool) const +TQString KIEBookmarkImporterImpl::findDefaultLocation(bool) const { // notify user that they must give a new dir such // as "Favourites" as otherwise it'll just place @@ -135,38 +135,38 @@ QString KIEBookmarkImporterImpl::findDefaultLocation(bool) const class IEExporter : private KBookmarkGroupTraverser { public: - IEExporter( const QString & ); + IEExporter( const TQString & ); void write( const KBookmarkGroup &grp ) { traverse(grp); }; private: virtual void visit( const KBookmark & ); virtual void visitEnter( const KBookmarkGroup & ); virtual void visitLeave( const KBookmarkGroup & ); private: - QDir m_currentDir; + TQDir m_currentDir; }; -static QString ieStyleQuote( const QString &str ) { - QString s(str); - s.replace(QRegExp("[/\\:*?\"<>|]"), "_"); +static TQString ieStyleQuote( const TQString &str ) { + TQString s(str); + s.replace(TQRegExp("[/\\:*?\"<>|]"), "_"); return s; } -IEExporter::IEExporter( const QString & dname ) { +IEExporter::IEExporter( const TQString & dname ) { m_currentDir.setPath( dname ); } void IEExporter::visit( const KBookmark &bk ) { - QString fname = m_currentDir.path() + "/" + ieStyleQuote( bk.fullText() ) + ".url"; + TQString fname = m_currentDir.path() + "/" + ieStyleQuote( bk.fullText() ) + ".url"; // kdDebug() << "visit(" << bk.text() << "), fname == " << fname << endl; - QFile file( fname ); + TQFile file( fname ); file.open( IO_WriteOnly ); - QTextStream ts( &file ); + TQTextStream ts( &file ); ts << "[InternetShortcut]\r\n"; ts << "URL=" << bk.url().url().utf8() << "\r\n"; } void IEExporter::visitEnter( const KBookmarkGroup &grp ) { - QString dname = m_currentDir.path() + "/" + ieStyleQuote( grp.fullText() ); + TQString dname = m_currentDir.path() + "/" + ieStyleQuote( grp.fullText() ); // kdDebug() << "visitEnter(" << grp.text() << "), dname == " << dname << endl; m_currentDir.mkdir( dname ); m_currentDir.cd( dname ); diff --git a/kio/bookmarks/kbookmarkimporter_ie.h b/kio/bookmarks/kbookmarkimporter_ie.h index 86f41a4f6..2a9ddac6d 100644 --- a/kio/bookmarks/kbookmarkimporter_ie.h +++ b/kio/bookmarks/kbookmarkimporter_ie.h @@ -21,9 +21,9 @@ #ifndef __kbookmarkimporter_ie_h #define __kbookmarkimporter_ie_h -#include <qdom.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include <ksimpleconfig.h> #include <kdemacros.h> @@ -37,25 +37,25 @@ class KIO_EXPORT_DEPRECATED KIEBookmarkImporter : public QObject { Q_OBJECT public: - KIEBookmarkImporter( const QString & fileName ) : m_fileName(fileName) {} + KIEBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {} ~KIEBookmarkImporter() {} void parseIEBookmarks(); // Usual place for IE bookmarks - static QString IEBookmarksDir(); + static TQString IEBookmarksDir(); signals: - void newBookmark( const QString & text, const QCString & url, const QString & additionalInfo ); - void newFolder( const QString & text, bool open, const QString & additionalInfo ); + void newBookmark( const TQString & text, const TQCString & url, const TQString & additionalInfo ); + void newFolder( const TQString & text, bool open, const TQString & additionalInfo ); void newSeparator(); void endFolder(); protected: - void parseIEBookmarks_dir( QString dirname, QString name = QString::null ); - void parseIEBookmarks_url_file( QString filename, QString name ); + void parseIEBookmarks_dir( TQString dirname, TQString name = TQString::null ); + void parseIEBookmarks_url_file( TQString filename, TQString name ); - QString m_fileName; + TQString m_fileName; }; /** @@ -67,7 +67,7 @@ class KIO_EXPORT KIEBookmarkImporterImpl : public KBookmarkImporterBase public: KIEBookmarkImporterImpl() { } virtual void parse(); - virtual QString findDefaultLocation(bool forSaving = false) const; + virtual TQString findDefaultLocation(bool forSaving = false) const; private: class KIEBookmarkImporterImplPrivate *d; }; @@ -78,7 +78,7 @@ private: class KIO_EXPORT KIEBookmarkExporterImpl : public KBookmarkExporterBase { public: - KIEBookmarkExporterImpl(KBookmarkManager* mgr, const QString & path) + KIEBookmarkExporterImpl(KBookmarkManager* mgr, const TQString & path) : KBookmarkExporterBase(mgr, path) { ; } virtual ~KIEBookmarkExporterImpl() {} diff --git a/kio/bookmarks/kbookmarkimporter_kde1.cc b/kio/bookmarks/kbookmarkimporter_kde1.cc index 72fe8dbb3..510787ab1 100644 --- a/kio/bookmarks/kbookmarkimporter_kde1.cc +++ b/kio/bookmarks/kbookmarkimporter_kde1.cc @@ -24,7 +24,7 @@ #include <klocale.h> #include <kdebug.h> #include <kcharsets.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <sys/types.h> #include <stddef.h> @@ -34,19 +34,19 @@ //////////////////// -void KBookmarkImporter::import( const QString & path ) +void KBookmarkImporter::import( const TQString & path ) { - QDomElement elem = m_pDoc->documentElement(); + TQDomElement elem = m_pDoc->documentElement(); Q_ASSERT(!elem.isNull()); scanIntern( elem, path ); } -void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _path ) +void KBookmarkImporter::scanIntern( TQDomElement & parentElem, const TQString & _path ) { kdDebug(7043) << "KBookmarkImporter::scanIntern " << _path << endl; // Substitute all symbolic links in the path - QDir dir( _path ); - QString canonical = dir.canonicalPath(); + TQDir dir( _path ); + TQString canonical = dir.canonicalPath(); if ( m_lstParsedDirs.contains(canonical) ) { @@ -58,7 +58,7 @@ void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _p DIR *dp; struct dirent *ep; - dp = opendir( QFile::encodeName(_path) ); + dp = opendir( TQFile::encodeName(_path) ); if ( dp == 0L ) return; @@ -68,7 +68,7 @@ void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _p if ( strcmp( ep->d_name, "." ) != 0 && strcmp( ep->d_name, ".." ) != 0 ) { KURL file; - file.setPath( QString( _path ) + '/' + QFile::decodeName(ep->d_name) ); + file.setPath( TQString( _path ) + '/' + TQFile::decodeName(ep->d_name) ); KMimeType::Ptr res = KMimeType::findByURL( file, 0, true ); //kdDebug(7043) << " - " << file.url() << " -> " << res->name() << endl; @@ -77,9 +77,9 @@ void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _p { // We could use KBookmarkGroup::createNewFolder, but then it // would notify about the change, so we'd need a flag, etc. - QDomElement groupElem = m_pDoc->createElement( "folder" ); + TQDomElement groupElem = m_pDoc->createElement( "folder" ); parentElem.appendChild( groupElem ); - QDomElement textElem = m_pDoc->createElement( "title" ); + TQDomElement textElem = m_pDoc->createElement( "title" ); groupElem.appendChild( textElem ); textElem.appendChild( m_pDoc->createTextNode( KIO::decodeFileName( ep->d_name ) ) ); if ( KIO::decodeFileName( ep->d_name ) == "Toolbar" ) @@ -90,7 +90,7 @@ void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _p { KSimpleConfig cfg( file.path(), true ); cfg.setDesktopGroup(); - QString type = cfg.readEntry( "Type" ); + TQString type = cfg.readEntry( "Type" ); // Is it really a bookmark file ? if ( type == "Link" ) parseBookmark( parentElem, ep->d_name, cfg, 0 /* desktop group */ ); @@ -101,12 +101,12 @@ void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _p { // maybe its an IE Favourite.. KSimpleConfig cfg( file.path(), true ); - QStringList grp = cfg.groupList().grep( "internetshortcut", false ); + TQStringList grp = cfg.groupList().grep( "internetshortcut", false ); if ( grp.count() == 0 ) continue; cfg.setGroup( *grp.begin() ); - QString url = cfg.readPathEntry("URL"); + TQString url = cfg.readPathEntry("URL"); if (!url.isEmpty() ) parseBookmark( parentElem, ep->d_name, cfg, *grp.begin() ); } else @@ -117,33 +117,33 @@ void KBookmarkImporter::scanIntern( QDomElement & parentElem, const QString & _p closedir( dp ); } -void KBookmarkImporter::parseBookmark( QDomElement & parentElem, QCString _text, - KSimpleConfig& _cfg, const QString &_group ) +void KBookmarkImporter::parseBookmark( TQDomElement & parentElem, TQCString _text, + KSimpleConfig& _cfg, const TQString &_group ) { if ( !_group.isEmpty() ) _cfg.setGroup( _group ); else _cfg.setDesktopGroup(); - QString url = _cfg.readPathEntry( "URL" ); - QString icon = _cfg.readEntry( "Icon" ); + TQString url = _cfg.readPathEntry( "URL" ); + TQString icon = _cfg.readEntry( "Icon" ); if (icon.right( 4 ) == ".xpm" ) // prevent warnings icon.truncate( icon.length() - 4 ); - QString text = KIO::decodeFileName( QString::fromLocal8Bit(_text) ); + TQString text = KIO::decodeFileName( TQString::fromLocal8Bit(_text) ); if ( text.length() > 8 && text.right( 8 ) == ".desktop" ) text.truncate( text.length() - 8 ); if ( text.length() > 7 && text.right( 7 ) == ".kdelnk" ) text.truncate( text.length() - 7 ); - QDomElement elem = m_pDoc->createElement( "bookmark" ); + TQDomElement elem = m_pDoc->createElement( "bookmark" ); parentElem.appendChild( elem ); elem.setAttribute( "href", url ); //if ( icon != "www" ) // No need to save the default // Hmm, after all, it makes KBookmark::pixmapFile faster, // and it shows a nice feature to those reading the file elem.setAttribute( "icon", icon ); - QDomElement textElem = m_pDoc->createElement( "title" ); + TQDomElement textElem = m_pDoc->createElement( "title" ); elem.appendChild( textElem ); textElem.appendChild( m_pDoc->createTextNode( text ) ); kdDebug(7043) << "KBookmarkImporter::parseBookmark text=" << text << endl; diff --git a/kio/bookmarks/kbookmarkimporter_kde1.h b/kio/bookmarks/kbookmarkimporter_kde1.h index 9811cce55..7e6ad2395 100644 --- a/kio/bookmarks/kbookmarkimporter_kde1.h +++ b/kio/bookmarks/kbookmarkimporter_kde1.h @@ -21,9 +21,9 @@ #ifndef __kbookmarkimporter_kde1_h #define __kbookmarkimporter_kde1_h -#include <qdom.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include <ksimpleconfig.h> /** @@ -34,16 +34,16 @@ class KIO_EXPORT KBookmarkImporter { public: - KBookmarkImporter( QDomDocument * doc ) : m_pDoc(doc) {} + KBookmarkImporter( TQDomDocument * doc ) : m_pDoc(doc) {} - void import( const QString & path ); + void import( const TQString & path ); private: - void scanIntern( QDomElement & parentElem, const QString & _path ); - void parseBookmark( QDomElement & parentElem, QCString _text, - KSimpleConfig& _cfg, const QString &_group ); - QDomDocument * m_pDoc; - QStringList m_lstParsedDirs; + void scanIntern( TQDomElement & parentElem, const TQString & _path ); + void parseBookmark( TQDomElement & parentElem, TQCString _text, + KSimpleConfig& _cfg, const TQString &_group ); + TQDomDocument * m_pDoc; + TQStringList m_lstParsedDirs; }; #endif diff --git a/kio/bookmarks/kbookmarkimporter_ns.cc b/kio/bookmarks/kbookmarkimporter_ns.cc index 23f37e4cb..5521bee7e 100644 --- a/kio/bookmarks/kbookmarkimporter_ns.cc +++ b/kio/bookmarks/kbookmarkimporter_ns.cc @@ -28,8 +28,8 @@ #include <klocale.h> #include <kdebug.h> #include <kcharsets.h> -#include <qtextcodec.h> -#include <qstylesheet.h> +#include <tqtextcodec.h> +#include <tqstylesheet.h> #include <sys/types.h> #include <stddef.h> @@ -39,8 +39,8 @@ void KNSBookmarkImporterImpl::parse() { - QFile f(m_fileName); - QTextCodec * codec = m_utf8 ? QTextCodec::codecForName("UTF-8") : QTextCodec::codecForLocale(); + TQFile f(m_fileName); + TQTextCodec * codec = m_utf8 ? TQTextCodec::codecForName("UTF-8") : TQTextCodec::codecForLocale(); Q_ASSERT(codec); if (!codec) return; @@ -48,7 +48,7 @@ void KNSBookmarkImporterImpl::parse() if(f.open(IO_ReadOnly)) { static const int g_lineLimit = 16*1024; - QCString s(g_lineLimit); + TQCString s(g_lineLimit); // skip header while(f.readLine(s.data(), g_lineLimit) >= 0 && !s.contains("<DL>")); @@ -58,21 +58,21 @@ void KNSBookmarkImporterImpl::parse() kdWarning() << "Netscape bookmarks contain a line longer than " << g_lineLimit << ". Skipping." << endl; continue; } - QCString t = s.stripWhiteSpace(); + TQCString t = s.stripWhiteSpace(); if(t.left(12).upper() == "<DT><A HREF=" || t.left(16).upper() == "<DT><H3><A HREF=") { int firstQuotes = t.find('"')+1; int secondQuotes = t.find('"', firstQuotes); if (firstQuotes != -1 && secondQuotes != -1) { - QCString link = t.mid(firstQuotes, secondQuotes-firstQuotes); + TQCString link = t.mid(firstQuotes, secondQuotes-firstQuotes); int endTag = t.find('>', secondQuotes+1); - QCString name = t.mid(endTag+1); + TQCString name = t.mid(endTag+1); name = name.left(name.findRev('<')); if ( name.right(4) == "</A>" ) name = name.left( name.length() - 4 ); - QString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); - QCString additionalInfo = t.mid( secondQuotes+1, endTag-secondQuotes-1 ); + TQString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); + TQCString additionalInfo = t.mid( secondQuotes+1, endTag-secondQuotes-1 ); emit newBookmark( qname, link, codec->toUnicode(additionalInfo) ); @@ -80,10 +80,10 @@ void KNSBookmarkImporterImpl::parse() } else if(t.left(7).upper() == "<DT><H3") { int endTag = t.find('>', 7); - QCString name = t.mid(endTag+1); + TQCString name = t.mid(endTag+1); name = name.left(name.findRev('<')); - QString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); - QCString additionalInfo = t.mid( 8, endTag-8 ); + TQString qname = KCharsets::resolveEntities( codec->toUnicode( name ) ); + TQCString additionalInfo = t.mid( 8, endTag-8 ); bool folded = (additionalInfo.left(6) == "FOLDED"); if (folded) additionalInfo.remove(0,7); @@ -101,20 +101,20 @@ void KNSBookmarkImporterImpl::parse() } } -QString KNSBookmarkImporterImpl::findDefaultLocation(bool forSaving) const +TQString KNSBookmarkImporterImpl::findDefaultLocation(bool forSaving) const { if (m_utf8) { if ( forSaving ) - return KFileDialog::getSaveFileName( QDir::homeDirPath() + "/.mozilla", + return KFileDialog::getSaveFileName( TQDir::homeDirPath() + "/.mozilla", i18n("*.html|HTML Files (*.html)") ); else - return KFileDialog::getOpenFileName( QDir::homeDirPath() + "/.mozilla", + return KFileDialog::getOpenFileName( TQDir::homeDirPath() + "/.mozilla", i18n("*.html|HTML Files (*.html)") ); } else { - return QDir::homeDirPath() + "/.netscape/bookmarks.html"; + return TQDir::homeDirPath() + "/.netscape/bookmarks.html"; } } @@ -130,7 +130,7 @@ void KNSBookmarkImporter::parseNSBookmarks( bool utf8 ) importer.parse(); } -QString KNSBookmarkImporter::netscapeBookmarksFile( bool forSaving ) +TQString KNSBookmarkImporter::netscapeBookmarksFile( bool forSaving ) { static KNSBookmarkImporterImpl *p = 0; if (!p) @@ -141,7 +141,7 @@ QString KNSBookmarkImporter::netscapeBookmarksFile( bool forSaving ) return p->findDefaultLocation(forSaving); } -QString KNSBookmarkImporter::mozillaBookmarksFile( bool forSaving ) +TQString KNSBookmarkImporter::mozillaBookmarksFile( bool forSaving ) { static KNSBookmarkImporterImpl *p = 0; if (!p) @@ -163,7 +163,7 @@ void KNSBookmarkExporter::write(bool utf8) { exporter.write(m_pManager->root()); } -void KNSBookmarkExporter::writeFolder(QTextStream &/*stream*/, KBookmarkGroup /*gp*/) { +void KNSBookmarkExporter::writeFolder(TQTextStream &/*stream*/, KBookmarkGroup /*gp*/) { // TODO - requires a d pointer workaround hack? } @@ -174,24 +174,24 @@ void KNSBookmarkExporterImpl::setUtf8(bool utf8) { } void KNSBookmarkExporterImpl::write(KBookmarkGroup parent) { - if (QFile::exists(m_fileName)) { + if (TQFile::exists(m_fileName)) { ::rename( - QFile::encodeName(m_fileName), - QFile::encodeName(m_fileName + ".beforekde")); + TQFile::encodeName(m_fileName), + TQFile::encodeName(m_fileName + ".beforekde")); } - QFile file(m_fileName); + TQFile file(m_fileName); if (!file.open(IO_WriteOnly)) { kdError(7043) << "Can't write to file " << m_fileName << endl; return; } - QTextStream fstream(&file); - fstream.setEncoding(m_utf8 ? QTextStream::UnicodeUTF8 : QTextStream::Locale); + TQTextStream fstream(&file); + fstream.setEncoding(m_utf8 ? TQTextStream::UnicodeUTF8 : TQTextStream::Locale); - QString charset - = m_utf8 ? "UTF-8" : QString::fromLatin1(QTextCodec::codecForLocale()->name()).upper(); + TQString charset + = m_utf8 ? "UTF-8" : TQString::fromLatin1(TQTextCodec::codecForLocale()->name()).upper(); fstream << "<!DOCTYPE NETSCAPE-Bookmark-file-1>" << endl << i18n("<!-- This file was generated by Konqueror -->") << endl @@ -204,9 +204,9 @@ void KNSBookmarkExporterImpl::write(KBookmarkGroup parent) { << "</DL><P>" << endl; } -QString KNSBookmarkExporterImpl::folderAsString(KBookmarkGroup parent) const { - QString str; - QTextStream fstream(&str, IO_WriteOnly); +TQString KNSBookmarkExporterImpl::folderAsString(KBookmarkGroup parent) const { + TQString str; + TQTextStream fstream(&str, IO_WriteOnly); for (KBookmark bk = parent.first(); !bk.isNull(); bk = parent.next(bk)) { if (bk.isSeparator()) { @@ -214,7 +214,7 @@ QString KNSBookmarkExporterImpl::folderAsString(KBookmarkGroup parent) const { continue; } - QString text = QStyleSheet::escape(bk.fullText()); + TQString text = TQStyleSheet::escape(bk.fullText()); if (bk.isGroup() ) { fstream << "<DT><H3 " diff --git a/kio/bookmarks/kbookmarkimporter_ns.h b/kio/bookmarks/kbookmarkimporter_ns.h index 48f6705aa..8b5c76338 100644 --- a/kio/bookmarks/kbookmarkimporter_ns.h +++ b/kio/bookmarks/kbookmarkimporter_ns.h @@ -21,9 +21,9 @@ #ifndef __kbookmarkimporter_ns_h #define __kbookmarkimporter_ns_h -#include <qdom.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include <ksimpleconfig.h> #include <kdemacros.h> @@ -38,7 +38,7 @@ class KIO_EXPORT_DEPRECATED KNSBookmarkImporter : public QObject { Q_OBJECT public: - KNSBookmarkImporter( const QString & fileName ) : m_fileName(fileName) {} + KNSBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {} ~KNSBookmarkImporter() {} // for compat reasons only @@ -46,17 +46,17 @@ public: // go for it. Set utf8 to true for Mozilla, false for Netscape. void parseNSBookmarks( bool utf8 ); - static QString netscapeBookmarksFile( bool forSaving=false ); - static QString mozillaBookmarksFile( bool forSaving=false ); + static TQString netscapeBookmarksFile( bool forSaving=false ); + static TQString mozillaBookmarksFile( bool forSaving=false ); signals: - void newBookmark( const QString & text, const QCString & url, const QString & additionalInfo ); - void newFolder( const QString & text, bool open, const QString & additionalInfo ); + void newBookmark( const TQString & text, const TQCString & url, const TQString & additionalInfo ); + void newFolder( const TQString & text, bool open, const TQString & additionalInfo ); void newSeparator(); void endFolder(); protected: - QString m_fileName; + TQString m_fileName; }; /** @@ -70,7 +70,7 @@ public: KNSBookmarkImporterImpl() : m_utf8(false) { } void setUtf8(bool utf8) { m_utf8 = utf8; } virtual void parse(); - virtual QString findDefaultLocation(bool forSaving = false) const; + virtual TQString findDefaultLocation(bool forSaving = false) const; private: bool m_utf8; class KNSBookmarkImporterImplPrivate *d; @@ -97,7 +97,7 @@ private: class KIO_EXPORT_DEPRECATED KNSBookmarkExporter { public: - KNSBookmarkExporter(KBookmarkManager* mgr, const QString & fileName) + KNSBookmarkExporter(KBookmarkManager* mgr, const TQString & fileName) : m_fileName(fileName), m_pManager(mgr) { } ~KNSBookmarkExporter() {} @@ -105,8 +105,8 @@ public: void write( bool utf8 ); protected: - void writeFolder(QTextStream &stream, KBookmarkGroup parent); - QString m_fileName; + void writeFolder(TQTextStream &stream, KBookmarkGroup parent); + TQString m_fileName; KBookmarkManager* m_pManager; }; @@ -116,14 +116,14 @@ protected: class KIO_EXPORT KNSBookmarkExporterImpl : public KBookmarkExporterBase { public: - KNSBookmarkExporterImpl(KBookmarkManager* mgr, const QString & fileName) + KNSBookmarkExporterImpl(KBookmarkManager* mgr, const TQString & fileName) : KBookmarkExporterBase(mgr, fileName) { ; } virtual ~KNSBookmarkExporterImpl() {} virtual void write(KBookmarkGroup); void setUtf8(bool); protected: - QString folderAsString(KBookmarkGroup) const; + TQString folderAsString(KBookmarkGroup) const; private: bool m_utf8; class KNSBookmarkExporterImplPrivate *d; diff --git a/kio/bookmarks/kbookmarkimporter_opera.cc b/kio/bookmarks/kbookmarkimporter_opera.cc index 6e2a90570..45ac1a7ca 100644 --- a/kio/bookmarks/kbookmarkimporter_opera.cc +++ b/kio/bookmarks/kbookmarkimporter_opera.cc @@ -22,7 +22,7 @@ #include <kstringhandler.h> #include <klocale.h> #include <kdebug.h> -#include <qtextcodec.h> +#include <tqtextcodec.h> #include <sys/types.h> #include <stddef.h> @@ -34,20 +34,20 @@ void KOperaBookmarkImporter::parseOperaBookmarks( ) { - QFile file(m_fileName); + TQFile file(m_fileName); if(!file.open(IO_ReadOnly)) { return; } - QTextCodec * codec = QTextCodec::codecForName("UTF-8"); + TQTextCodec * codec = TQTextCodec::codecForName("UTF-8"); Q_ASSERT(codec); if (!codec) return; int lineno = 0; - QString url, name, type; + TQString url, name, type; static const int g_lineLimit = 16*1024; - QCString line(g_lineLimit); + TQCString line(g_lineLimit); while ( file.readLine(line.data(), g_lineLimit) >=0 ) { lineno++; @@ -56,7 +56,7 @@ void KOperaBookmarkImporter::parseOperaBookmarks( ) if ( line[line.length()-1] != '\n' || lineno <= 2 ) continue; - QString currentLine = codec->toUnicode(line).stripWhiteSpace(); + TQString currentLine = codec->toUnicode(line).stripWhiteSpace(); if (currentLine.isEmpty()) { // end of data block @@ -67,9 +67,9 @@ void KOperaBookmarkImporter::parseOperaBookmarks( ) else if (type == "FOLDER" ) emit newFolder( name, false, "" ); - type = QString::null; - name = QString::null; - url = QString::null; + type = TQString::null; + name = TQString::null; + url = TQString::null; } else if (currentLine == "-") { // end of folder @@ -77,7 +77,7 @@ void KOperaBookmarkImporter::parseOperaBookmarks( ) } else { // data block line - QString tag; + TQString tag; if ( tag = "#", currentLine.startsWith( tag ) ) type = currentLine.remove( 0, tag.length() ); else if ( tag = "NAME=", currentLine.startsWith( tag ) ) @@ -89,7 +89,7 @@ void KOperaBookmarkImporter::parseOperaBookmarks( ) } -QString KOperaBookmarkImporter::operaBookmarksFile() +TQString KOperaBookmarkImporter::operaBookmarksFile() { static KOperaBookmarkImporterImpl *p = 0; if (!p) @@ -103,13 +103,13 @@ void KOperaBookmarkImporterImpl::parse() { importer.parseOperaBookmarks(); } -QString KOperaBookmarkImporterImpl::findDefaultLocation(bool saving) const +TQString KOperaBookmarkImporterImpl::findDefaultLocation(bool saving) const { return saving ? KFileDialog::getSaveFileName( - QDir::homeDirPath() + "/.opera", + TQDir::homeDirPath() + "/.opera", i18n("*.adr|Opera Bookmark Files (*.adr)") ) : KFileDialog::getOpenFileName( - QDir::homeDirPath() + "/.opera", + TQDir::homeDirPath() + "/.opera", i18n("*.adr|Opera Bookmark Files (*.adr)") ); } @@ -118,14 +118,14 @@ QString KOperaBookmarkImporterImpl::findDefaultLocation(bool saving) const class OperaExporter : private KBookmarkGroupTraverser { public: OperaExporter(); - QString generate( const KBookmarkGroup &grp ) { traverse(grp); return m_string; }; + TQString generate( const KBookmarkGroup &grp ) { traverse(grp); return m_string; }; private: virtual void visit( const KBookmark & ); virtual void visitEnter( const KBookmarkGroup & ); virtual void visitLeave( const KBookmarkGroup & ); private: - QString m_string; - QTextStream m_out; + TQString m_string; + TQTextStream m_out; }; OperaExporter::OperaExporter() : m_out(&m_string, IO_WriteOnly) { @@ -156,14 +156,14 @@ void OperaExporter::visitLeave( const KBookmarkGroup & ) { void KOperaBookmarkExporterImpl::write(KBookmarkGroup parent) { OperaExporter exporter; - QString content = exporter.generate( parent ); - QFile file(m_fileName); + TQString content = exporter.generate( parent ); + TQFile file(m_fileName); if (!file.open(IO_WriteOnly)) { kdError(7043) << "Can't write to file " << m_fileName << endl; return; } - QTextStream fstream(&file); - fstream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream fstream(&file); + fstream.setEncoding(TQTextStream::UnicodeUTF8); fstream << content; } diff --git a/kio/bookmarks/kbookmarkimporter_opera.h b/kio/bookmarks/kbookmarkimporter_opera.h index b179f2f93..e87df2efe 100644 --- a/kio/bookmarks/kbookmarkimporter_opera.h +++ b/kio/bookmarks/kbookmarkimporter_opera.h @@ -21,9 +21,9 @@ #ifndef __kbookmarkimporter_opera_h #define __kbookmarkimporter_opera_h -#include <qdom.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqdom.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include <ksimpleconfig.h> #include <kbookmarkimporter.h> @@ -36,22 +36,22 @@ class KIO_EXPORT_DEPRECATED KOperaBookmarkImporter : public QObject { Q_OBJECT public: - KOperaBookmarkImporter( const QString & fileName ) : m_fileName(fileName) {} + KOperaBookmarkImporter( const TQString & fileName ) : m_fileName(fileName) {} ~KOperaBookmarkImporter() {} void parseOperaBookmarks(); // Usual place for Opera bookmarks - static QString operaBookmarksFile(); + static TQString operaBookmarksFile(); signals: - void newBookmark( const QString & text, const QCString & url, const QString & additionalInfo ); - void newFolder( const QString & text, bool open, const QString & additionalInfo ); + void newBookmark( const TQString & text, const TQCString & url, const TQString & additionalInfo ); + void newFolder( const TQString & text, bool open, const TQString & additionalInfo ); void newSeparator(); void endFolder(); protected: - QString m_fileName; + TQString m_fileName; }; /** @@ -63,7 +63,7 @@ class KIO_EXPORT KOperaBookmarkImporterImpl : public KBookmarkImporterBase public: KOperaBookmarkImporterImpl() { } virtual void parse(); - virtual QString findDefaultLocation(bool forSaving = false) const; + virtual TQString findDefaultLocation(bool forSaving = false) const; private: class KOperaBookmarkImporterImplPrivate *d; }; @@ -74,7 +74,7 @@ private: class KIO_EXPORT KOperaBookmarkExporterImpl : public KBookmarkExporterBase { public: - KOperaBookmarkExporterImpl(KBookmarkManager* mgr, const QString & filename) + KOperaBookmarkExporterImpl(KBookmarkManager* mgr, const TQString & filename) : KBookmarkExporterBase(mgr, filename) { ; } virtual ~KOperaBookmarkExporterImpl() {} diff --git a/kio/bookmarks/kbookmarkmanager.cc b/kio/bookmarks/kbookmarkmanager.cc index d101c1f7f..1a9e5dc4e 100644 --- a/kio/bookmarks/kbookmarkmanager.cc +++ b/kio/bookmarks/kbookmarkmanager.cc @@ -28,17 +28,17 @@ #include <kstandarddirs.h> #include <ksavefile.h> #include <dcopref.h> -#include <qregexp.h> +#include <tqregexp.h> #include <kmessagebox.h> #include <kprocess.h> #include <klocale.h> #include <kapplication.h> #include <dcopclient.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtextstream.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtextstream.h> #include <kstaticdeleter.h> -#include <qptrstack.h> +#include <tqptrstack.h> #include "dptrtemplate.h" @@ -46,32 +46,32 @@ class KBookmarkManagerPrivate : public dPtrTemplate<KBookmarkManager, KBookmarkM public: KBookmarkManagerPrivate() { m_browserEditor = true; } - QString m_editorCaption; + TQString m_editorCaption; bool m_browserEditor; }; -template<> QPtrDict<KBookmarkManagerPrivate>* dPtrTemplate<KBookmarkManager, KBookmarkManagerPrivate>::d_ptr = 0; +template<> TQPtrDict<KBookmarkManagerPrivate>* dPtrTemplate<KBookmarkManager, KBookmarkManagerPrivate>::d_ptr = 0; KBookmarkManagerPrivate* KBookmarkManager::dptr() const { return KBookmarkManagerPrivate::d( this ); } // TODO - clean this stuff up by just using the above dptrtemplate? -QPtrList<KBookmarkManager>* KBookmarkManager::s_pSelf; -static KStaticDeleter<QPtrList<KBookmarkManager> > sdbm; +TQPtrList<KBookmarkManager>* KBookmarkManager::s_pSelf; +static KStaticDeleter<TQPtrList<KBookmarkManager> > sdbm; class KBookmarkMap : private KBookmarkGroupTraverser { public: KBookmarkMap( KBookmarkManager * ); void update(); - QValueList<KBookmark> find( const QString &url ) const + TQValueList<KBookmark> find( const TQString &url ) const { return m_bk_map[url]; } private: virtual void visit(const KBookmark &); virtual void visitEnter(const KBookmarkGroup &) { ; } virtual void visitLeave(const KBookmarkGroup &) { ; } private: - typedef QValueList<KBookmark> KBookmarkList; - QMap<QString, KBookmarkList> m_bk_map; + typedef TQValueList<KBookmark> KBookmarkList; + TQMap<TQString, KBookmarkList> m_bk_map; KBookmarkManager *m_manager; }; @@ -97,13 +97,13 @@ void KBookmarkMap::visit(const KBookmark &bk) } -KBookmarkManager* KBookmarkManager::managerForFile( const QString& bookmarksFile, bool bImportDesktopFiles ) +KBookmarkManager* KBookmarkManager::managerForFile( const TQString& bookmarksFile, bool bImportDesktopFiles ) { if ( !s_pSelf ) { - sdbm.setObject( s_pSelf, new QPtrList<KBookmarkManager> ); + sdbm.setObject( s_pSelf, new TQPtrList<KBookmarkManager> ); s_pSelf->setAutoDelete( true ); } - QPtrListIterator<KBookmarkManager> it ( *s_pSelf ); + TQPtrListIterator<KBookmarkManager> it ( *s_pSelf ); for ( ; it.current() ; ++it ) if ( it.current()->path() == bookmarksFile ) return it.current(); @@ -117,7 +117,7 @@ KBookmarkManager* KBookmarkManager::managerForFile( const QString& bookmarksFile KBookmarkManager* KBookmarkManager::createTempManager() { if ( !s_pSelf ) { - sdbm.setObject( s_pSelf, new QPtrList<KBookmarkManager> ); + sdbm.setObject( s_pSelf, new TQPtrList<KBookmarkManager> ); s_pSelf->setAutoDelete( true ); } KBookmarkManager* mgr = new KBookmarkManager(); @@ -127,8 +127,8 @@ KBookmarkManager* KBookmarkManager::createTempManager() #define PI_DATA "version=\"1.0\" encoding=\"UTF-8\"" -KBookmarkManager::KBookmarkManager( const QString & bookmarksFile, bool bImportDesktopFiles ) - : DCOPObject(QCString("KBookmarkManager-")+bookmarksFile.utf8()), m_doc("xbel"), m_docIsLoaded(false) +KBookmarkManager::KBookmarkManager( const TQString & bookmarksFile, bool bImportDesktopFiles ) + : DCOPObject(TQCString("KBookmarkManager-")+bookmarksFile.utf8()), m_doc("xbel"), m_docIsLoaded(false) { m_toolbarDoc.clear(); @@ -138,9 +138,9 @@ KBookmarkManager::KBookmarkManager( const QString & bookmarksFile, bool bImportD Q_ASSERT( !bookmarksFile.isEmpty() ); m_bookmarksFile = bookmarksFile; - if ( !QFile::exists(m_bookmarksFile) ) + if ( !TQFile::exists(m_bookmarksFile) ) { - QDomElement topLevel = m_doc.createElement("xbel"); + TQDomElement topLevel = m_doc.createElement("xbel"); m_doc.appendChild( topLevel ); m_doc.insertBefore( m_doc.createProcessingInstruction( "xml", PI_DATA), topLevel ); if ( bImportDesktopFiles ) @@ -148,27 +148,27 @@ KBookmarkManager::KBookmarkManager( const QString & bookmarksFile, bool bImportD m_docIsLoaded = true; } - connectDCOPSignal(0, objId(), "bookmarksChanged(QString)", "notifyChanged(QString)", false); + connectDCOPSignal(0, objId(), "bookmarksChanged(TQString)", "notifyChanged(TQString)", false); connectDCOPSignal(0, objId(), "bookmarkConfigChanged()", "notifyConfigChanged()", false); } KBookmarkManager::KBookmarkManager( ) - : DCOPObject(QCString("KBookmarkManager-generated")), m_doc("xbel"), m_docIsLoaded(true) + : DCOPObject(TQCString("KBookmarkManager-generated")), m_doc("xbel"), m_docIsLoaded(true) { m_toolbarDoc.clear(); // strange ;-) m_update = false; // TODO - make it read/write m_showNSBookmarks = true; - m_bookmarksFile = QString::null; // AK - check all codepaths for this one + m_bookmarksFile = TQString::null; // AK - check all codepaths for this one - QDomElement topLevel = m_doc.createElement("xbel"); + TQDomElement topLevel = m_doc.createElement("xbel"); m_doc.appendChild( topLevel ); m_doc.insertBefore( m_doc.createProcessingInstruction( "xml", PI_DATA), topLevel ); // TODO - enable this via some sort of api and fix the above DCOPObject script somehow #if 0 - connectDCOPSignal(0, objId(), "bookmarksChanged(QString)", "notifyChanged(QString)", false); + connectDCOPSignal(0, objId(), "bookmarksChanged(TQString)", "notifyChanged(TQString)", false); connectDCOPSignal(0, objId(), "bookmarkConfigChanged()", "notifyConfigChanged()", false); #endif } @@ -184,7 +184,7 @@ void KBookmarkManager::setUpdate( bool update ) m_update = update; } -const QDomDocument &KBookmarkManager::internalDocument() const +const TQDomDocument &KBookmarkManager::internalDocument() const { if(!m_docIsLoaded) { @@ -199,21 +199,21 @@ void KBookmarkManager::parse() const { m_docIsLoaded = true; //kdDebug(7043) << "KBookmarkManager::parse " << m_bookmarksFile << endl; - QFile file( m_bookmarksFile ); + TQFile file( m_bookmarksFile ); if ( !file.open( IO_ReadOnly ) ) { kdWarning() << "Can't open " << m_bookmarksFile << endl; return; } - m_doc = QDomDocument("xbel"); + m_doc = TQDomDocument("xbel"); m_doc.setContent( &file ); - QDomElement docElem = m_doc.documentElement(); + TQDomElement docElem = m_doc.documentElement(); if ( docElem.isNull() ) kdWarning() << "KBookmarkManager::parse : can't parse " << m_bookmarksFile << endl; else { - QString mainTag = docElem.tagName(); + TQString mainTag = docElem.tagName(); if ( mainTag == "BOOKMARKS" ) { kdWarning() << "Old style bookmarks found. Calling convertToXBEL." << endl; @@ -230,14 +230,14 @@ void KBookmarkManager::parse() const else if ( mainTag != "xbel" ) kdWarning() << "KBookmarkManager::parse : unknown main tag " << mainTag << endl; - QDomNode n = m_doc.documentElement().previousSibling(); + TQDomNode n = m_doc.documentElement().previousSibling(); if ( n.isProcessingInstruction() ) { - QDomProcessingInstruction pi = n.toProcessingInstruction(); + TQDomProcessingInstruction pi = n.toProcessingInstruction(); pi.parentNode().removeChild(pi); } - QDomProcessingInstruction pi; + TQDomProcessingInstruction pi; pi = m_doc.createProcessingInstruction( "xml", PI_DATA ); m_doc.insertBefore( pi, docElem ); } @@ -248,12 +248,12 @@ void KBookmarkManager::parse() const s_bk_map->update(); } -void KBookmarkManager::convertToXBEL( QDomElement & group ) +void KBookmarkManager::convertToXBEL( TQDomElement & group ) { - QDomNode n = group.firstChild(); + TQDomNode n = group.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if ( !e.isNull() ) if ( e.tagName() == "TEXT" ) { @@ -286,10 +286,10 @@ void KBookmarkManager::convertToXBEL( QDomElement & group ) convertAttribute(e, "ICON","icon"); // non standard, but we need it convertAttribute(e, "NETSCAPEINFO","netscapeinfo"); // idem convertAttribute(e, "URL","href"); - QString text = e.text(); + TQString text = e.text(); while ( !e.firstChild().isNull() ) // clean up the old contained text e.removeChild(e.firstChild()); - QDomElement titleElem = e.ownerDocument().createElement("title"); + TQDomElement titleElem = e.ownerDocument().createElement("title"); e.appendChild( titleElem ); // should be the only child anyway titleElem.appendChild( e.ownerDocument().createTextNode( text ) ); } @@ -299,7 +299,7 @@ void KBookmarkManager::convertToXBEL( QDomElement & group ) } } -void KBookmarkManager::convertAttribute( QDomElement elem, const QString & oldName, const QString & newName ) +void KBookmarkManager::convertAttribute( TQDomElement elem, const TQString & oldName, const TQString & newName ) { if ( elem.hasAttribute( oldName ) ) { @@ -310,8 +310,8 @@ void KBookmarkManager::convertAttribute( QDomElement elem, const QString & oldNa void KBookmarkManager::importDesktopFiles() { - KBookmarkImporter importer( const_cast<QDomDocument *>(&internalDocument()) ); - QString path(KGlobal::dirs()->saveLocation("data", "kfm/bookmarks", true)); + KBookmarkImporter importer( const_cast<TQDomDocument *>(&internalDocument()) ); + TQString path(KGlobal::dirs()->saveLocation("data", "kfm/bookmarks", true)); importer.import( path ); //kdDebug(7043) << internalDocument().toCString() << endl; @@ -323,36 +323,36 @@ bool KBookmarkManager::save( bool toolbarCache ) const return saveAs( m_bookmarksFile, toolbarCache ); } -bool KBookmarkManager::saveAs( const QString & filename, bool toolbarCache ) const +bool KBookmarkManager::saveAs( const TQString & filename, bool toolbarCache ) const { kdDebug(7043) << "KBookmarkManager::save " << filename << endl; // Save the bookmark toolbar folder for quick loading // but only when it will actually make things quicker - const QString cacheFilename = filename + QString::fromLatin1(".tbcache"); + const TQString cacheFilename = filename + TQString::fromLatin1(".tbcache"); if(toolbarCache && !root().isToolbarGroup()) { KSaveFile cacheFile( cacheFilename ); if ( cacheFile.status() == 0 ) { - QString str; - QTextStream stream(&str, IO_WriteOnly); + TQString str; + TQTextStream stream(&str, IO_WriteOnly); stream << root().findToolbar(); - QCString cstr = str.utf8(); + TQCString cstr = str.utf8(); cacheFile.file()->writeBlock( cstr.data(), cstr.length() ); cacheFile.close(); } } else // remove any (now) stale cache { - QFile::remove( cacheFilename ); + TQFile::remove( cacheFilename ); } KSaveFile file( filename ); if ( file.status() == 0 ) { - file.backupFile( file.name(), QString::null, ".bak" ); - QCString cstr; + file.backupFile( file.name(), TQString::null, ".bak" ); + TQCString cstr; cstr = internalDocument().toCString(); // is in UTF8 file.file()->writeBlock( cstr.data(), cstr.length() ); if ( file.close() ) @@ -362,12 +362,12 @@ bool KBookmarkManager::saveAs( const QString & filename, bool toolbarCache ) con static int hadSaveError = false; file.abort(); if ( !hadSaveError ) { - QString error = i18n("Unable to save bookmarks in %1. Reported error was: %2. " + TQString error = i18n("Unable to save bookmarks in %1. Reported error was: %2. " "This error message will only be shown once. The cause " "of the error needs to be fixed as quickly as possible, " "which is most likely a full hard drive.") - .arg(filename).arg(QString::fromLocal8Bit(strerror(file.status()))); - if (qApp->type() != QApplication::Tty) + .arg(filename).arg(TQString::fromLocal8Bit(strerror(file.status()))); + if (qApp->type() != TQApplication::Tty) KMessageBox::error( 0L, error ); else kdError() << error << endl; @@ -388,19 +388,19 @@ KBookmarkGroup KBookmarkManager::toolbar() if(!m_docIsLoaded) { kdDebug(7043) << "KBookmarkManager::toolbar trying cache" << endl; - const QString cacheFilename = m_bookmarksFile + QString::fromLatin1(".tbcache"); - QFileInfo bmInfo(m_bookmarksFile); - QFileInfo cacheInfo(cacheFilename); + const TQString cacheFilename = m_bookmarksFile + TQString::fromLatin1(".tbcache"); + TQFileInfo bmInfo(m_bookmarksFile); + TQFileInfo cacheInfo(cacheFilename); if (m_toolbarDoc.isNull() && - QFile::exists(cacheFilename) && + TQFile::exists(cacheFilename) && bmInfo.lastModified() < cacheInfo.lastModified()) { kdDebug(7043) << "KBookmarkManager::toolbar reading file" << endl; - QFile file( cacheFilename ); + TQFile file( cacheFilename ); if ( file.open( IO_ReadOnly ) ) { - m_toolbarDoc = QDomDocument("cache"); + m_toolbarDoc = TQDomDocument("cache"); m_toolbarDoc.setContent( &file ); kdDebug(7043) << "KBookmarkManager::toolbar opened" << endl; } @@ -408,28 +408,28 @@ KBookmarkGroup KBookmarkManager::toolbar() if (!m_toolbarDoc.isNull()) { kdDebug(7043) << "KBookmarkManager::toolbar returning element" << endl; - QDomElement elem = m_toolbarDoc.firstChild().toElement(); + TQDomElement elem = m_toolbarDoc.firstChild().toElement(); return KBookmarkGroup(elem); } } // Fallback to the normal way if there is no cache or if the bookmark file // is already loaded - QDomElement elem = root().findToolbar(); + TQDomElement elem = root().findToolbar(); if (elem.isNull()) return root(); // Root is the bookmark toolbar if none has been set. else return KBookmarkGroup(root().findToolbar()); } -KBookmark KBookmarkManager::findByAddress( const QString & address, bool tolerant ) +KBookmark KBookmarkManager::findByAddress( const TQString & address, bool tolerant ) { //kdDebug(7043) << "KBookmarkManager::findByAddress " << address << endl; KBookmark result = root(); // The address is something like /5/10/2+ - QStringList addresses = QStringList::split(QRegExp("[/+]"),address); + TQStringList addresses = TQStringList::split(TQRegExp("[/+]"),address); // kdWarning() << addresses.join(",") << endl; - for ( QStringList::Iterator it = addresses.begin() ; it != addresses.end() ; ) + for ( TQStringList::Iterator it = addresses.begin() ; it != addresses.end() ; ) { bool append = ((*it) == "+"); uint number = (*it).toUInt(); @@ -459,13 +459,13 @@ KBookmark KBookmarkManager::findByAddress( const QString & address, bool toleran return result; } -static QString pickUnusedTitle( KBookmarkGroup parentBookmark, - const QString &title, const QString &url +static TQString pickUnusedTitle( KBookmarkGroup parentBookmark, + const TQString &title, const TQString &url ) { // If this title is already used, we'll try to find something unused. KBookmark ch = parentBookmark.first(); int count = 1; - QString uniqueTitle = title; + TQString uniqueTitle = title; do { while ( !ch.isNull() ) @@ -475,7 +475,7 @@ static QString pickUnusedTitle( KBookmarkGroup parentBookmark, // Title already used ! if ( url != ch.url().url() ) { - uniqueTitle = title + QString(" (%1)").arg(++count); + uniqueTitle = title + TQString(" (%1)").arg(++count); // New title -> restart search from the beginning ch = parentBookmark.first(); break; @@ -483,7 +483,7 @@ static QString pickUnusedTitle( KBookmarkGroup parentBookmark, else { // this exact URL already exists - return QString::null; + return TQString::null; } } ch = parentBookmark.next( ch ); @@ -494,12 +494,12 @@ static QString pickUnusedTitle( KBookmarkGroup parentBookmark, } KBookmarkGroup KBookmarkManager::addBookmarkDialog( - const QString & _url, const QString & _title, - const QString & _parentBookmarkAddress + const TQString & _url, const TQString & _title, + const TQString & _parentBookmarkAddress ) { - QString url = _url; - QString title = _title; - QString parentBookmarkAddress = _parentBookmarkAddress; + TQString url = _url; + TQString title = _title; + TQString parentBookmarkAddress = _parentBookmarkAddress; if ( url.isEmpty() ) { @@ -524,7 +524,7 @@ KBookmarkGroup KBookmarkManager::addBookmarkDialog( parentBookmark = findByAddress( parentBookmarkAddress ).toGroup(); Q_ASSERT( !parentBookmark.isNull() ); - QString uniqueTitle = pickUnusedTitle( parentBookmark, title, url ); + TQString uniqueTitle = pickUnusedTitle( parentBookmark, title, url ); if ( !uniqueTitle.isNull() ) parentBookmark.addBookmark( this, uniqueTitle, KURL( url )); @@ -539,11 +539,11 @@ void KBookmarkManager::emitChanged( /*KDE4 const*/ KBookmarkGroup & group ) // Tell the other processes too // kdDebug(7043) << "KBookmarkManager::emitChanged : broadcasting change " << group.address() << endl; - QByteArray data; - QDataStream ds( data, IO_WriteOnly ); + TQByteArray data; + TQDataStream ds( data, IO_WriteOnly ); ds << group.address(); - emitDCOPSignal("bookmarksChanged(QString)", data); + emitDCOPSignal("bookmarksChanged(TQString)", data); // We do get our own broadcast, so no need for this anymore //emit changed( group ); @@ -551,10 +551,10 @@ void KBookmarkManager::emitChanged( /*KDE4 const*/ KBookmarkGroup & group ) void KBookmarkManager::emitConfigChanged() { - emitDCOPSignal("bookmarkConfigChanged()", QByteArray()); + emitDCOPSignal("bookmarkConfigChanged()", TQByteArray()); } -void KBookmarkManager::notifyCompleteChange( QString caller ) // DCOP call +void KBookmarkManager::notifyCompleteChange( TQString caller ) // DCOP call { if (!m_update) return; @@ -574,7 +574,7 @@ void KBookmarkManager::notifyConfigChanged() // DCOP call parse(); // reload, and thusly recreate the menus } -void KBookmarkManager::notifyChanged( QString groupAddress ) // DCOP call +void KBookmarkManager::notifyChanged( TQString groupAddress ) // DCOP call { if (!m_update) return; @@ -586,7 +586,7 @@ void KBookmarkManager::notifyChanged( QString groupAddress ) // DCOP call //kdDebug(7043) << "KBookmarkManager::notifyChanged " << groupAddress << endl; //KBookmarkGroup group = findByAddress( groupAddress ).toGroup(); //Q_ASSERT(!group.isNull()); - emit changed( groupAddress, QString::null ); + emit changed( groupAddress, TQString::null ); } bool KBookmarkManager::showNSBookmarks() const @@ -605,7 +605,7 @@ void KBookmarkManager::setShowNSBookmarks( bool show ) KBookmarkMenu::setDynamicBookmarks("netscape", info); } -void KBookmarkManager::setEditorOptions( const QString& caption, bool browser ) +void KBookmarkManager::setEditorOptions( const TQString& caption, bool browser ) { dptr()->m_editorCaption = caption; dptr()->m_browserEditor = browser; @@ -614,27 +614,27 @@ void KBookmarkManager::setEditorOptions( const QString& caption, bool browser ) void KBookmarkManager::slotEditBookmarks() { KProcess proc; - proc << QString::fromLatin1("keditbookmarks"); + proc << TQString::fromLatin1("keditbookmarks"); if (!dptr()->m_editorCaption.isNull()) - proc << QString::fromLatin1("--customcaption") << dptr()->m_editorCaption; + proc << TQString::fromLatin1("--customcaption") << dptr()->m_editorCaption; if (!dptr()->m_browserEditor) - proc << QString::fromLatin1("--nobrowser"); + proc << TQString::fromLatin1("--nobrowser"); proc << m_bookmarksFile; proc.start(KProcess::DontCare); } -void KBookmarkManager::slotEditBookmarksAtAddress( const QString& address ) +void KBookmarkManager::slotEditBookmarksAtAddress( const TQString& address ) { KProcess proc; - proc << QString::fromLatin1("keditbookmarks") - << QString::fromLatin1("--address") << address + proc << TQString::fromLatin1("keditbookmarks") + << TQString::fromLatin1("--address") << address << m_bookmarksFile; proc.start(KProcess::DontCare); } /////// -void KBookmarkOwner::openBookmarkURL( const QString& url ) +void KBookmarkOwner::openBookmarkURL( const TQString& url ) { (void) new KRun(KURL( url )); } @@ -642,18 +642,18 @@ void KBookmarkOwner::openBookmarkURL( const QString& url ) void KBookmarkOwner::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -bool KBookmarkManager::updateAccessMetadata( const QString & url, bool emitSignal ) +bool KBookmarkManager::updateAccessMetadata( const TQString & url, bool emitSignal ) { if (!s_bk_map) { s_bk_map = new KBookmarkMap(this); s_bk_map->update(); } - QValueList<KBookmark> list = s_bk_map->find(url); + TQValueList<KBookmark> list = s_bk_map->find(url); if ( list.count() == 0 ) return false; - for ( QValueList<KBookmark>::iterator it = list.begin(); + for ( TQValueList<KBookmark>::iterator it = list.begin(); it != list.end(); ++it ) (*it).updateAccessMetadata(); @@ -663,7 +663,7 @@ bool KBookmarkManager::updateAccessMetadata( const QString & url, bool emitSigna return true; } -void KBookmarkManager::updateFavicon( const QString &url, const QString &faviconurl, bool emitSignal ) +void KBookmarkManager::updateFavicon( const TQString &url, const TQString &faviconurl, bool emitSignal ) { Q_UNUSED(faviconurl); @@ -672,8 +672,8 @@ void KBookmarkManager::updateFavicon( const QString &url, const QString &favicon s_bk_map->update(); } - QValueList<KBookmark> list = s_bk_map->find(url); - for ( QValueList<KBookmark>::iterator it = list.begin(); + TQValueList<KBookmark> list = s_bk_map->find(url); + for ( TQValueList<KBookmark>::iterator it = list.begin(); it != list.end(); ++it ) { // TODO - update favicon data based on faviconurl @@ -688,9 +688,9 @@ void KBookmarkManager::updateFavicon( const QString &url, const QString &favicon } } -QString KBookmarkManager::userBookmarksFile() +TQString KBookmarkManager::userBookmarksFile() { - return locateLocal("data", QString::fromLatin1("konqueror/bookmarks.xml")); + return locateLocal("data", TQString::fromLatin1("konqueror/bookmarks.xml")); } KBookmarkManager* KBookmarkManager::userBookmarksManager() diff --git a/kio/bookmarks/kbookmarkmanager.h b/kio/bookmarks/kbookmarkmanager.h index 03d0ac0c6..403a2e1b3 100644 --- a/kio/bookmarks/kbookmarkmanager.h +++ b/kio/bookmarks/kbookmarkmanager.h @@ -20,10 +20,10 @@ #ifndef __kbookmarkmanager_h #define __kbookmarkmanager_h -#include <qstring.h> -#include <qstringlist.h> -#include <qobject.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqobject.h> +#include <tqdom.h> #include <dcopobject.h> #include "kbookmark.h" #include "kbookmarknotifier.h" @@ -50,7 +50,7 @@ * </xbel> * \endcode */ -class KIO_EXPORT KBookmarkManager : public QObject, public DCOPObject +class KIO_EXPORT KBookmarkManager : public TQObject, public DCOPObject { Q_OBJECT K_DCOP @@ -69,7 +69,7 @@ protected: * @param bImportDesktopFiles if true, and if the bookmarksFile * doesn't already exist, import bookmarks from desktop files */ - KBookmarkManager( const QString & bookmarksFile, bool bImportDesktopFiles = true ); + KBookmarkManager( const TQString & bookmarksFile, bool bImportDesktopFiles = true ); /** * @since 3.2 @@ -103,7 +103,7 @@ public: * @param toolbarCache iff true save a cache of the toolbar folder, too * @return true if saving was successful */ - bool saveAs( const QString & filename, bool toolbarCache = true ) const; + bool saveAs( const TQString & filename, bool toolbarCache = true ) const; /** * Update access time stamps for a given url. @@ -112,7 +112,7 @@ public: * @since 3.2 * @return true if any metadata was modified (bookmarks file is not saved automatically) */ - bool updateAccessMetadata( const QString &url, bool emitSignal = true ); + bool updateAccessMetadata( const TQString &url, bool emitSignal = true ); /* * NB. currently *unimplemented* @@ -123,7 +123,7 @@ public: * @emitSignal iff true emit KBookmarkNotifier signal * @since 3.3 */ - void updateFavicon( const QString &url, const QString &faviconurl, bool emitSignal = true ); + void updateFavicon( const TQString &url, const TQString &faviconurl, bool emitSignal = true ); /** * This will return the path that this manager is using to read @@ -131,7 +131,7 @@ public: * @internal * @return the path containing the bookmarks */ - QString path() { return m_bookmarksFile; } + TQString path() { return m_bookmarksFile; } /** * This will return the root bookmark. It is used to iterate @@ -155,7 +155,7 @@ public: * @param tolerate when true tries to find the most tolerable bookmark position * @see KBookmark::address */ - KBookmark findByAddress( const QString & address, bool tolerate = false ); + KBookmark findByAddress( const TQString & address, bool tolerate = false ); /** * Saves the bookmark file and notifies everyone. @@ -188,7 +188,7 @@ public: * menu items in keditbookmarks :: --nobrowser * @since 3.2 */ - void setEditorOptions( const QString& caption, bool browser ); + void setEditorOptions( const TQString& caption, bool browser ); /** * This static function will return an instance of the @@ -206,7 +206,7 @@ public: * doesn't already exist, import bookmarks from desktop files * @return a pointer to an instance of the KBookmarkManager. */ - static KBookmarkManager* managerForFile( const QString& bookmarksFile, + static KBookmarkManager* managerForFile( const TQString& bookmarksFile, bool bImportDesktopFiles = true ); @@ -222,12 +222,12 @@ public: * Returns the path to the user's main bookmark collection file. * @since 3.5.5 */ - static QString userBookmarksFile(); + static TQString userBookmarksFile(); /** * @internal */ - const QDomDocument & internalDocument() const; + const TQDomDocument & internalDocument() const; /** * Access to bookmark notifier, for emitting signals. @@ -239,12 +239,12 @@ public: /** * @since 3.2 */ - KBookmarkGroup addBookmarkDialog( const QString & _url, const QString & _title, - const QString & _parentBookmarkAddress = QString::null ); + KBookmarkGroup addBookmarkDialog( const TQString & _url, const TQString & _title, + const TQString & _parentBookmarkAddress = TQString::null ); public slots: void slotEditBookmarks(); - void slotEditBookmarksAtAddress( const QString& address ); + void slotEditBookmarksAtAddress( const TQString& address ); public: k_dcop: @@ -252,7 +252,7 @@ k_dcop: * Reparse the whole bookmarks file and notify about the change * (Called by the bookmark editor) */ - ASYNC notifyCompleteChange( QString caller ); + ASYNC notifyCompleteChange( TQString caller ); /** * Emit the changed signal for the group whose address is given @@ -260,7 +260,7 @@ k_dcop: * Called by the instance of konqueror that saved the file after * a small change (new bookmark or new folder). */ - ASYNC notifyChanged( QString groupAddress ); + ASYNC notifyChanged( TQString groupAddress ); ASYNC notifyConfigChanged(); @@ -270,23 +270,23 @@ signals: * @p groupAddress (e.g. "/4/5") * has been modified by the caller @p caller. */ - void changed( const QString & groupAddress, const QString & caller ); + void changed( const TQString & groupAddress, const TQString & caller ); protected: // consts added to avoid a copy-and-paste of internalDocument void parse() const; void importDesktopFiles(); - static void convertToXBEL( QDomElement & group ); - static void convertAttribute( QDomElement elem, const QString & oldName, const QString & newName ); + static void convertToXBEL( TQDomElement & group ); + static void convertAttribute( TQDomElement elem, const TQString & oldName, const TQString & newName ); private: KBookmarkNotifier m_notifier; - QString m_bookmarksFile; - mutable QDomDocument m_doc; - mutable QDomDocument m_toolbarDoc; + TQString m_bookmarksFile; + mutable TQDomDocument m_doc; + mutable TQDomDocument m_toolbarDoc; mutable bool m_docIsLoaded; bool m_update; - static QPtrList<KBookmarkManager>* s_pSelf; + static TQPtrList<KBookmarkManager>* s_pSelf; bool m_showNSBookmarks; private: @@ -321,7 +321,7 @@ public: * This function is called if the user selects a bookmark. It will * open up the bookmark in a default fashion unless you override it. */ - virtual void openBookmarkURL(const QString& _url); + virtual void openBookmarkURL(const TQString& _url); /** * This function is called whenever the user wants to add the @@ -331,7 +331,7 @@ public: * * @return the title of the current page. */ - virtual QString currentTitle() const { return QString::null; } + virtual TQString currentTitle() const { return TQString::null; } /** * This function is called whenever the user wants to add the @@ -341,7 +341,7 @@ public: * * @return the URL of the current page. */ - virtual QString currentURL() const { return QString::null; } + virtual TQString currentURL() const { return TQString::null; } protected: virtual void virtual_hook( int id, void* data ); @@ -350,11 +350,11 @@ protected: /** * @since 3.2 */ -class KIO_EXPORT KExtendedBookmarkOwner : public QObject, virtual public KBookmarkOwner +class KIO_EXPORT KExtendedBookmarkOwner : public TQObject, virtual public KBookmarkOwner { Q_OBJECT public: - typedef QValueList<QPair<QString,QString> > QStringPairList; + typedef TQValueList<QPair<TQString,TQString> > QStringPairList; public slots: void fillBookmarksList( KExtendedBookmarkOwner::QStringPairList & list ) { emit signalFillBookmarksList( list ); }; signals: diff --git a/kio/bookmarks/kbookmarkmenu.cc b/kio/bookmarks/kbookmarkmenu.cc index 0e1dfe35c..69c9debd6 100644 --- a/kio/bookmarks/kbookmarkmenu.cc +++ b/kio/bookmarks/kbookmarkmenu.cc @@ -39,34 +39,34 @@ #include <kstdaction.h> #include <kstringhandler.h> -#include <qclipboard.h> -#include <qfile.h> -#include <qheader.h> -#include <qlabel.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qlistview.h> -#include <qpushbutton.h> +#include <tqclipboard.h> +#include <tqfile.h> +#include <tqheader.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqlistview.h> +#include <tqpushbutton.h> #include <dptrtemplate.h> -template class QPtrList<KBookmarkMenu>; +template class TQPtrList<KBookmarkMenu>; -static QString makeTextNodeMod(KBookmark bk, const QString &m_nodename, const QString &m_newText) { - QDomNode subnode = bk.internalElement().namedItem(m_nodename); +static TQString makeTextNodeMod(KBookmark bk, const TQString &m_nodename, const TQString &m_newText) { + TQDomNode subnode = bk.internalElement().namedItem(m_nodename); if (subnode.isNull()) { subnode = bk.internalElement().ownerDocument().createElement(m_nodename); bk.internalElement().appendChild(subnode); } if (subnode.firstChild().isNull()) { - QDomText domtext = subnode.ownerDocument().createTextNode(""); + TQDomText domtext = subnode.ownerDocument().createTextNode(""); subnode.appendChild(domtext); } - QDomText domtext = subnode.firstChild().toText(); + TQDomText domtext = subnode.firstChild().toText(); - QString m_oldText = domtext.data(); + TQString m_oldText = domtext.data(); domtext.setData(m_newText); return m_oldText; @@ -79,8 +79,8 @@ static QString makeTextNodeMod(KBookmark bk, const QString &m_nodename, const QS KBookmarkMenu::KBookmarkMenu( KBookmarkManager* mgr, KBookmarkOwner * _owner, KPopupMenu * _parentMenu, KActionCollection *collec, bool _isRoot, bool _add, - const QString & parentAddress ) - : QObject(), + const TQString & parentAddress ) + : TQObject(), m_bIsRoot(_isRoot), m_bAddBookmark(_add), m_bAddShortcuts(true), m_pManager(mgr), m_pOwner(_owner), @@ -96,9 +96,9 @@ KBookmarkMenu::KBookmarkMenu( KBookmarkManager* mgr, if (m_actionCollection) { m_actionCollection->setHighlightingEnabled(true); - disconnect( m_actionCollection, SIGNAL( actionHighlighted( KAction * ) ), 0, 0 ); - connect( m_actionCollection, SIGNAL( actionHighlighted( KAction * ) ), - this, SLOT( slotActionHighlighted( KAction * ) ) ); + disconnect( m_actionCollection, TQT_SIGNAL( actionHighlighted( KAction * ) ), 0, 0 ); + connect( m_actionCollection, TQT_SIGNAL( actionHighlighted( KAction * ) ), + this, TQT_SLOT( slotActionHighlighted( KAction * ) ) ); } m_bNSBookmark = m_parentAddress.isNull(); @@ -106,20 +106,20 @@ KBookmarkMenu::KBookmarkMenu( KBookmarkManager* mgr, { //kdDebug(7043) << "KBookmarkMenu::KBookmarkMenu " << this << " address : " << m_parentAddress << endl; - connect( _parentMenu, SIGNAL( aboutToShow() ), - SLOT( slotAboutToShow() ) ); + connect( _parentMenu, TQT_SIGNAL( aboutToShow() ), + TQT_SLOT( slotAboutToShow() ) ); if ( KBookmarkSettings::self()->m_contextmenu ) { (void) _parentMenu->contextMenu(); - connect( _parentMenu, SIGNAL( aboutToShowContextMenu(KPopupMenu*, int, QPopupMenu*) ), - this, SLOT( slotAboutToShowContextMenu(KPopupMenu*, int, QPopupMenu*) )); + connect( _parentMenu, TQT_SIGNAL( aboutToShowContextMenu(KPopupMenu*, int, TQPopupMenu*) ), + this, TQT_SLOT( slotAboutToShowContextMenu(KPopupMenu*, int, TQPopupMenu*) )); } if ( m_bIsRoot ) { - connect( m_pManager, SIGNAL( changed(const QString &, const QString &) ), - SLOT( slotBookmarksChanged(const QString &) ) ); + connect( m_pManager, TQT_SIGNAL( changed(const TQString &, const TQString &) ), + TQT_SLOT( slotBookmarksChanged(const TQString &) ) ); } } @@ -142,7 +142,7 @@ KBookmarkMenu::KBookmarkMenu( KBookmarkManager* mgr, KBookmarkMenu::~KBookmarkMenu() { //kdDebug(7043) << "KBookmarkMenu::~KBookmarkMenu() " << this << endl; - QPtrListIterator<KAction> it( m_actions ); + TQPtrListIterator<KAction> it( m_actions ); for (; it.current(); ++it ) it.current()->unplugAll(); @@ -165,9 +165,9 @@ void KBookmarkMenu::slotAboutToShow() } } -QString KBookmarkMenu::s_highlightedAddress; -QString KBookmarkMenu::s_highlightedImportType; -QString KBookmarkMenu::s_highlightedImportLocation; +TQString KBookmarkMenu::s_highlightedAddress; +TQString KBookmarkMenu::s_highlightedImportType; +TQString KBookmarkMenu::s_highlightedImportLocation; void KBookmarkMenu::slotActionHighlighted( KAction* action ) { @@ -183,9 +183,9 @@ void KBookmarkMenu::slotActionHighlighted( KAction* action ) } else { - s_highlightedAddress = QString::null; - s_highlightedImportType = QString::null; - s_highlightedImportLocation = QString::null; + s_highlightedAddress = TQString::null; + s_highlightedImportType = TQString::null; + s_highlightedImportLocation = TQString::null; } } @@ -194,7 +194,7 @@ void KBookmarkMenu::slotActionHighlighted( KAction* action ) /********************************************************************/ class KBookmarkMenuRMBAssoc : public dPtrTemplate<KBookmarkMenu, RMB> { }; -template<> QPtrDict<RMB>* dPtrTemplate<KBookmarkMenu, RMB>::d_ptr = 0; +template<> TQPtrDict<RMB>* dPtrTemplate<KBookmarkMenu, RMB>::d_ptr = 0; static RMB* rmbSelf(KBookmarkMenu *m) { return KBookmarkMenuRMBAssoc::d(m); } @@ -224,14 +224,14 @@ bool RMB::invalid( int val ) return !valid; } -KBookmark RMB::atAddress(const QString & address) +KBookmark RMB::atAddress(const TQString & address) { KBookmark bookmark = m_pManager->findByAddress( address ); Q_ASSERT(!bookmark.isNull()); return bookmark; } -void KBookmarkMenu::slotAboutToShowContextMenu( KPopupMenu*, int, QPopupMenu* contextMenu ) +void KBookmarkMenu::slotAboutToShowContextMenu( KPopupMenu*, int, TQPopupMenu* contextMenu ) { //kdDebug(7043) << "KBookmarkMenu::slotAboutToShowContextMenu" << s_highlightedAddress << endl; if (s_highlightedAddress.isNull()) @@ -243,7 +243,7 @@ void KBookmarkMenu::slotAboutToShowContextMenu( KPopupMenu*, int, QPopupMenu* co fillContextMenu( contextMenu, s_highlightedAddress, 0 ); } -void RMB::fillContextMenu( QPopupMenu* contextMenu, const QString & address, int val ) +void RMB::fillContextMenu( TQPopupMenu* contextMenu, const TQString & address, int val ) { KBookmark bookmark = atAddress(address); @@ -256,41 +256,41 @@ void RMB::fillContextMenu( QPopupMenu* contextMenu, const QString & address, int // TODO rename these, but, message freeze... umm... // if (bookmark.isGroup()) { - id = contextMenu->insertItem( SmallIcon("bookmark_add"), i18n( "Add Bookmark Here" ), recv, SLOT(slotRMBActionInsert(int)) ); + id = contextMenu->insertItem( SmallIcon("bookmark_add"), i18n( "Add Bookmark Here" ), recv, TQT_SLOT(slotRMBActionInsert(int)) ); contextMenu->setItemParameter( id, val ); /* } else { - id = contextMenu->insertItem( SmallIcon("bookmark_add"), i18n( "Add Bookmark Here" ), recv, SLOT(slotRMBActionInsert(int)) ); + id = contextMenu->insertItem( SmallIcon("bookmark_add"), i18n( "Add Bookmark Here" ), recv, TQT_SLOT(slotRMBActionInsert(int)) ); contextMenu->setItemParameter( id, val ); }*/ } -void RMB::fillContextMenu2( QPopupMenu* contextMenu, const QString & address, int val ) +void RMB::fillContextMenu2( TQPopupMenu* contextMenu, const TQString & address, int val ) { KBookmark bookmark = atAddress(address); int id; if (bookmark.isGroup()) { - id = contextMenu->insertItem( i18n( "Open Folder in Bookmark Editor" ), recv, SLOT(slotRMBActionEditAt(int)) ); + id = contextMenu->insertItem( i18n( "Open Folder in Bookmark Editor" ), recv, TQT_SLOT(slotRMBActionEditAt(int)) ); contextMenu->setItemParameter( id, val ); contextMenu->insertSeparator(); - id = contextMenu->insertItem( SmallIcon("editdelete"), i18n( "Delete Folder" ), recv, SLOT(slotRMBActionRemove(int)) ); + id = contextMenu->insertItem( SmallIcon("editdelete"), i18n( "Delete Folder" ), recv, TQT_SLOT(slotRMBActionRemove(int)) ); contextMenu->setItemParameter( id, val ); contextMenu->insertSeparator(); - id = contextMenu->insertItem( i18n( "Properties" ), recv, SLOT(slotRMBActionProperties(int)) ); + id = contextMenu->insertItem( i18n( "Properties" ), recv, TQT_SLOT(slotRMBActionProperties(int)) ); contextMenu->setItemParameter( id, val ); } else { - id = contextMenu->insertItem( i18n( "Copy Link Address" ), recv, SLOT(slotRMBActionCopyLocation(int)) ); + id = contextMenu->insertItem( i18n( "Copy Link Address" ), recv, TQT_SLOT(slotRMBActionCopyLocation(int)) ); contextMenu->setItemParameter( id, val ); contextMenu->insertSeparator(); - id = contextMenu->insertItem( SmallIcon("editdelete"), i18n( "Delete Bookmark" ), recv, SLOT(slotRMBActionRemove(int)) ); + id = contextMenu->insertItem( SmallIcon("editdelete"), i18n( "Delete Bookmark" ), recv, TQT_SLOT(slotRMBActionRemove(int)) ); contextMenu->setItemParameter( id, val ); contextMenu->insertSeparator(); - id = contextMenu->insertItem( i18n( "Properties" ), recv, SLOT(slotRMBActionProperties(int)) ); + id = contextMenu->insertItem( i18n( "Properties" ), recv, TQT_SLOT(slotRMBActionProperties(int)) ); contextMenu->setItemParameter( id, val ); } } @@ -312,7 +312,7 @@ void RMB::slotRMBActionProperties( int val ) KBookmark bookmark = atAddress(s_highlightedAddress); - QString folder = bookmark.isGroup() ? QString::null : bookmark.url().pathOrURL(); + TQString folder = bookmark.isGroup() ? TQString::null : bookmark.url().pathOrURL(); KBookmarkEditDialog dlg( bookmark.fullText(), folder, m_pManager, KBookmarkEditDialog::ModifyMode, 0, 0, 0, i18n("Bookmark Properties") ); @@ -337,13 +337,13 @@ void RMB::slotRMBActionInsert( int val ) kdDebug(7043) << "KBookmarkMenu::slotRMBActionInsert" << s_highlightedAddress << endl; if (invalid(val)) { hidePopup(); return; } - QString url = m_pOwner->currentURL(); + TQString url = m_pOwner->currentURL(); if (url.isEmpty()) { KMessageBox::error( 0L, i18n("Cannot add bookmark with empty URL.")); return; } - QString title = m_pOwner->currentTitle(); + TQString title = m_pOwner->currentTitle(); if (title.isEmpty()) title = url; @@ -418,7 +418,7 @@ void RMB::hidePopup() { /********************************************************************/ /********************************************************************/ -void KBookmarkMenu::fillContextMenu( QPopupMenu* contextMenu, const QString & address, int val ) +void KBookmarkMenu::fillContextMenu( TQPopupMenu* contextMenu, const TQString & address, int val ) { RMB::begin_rmb_action(this); rmbSelf(this)->fillContextMenu(contextMenu, address, val); @@ -441,7 +441,7 @@ void KBookmarkMenu::slotRMBActionRemove( int val ) void KBookmarkMenu::slotRMBActionCopyLocation( int val ) { RMB::begin_rmb_action(this); rmbSelf(this)->slotRMBActionCopyLocation( val ); } -void KBookmarkMenu::slotBookmarksChanged( const QString & groupAddress ) +void KBookmarkMenu::slotBookmarksChanged( const TQString & groupAddress ) { if (m_bNSBookmark) return; @@ -454,7 +454,7 @@ void KBookmarkMenu::slotBookmarksChanged( const QString & groupAddress ) else { // Iterate recursively into child menus - QPtrListIterator<KBookmarkMenu> it( m_lstSubMenus ); + TQPtrListIterator<KBookmarkMenu> it( m_lstSubMenus ); for (; it.current(); ++it ) { it.current()->slotBookmarksChanged( groupAddress ); @@ -467,7 +467,7 @@ void KBookmarkMenu::refill() //kdDebug(7043) << "KBookmarkMenu::refill()" << endl; m_lstSubMenus.clear(); - QPtrListIterator<KAction> it( m_actions ); + TQPtrListIterator<KAction> it( m_actions ); for (; it.current(); ++it ) it.current()->unplug( m_parentMenu ); @@ -483,13 +483,13 @@ void KBookmarkMenu::addAddBookmarksList() if (!kapp->authorizeKAction("bookmarks")) return; - QString title = i18n( "Bookmark Tabs as Folder..." ); + TQString title = i18n( "Bookmark Tabs as Folder..." ); KAction * paAddBookmarksList = new KAction( title, "bookmarks_list_add", 0, this, - SLOT( slotAddBookmarksList() ), + TQT_SLOT( slotAddBookmarksList() ), m_actionCollection, m_bIsRoot ? "add_bookmarks_list" : 0 ); paAddBookmarksList->setToolTip( i18n( "Add a folder of bookmarks for all open tabs." ) ); @@ -503,13 +503,13 @@ void KBookmarkMenu::addAddBookmark() if (!kapp->authorizeKAction("bookmarks")) return; - QString title = i18n( "Add Bookmark" ); + TQString title = i18n( "Add Bookmark" ); KAction * paAddBookmarks = new KAction( title, "bookmark_add", m_bIsRoot && m_bAddShortcuts ? KStdAccel::addBookmark() : KShortcut(), this, - SLOT( slotAddBookmark() ), + TQT_SLOT( slotAddBookmark() ), m_actionCollection, m_bIsRoot ? "add_bookmark" : 0 ); paAddBookmarks->setToolTip( i18n( "Add a bookmark for the current document" ) ); @@ -523,7 +523,7 @@ void KBookmarkMenu::addEditBookmarks() if (!kapp->authorizeKAction("bookmarks")) return; - KAction * m_paEditBookmarks = KStdAction::editBookmarks( m_pManager, SLOT( slotEditBookmarks() ), + KAction * m_paEditBookmarks = KStdAction::editBookmarks( m_pManager, TQT_SLOT( slotEditBookmarks() ), m_actionCollection, "edit_bookmarks" ); m_paEditBookmarks->plug( m_parentMenu ); m_paEditBookmarks->setToolTip( i18n( "Edit your bookmark collection in a separate window" ) ); @@ -535,7 +535,7 @@ void KBookmarkMenu::addNewFolder() if (!kapp->authorizeKAction("bookmarks")) return; - QString title = i18n( "&New Bookmark Folder..." ); + TQString title = i18n( "&New Bookmark Folder..." ); int p; while ( ( p = title.find( '&' ) ) >= 0 ) title.remove( p, 1 ); @@ -544,7 +544,7 @@ void KBookmarkMenu::addNewFolder() "folder_new", //"folder", 0, this, - SLOT( slotNewFolder() ), + TQT_SLOT( slotNewFolder() ), m_actionCollection ); paNewFolder->setToolTip( i18n( "Create a new bookmark folder in this menu" ) ); @@ -578,14 +578,14 @@ void KBookmarkMenu::fillBookmarkMenu() { bool haveSep = false; - QValueList<QString> keys = KBookmarkMenu::dynamicBookmarksList(); - QValueList<QString>::const_iterator it; + TQValueList<TQString> keys = KBookmarkMenu::dynamicBookmarksList(); + TQValueList<TQString>::const_iterator it; for ( it = keys.begin(); it != keys.end(); ++it ) { DynMenuInfo info; info = showDynamicBookmarks((*it)); - if ( !info.show || !QFile::exists( info.location ) ) + if ( !info.show || !TQFile::exists( info.location ) ) continue; if (!haveSep) @@ -608,12 +608,12 @@ void KBookmarkMenu::fillBookmarkMenu() KBookmarkMenu *subMenu = new KBookmarkMenu( m_pManager, m_pOwner, actionMenu->popupMenu(), m_actionCollection, false, - m_bAddBookmark, QString::null ); - connect( subMenu, SIGNAL( openBookmark( const QString &, Qt::ButtonState ) ), - this, SIGNAL( openBookmark( const QString &, Qt::ButtonState ) )); + m_bAddBookmark, TQString::null ); + connect( subMenu, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState ) ), + this, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState ) )); m_lstSubMenus.append(subMenu); - connect(actionMenu->popupMenu(), SIGNAL(aboutToShow()), subMenu, SLOT(slotNSLoad())); + connect(actionMenu->popupMenu(), TQT_SIGNAL(aboutToShow()), subMenu, TQT_SLOT(slotNSLoad())); } } @@ -622,7 +622,7 @@ void KBookmarkMenu::fillBookmarkMenu() bool separatorInserted = false; for ( KBookmark bm = parentBookmark.first(); !bm.isNull(); bm = parentBookmark.next(bm) ) { - QString text = KStringHandler::csqueeze(bm.fullText(), 60); + TQString text = KStringHandler::csqueeze(bm.fullText(), 60); text.replace( '&', "&&" ); if ( !separatorInserted && m_bIsRoot) { // inserted before the first konq bookmark, to avoid the separator if no konq bookmark @@ -639,8 +639,8 @@ void KBookmarkMenu::fillBookmarkMenu() { //kdDebug(7043) << "Creating URL bookmark menu item for " << bm.text() << endl; KAction * action = new KBookmarkAction( text, bm.icon(), 0, m_actionCollection, 0 ); - connect(action, SIGNAL( activated ( KAction::ActivationReason, Qt::ButtonState )), - this, SLOT( slotBookmarkSelected( KAction::ActivationReason, Qt::ButtonState ) )); + connect(action, TQT_SIGNAL( activated ( KAction::ActivationReason, Qt::ButtonState )), + this, TQT_SLOT( slotBookmarkSelected( KAction::ActivationReason, Qt::ButtonState ) )); action->setProperty( "url", bm.url().url() ); action->setProperty( "address", bm.address() ); @@ -666,10 +666,10 @@ void KBookmarkMenu::fillBookmarkMenu() m_bAddBookmark, bm.address() ); - connect(subMenu, SIGNAL( aboutToShowContextMenu( const KBookmark &, QPopupMenu * ) ), - this, SIGNAL( aboutToShowContextMenu( const KBookmark &, QPopupMenu * ) )); - connect(subMenu, SIGNAL( openBookmark( const QString &, Qt::ButtonState ) ), - this, SIGNAL( openBookmark( const QString &, Qt::ButtonState ) )); + connect(subMenu, TQT_SIGNAL( aboutToShowContextMenu( const KBookmark &, TQPopupMenu * ) ), + this, TQT_SIGNAL( aboutToShowContextMenu( const KBookmark &, TQPopupMenu * ) )); + connect(subMenu, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState ) ), + this, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState ) )); m_lstSubMenus.append( subMenu ); } } @@ -750,7 +750,7 @@ void KBookmarkMenu::slotBookmarkSelected( KAction::ActivationReason /*reason*/, const KAction* action = dynamic_cast<const KAction *>(sender()); if(action) { - const QString& url = sender()->property("url").toString(); + const TQString& url = sender()->property("url").toString(); m_pOwner->openBookmarkURL( url ); emit openBookmark( url, state ); } @@ -769,7 +769,7 @@ KExtendedBookmarkOwner* KBookmarkMenu::extOwner() void KBookmarkMenu::slotNSLoad() { // only fill menu once - m_parentMenu->disconnect(SIGNAL(aboutToShow())); + m_parentMenu->disconnect(TQT_SIGNAL(aboutToShow())); // not NSImporter, but kept old name for BC reasons KBookmarkMenuNSImporter importer( m_pManager, this, m_actionCollection ); @@ -780,21 +780,21 @@ void KBookmarkMenu::slotNSLoad() /********************************************************************/ /********************************************************************/ -KBookmarkEditFields::KBookmarkEditFields(QWidget *main, QBoxLayout *vbox, FieldsSet fieldsSet) +KBookmarkEditFields::KBookmarkEditFields(TQWidget *main, TQBoxLayout *vbox, FieldsSet fieldsSet) { bool isF = (fieldsSet != FolderFieldsSet); - QGridLayout *grid = new QGridLayout( vbox, 2, isF ? 2 : 1 ); + TQGridLayout *grid = new TQGridLayout( vbox, 2, isF ? 2 : 1 ); m_title = new KLineEdit( main ); grid->addWidget( m_title, 0, 1 ); - grid->addWidget( new QLabel( m_title, i18n( "Name:" ), main ), 0, 0 ); + grid->addWidget( new TQLabel( m_title, i18n( "Name:" ), main ), 0, 0 ); m_title->setFocus(); if (isF) { m_url = new KLineEdit( main ); grid->addWidget( m_url, 1, 1 ); - grid->addWidget( new QLabel( m_url, i18n( "Location:" ), main ), 1, 0 ); + grid->addWidget( new TQLabel( m_url, i18n( "Location:" ), main ), 1, 0 ); } else { @@ -804,12 +804,12 @@ KBookmarkEditFields::KBookmarkEditFields(QWidget *main, QBoxLayout *vbox, Fields main->setMinimumSize( 300, 0 ); } -void KBookmarkEditFields::setName(const QString &str) +void KBookmarkEditFields::setName(const TQString &str) { m_title->setText(str); } -void KBookmarkEditFields::setLocation(const QString &str) +void KBookmarkEditFields::setLocation(const TQString &str) { m_url->setText(str); } @@ -819,8 +819,8 @@ void KBookmarkEditFields::setLocation(const QString &str) /********************************************************************/ // TODO - make the dialog use Properties as a title when in Modify mode... (dirk noticed the bug...) -KBookmarkEditDialog::KBookmarkEditDialog(const QString& title, const QString& url, KBookmarkManager * mgr, BookmarkEditType editType, const QString& address, - QWidget * parent, const char * name, const QString& caption ) +KBookmarkEditDialog::KBookmarkEditDialog(const TQString& title, const TQString& url, KBookmarkManager * mgr, BookmarkEditType editType, const TQString& address, + TQWidget * parent, const char * name, const TQString& caption ) : KDialogBase(parent, name, true, caption, (editType == InsertionMode) ? (User1|Ok|Cancel) : (Ok|Cancel), Ok, false, KGuiItem()), @@ -833,10 +833,10 @@ KBookmarkEditDialog::KBookmarkEditDialog(const QString& title, const QString& ur bool folder = url.isNull(); - m_main = new QWidget( this ); + m_main = new TQWidget( this ); setMainWidget( m_main ); - QBoxLayout *vbox = new QVBoxLayout( m_main, 0, spacingHint() ); + TQBoxLayout *vbox = new TQVBoxLayout( m_main, 0, spacingHint() ); KBookmarkEditFields::FieldsSet fs = folder ? KBookmarkEditFields::FolderFieldsSet : KBookmarkEditFields::BookmarkFieldsSet; @@ -848,14 +848,14 @@ KBookmarkEditDialog::KBookmarkEditDialog(const QString& title, const QString& ur if ( editType == InsertionMode ) { m_folderTree = KBookmarkFolderTree::createTree( m_mgr, m_main, name, m_address ); - connect( m_folderTree, SIGNAL( doubleClicked(QListViewItem*) ), - this, SLOT( slotDoubleClicked(QListViewItem*) ) ); + connect( m_folderTree, TQT_SIGNAL( doubleClicked(TQListViewItem*) ), + this, TQT_SLOT( slotDoubleClicked(TQListViewItem*) ) ); vbox->addWidget( m_folderTree ); - connect( this, SIGNAL( user1Clicked() ), SLOT( slotUser1() ) ); + connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotUser1() ) ); } } -void KBookmarkEditDialog::slotDoubleClicked( QListViewItem* item ) +void KBookmarkEditDialog::slotDoubleClicked( TQListViewItem* item ) { Q_ASSERT( m_folderTree ); m_folderTree->setCurrentItem( item ); @@ -872,20 +872,20 @@ void KBookmarkEditDialog::slotCancel() reject(); } -QString KBookmarkEditDialog::finalAddress() const +TQString KBookmarkEditDialog::finalAddress() const { Q_ASSERT( m_folderTree ); return KBookmarkFolderTree::selectedAddress( m_folderTree ); } -QString KBookmarkEditDialog::finalUrl() const +TQString KBookmarkEditDialog::finalUrl() const { - return m_fields->m_url ? m_fields->m_url->text() : QString::null; + return m_fields->m_url ? m_fields->m_url->text() : TQString::null; } -QString KBookmarkEditDialog::finalTitle() const +TQString KBookmarkEditDialog::finalTitle() const { - return m_fields->m_title ? m_fields->m_title->text() : QString::null; + return m_fields->m_title ? m_fields->m_title->text() : TQString::null; } void KBookmarkEditDialog::slotUser1() @@ -893,7 +893,7 @@ void KBookmarkEditDialog::slotUser1() // kdDebug(7043) << "KBookmarkEditDialog::slotUser1" << endl; Q_ASSERT( m_folderTree ); - QString address = KBookmarkFolderTree::selectedAddress( m_folderTree ); + TQString address = KBookmarkFolderTree::selectedAddress( m_folderTree ); if ( address.isNull() ) return; KBookmarkGroup bm = m_mgr->findByAddress( address ).toGroup(); Q_ASSERT(!bm.isNull()); @@ -912,7 +912,7 @@ void KBookmarkEditDialog::slotUser1() /********************************************************************/ /********************************************************************/ -static void fillGroup( QListView* listview, KBookmarkFolderTreeItem * parentItem, KBookmarkGroup group, bool expandOpenGroups = true, const QString& address = QString::null ) +static void fillGroup( TQListView* listview, KBookmarkFolderTreeItem * parentItem, KBookmarkGroup group, bool expandOpenGroups = true, const TQString& address = TQString::null ) { bool noSubGroups = true; KBookmarkFolderTreeItem * lastItem = 0L; @@ -939,17 +939,17 @@ static void fillGroup( QListView* listview, KBookmarkFolderTreeItem * parentItem } } -QListView* KBookmarkFolderTree::createTree( KBookmarkManager* mgr, QWidget* parent, const char* name, const QString& address ) +TQListView* KBookmarkFolderTree::createTree( KBookmarkManager* mgr, TQWidget* parent, const char* name, const TQString& address ) { - QListView *listview = new QListView( parent, name ); + TQListView *listview = new TQListView( parent, name ); listview->setRootIsDecorated( false ); listview->header()->hide(); listview->addColumn( i18n("Bookmark"), 200 ); listview->setSorting( -1, false ); - listview->setSelectionMode( QListView::Single ); + listview->setSelectionMode( TQListView::Single ); listview->setAllColumnsShowFocus( true ); - listview->setResizeMode( QListView::AllColumns ); + listview->setResizeMode( TQListView::AllColumns ); listview->setMinimumSize( 60, 100 ); fillTree( listview, mgr, address ); @@ -957,7 +957,7 @@ QListView* KBookmarkFolderTree::createTree( KBookmarkManager* mgr, QWidget* pare return listview; } -void KBookmarkFolderTree::fillTree( QListView *listview, KBookmarkManager* mgr, const QString& address ) +void KBookmarkFolderTree::fillTree( TQListView *listview, KBookmarkManager* mgr, const TQString& address ) { listview->clear(); @@ -969,20 +969,20 @@ void KBookmarkFolderTree::fillTree( QListView *listview, KBookmarkManager* mgr, rootItem->setOpen( true ); } -static KBookmarkFolderTreeItem* ft_cast( QListViewItem *i ) +static KBookmarkFolderTreeItem* ft_cast( TQListViewItem *i ) { return static_cast<KBookmarkFolderTreeItem*>( i ); } -QString KBookmarkFolderTree::selectedAddress( QListView *listview ) +TQString KBookmarkFolderTree::selectedAddress( TQListView *listview ) { if ( !listview) - return QString::null; + return TQString::null; KBookmarkFolderTreeItem *item = ft_cast( listview->currentItem() ); - return item ? item->m_bookmark.address() : QString::null; + return item ? item->m_bookmark.address() : TQString::null; } -void KBookmarkFolderTree::setAddress( QListView *listview, const QString & address ) +void KBookmarkFolderTree::setAddress( TQListView *listview, const TQString & address ) { KBookmarkFolderTreeItem* it = ft_cast( listview->firstChild() ); while ( true ) { @@ -1002,16 +1002,16 @@ void KBookmarkFolderTree::setAddress( QListView *listview, const QString & addre /********************************************************************/ // toplevel item -KBookmarkFolderTreeItem::KBookmarkFolderTreeItem( QListView *parent, const KBookmark & gp ) - : QListViewItem(parent, i18n("Bookmarks")), m_bookmark(gp) +KBookmarkFolderTreeItem::KBookmarkFolderTreeItem( TQListView *parent, const KBookmark & gp ) + : TQListViewItem(parent, i18n("Bookmarks")), m_bookmark(gp) { setPixmap(0, SmallIcon("bookmark")); setExpandable(true); } // group -KBookmarkFolderTreeItem::KBookmarkFolderTreeItem( KBookmarkFolderTreeItem *parent, QListViewItem *after, const KBookmarkGroup & gp ) - : QListViewItem(parent, after, gp.fullText()), m_bookmark(gp) +KBookmarkFolderTreeItem::KBookmarkFolderTreeItem( KBookmarkFolderTreeItem *parent, TQListViewItem *after, const KBookmarkGroup & gp ) + : TQListViewItem(parent, after, gp.fullText()), m_bookmark(gp) { setPixmap(0, SmallIcon( gp.icon() ) ); setExpandable(true); @@ -1029,7 +1029,7 @@ void KBookmarkMenuNSImporter::openNSBookmarks() openBookmarks( KNSBookmarkImporter::netscapeBookmarksFile(), "netscape" ); } -void KBookmarkMenuNSImporter::openBookmarks( const QString &location, const QString &type ) +void KBookmarkMenuNSImporter::openBookmarks( const TQString &location, const TQString &type ) { mstack.push(m_menu); @@ -1043,41 +1043,41 @@ void KBookmarkMenuNSImporter::openBookmarks( const QString &location, const QStr delete importer; } -void KBookmarkMenuNSImporter::connectToImporter(const QObject &importer) +void KBookmarkMenuNSImporter::connectToImporter(const TQObject &importer) { - connect( &importer, SIGNAL( newBookmark( const QString &, const QCString &, const QString & ) ), - SLOT( newBookmark( const QString &, const QCString &, const QString & ) ) ); - connect( &importer, SIGNAL( newFolder( const QString &, bool, const QString & ) ), - SLOT( newFolder( const QString &, bool, const QString & ) ) ); - connect( &importer, SIGNAL( newSeparator() ), SLOT( newSeparator() ) ); - connect( &importer, SIGNAL( endFolder() ), SLOT( endFolder() ) ); + connect( &importer, TQT_SIGNAL( newBookmark( const TQString &, const TQCString &, const TQString & ) ), + TQT_SLOT( newBookmark( const TQString &, const TQCString &, const TQString & ) ) ); + connect( &importer, TQT_SIGNAL( newFolder( const TQString &, bool, const TQString & ) ), + TQT_SLOT( newFolder( const TQString &, bool, const TQString & ) ) ); + connect( &importer, TQT_SIGNAL( newSeparator() ), TQT_SLOT( newSeparator() ) ); + connect( &importer, TQT_SIGNAL( endFolder() ), TQT_SLOT( endFolder() ) ); } -void KBookmarkMenuNSImporter::newBookmark( const QString & text, const QCString & url, const QString & ) +void KBookmarkMenuNSImporter::newBookmark( const TQString & text, const TQCString & url, const TQString & ) { - QString _text = KStringHandler::csqueeze(text); + TQString _text = KStringHandler::csqueeze(text); _text.replace( '&', "&&" ); KAction * action = new KBookmarkAction(_text, "html", 0, 0, "", m_actionCollection, 0); - connect(action, SIGNAL( activated ( KAction::ActivationReason, Qt::ButtonState )), - m_menu, SLOT( slotBookmarkSelected( KAction::ActivationReason, Qt::ButtonState ) )); + connect(action, TQT_SIGNAL( activated ( KAction::ActivationReason, Qt::ButtonState )), + m_menu, TQT_SLOT( slotBookmarkSelected( KAction::ActivationReason, Qt::ButtonState ) )); action->setProperty( "url", url ); action->setToolTip( url ); action->plug( mstack.top()->m_parentMenu ); mstack.top()->m_actions.append( action ); } -void KBookmarkMenuNSImporter::newFolder( const QString & text, bool, const QString & ) +void KBookmarkMenuNSImporter::newFolder( const TQString & text, bool, const TQString & ) { - QString _text = KStringHandler::csqueeze(text); + TQString _text = KStringHandler::csqueeze(text); _text.replace( '&', "&&" ); KActionMenu * actionMenu = new KActionMenu( _text, "folder", m_actionCollection, 0L ); actionMenu->plug( mstack.top()->m_parentMenu ); mstack.top()->m_actions.append( actionMenu ); KBookmarkMenu *subMenu = new KBookmarkMenu( m_pManager, m_menu->m_pOwner, actionMenu->popupMenu(), m_actionCollection, false, - m_menu->m_bAddBookmark, QString::null ); - connect( subMenu, SIGNAL( openBookmark( const QString &, Qt::ButtonState ) ), - m_menu, SIGNAL( openBookmark( const QString &, Qt::ButtonState ) )); + m_menu->m_bAddBookmark, TQString::null ); + connect( subMenu, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState ) ), + m_menu, TQT_SIGNAL( openBookmark( const TQString &, Qt::ButtonState ) )); mstack.top()->m_lstSubMenus.append( subMenu ); mstack.push(subMenu); @@ -1097,7 +1097,7 @@ void KBookmarkMenuNSImporter::endFolder() /********************************************************************/ /********************************************************************/ -KBookmarkMenu::DynMenuInfo KBookmarkMenu::showDynamicBookmarks( const QString &id ) +KBookmarkMenu::DynMenuInfo KBookmarkMenu::showDynamicBookmarks( const TQString &id ) { KConfig config("kbookmarkrc", false, false); config.setGroup("Bookmarks"); @@ -1129,12 +1129,12 @@ KBookmarkMenu::DynMenuInfo KBookmarkMenu::showDynamicBookmarks( const QString &i return info; } -QStringList KBookmarkMenu::dynamicBookmarksList() +TQStringList KBookmarkMenu::dynamicBookmarksList() { KConfig config("kbookmarkrc", false, false); config.setGroup("Bookmarks"); - QStringList mlist; + TQStringList mlist; if (config.hasKey("DynamicMenus")) mlist = config.readListEntry("DynamicMenus"); else @@ -1143,7 +1143,7 @@ QStringList KBookmarkMenu::dynamicBookmarksList() return mlist; } -void KBookmarkMenu::setDynamicBookmarks(const QString &id, const DynMenuInfo &newMenu) +void KBookmarkMenu::setDynamicBookmarks(const TQString &id, const DynMenuInfo &newMenu) { KConfig config("kbookmarkrc", false, false); @@ -1154,7 +1154,7 @@ void KBookmarkMenu::setDynamicBookmarks(const QString &id, const DynMenuInfo &ne config.writeEntry("Type", newMenu.type); config.writeEntry("Name", newMenu.name); - QStringList elist; + TQStringList elist; config.setGroup("Bookmarks"); if (!config.hasKey("DynamicMenus")) { diff --git a/kio/bookmarks/kbookmarkmenu.h b/kio/bookmarks/kbookmarkmenu.h index 0a1ca1f24..d97271879 100644 --- a/kio/bookmarks/kbookmarkmenu.h +++ b/kio/bookmarks/kbookmarkmenu.h @@ -24,10 +24,10 @@ #include <sys/types.h> -#include <qptrlist.h> -#include <qptrstack.h> -#include <qobject.h> -#include <qlistview.h> +#include <tqptrlist.h> +#include <tqptrstack.h> +#include <tqobject.h> +#include <tqlistview.h> #include <kdialogbase.h> #include <klocale.h> @@ -104,7 +104,7 @@ public: KBookmarkMenu( KBookmarkManager* mgr, KBookmarkOwner * owner, KPopupMenu * parentMenu, KActionCollection * collec, bool root, bool add = true, - const QString & parentAddress = "" ); + const TQString & parentAddress = "" ); ~KBookmarkMenu(); @@ -129,9 +129,9 @@ public: // TODO - transform into class struct DynMenuInfo { bool show; - QString location; - QString type; - QString name; + TQString location; + TQString type; + TQString name; class DynMenuInfoPrivate *d; }; @@ -139,7 +139,7 @@ public: * @return dynmenu info block for the given dynmenu name * @since 3.2 */ - static DynMenuInfo showDynamicBookmarks( const QString &id ); + static DynMenuInfo showDynamicBookmarks( const TQString &id ); /** * Shows an extra menu for the given bookmarks file and type. @@ -149,27 +149,27 @@ public: * @param info a DynMenuInfo struct containing the to be added/modified data * @since 3.2 */ - static void setDynamicBookmarks( const QString &id, const DynMenuInfo &info ); + static void setDynamicBookmarks( const TQString &id, const DynMenuInfo &info ); /** * @return list of dynamic menu ids * @since 3.2 */ - static QStringList dynamicBookmarksList(); + static TQStringList dynamicBookmarksList(); signals: - void aboutToShowContextMenu( const KBookmark &, QPopupMenu * ); + void aboutToShowContextMenu( const KBookmark &, TQPopupMenu * ); /** * @since 3.4 */ - void openBookmark( const QString& url, Qt::ButtonState state ); + void openBookmark( const TQString& url, Qt::ButtonState state ); public slots: // public for bookmark bar - void slotBookmarksChanged( const QString & ); + void slotBookmarksChanged( const TQString & ); protected slots: void slotAboutToShow(); - void slotAboutToShowContextMenu( KPopupMenu *, int, QPopupMenu * ); + void slotAboutToShowContextMenu( KPopupMenu *, int, TQPopupMenu * ); void slotActionHighlighted( KAction * ); void slotRMBActionRemove( int ); @@ -200,7 +200,7 @@ protected: void addEditBookmarks(); void addNewFolder(); - void fillContextMenu( QPopupMenu *, const QString &, int ); + void fillContextMenu( TQPopupMenu *, const TQString &, int ); bool m_bIsRoot:1; bool m_bAddBookmark:1; @@ -218,21 +218,21 @@ protected: /** * List of our sub menus */ - QPtrList<KBookmarkMenu> m_lstSubMenus; + TQPtrList<KBookmarkMenu> m_lstSubMenus; KActionCollection * m_actionCollection; /** * List of our actions. */ - QPtrList<KAction> m_actions; + TQPtrList<KAction> m_actions; /** * Parent bookmark for this menu. */ - QString m_parentAddress; + TQString m_parentAddress; // TODO make non static! - static QString s_highlightedAddress; - static QString s_highlightedImportLocation; - static QString s_highlightedImportType; + static TQString s_highlightedAddress; + static TQString s_highlightedImportLocation; + static TQString s_highlightedImportType; }; /** @@ -246,17 +246,17 @@ public: m_menu(menu), m_actionCollection(act), m_pManager(mgr) {} void openNSBookmarks(); - void openBookmarks( const QString &location, const QString &type ); - void connectToImporter( const QObject &importer ); + void openBookmarks( const TQString &location, const TQString &type ); + void connectToImporter( const TQObject &importer ); protected slots: - void newBookmark( const QString & text, const QCString & url, const QString & ); - void newFolder( const QString & text, bool, const QString & ); + void newBookmark( const TQString & text, const TQCString & url, const TQString & ); + void newFolder( const TQString & text, bool, const TQString & ); void newSeparator(); void endFolder(); protected: - QPtrStack<KBookmarkMenu> mstack; + TQPtrStack<KBookmarkMenu> mstack; KBookmarkMenu * m_menu; KActionCollection * m_actionCollection; KBookmarkManager* m_pManager; diff --git a/kio/bookmarks/kbookmarkmenu_p.h b/kio/bookmarks/kbookmarkmenu_p.h index 1c3f15ba8..6409a5f3e 100644 --- a/kio/bookmarks/kbookmarkmenu_p.h +++ b/kio/bookmarks/kbookmarkmenu_p.h @@ -24,10 +24,10 @@ #include <sys/types.h> -#include <qptrlist.h> -#include <qptrstack.h> -#include <qobject.h> -#include <qlistview.h> +#include <tqptrlist.h> +#include <tqptrstack.h> +#include <tqobject.h> +#include <tqlistview.h> #include <kdialogbase.h> #include <klocale.h> @@ -54,19 +54,19 @@ class KPopupMenu; class KImportedBookmarksActionMenu : public KActionMenu { Q_OBJECT - Q_PROPERTY( QString type READ type WRITE setType ) - Q_PROPERTY( QString location READ location WRITE setLocation ) + Q_PROPERTY( TQString type READ type WRITE setType ) + Q_PROPERTY( TQString location READ location WRITE setLocation ) public: - const QString type() const { return m_type; } - void setType(const QString &type) { m_type = type; } - const QString location() const { return m_location; } - void setLocation(const QString &location) { m_location = location; } + const TQString type() const { return m_type; } + void setType(const TQString &type) { m_type = type; } + const TQString location() const { return m_location; } + void setLocation(const TQString &location) { m_location = location; } private: - QString m_type; - QString m_location; + TQString m_type; + TQString m_location; public: KImportedBookmarksActionMenu( - const QString &text, const QString& sIconName, + const TQString &text, const TQString& sIconName, KActionCollection* parent, const char* name) : KActionMenu(text, sIconName, parent, name) { ; @@ -75,23 +75,23 @@ public: class KBookmarkActionMenu : public KActionMenu { Q_OBJECT - Q_PROPERTY( QString url READ url WRITE setUrl ) - Q_PROPERTY( QString address READ address WRITE setAddress ) + Q_PROPERTY( TQString url READ url WRITE setUrl ) + Q_PROPERTY( TQString address READ address WRITE setAddress ) Q_PROPERTY( bool readOnly READ readOnly WRITE setReadOnly ) public: - const QString url() const { return m_url; } - void setUrl(const QString &url) { m_url = url; } - const QString address() const { return m_address; } - void setAddress(const QString &address) { m_address = address; } + const TQString url() const { return m_url; } + void setUrl(const TQString &url) { m_url = url; } + const TQString address() const { return m_address; } + void setAddress(const TQString &address) { m_address = address; } bool readOnly() const { return m_readOnly; } void setReadOnly(bool readOnly) { m_readOnly = readOnly; } private: - QString m_url; - QString m_address; + TQString m_url; + TQString m_address; bool m_readOnly; public: KBookmarkActionMenu( - const QString &text, const QString& sIconName, + const TQString &text, const TQString& sIconName, KActionCollection* parent, const char* name) : KActionMenu(text, sIconName, parent, name) { ; @@ -100,26 +100,26 @@ public: class KBookmarkAction : public KAction { Q_OBJECT - Q_PROPERTY( QString url READ url WRITE setUrl ) - Q_PROPERTY( QString address READ address WRITE setAddress ) + Q_PROPERTY( TQString url READ url WRITE setUrl ) + Q_PROPERTY( TQString address READ address WRITE setAddress ) public: - const QString url() const { return m_url; } - void setUrl(const QString &url) { m_url = url; } - const QString address() const { return m_address; } - void setAddress(const QString &address) { m_address = address; } + const TQString url() const { return m_url; } + void setUrl(const TQString &url) { m_url = url; } + const TQString address() const { return m_address; } + void setAddress(const TQString &address) { m_address = address; } private: - QString m_url; - QString m_address; + TQString m_url; + TQString m_address; public: // KDE4: remove KBookmarkAction( - const QString& text, const QString& sIconName, const KShortcut& cut, - const QObject* receiver, const char* slot, + const TQString& text, const TQString& sIconName, const KShortcut& cut, + const TQObject* receiver, const char* slot, KActionCollection* parent, const char* name) : KAction(text, sIconName, cut, receiver, slot, parent, name) { } KBookmarkAction( - const QString& text, const QString& sIconName, const KShortcut& cut, + const TQString& text, const TQString& sIconName, const KShortcut& cut, KActionCollection* parent, const char* name) : KAction(text, sIconName, cut, parent, name) { } @@ -130,9 +130,9 @@ public: typedef enum { FolderFieldsSet, BookmarkFieldsSet } FieldsSet; KLineEdit * m_url; KLineEdit * m_title; - KBookmarkEditFields(QWidget *main, QBoxLayout *vbox, FieldsSet isFolder); - void setName(const QString &str); - void setLocation(const QString &str); + KBookmarkEditFields(TQWidget *main, TQBoxLayout *vbox, FieldsSet isFolder); + void setName(const TQString &str); + void setLocation(const TQString &str); }; class KBookmarkEditDialog : public KDialogBase @@ -142,27 +142,27 @@ class KBookmarkEditDialog : public KDialogBase public: typedef enum { ModifyMode, InsertionMode } BookmarkEditType; - KBookmarkEditDialog( const QString& title, const QString& url, KBookmarkManager *, BookmarkEditType editType, const QString& address = QString::null, - QWidget * = 0, const char * = 0, const QString& caption = i18n( "Add Bookmark" ) ); + KBookmarkEditDialog( const TQString& title, const TQString& url, KBookmarkManager *, BookmarkEditType editType, const TQString& address = TQString::null, + TQWidget * = 0, const char * = 0, const TQString& caption = i18n( "Add Bookmark" ) ); - QString finalUrl() const; - QString finalTitle() const; - QString finalAddress() const; + TQString finalUrl() const; + TQString finalTitle() const; + TQString finalAddress() const; protected slots: void slotOk(); void slotCancel(); void slotUser1(); - void slotDoubleClicked(QListViewItem* item); + void slotDoubleClicked(TQListViewItem* item); private: - QWidget * m_main; + TQWidget * m_main; KBookmarkEditFields * m_fields; - QListView * m_folderTree; - QPushButton * m_button; + TQListView * m_folderTree; + TQPushButton * m_button; KBookmarkManager * m_mgr; BookmarkEditType m_editType; - QString m_address; + TQString m_address; }; class KBookmarkFolderTreeItem : public QListViewItem @@ -170,8 +170,8 @@ class KBookmarkFolderTreeItem : public QListViewItem // make this an accessor friend class KBookmarkFolderTree; public: - KBookmarkFolderTreeItem( QListView *, const KBookmark & ); - KBookmarkFolderTreeItem( KBookmarkFolderTreeItem *, QListViewItem *, const KBookmarkGroup & ); + KBookmarkFolderTreeItem( TQListView *, const KBookmark & ); + KBookmarkFolderTreeItem( KBookmarkFolderTreeItem *, TQListViewItem *, const KBookmarkGroup & ); private: KBookmark m_bookmark; }; @@ -179,10 +179,10 @@ private: class KBookmarkFolderTree { public: - static QListView* createTree( KBookmarkManager *, QWidget * = 0, const char * = 0, const QString& = QString::null ); - static void fillTree( QListView*, KBookmarkManager *, const QString& = QString::null ); - static QString selectedAddress( QListView* ); - static void setAddress( QListView *, const QString & ); + static TQListView* createTree( KBookmarkManager *, TQWidget * = 0, const char * = 0, const TQString& = TQString::null ); + static void fillTree( TQListView*, KBookmarkManager *, const TQString& = TQString::null ); + static TQString selectedAddress( TQListView* ); + static void setAddress( TQListView *, const TQString & ); }; class KBookmarkSettings @@ -203,9 +203,9 @@ public: static void begin_rmb_action(KBookmarkMenu *); static void begin_rmb_action(KBookmarkBar *); bool invalid( int val ); - KBookmark atAddress(const QString & address); - void fillContextMenu( QPopupMenu* contextMenu, const QString & address, int val ); - void fillContextMenu2( QPopupMenu* contextMenu, const QString & address, int val ); + KBookmark atAddress(const TQString & address); + void fillContextMenu( TQPopupMenu* contextMenu, const TQString & address, int val ); + void fillContextMenu2( TQPopupMenu* contextMenu, const TQString & address, int val ); void slotRMBActionEditAt( int val ); void slotRMBActionProperties( int val ); void slotRMBActionInsert( int val ); @@ -213,12 +213,12 @@ public: void slotRMBActionCopyLocation( int val ); void hidePopup(); public: - QObject *recv; + TQObject *recv; KBookmarkManager *m_pManager; - QString s_highlightedAddress; - QString m_parentAddress; + TQString s_highlightedAddress; + TQString m_parentAddress; KBookmarkOwner *m_pOwner; - QWidget *m_parentMenu; + TQWidget *m_parentMenu; }; #endif diff --git a/kio/bookmarks/kbookmarknotifier.h b/kio/bookmarks/kbookmarknotifier.h index 6a16fa052..3982f984f 100644 --- a/kio/bookmarks/kbookmarknotifier.h +++ b/kio/bookmarks/kbookmarknotifier.h @@ -33,12 +33,12 @@ class KIO_EXPORT KBookmarkNotifier : virtual public DCOPObject K_DCOP public: - KBookmarkNotifier(QCString objId = "KBookmarkNotifier") : DCOPObject(objId) {} + KBookmarkNotifier(TQCString objId = "KBookmarkNotifier") : DCOPObject(objId) {} k_dcop_signals: - void addedBookmark( QString filename, QString url, QString text, QString address, QString icon ); - void createdNewFolder( QString filename, QString text, QString address ); - void updatedAccessMetadata( QString filename, QString url ); + void addedBookmark( TQString filename, TQString url, TQString text, TQString address, TQString icon ); + void createdNewFolder( TQString filename, TQString text, TQString address ); + void updatedAccessMetadata( TQString filename, TQString url ); }; #endif |