diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:54:04 +0000 |
commit | dc6b8e72fed2586239e3514819238c520636c9d9 (patch) | |
tree | 88b200df0a0b7fab9d6f147596173556f1ed9a13 /quanta/treeviews/basetreeview.cpp | |
parent | 6927d4436e54551917f600b706a8d6109e49de1c (diff) | |
download | tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.tar.gz tdewebdev-dc6b8e72fed2586239e3514819238c520636c9d9.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1157656 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/treeviews/basetreeview.cpp')
-rw-r--r-- | quanta/treeviews/basetreeview.cpp | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/quanta/treeviews/basetreeview.cpp b/quanta/treeviews/basetreeview.cpp index 8d8fad11..c7f65b22 100644 --- a/quanta/treeviews/basetreeview.cpp +++ b/quanta/treeviews/basetreeview.cpp @@ -16,20 +16,20 @@ ***************************************************************************/ // QT includes -#include <qeventloop.h> -#include <qlayout.h> -#include <qfileinfo.h> -#include <qlabel.h> -#include <qimage.h> -#include <qregexp.h> -#include <qclipboard.h> -#include <qpoint.h> -#include <qregexp.h> -#include <qlineedit.h> -#include <qfont.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qptrstack.h> +#include <tqeventloop.h> +#include <tqlayout.h> +#include <tqfileinfo.h> +#include <tqlabel.h> +#include <tqimage.h> +#include <tqregexp.h> +#include <tqclipboard.h> +#include <tqpoint.h> +#include <tqregexp.h> +#include <tqlineedit.h> +#include <tqfont.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqptrstack.h> // KDE includes #include <kaction.h> @@ -70,32 +70,32 @@ class BaseTreeViewToolTip : public QToolTip { public: - BaseTreeViewToolTip( QWidget *parent, BaseTreeView *lv ); + BaseTreeViewToolTip( TQWidget *parent, BaseTreeView *lv ); - void maybeTip( const QPoint &pos ); + void maybeTip( const TQPoint &pos ); private: BaseTreeView *m_view; }; -BaseTreeViewToolTip::BaseTreeViewToolTip( QWidget *parent, BaseTreeView *lv ) - : QToolTip( parent ), m_view( lv ) +BaseTreeViewToolTip::BaseTreeViewToolTip( TQWidget *parent, BaseTreeView *lv ) + : TQToolTip( parent ), m_view( lv ) { } -void BaseTreeViewToolTip::maybeTip( const QPoint &pos ) +void BaseTreeViewToolTip::maybeTip( const TQPoint &pos ) { if ( !parentWidget() || !m_view || !m_view->showToolTips() ) return; - QListViewItem *item = m_view->itemAt(pos); + TQListViewItem *item = m_view->itemAt(pos); if (!item) return; - QString text; + TQString text; KFileTreeViewItem * kftvi = dynamic_cast<BaseTreeViewItem *> (item); if (kftvi) { - QString desc = kftvi->text(1); + TQString desc = kftvi->text(1); text = kftvi->fileItem()->getToolTipText(); if ( !desc.isEmpty() ) text.prepend(" <i>" + desc + "</i><br>"); @@ -116,7 +116,7 @@ BaseTreeViewItem::BaseTreeViewItem( KFileTreeViewItem *parent, KFileItem* item, { } -QString BaseTreeViewItem::key(int column, bool ascending) const +TQString BaseTreeViewItem::key(int column, bool ascending) const { if (ascending) if (isDir()) @@ -130,19 +130,19 @@ QString BaseTreeViewItem::key(int column, bool ascending) const return text(column).prepend(" "); } -int BaseTreeViewItem::compare(QListViewItem *i, int col, +int BaseTreeViewItem::compare(TQListViewItem *i, int col, bool ascending) const { return key(col, ascending).compare(i->key(col, ascending)); } -void BaseTreeViewItem::paintCell(QPainter *p, const QColorGroup &cg, +void BaseTreeViewItem::paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align) { - QColorGroup _cg( cg ); + TQColorGroup _cg( cg ); if (column == 0) { - QFont f = p->font(); + TQFont f = p->font(); if (quantaApp) f.setBold(ViewManager::ref()->isOpened(url())); p->setFont(f); @@ -151,7 +151,7 @@ void BaseTreeViewItem::paintCell(QPainter *p, const QColorGroup &cg, int h, s, v; p->pen().color().getHsv(&h, &s, &v); v = (v < 155 ? v + 100 : 255); - _cg.setColor(QColorGroup::Text, QColor(h, s, v, QColor::Hsv)); + _cg.setColor(TQColorGroup::Text, TQColor(h, s, v, TQColor::Hsv)); }; KFileTreeViewItem::paintCell( p, _cg, column, width, align ); } @@ -164,7 +164,7 @@ void BaseTreeViewItem::refreshIcon() //BaseTreeBranch implementation BaseTreeBranch::BaseTreeBranch(KFileTreeView *parent, const KURL& url, - const QString& name, const QPixmap& pix, + const TQString& name, const TQPixmap& pix, bool showHidden , KFileTreeViewItem *branchRoot) : KFileTreeBranch(parent, url, name, pix, showHidden, branchRoot) @@ -203,7 +203,7 @@ KFileTreeViewItem* BaseTreeBranch::createTreeViewItem(KFileTreeViewItem *parent, } -void BaseTreeBranch::addOpenFolder(QStringList* openFolder) +void BaseTreeBranch::addOpenFolder(TQStringList* openFolder) { if (! openFolder) // just in case return; @@ -244,7 +244,7 @@ void BaseTreeBranch::reopenFolder() if (folderToOpen.isEmpty()) return; KFileTreeViewItem *item; - for (QStringList::Iterator it = folderToOpen.begin(); it != folderToOpen.end(); ++it) { + for (TQStringList::Iterator it = folderToOpen.begin(); it != folderToOpen.end(); ++it) { KURL url( (*it) ); item = findTVIByURL(url); if (item) { @@ -265,7 +265,7 @@ void BaseTreeBranch::updateOpenFolder() while (item) { if (item->isDir() && item->isOpen()) { updateDirectory( item->url() ); - kapp->processEvents(QEventLoop::ExcludeUserInput | QEventLoop::ExcludeSocketNotifiers); + kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); // dive into the tree first newItem = dynamic_cast<KFileTreeViewItem *>(item->firstChild()); if (newItem) { @@ -291,11 +291,11 @@ void BaseTreeBranch::updateOpenFolder() // //////////////////////////////////////////////////////////////////////////////////// -BaseTreeView::BaseTreeView(QWidget *parent, const char *name) +BaseTreeView::BaseTreeView(TQWidget *parent, const char *name) : KFileTreeView(parent, name), fileInfoDlg(0), m_saveOpenFolder(false), m_openWithMenu(0L), m_openWithMenuId(-1) { m_parent = parent; - QToolTip::remove(viewport()); // remove the tooltip from QListView + TQToolTip::remove(viewport()); // remove the tooltip from QListView m_tooltip = new BaseTreeViewToolTip(viewport(), this); setFrameStyle( Panel | Sunken ); setRootIsDecorated(true); @@ -303,38 +303,38 @@ BaseTreeView::BaseTreeView(QWidget *parent, const char *name) setLineWidth(2); setFullWidth(true); setShowSortIndicator(true); - setFocusPolicy(QWidget::ClickFocus); + setFocusPolicy(TQWidget::ClickFocus); setShowFolderOpenPixmap(false); - connect(this, SIGNAL(returnPressed(QListViewItem *)), - this, SLOT(slotReturnPressed(QListViewItem *))); + connect(this, TQT_SIGNAL(returnPressed(TQListViewItem *)), + this, TQT_SLOT(slotReturnPressed(TQListViewItem *))); - connect(this, SIGNAL(dropped(QWidget *, QDropEvent *, KURL::List&, KURL&)), - this, SLOT(slotDropped(QWidget *, QDropEvent *, KURL::List&, KURL&))); + connect(this, TQT_SIGNAL(dropped(TQWidget *, TQDropEvent *, KURL::List&, KURL&)), + this, TQT_SLOT(slotDropped(TQWidget *, TQDropEvent *, KURL::List&, KURL&))); - connect(this, SIGNAL(itemRenamed(QListViewItem*, const QString &, int )), - this, SLOT(slotRenameItem(QListViewItem*, const QString &, int ))); + connect(this, TQT_SIGNAL(itemRenamed(TQListViewItem*, const TQString &, int )), + this, TQT_SLOT(slotRenameItem(TQListViewItem*, const TQString &, int ))); - connect(this, SIGNAL(executed(QListViewItem *)), - this, SLOT(slotSelectFile(QListViewItem *))); + connect(this, TQT_SIGNAL(executed(TQListViewItem *)), + this, TQT_SLOT(slotSelectFile(TQListViewItem *))); - connect(this, SIGNAL(openFile(const KURL &)), - quantaApp, SLOT(slotFileOpen(const KURL &))); + connect(this, TQT_SIGNAL(openFile(const KURL &)), + quantaApp, TQT_SLOT(slotFileOpen(const KURL &))); - connect(this, SIGNAL(openImage(const KURL &)), - quantaApp, SLOT(slotImageOpen(const KURL &))); + connect(this, TQT_SIGNAL(openImage(const KURL &)), + quantaApp, TQT_SLOT(slotImageOpen(const KURL &))); - connect(this, SIGNAL(closeFile(const KURL &)), - quantaApp, SLOT(slotFileClose(const KURL &))); + connect(this, TQT_SIGNAL(closeFile(const KURL &)), + quantaApp, TQT_SLOT(slotFileClose(const KURL &))); - connect(this, SIGNAL(insertTag(const KURL &, DirInfo)), - quantaApp, SLOT(slotInsertTag(const KURL &, DirInfo))); + connect(this, TQT_SIGNAL(insertTag(const KURL &, DirInfo)), + quantaApp, TQT_SLOT(slotInsertTag(const KURL &, DirInfo))); } BaseTreeView::~BaseTreeView() { - QToolTip::remove(viewport()); + TQToolTip::remove(viewport()); delete m_tooltip; } @@ -360,7 +360,7 @@ void BaseTreeView::itemRenamed(const KURL& oldURL, const KURL& newURL) /** Called for: double click, return, Open */ -void BaseTreeView::slotSelectFile(QListViewItem *item) +void BaseTreeView::slotSelectFile(TQListViewItem *item) { KFileTreeViewItem* kftvi = currentKFileTreeViewItem(); if (!kftvi || kftvi->isDir()) return; @@ -400,7 +400,7 @@ bool BaseTreeView::expandArchiv (KFileTreeViewItem *item) if ( ! urlToOpen.isLocalFile()) return false; - QString mimeType = KMimeType::findByURL(urlToOpen)->name(); + TQString mimeType = KMimeType::findByURL(urlToOpen)->name(); if ( mimeType == "application/x-tgz" || mimeType == "application/x-tbz" || @@ -435,8 +435,8 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) if ( !currentKFileTreeViewItem()->isDir() ) { - QFrame *quantaFilePage = propDlg->addPage(i18n("Quanta File Info")); - QVBoxLayout *topLayout = new QVBoxLayout( quantaFilePage); + TQFrame *quantaFilePage = propDlg->addPage(i18n("Quanta File Info")); + TQVBoxLayout *topLayout = new TQVBoxLayout( quantaFilePage); quantaFileProperties = new FileInfoDlg( quantaFilePage, i18n("Quanta") ); int fsize,fimgsize=0; @@ -444,20 +444,20 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) KURL u = currentURL(); if (u.isLocalFile()) //get the file info only for local file. TODO: for non-local ones { - QString nameForInfo = u.path(); - QString path =u.directory(0,0); //extract path for images - QString sourcename=u.fileName(0); + TQString nameForInfo = u.path(); + TQString path =u.directory(0,0); //extract path for images + TQString sourcename=u.fileName(0); - QFile qfile(nameForInfo); + TQFile qfile(nameForInfo); fsize=qfile.size(); //html file size - QString mimetype = KMimeType::findByFileContent(nameForInfo)->name(); + TQString mimetype = KMimeType::findByFileContent(nameForInfo)->name(); if (mimetype.contains("text")) { qfile.open(IO_ReadOnly); - QString imgname,imgpath; - QTextStream stream(&qfile); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQString imgname,imgpath; + TQTextStream stream(&qfile); + stream.setEncoding(TQTextStream::UnicodeUTF8); while (!stream.atEnd()) //open & parse file { imgname = stream.readLine(); @@ -482,7 +482,7 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) { KURL v(KURL::fromPathOrURL( path ),imgname); imgpath=v.path(); - QFile qimage(imgpath); + TQFile qimage(imgpath); if (qimage.exists() && v.isLocalFile()) { fimgsize+=qimage.size(); @@ -501,7 +501,7 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) } else if (mimetype.contains("image")) { // assume it's an image file - QImage imagefile=QImage(nameForInfo); + TQImage imagefile=TQImage(nameForInfo); quantaFileProperties->lineNum->setText(i18n("Image size: %1 x %2").arg(imagefile.width()).arg(imagefile.height())); quantaFileProperties->imageNum->hide(); quantaFileProperties->imageSize->hide(); @@ -532,7 +532,7 @@ void BaseTreeView::slotClose() void BaseTreeView::slotOpen() { - QListViewItem *item = currentItem(); + TQListViewItem *item = currentItem(); if (item) { emit open(item); @@ -592,9 +592,9 @@ void BaseTreeView::insertOpenWithMenu(KPopupMenu *menu, int position) } m_openWithActions.clear(); KURL urlToOpen = currentURL(); - QString mimeType = KMimeType::findByURL(urlToOpen, 0, true, true)->name(); + TQString mimeType = KMimeType::findByURL(urlToOpen, 0, true, true)->name(); KTrader::OfferList offers = KTrader::self()->query(mimeType, "Type == 'Application'"); - QDict<QuantaPlugin> plugins = QuantaPluginInterface::ref()->plugins(); + TQDict<QuantaPlugin> plugins = QuantaPluginInterface::ref()->plugins(); m_pluginIds.clear(); if (offers.count() > 0 || plugins.count() > 0) @@ -605,8 +605,8 @@ void BaseTreeView::insertOpenWithMenu(KPopupMenu *menu, int position) KTrader::OfferList::Iterator it; for (it = offers.begin(); it != offers.end(); ++it) { - KAction *action = new KAction((*it)->name(), (*it)->icon(), 0, 0, QFile::encodeName((*it)->desktopEntryPath()).data()); - connect(action, SIGNAL(activated()), this, SLOT(slotOpenWithApplication())); + KAction *action = new KAction((*it)->name(), (*it)->icon(), 0, 0, TQFile::encodeName((*it)->desktopEntryPath()).data()); + connect(action, TQT_SIGNAL(activated()), this, TQT_SLOT(slotOpenWithApplication())); action->plug(m_openWithMenu); m_openWithActions.append(action); } @@ -615,19 +615,19 @@ void BaseTreeView::insertOpenWithMenu(KPopupMenu *menu, int position) if (plugins.count() > 0) { m_openWithMenu->insertTitle(i18n("Plugins")); - QDictIterator<QuantaPlugin> it2(plugins); + TQDictIterator<QuantaPlugin> it2(plugins); for(;it2.current();++it2) { int id = m_openWithMenu->insertItem(KGlobal::iconLoader()->loadIconSet(it2.current()->icon(),KIcon::Small), it2.current()->name()); m_pluginIds[id] = it2.current(); } - connect(m_openWithMenu, SIGNAL(activated(int)), SLOT(slotOpenWithActivated(int))); + connect(m_openWithMenu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotOpenWithActivated(int))); m_openWithMenu->insertSeparator(); } - m_openWithMenu->insertItem(i18n("&Other..."), this, SLOT(slotOpenWith())); + m_openWithMenu->insertItem(i18n("&Other..."), this, TQT_SLOT(slotOpenWith())); m_openWithMenuId = menu->insertItem(i18n("Open &With"), m_openWithMenu, -1, position); } else - m_openWithMenuId = menu->insertItem(i18n("Open &With..."), this, SLOT(slotOpenWith()), 0, -1, position); + m_openWithMenuId = menu->insertItem(i18n("Open &With..."), this, TQT_SLOT(slotOpenWith()), 0, -1, position); } void BaseTreeView::slotInsertTag() @@ -648,7 +648,7 @@ void BaseTreeView::slotCopy() { if (currentItem()) { - QClipboard *cb = QApplication::clipboard(); + QClipboard *cb = TQApplication::clipboard(); cb->setText( currentURL().prettyURL() ); } } @@ -658,8 +658,8 @@ void BaseTreeView::slotPaste() { if (currentItem()) { - QClipboard *cb = QApplication::clipboard(); - KURL::List list( QStringList::split( QChar('\n'), cb->text() ) ); + QClipboard *cb = TQApplication::clipboard(); + KURL::List list( TQStringList::split( TQChar('\n'), cb->text() ) ); KURL url = currentURL(); if ( ! currentKFileTreeViewItem()->isDir() ) @@ -701,7 +701,7 @@ void BaseTreeView::slotPopulateFinished(KFileTreeViewItem *item) item->setOpen(false); item->setExpandable(false); } else { - QString url = item->url().url(); + TQString url = item->url().url(); BaseTreeBranch *btb = dynamic_cast<BaseTreeBranch *>(item->branch()); if (btb && ! btb->folderToOpen.empty()) { btb->reopenFolder(); @@ -740,7 +740,7 @@ void BaseTreeView::slotProperties() { fileInfoDlg = addFileInfoPage(propDlg); } - connect(propDlg, SIGNAL( applied() ), this, SLOT( slotPropertiesApplied()) ); + connect(propDlg, TQT_SIGNAL( applied() ), this, TQT_SLOT( slotPropertiesApplied()) ); propDlg->exec(); } @@ -758,7 +758,7 @@ void BaseTreeView::slotPropertiesApplied() if (fileInfoDlg && kftvi) { // has description changed? - QString newDesc = fileInfoDlg->fileDesc->text(); + TQString newDesc = fileInfoDlg->fileDesc->text(); if (kftvi->text(1) != newDesc) itemDescChanged(kftvi, newDesc); } @@ -776,7 +776,7 @@ void BaseTreeView::slotPropertiesApplied() void BaseTreeView::slotReloadAllTrees() { - QPtrStack<BaseTreeBranch> stack; + TQPtrStack<BaseTreeBranch> stack; BaseTreeBranch *btb; KFileTreeBranchIterator it( branches() ); for ( ; it.current(); ++it) @@ -804,7 +804,7 @@ void BaseTreeView::slotReload() void BaseTreeView::reload(BaseTreeBranch *btb) { // remember the old status - QStringList folderToOpen; + TQStringList folderToOpen; btb->addOpenFolder(&folderToOpen); KURL url = btb->rootUrl(); // remove and open again @@ -829,16 +829,16 @@ void BaseTreeView::slotJobFinished(KIO::Job *job) } -void BaseTreeView::slotReturnPressed(QListViewItem *item) +void BaseTreeView::slotReturnPressed(TQListViewItem *item) { emit executed(item); } -bool BaseTreeView::acceptDrag(QDropEvent* e ) const +bool BaseTreeView::acceptDrag(TQDropEvent* e ) const { - QPoint p (contentsToViewport(e->pos())); - QListViewItem *atpos = itemAt(p); + TQPoint p (contentsToViewport(e->pos())); + TQListViewItem *atpos = itemAt(p); KFileTreeViewItem *kftvi = dynamic_cast <KFileTreeViewItem *> (atpos); if (kftvi) return (KFileTreeView::acceptDrag(e) && kftvi->isDir()); // accept only on folders @@ -847,7 +847,7 @@ bool BaseTreeView::acceptDrag(QDropEvent* e ) const } -void BaseTreeView::slotDropped (QWidget *, QDropEvent * /*e*/, KURL::List& fileList, KURL& dest) +void BaseTreeView::slotDropped (TQWidget *, TQDropEvent * /*e*/, KURL::List& fileList, KURL& dest) { if(fileList.empty()) return; @@ -880,7 +880,7 @@ void BaseTreeView::slotDropped (QWidget *, QDropEvent * /*e*/, KURL::List& fileL } else { // create the popup menu - QPopupMenu popup; + TQPopupMenu popup; if (sMoving || (sReading && sDeleting)) popup.insertItem(SmallIconSet("goto"), i18n("&Move Here"), 2 ); if (sReading) @@ -890,7 +890,7 @@ void BaseTreeView::slotDropped (QWidget *, QDropEvent * /*e*/, KURL::List& fileL popup.insertSeparator(); popup.insertItem(SmallIconSet("cancel"), i18n("C&ancel"), 5); - result = popup.exec( QCursor::pos() ); + result = popup.exec( TQCursor::pos() ); } } bool tooltip = showToolTips(); @@ -915,18 +915,18 @@ void BaseTreeView::slotDropped (QWidget *, QDropEvent * /*e*/, KURL::List& fileL if (!job) return; - connect(job, SIGNAL( result(KIO::Job *) ), - this, SLOT( slotJobFinished(KIO::Job *) ) ); + connect(job, TQT_SIGNAL( result(KIO::Job *) ), + this, TQT_SLOT( slotJobFinished(KIO::Job *) ) ); progressBar->setTotalSteps(100); - connect(job, SIGNAL(percent( KIO::Job *, unsigned long)), - this, SLOT(slotPercent( KIO::Job *, unsigned long))); + connect(job, TQT_SIGNAL(percent( KIO::Job *, unsigned long)), + this, TQT_SLOT(slotPercent( KIO::Job *, unsigned long))); } -void BaseTreeView::findDrop(const QPoint &pos, QListViewItem *&parent, QListViewItem *&after) +void BaseTreeView::findDrop(const TQPoint &pos, TQListViewItem *&parent, TQListViewItem *&after) { - QPoint p (contentsToViewport(pos)); - QListViewItem *atpos = itemAt(p); + TQPoint p (contentsToViewport(pos)); + TQListViewItem *atpos = itemAt(p); // if (atpos && atpos->parent()) { // after = atpos; // parent = atpos->parent(); @@ -937,7 +937,7 @@ void BaseTreeView::findDrop(const QPoint &pos, QListViewItem *&parent, QListView } -void BaseTreeView::slotNewProjectLoaded(const QString &name, const KURL &baseURL, const KURL &) +void BaseTreeView::slotNewProjectLoaded(const TQString &name, const KURL &baseURL, const KURL &) { m_projectName = name; m_projectBaseURL = baseURL; @@ -952,8 +952,8 @@ bool BaseTreeView::isFileOpen(const KURL &url) bool BaseTreeView::isPathInClipboard() { - QClipboard *cb = QApplication::clipboard(); - KURL::List list( QStringList::split( QChar('\n'), cb->text() ) ); + QClipboard *cb = TQApplication::clipboard(); + KURL::List list( TQStringList::split( TQChar('\n'), cb->text() ) ); for ( KURL::List::Iterator it = list.begin(); it != list.end(); ++it ) { if ( !(*it).isValid() ) @@ -975,7 +975,7 @@ void BaseTreeView::slotDocumentClosed(const KURL& url) item->repaint(); } } -/* QListViewItemIterator iter(this); +/* TQListViewItemIterator iter(this); for ( ; iter.current(); ++iter ) { iter.current()->repaint(); @@ -1002,7 +1002,7 @@ void BaseTreeView::cancelRename(int col) } -void BaseTreeView::slotRenameItem(QListViewItem* item, const QString & newText, int col) +void BaseTreeView::slotRenameItem(TQListViewItem* item, const TQString & newText, int col) { if (!item) return; @@ -1017,7 +1017,7 @@ void BaseTreeView::slotRenameItem(QListViewItem* item, const QString & newText, } -void BaseTreeView::doRename(KFileTreeViewItem* kftvi, const QString & newName) +void BaseTreeView::doRename(KFileTreeViewItem* kftvi, const TQString & newName) { if (! kftvi) return; @@ -1027,7 +1027,7 @@ void BaseTreeView::doRename(KFileTreeViewItem* kftvi, const QString & newName) if (kftvi->isDir()) { - newURL.setPath(QFileInfo(oldURL.path(-1)).dirPath() + '/' + newName + '/'); + newURL.setPath(TQFileInfo(oldURL.path(-1)).dirPath() + '/' + newName + '/'); oldURL.adjustPath(1); } else { @@ -1057,7 +1057,7 @@ void BaseTreeView::doRename(KFileTreeViewItem* kftvi, const QString & newName) } -void BaseTreeView::saveLayout(KConfig *config, const QString &group) +void BaseTreeView::saveLayout(KConfig *config, const TQString &group) { KListView::saveLayout(config, group); if (! m_saveOpenFolder || ! qConfig.saveTrees) @@ -1072,18 +1072,18 @@ void BaseTreeView::saveLayout(KConfig *config, const QString &group) btb = dynamic_cast<BaseTreeBranch *>( (*it) ); if (btb && btb->rootUrl().isLocalFile()) { ++i; - QStringList folderList; + TQStringList folderList; // remember the root url so that I find the branch on restore folderList.append(btb->rootUrl().url()); btb->addOpenFolder(&folderList); - config->writePathEntry("OpenFolderList" + QString::number(i), folderList); + config->writePathEntry("OpenFolderList" + TQString::number(i), folderList); } } config->writeEntry("NumOpenFolderList", i); } -void BaseTreeView::restoreLayout(KConfig *config, const QString &group) +void BaseTreeView::restoreLayout(KConfig *config, const TQString &group) { KListView::restoreLayout(config, group); KConfigGroupSaver saver(config, group); @@ -1097,7 +1097,7 @@ void BaseTreeView::restoreLayout(KConfig *config, const QString &group) int maxBranch = config->readNumEntry("NumOpenFolderList", 0); for (int i = 1; i <= maxBranch; ++i) { - QStringList folderList = QuantaCommon::readPathListEntry(config, "OpenFolderList" + QString::number(i)); + TQStringList folderList = QuantaCommon::readPathListEntry(config, "OpenFolderList" + TQString::number(i)); if (folderList.count() > 1) { KURL rootURL = (*folderList.begin()); folderList.remove(folderList.begin()); // remove the root URL @@ -1120,7 +1120,7 @@ void BaseTreeView::restoreLayout(KConfig *config, const QString &group) void BaseTreeView::slotCreateSiteTemplate() { - QString startDir; + TQString startDir; if (Project::ref()->hasProject()) { startDir = Project::ref()->templateURL().url(); @@ -1164,10 +1164,10 @@ void BaseTreeView::slotCreateSiteTemplate() { if (!(*it).path().endsWith("/")) { - QFile f((*it).path()); + TQFile f((*it).path()); if (f.open(IO_ReadOnly)) { - QByteArray buffer(f.readAll()); + TQByteArray buffer(f.readAll()); if (!tar.writeFile((*it).path().remove(url.path()), "user", "group", buffer.size(), buffer.data())) { error = true; @@ -1191,7 +1191,7 @@ void BaseTreeView::slotCreateSiteTemplate() void BaseTreeView::slotCreateFolder() { bool ok; - QString folderName = KInputDialog::getText(i18n("Create New Folder"), i18n("Folder name:"), "", &ok, this); + TQString folderName = KInputDialog::getText(i18n("Create New Folder"), i18n("Folder name:"), "", &ok, this); if (ok) { KURL url = currentURL(); @@ -1206,7 +1206,7 @@ void BaseTreeView::slotCreateFolder() void BaseTreeView::slotCreateFile() { bool ok; - QString fileName = KInputDialog::getText(i18n("Create New File"), i18n("File name:"), "", &ok, this); + TQString fileName = KInputDialog::getText(i18n("Create New File"), i18n("File name:"), "", &ok, this); if (ok) { KURL url = currentURL(); |