diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:33:34 +0000 |
commit | c663b6440964f6ac48027143ac9e63298991f9d0 (patch) | |
tree | 6d8b0c5a5f9db1ee16acf98b1397cea9126b281d /konqueror/sidebar/trees/dirtree_module | |
parent | a061f7191beebb0e4a3b0c0a7c534ec5f22f2dc7 (diff) | |
download | tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.tar.gz tdebase-c663b6440964f6ac48027143ac9e63298991f9d0.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konqueror/sidebar/trees/dirtree_module')
4 files changed, 79 insertions, 79 deletions
diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp b/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp index 7f7ee8849..811867b14 100644 --- a/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_item.cpp @@ -25,13 +25,13 @@ #include <kdebug.h> #include <kglobalsettings.h> #include <kuserprofile.h> -#include <qapplication.h> -#include <qclipboard.h> +#include <tqapplication.h> +#include <tqclipboard.h> #include <kio/paste.h> -#include <qfile.h> -#include <qpainter.h> +#include <tqfile.h> +#include <tqpainter.h> #include <kiconloader.h> -#include <qcursor.h> +#include <tqcursor.h> #define MYMODULE static_cast<KonqSidebarDirTreeModule*>(module()) @@ -64,7 +64,7 @@ void KonqSidebarDirTreeItem::reset() KURL url = m_fileItem->url(); if ( url.isLocalFile() ) { - QCString path( QFile::encodeName(url.path())); + TQCString path( TQFile::encodeName(url.path())); struct stat buff; if ( ::stat( path.data(), &buff ) != -1 ) { @@ -108,15 +108,15 @@ bool KonqSidebarDirTreeItem::hasStandardIcon() return m_fileItem->iconName() == "folder"; } -void KonqSidebarDirTreeItem::paintCell( QPainter *_painter, const QColorGroup & _cg, int _column, int _width, int _alignment ) +void KonqSidebarDirTreeItem::paintCell( TQPainter *_painter, const TQColorGroup & _cg, int _column, int _width, int _alignment ) { if (m_fileItem->isLink()) { - QFont f( _painter->font() ); + TQFont f( _painter->font() ); f.setItalic( TRUE ); _painter->setFont( f ); } - QListViewItem::paintCell( _painter, _cg, _column, _width, _alignment ); + TQListViewItem::paintCell( _painter, _cg, _column, _width, _alignment ); } KURL KonqSidebarDirTreeItem::externalURL() const @@ -124,27 +124,27 @@ KURL KonqSidebarDirTreeItem::externalURL() const return m_fileItem->url(); } -QString KonqSidebarDirTreeItem::externalMimeType() const +TQString KonqSidebarDirTreeItem::externalMimeType() const { if (m_fileItem->isMimeTypeKnown()) return m_fileItem->mimetype(); else - return QString::null; + return TQString::null; } -bool KonqSidebarDirTreeItem::acceptsDrops( const QStrList & formats ) +bool KonqSidebarDirTreeItem::acceptsDrops( const TQStrList & formats ) { if ( formats.contains("text/uri-list") ) return m_fileItem->acceptsDrops(); return false; } -void KonqSidebarDirTreeItem::drop( QDropEvent * ev ) +void KonqSidebarDirTreeItem::drop( TQDropEvent * ev ) { KonqOperations::doDrop( m_fileItem, externalURL(), ev, tree() ); } -QDragObject * KonqSidebarDirTreeItem::dragObject( QWidget * parent, bool move ) +TQDragObject * KonqSidebarDirTreeItem::dragObject( TQWidget * parent, bool move ) { KURL::List lst; lst.append( m_fileItem->url() ); @@ -162,7 +162,7 @@ void KonqSidebarDirTreeItem::itemSelected() if ( m_fileItem->url().directory(false) == KGlobalSettings::trashPath() ) bInTrash = true; - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); bool paste = ( data->encodedData( data->format() ).size() != 0 ); tree()->enableActions( true, true, paste, true && !bInTrash, true, true ); @@ -190,14 +190,14 @@ void KonqSidebarDirTreeItem::rightButtonPressed() { KFileItemList lstItems; lstItems.append( m_fileItem ); - emit tree()->popupMenu( QCursor::pos(), lstItems ); + emit tree()->popupMenu( TQCursor::pos(), lstItems ); } void KonqSidebarDirTreeItem::paste() { // move or not move ? bool move = false; - QMimeSource *data = QApplication::clipboard()->data(); + TQMimeSource *data = TQApplication::clipboard()->data(); if ( data->provides( "application/x-kde-cutselection" ) ) { move = KonqDrag::decodeIsCutSelection( data ); kdDebug(1201) << "move (from clipboard data) = " << move << endl; @@ -229,7 +229,7 @@ void KonqSidebarDirTreeItem::delOperation( int method ) KonqOperations::del(tree(), method, lst); } -QString KonqSidebarDirTreeItem::toolTipText() const +TQString KonqSidebarDirTreeItem::toolTipText() const { return m_fileItem->url().pathOrURL(); } @@ -239,7 +239,7 @@ void KonqSidebarDirTreeItem::rename() tree()->rename( this, 0 ); } -void KonqSidebarDirTreeItem::rename( const QString & name ) +void KonqSidebarDirTreeItem::rename( const TQString & name ) { KonqOperations::rename( tree(), m_fileItem->url(), name ); } diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_item.h b/konqueror/sidebar/trees/dirtree_module/dirtree_item.h index fe98595e6..f8025d230 100644 --- a/konqueror/sidebar/trees/dirtree_module/dirtree_item.h +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_item.h @@ -21,7 +21,7 @@ #include "konq_sidebartreeitem.h" #include <kurl.h> -#include <qstringlist.h> +#include <tqstringlist.h> class QDropEvent; class KFileItem; @@ -36,11 +36,11 @@ public: virtual void setOpen( bool open ); - virtual void paintCell( QPainter *_painter, const QColorGroup & _cg, int _column, int _width, int _alignment ); + virtual void paintCell( TQPainter *_painter, const TQColorGroup & _cg, int _column, int _width, int _alignment ); - virtual bool acceptsDrops( const QStrList & formats ); - virtual void drop( QDropEvent * ev ); - virtual QDragObject * dragObject( QWidget * parent, bool move = false ); + virtual bool acceptsDrops( const TQStrList & formats ); + virtual void drop( TQDropEvent * ev ); + virtual TQDragObject * dragObject( TQWidget * parent, bool move = false ); virtual void middleButtonClicked(); virtual void rightButtonPressed(); @@ -50,12 +50,12 @@ public: virtual void del(); virtual void shred(); virtual void rename(); // start a rename operation - void rename( const QString & name ); // do the actual renaming + void rename( const TQString & name ); // do the actual renaming // The URL to open when this link is clicked virtual KURL externalURL() const; - virtual QString externalMimeType() const; - virtual QString toolTipText() const; + virtual TQString externalMimeType() const; + virtual TQString toolTipText() const; virtual void itemSelected(); @@ -63,7 +63,7 @@ public: bool hasStandardIcon(); - QString id; + TQString id; private: void delOperation( int method ); diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp b/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp index 725927362..ac26b1285 100644 --- a/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_module.cpp @@ -53,8 +53,8 @@ KonqSidebarDirTreeModule::~KonqSidebarDirTreeModule() // KDirLister may still emit canceled while being deleted. if (m_dirLister) { - disconnect( m_dirLister, SIGNAL( canceled( const KURL & ) ), - this, SLOT( slotListingStopped( const KURL & ) ) ); + disconnect( m_dirLister, TQT_SIGNAL( canceled( const KURL & ) ), + this, TQT_SLOT( slotListingStopped( const KURL & ) ) ); delete m_dirLister; } } @@ -87,12 +87,12 @@ void KonqSidebarDirTreeModule::addTopLevelItem( KonqSidebarTreeTopLevelItem * it { targetURL = cfg.readURL(); // some services might want to make their URL configurable in kcontrol - QString configured = cfg.readEntry("X-KDE-ConfiguredURL"); + TQString configured = cfg.readEntry("X-KDE-ConfiguredURL"); if (!configured.isEmpty()) { - QStringList list = QStringList::split(':', configured); + TQStringList list = TQStringList::split(':', configured); KConfig config(list[0]); if (list[1] != "noGroup") config.setGroup(list[1]); - QString conf_url = config.readEntry(list[2]); + TQString conf_url = config.readEntry(list[2]); if (!conf_url.isEmpty()) { targetURL = conf_url; } @@ -101,7 +101,7 @@ void KonqSidebarDirTreeModule::addTopLevelItem( KonqSidebarTreeTopLevelItem * it else if ( cfg.hasDeviceType() ) { // Determine the mountpoint - QString mp = cfg.readEntry("MountPoint"); + TQString mp = cfg.readEntry("MountPoint"); if ( mp.isEmpty() ) return; @@ -133,7 +133,7 @@ void KonqSidebarDirTreeModule::openTopLevelItem( KonqSidebarTreeTopLevelItem * i void KonqSidebarDirTreeModule::addSubDir( KonqSidebarTreeItem *item ) { - QString id = item->externalURL().url(-1); + TQString id = item->externalURL().url(-1); kdDebug(1201) << this << " KonqSidebarDirTreeModule::addSubDir " << id << endl; m_dictSubDirs.insert(id, item ); @@ -144,9 +144,9 @@ void KonqSidebarDirTreeModule::addSubDir( KonqSidebarTreeItem *item ) // Remove <key, item> from dict, taking into account that there maybe // other items with the same key. -static void remove(QDict<KonqSidebarTreeItem> &dict, const QString &key, KonqSidebarTreeItem *item) +static void remove(TQDict<KonqSidebarTreeItem> &dict, const TQString &key, KonqSidebarTreeItem *item) { - QPtrList<KonqSidebarTreeItem> *otherItems = 0; + TQPtrList<KonqSidebarTreeItem> *otherItems = 0; while(true) { KonqSidebarTreeItem *takeItem = dict.take(key); if (!takeItem || (takeItem == item)) @@ -164,7 +164,7 @@ static void remove(QDict<KonqSidebarTreeItem> &dict, const QString &key, KonqSid } // Not the item we are looking for if (!otherItems) - otherItems = new QPtrList<KonqSidebarTreeItem>(); + otherItems = new TQPtrList<KonqSidebarTreeItem>(); otherItems->prepend(takeItem); } @@ -173,7 +173,7 @@ static void remove(QDict<KonqSidebarTreeItem> &dict, const QString &key, KonqSid // Looks up key in dict and returns it in item, if there are multiple items // with the same key, additional items are returned in itemList which should // be deleted by the caller. -static void lookupItems(QDict<KonqSidebarTreeItem> &dict, const QString &key, KonqSidebarTreeItem *&item, QPtrList<KonqSidebarTreeItem> *&itemList) +static void lookupItems(TQDict<KonqSidebarTreeItem> &dict, const TQString &key, KonqSidebarTreeItem *&item, TQPtrList<KonqSidebarTreeItem> *&itemList) { itemList = 0; item = dict.take(key); @@ -196,7 +196,7 @@ static void lookupItems(QDict<KonqSidebarTreeItem> &dict, const QString &key, Ko return; } if (!itemList) - itemList = new QPtrList<KonqSidebarTreeItem>(); + itemList = new TQPtrList<KonqSidebarTreeItem>(); itemList->prepend(takeItem); } @@ -204,9 +204,9 @@ static void lookupItems(QDict<KonqSidebarTreeItem> &dict, const QString &key, Ko // Remove <key, item> from dict, taking into account that there maybe // other items with the same key. -static void remove(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTreeItem *item) +static void remove(TQPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTreeItem *item) { - QPtrList<KonqSidebarTreeItem> *otherItems = 0; + TQPtrList<KonqSidebarTreeItem> *otherItems = 0; while(true) { KonqSidebarTreeItem *takeItem = dict.take(key); if (!takeItem || (takeItem == item)) @@ -224,7 +224,7 @@ static void remove(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTr } // Not the item we are looking for if (!otherItems) - otherItems = new QPtrList<KonqSidebarTreeItem>(); + otherItems = new TQPtrList<KonqSidebarTreeItem>(); otherItems->prepend(takeItem); } @@ -233,7 +233,7 @@ static void remove(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTr // Looks up key in dict and returns it in item, if there are multiple items // with the same key, additional items are returned in itemList which should // be deleted by the caller. -static void lookupItems(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTreeItem *&item, QPtrList<KonqSidebarTreeItem> *&itemList) +static void lookupItems(TQPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSidebarTreeItem *&item, TQPtrList<KonqSidebarTreeItem> *&itemList) { itemList = 0; item = dict.take(key); @@ -256,7 +256,7 @@ static void lookupItems(QPtrDict<KonqSidebarTreeItem> &dict, void *key, KonqSide return; } if (!itemList) - itemList = new QPtrList<KonqSidebarTreeItem>(); + itemList = new TQPtrList<KonqSidebarTreeItem>(); itemList->prepend(takeItem); } @@ -280,7 +280,7 @@ void KonqSidebarDirTreeModule::removeSubDir( KonqSidebarTreeItem *item, bool chi if ( !childrenOnly ) { - QString id = item->externalURL().url(-1); + TQString id = item->externalURL().url(-1); remove(m_dictSubDirs, id, item); while (!(item->alias.isEmpty())) { @@ -303,22 +303,22 @@ void KonqSidebarDirTreeModule::openSubFolder( KonqSidebarTreeItem *item ) { m_dirLister = new KDirLister( true ); //m_dirLister->setDirOnlyMode( true ); -// QStringList mimetypes; -// mimetypes<<QString("inode/directory"); +// TQStringList mimetypes; +// mimetypes<<TQString("inode/directory"); // m_dirLister->setMimeFilter(mimetypes); - connect( m_dirLister, SIGNAL( newItems( const KFileItemList & ) ), - this, SLOT( slotNewItems( const KFileItemList & ) ) ); - connect( m_dirLister, SIGNAL( refreshItems( const KFileItemList & ) ), - this, SLOT( slotRefreshItems( const KFileItemList & ) ) ); - connect( m_dirLister, SIGNAL( deleteItem( KFileItem * ) ), - this, SLOT( slotDeleteItem( KFileItem * ) ) ); - connect( m_dirLister, SIGNAL( completed( const KURL & ) ), - this, SLOT( slotListingStopped( const KURL & ) ) ); - connect( m_dirLister, SIGNAL( canceled( const KURL & ) ), - this, SLOT( slotListingStopped( const KURL & ) ) ); - connect( m_dirLister, SIGNAL( redirection( const KURL &, const KURL & ) ), - this, SLOT( slotRedirection( const KURL &, const KURL & ) ) ); + connect( m_dirLister, TQT_SIGNAL( newItems( const KFileItemList & ) ), + this, TQT_SLOT( slotNewItems( const KFileItemList & ) ) ); + connect( m_dirLister, TQT_SIGNAL( refreshItems( const KFileItemList & ) ), + this, TQT_SLOT( slotRefreshItems( const KFileItemList & ) ) ); + connect( m_dirLister, TQT_SIGNAL( deleteItem( KFileItem * ) ), + this, TQT_SLOT( slotDeleteItem( KFileItem * ) ) ); + connect( m_dirLister, TQT_SIGNAL( completed( const KURL & ) ), + this, TQT_SLOT( slotListingStopped( const KURL & ) ) ); + connect( m_dirLister, TQT_SIGNAL( canceled( const KURL & ) ), + this, TQT_SLOT( slotListingStopped( const KURL & ) ) ); + connect( m_dirLister, TQT_SIGNAL( redirection( const KURL &, const KURL & ) ), + this, TQT_SLOT( slotRedirection( const KURL &, const KURL & ) ) ); } @@ -326,7 +326,7 @@ void KonqSidebarDirTreeModule::openSubFolder( KonqSidebarTreeItem *item ) static_cast<KonqSidebarDirTreeItem *>(item)->hasStandardIcon() ) { int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); - QPixmap pix = DesktopIcon( "folder_open", size ); + TQPixmap pix = DesktopIcon( "folder_open", size ); m_pTree->startAnimation( item, "kde", 6, &pix ); } else @@ -338,10 +338,10 @@ void KonqSidebarDirTreeModule::openSubFolder( KonqSidebarTreeItem *item ) void KonqSidebarDirTreeModule::listDirectory( KonqSidebarTreeItem *item ) { // This causes a reparsing, but gets rid of the trailing slash - QString strUrl = item->externalURL().url(-1); + TQString strUrl = item->externalURL().url(-1); KURL url( strUrl ); - QPtrList<KonqSidebarTreeItem> *itemList; + TQPtrList<KonqSidebarTreeItem> *itemList; KonqSidebarTreeItem * openItem; lookupItems(m_dictSubDirs, strUrl, openItem, itemList); @@ -407,13 +407,13 @@ void KonqSidebarDirTreeModule::slotNewItems( const KFileItemList& entries ) dir.setFileName( "" ); kdDebug(1201) << this << " KonqSidebarDirTreeModule::slotNewItems dir=" << dir.url(-1) << endl; - QPtrList<KonqSidebarTreeItem> *parentItemList; + TQPtrList<KonqSidebarTreeItem> *parentItemList; KonqSidebarTreeItem * parentItem; lookupItems(m_dictSubDirs, dir.url(-1), parentItem, parentItemList); if ( !parentItem ) // hack for dnssd://domain/type/service listed in dnssd:/type/ dir { - dir.setHost( QString::null ); + dir.setHost( TQString::null ); lookupItems( m_dictSubDirs, dir.url(-1), parentItem, parentItemList ); } @@ -428,7 +428,7 @@ void KonqSidebarDirTreeModule::slotNewItems( const KFileItemList& entries ) do { kdDebug()<<"Parent Item URL:"<<parentItem->externalURL()<<endl; - QPtrListIterator<KFileItem> kit ( entries ); + TQPtrListIterator<KFileItem> kit ( entries ); for( ; kit.current(); ++kit ) { KFileItem * fileItem = *kit; @@ -458,13 +458,13 @@ void KonqSidebarDirTreeModule::slotRefreshItems( const KFileItemList &entries ) { int size = KGlobal::iconLoader()->currentSize( KIcon::Small ); - QPtrListIterator<KFileItem> kit ( entries ); + TQPtrListIterator<KFileItem> kit ( entries ); kdDebug(1201) << "KonqSidebarDirTreeModule::slotRefreshItems " << entries.count() << " entries. First: " << kit.current()->url().url() << endl; for( ; kit.current(); ++kit ) { KFileItem *fileItem = kit.current(); - QPtrList<KonqSidebarTreeItem> *itemList; + TQPtrList<KonqSidebarTreeItem> *itemList; KonqSidebarTreeItem * item; lookupItems(m_ptrdictSubDirs, fileItem, item, itemList); @@ -517,7 +517,7 @@ void KonqSidebarDirTreeModule::slotDeleteItem( KFileItem *fileItem ) kdDebug(1201) << "KonqSidebarDirTreeModule::slotDeleteItem( " << fileItem->url().url(-1) << " )" << endl; // All items are in m_ptrdictSubDirs, so look it up fast - QPtrList<KonqSidebarTreeItem> *itemList; + TQPtrList<KonqSidebarTreeItem> *itemList; KonqSidebarTreeItem * item; lookupItems(m_ptrdictSubDirs, fileItem, item, itemList); while(item) @@ -534,10 +534,10 @@ void KonqSidebarDirTreeModule::slotRedirection( const KURL & oldUrl, const KURL { kdDebug(1201) << "******************************KonqSidebarDirTreeModule::slotRedirection(" << newUrl.prettyURL() << ")" << endl; - QString oldUrlStr = oldUrl.url(-1); - QString newUrlStr = newUrl.url(-1); + TQString oldUrlStr = oldUrl.url(-1); + TQString newUrlStr = newUrl.url(-1); - QPtrList<KonqSidebarTreeItem> *itemList; + TQPtrList<KonqSidebarTreeItem> *itemList; KonqSidebarTreeItem * item; lookupItems(m_dictSubDirs, oldUrlStr, item, itemList); @@ -565,7 +565,7 @@ void KonqSidebarDirTreeModule::slotListingStopped( const KURL & url ) { kdDebug(1201) << "KonqSidebarDirTree::slotListingStopped " << url.url(-1) << endl; - QPtrList<KonqSidebarTreeItem> *itemList; + TQPtrList<KonqSidebarTreeItem> *itemList; KonqSidebarTreeItem * item; lookupItems(m_dictSubDirs, url.url(-1), item, itemList); diff --git a/konqueror/sidebar/trees/dirtree_module/dirtree_module.h b/konqueror/sidebar/trees/dirtree_module/dirtree_module.h index dc46d3b9e..af915aa46 100644 --- a/konqueror/sidebar/trees/dirtree_module/dirtree_module.h +++ b/konqueror/sidebar/trees/dirtree_module/dirtree_module.h @@ -21,9 +21,9 @@ #include <konq_sidebartreemodule.h> #include <kfileitem.h> -#include <qpixmap.h> -#include <qdict.h> -#include <qptrdict.h> +#include <tqpixmap.h> +#include <tqdict.h> +#include <tqptrdict.h> class KDirLister; class KonqSidebarTree; @@ -31,7 +31,7 @@ class KonqSidebarTreeItem; class KonqSidebarDirTreeItem; class KonqPropsView; -class KonqSidebarDirTreeModule : public QObject, public KonqSidebarTreeModule +class KonqSidebarDirTreeModule : public TQObject, public KonqSidebarTreeModule { Q_OBJECT public: @@ -64,10 +64,10 @@ private: // URL -> item // Each KonqSidebarDirTreeItem is indexed on item->id() and // all item->alias'es - QDict<KonqSidebarTreeItem> m_dictSubDirs; + TQDict<KonqSidebarTreeItem> m_dictSubDirs; // KFileItem -> item - QPtrDict<KonqSidebarTreeItem> m_ptrdictSubDirs; + TQPtrDict<KonqSidebarTreeItem> m_ptrdictSubDirs; KDirLister * m_dirLister; |