diff options
Diffstat (limited to 'quanta/treeviews/basetreeview.cpp')
-rw-r--r-- | quanta/treeviews/basetreeview.cpp | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/quanta/treeviews/basetreeview.cpp b/quanta/treeviews/basetreeview.cpp index 952badbe..efe8bb69 100644 --- a/quanta/treeviews/basetreeview.cpp +++ b/quanta/treeviews/basetreeview.cpp @@ -67,10 +67,10 @@ #include <X11/Xlib.h> -class BaseTreeViewToolTip : public QToolTip +class BaseTreeViewToolTip : public TQToolTip { public: - BaseTreeViewToolTip( TQWidget *parent, BaseTreeView *lv ); + BaseTreeViewToolTip( TQWidget *tqparent, BaseTreeView *lv ); void maybeTip( const TQPoint &pos ); @@ -79,14 +79,14 @@ private: }; -BaseTreeViewToolTip::BaseTreeViewToolTip( TQWidget *parent, BaseTreeView *lv ) - : TQToolTip( parent ), m_view( lv ) +BaseTreeViewToolTip::BaseTreeViewToolTip( TQWidget *tqparent, BaseTreeView *lv ) + : TQToolTip( tqparent ), m_view( lv ) { } void BaseTreeViewToolTip::maybeTip( const TQPoint &pos ) { - if ( !parentWidget() || !m_view || !m_view->showToolTips() ) + if ( !tqparentWidget() || !m_view || !m_view->showToolTips() ) return; TQListViewItem *item = m_view->itemAt(pos); @@ -106,13 +106,13 @@ void BaseTreeViewToolTip::maybeTip( const TQPoint &pos ) text.append( "<br>" + item->text(1)); } if ( !text.isEmpty() ) - tip(m_view->itemRect(item), text); + tip(m_view->tqitemRect(item), text); } //BaseTreeViewItem implementation -BaseTreeViewItem::BaseTreeViewItem( KFileTreeViewItem *parent, KFileItem* item, KFileTreeBranch *brnch ) -: KFileTreeViewItem( parent, item, brnch) +BaseTreeViewItem::BaseTreeViewItem( KFileTreeViewItem *tqparent, KFileItem* item, KFileTreeBranch *brnch ) +: KFileTreeViewItem( tqparent, item, brnch) { } @@ -163,11 +163,11 @@ void BaseTreeViewItem::refreshIcon() //BaseTreeBranch implementation -BaseTreeBranch::BaseTreeBranch(KFileTreeView *parent, const KURL& url, +BaseTreeBranch::BaseTreeBranch(KFileTreeView *tqparent, const KURL& url, const TQString& name, const TQPixmap& pix, bool showHidden , KFileTreeViewItem *branchRoot) - : KFileTreeBranch(parent, url, name, pix, showHidden, branchRoot) + : KFileTreeBranch(tqparent, url, name, pix, showHidden, branchRoot) { bool localFile = url.isLocalFile(); setAutoUpdate(localFile); @@ -184,13 +184,13 @@ bool BaseTreeBranch::matchesFilter(const KFileItem *item) const return KFileTreeBranch::matchesFilter(item); } -KFileTreeViewItem* BaseTreeBranch::createTreeViewItem(KFileTreeViewItem *parent, +KFileTreeViewItem* BaseTreeBranch::createTreeViewItem(KFileTreeViewItem *tqparent, KFileItem *fileItem) { BaseTreeViewItem *tvi = 0; - if( parent && fileItem) + if( tqparent && fileItem) { - tvi = new BaseTreeViewItem(parent, fileItem, this); + tvi = new BaseTreeViewItem(tqparent, fileItem, this); // we assume there are childs if (tvi) { @@ -198,7 +198,7 @@ KFileTreeViewItem* BaseTreeBranch::createTreeViewItem(KFileTreeViewItem *parent, } } else - kdDebug(24000) << "createTreeViewItem: Have no parent" << endl; + kdDebug(24000) << "createTreeViewItem: Have no tqparent" << endl; return tvi; } @@ -230,7 +230,7 @@ void BaseTreeBranch::addOpenFolder(TQStringList* openFolder) } else { - item = dynamic_cast<KFileTreeViewItem *>(item->parent()); + item = dynamic_cast<KFileTreeViewItem *>(item->tqparent()); } } if (item == root()) @@ -265,7 +265,7 @@ void BaseTreeBranch::updateOpenFolder() while (item) { if (item->isDir() && item->isOpen()) { updateDirectory( item->url() ); - kapp->processEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); + kapp->tqprocessEvents(TQEventLoop::ExcludeUserInput | TQEventLoop::ExcludeSocketNotifiers); // dive into the tree first newItem = dynamic_cast<KFileTreeViewItem *>(item->firstChild()); if (newItem) { @@ -276,7 +276,7 @@ void BaseTreeBranch::updateOpenFolder() }; // go up if no sibling available if (! item->nextSibling()) - item = dynamic_cast<KFileTreeViewItem *>(item->parent()); + item = dynamic_cast<KFileTreeViewItem *>(item->tqparent()); if (item == root()) break; if (item) @@ -291,11 +291,11 @@ void BaseTreeBranch::updateOpenFolder() // //////////////////////////////////////////////////////////////////////////////////// -BaseTreeView::BaseTreeView(TQWidget *parent, const char *name) -: KFileTreeView(parent, name), fileInfoDlg(0), m_saveOpenFolder(false), m_openWithMenu(0L), m_openWithMenuId(-1) +BaseTreeView::BaseTreeView(TQWidget *tqparent, const char *name) +: KFileTreeView(tqparent, name), fileInfoDlg(0), m_saveOpenFolder(false), m_openWithMenu(0L), m_openWithMenuId(-1) { - m_parent = parent; - TQToolTip::remove(viewport()); // remove the tooltip from QListView + m_parent = tqparent; + TQToolTip::remove(viewport()); // remove the tooltip from TQListView m_tooltip = new BaseTreeViewToolTip(viewport(), this); setFrameStyle( Panel | Sunken ); setRootIsDecorated(true); @@ -303,7 +303,7 @@ BaseTreeView::BaseTreeView(TQWidget *parent, const char *name) setLineWidth(2); setFullWidth(true); setShowSortIndicator(true); - setFocusPolicy(TQWidget::ClickFocus); + setFocusPolicy(TQ_ClickFocus); setShowFolderOpenPixmap(false); connect(this, TQT_SIGNAL(returnPressed(TQListViewItem *)), @@ -371,7 +371,7 @@ void BaseTreeView::slotSelectFile(TQListViewItem *item) if ( QuantaCommon::checkMimeGroup(urlToOpen,"text") ) { emit openFile(urlToOpen); - item->repaint(); + item->tqrepaint(); } else if ( QuantaCommon::checkMimeGroup(urlToOpen, "image") ) //it may be an image { @@ -385,7 +385,7 @@ void BaseTreeView::slotSelectFile(TQListViewItem *item) if (QuantaCommon::denyBinaryInsert(this) == KMessageBox::Yes) { emit openFile(urlToOpen); - item->repaint(); + item->tqrepaint(); } } } @@ -452,7 +452,7 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) fsize=qfile.size(); //html file size TQString mimetype = KMimeType::findByFileContent(nameForInfo)->name(); - if (mimetype.contains("text")) + if (mimetype.tqcontains("text")) { qfile.open(IO_ReadOnly); TQString imgname,imgpath; @@ -462,23 +462,23 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) { imgname = stream.readLine(); ct++; - position=imgname.find("<img",0,false); //check for images + position=imgname.tqfind("<img",0,false); //check for images if (position!=-1) { imgname.remove(0,position+4); - position=imgname.find("src=",0,false); //extract images names + position=imgname.tqfind("src=",0,false); //extract images names imgname.remove(0,position+4); if (imgname.startsWith("\"")) imgname.remove(0,1); if (imgname.startsWith("'")) imgname.remove(0,1); - position=imgname.find(" ",0,false); + position=imgname.tqfind(" ",0,false); if (position!=-1) imgname=imgname.left(position); - position=imgname.find(">",0,false); + position=imgname.tqfind(">",0,false); if (position!=-1) imgname=imgname.left(position); - position=imgname.find("\"",0,false); + position=imgname.tqfind("\"",0,false); if (position!=-1) imgname=imgname.left(position); - position=imgname.find("'",0,false); + position=imgname.tqfind("'",0,false); if (position!=-1) imgname=imgname.left(position); - if (!quantaFileProperties->imageList->findItem(imgname,Qt::ExactMatch)) //check if image was already counted + if (!quantaFileProperties->imageList->tqfindItem(imgname,TQt::ExactMatch)) //check if image was already counted { KURL v(KURL::fromPathOrURL( path ),imgname); imgpath=v.path(); @@ -494,15 +494,15 @@ FileInfoDlg* BaseTreeView::addFileInfoPage(KPropertiesDialog* propDlg) } qfile.close(); - quantaFileProperties->lineNum->setText(i18n("Number of lines: %1").arg(ct)); - quantaFileProperties->imageNum->setText(i18n("Number of images included: %1").arg(imgct)); - quantaFileProperties->imageSize->setText(i18n("Size of the included images: %1 bytes").arg(fimgsize)); - quantaFileProperties->totalSize->setText(i18n("Total size with images: %1 bytes").arg(fsize+fimgsize)); + quantaFileProperties->lineNum->setText(i18n("Number of lines: %1").tqarg(ct)); + quantaFileProperties->imageNum->setText(i18n("Number of images included: %1").tqarg(imgct)); + quantaFileProperties->imageSize->setText(i18n("Size of the included images: %1 bytes").tqarg(fimgsize)); + quantaFileProperties->totalSize->setText(i18n("Total size with images: %1 bytes").tqarg(fsize+fimgsize)); } - else if (mimetype.contains("image")) + else if (mimetype.tqcontains("image")) { // assume it's an image file TQImage imagefile=TQImage(nameForInfo); - quantaFileProperties->lineNum->setText(i18n("Image size: %1 x %2").arg(imagefile.width()).arg(imagefile.height())); + quantaFileProperties->lineNum->setText(i18n("Image size: %1 x %2").tqarg(imagefile.width()).tqarg(imagefile.height())); quantaFileProperties->imageNum->hide(); quantaFileProperties->imageSize->hide(); quantaFileProperties->totalSize->hide(); @@ -536,7 +536,7 @@ void BaseTreeView::slotOpen() if (item) { emit open(item); - item->repaint(); + item->tqrepaint(); } } @@ -554,7 +554,7 @@ void BaseTreeView::slotOpenWith() void BaseTreeView::slotOpenWithApplication() { - KService::Ptr ptr = KService::serviceByDesktopPath(sender()->name()); + KService::Ptr ptr = KService::serviceByDesktopPath(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender()))->name()); if (ptr) { KURL::List list; @@ -565,7 +565,7 @@ void BaseTreeView::slotOpenWithApplication() void BaseTreeView::slotOpenWithActivated(int id) { - if (m_pluginIds.contains(id)) + if (m_pluginIds.tqcontains(id)) { QuantaPlugin *plugin = m_pluginIds[id]; plugin->unload(true); @@ -648,7 +648,7 @@ void BaseTreeView::slotCopy() { if (currentItem()) { - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); cb->setText( currentURL().prettyURL() ); } } @@ -658,7 +658,7 @@ void BaseTreeView::slotPaste() { if (currentItem()) { - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); KURL::List list( TQStringList::split( TQChar('\n'), cb->text() ) ); KURL url = currentURL(); @@ -923,16 +923,16 @@ void BaseTreeView::slotDropped (TQWidget *, TQDropEvent * /*e*/, KURL::List& fil } -void BaseTreeView::findDrop(const TQPoint &pos, TQListViewItem *&parent, TQListViewItem *&after) +void BaseTreeView::findDrop(const TQPoint &pos, TQListViewItem *&tqparent, TQListViewItem *&after) { TQPoint p (contentsToViewport(pos)); TQListViewItem *atpos = itemAt(p); -// if (atpos && atpos->parent()) { +// if (atpos && atpos->tqparent()) { // after = atpos; -// parent = atpos->parent(); +// tqparent = atpos->tqparent(); // } else { after = atpos; - parent = atpos; + tqparent = atpos; // } } @@ -952,7 +952,7 @@ bool BaseTreeView::isFileOpen(const KURL &url) bool BaseTreeView::isPathInClipboard() { - QClipboard *cb = TQApplication::clipboard(); + TQClipboard *cb = TQApplication::tqclipboard(); KURL::List list( TQStringList::split( TQChar('\n'), cb->text() ) ); for ( KURL::List::Iterator it = list.begin(); it != list.end(); ++it ) { @@ -972,13 +972,13 @@ void BaseTreeView::slotDocumentClosed(const KURL& url) item = (*it)->findTVIByURL(url); if (item) { - item->repaint(); + item->tqrepaint(); } } /* TQListViewItemIterator iter(this); for ( ; iter.current(); ++iter ) { - iter.current()->repaint(); + iter.current()->tqrepaint(); }*/ } @@ -1036,9 +1036,9 @@ void BaseTreeView::doRename(KFileTreeViewItem* kftvi, const TQString & newName) if ( oldURL != newURL ) { bool proceed = true; - if (QExtFileInfo::exists(newURL, false, this)) + if (TQExtFileInfo::exists(newURL, false, this)) { - proceed = KMessageBox::warningContinueCancel(this, i18n("<qt>The file <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>").arg(newURL.prettyURL(0, KURL::StripFileProtocol)),i18n("Overwrite"), i18n("Overwrite")) == KMessageBox::Continue; + proceed = KMessageBox::warningContinueCancel(this, i18n("<qt>The file <b>%1</b> already exists.<br>Do you want to overwrite it?</qt>").tqarg(newURL.prettyURL(0, KURL::StripFileProtocol)),i18n("Overwrite"), i18n("Overwrite")) == KMessageBox::Continue; } if (proceed) { @@ -1159,7 +1159,7 @@ void BaseTreeView::slotCreateSiteTemplate() bool error = false; if (tar.open(IO_WriteOnly)) { - KURL::List fileList = QExtFileInfo::allFiles(url, "*", this); + KURL::List fileList = TQExtFileInfo::allFiles(url, "*", this); for (KURL::List::Iterator it = fileList.begin(); it != fileList.end(); ++it) { if (!(*it).path().endsWith("/")) @@ -1184,7 +1184,7 @@ void BaseTreeView::slotCreateSiteTemplate() error = true; if (error) - KMessageBox::error(this, i18n("<qt>There was an error while creating the site template tarball.<br>Check that you can read the files from <i>%1</i>, you have write access to <i>%2</i> and that you have enough free space in your temporary folder.</qt>").arg(url.prettyURL(0, KURL::StripFileProtocol)).arg(targetURL.prettyURL(0, KURL::StripFileProtocol)), i18n("Template Creation Error")); + KMessageBox::error(this, i18n("<qt>There was an error while creating the site template tarball.<br>Check that you can read the files from <i>%1</i>, you have write access to <i>%2</i> and that you have enough free space in your temporary folder.</qt>").tqarg(url.prettyURL(0, KURL::StripFileProtocol)).tqarg(targetURL.prettyURL(0, KURL::StripFileProtocol)), i18n("Template Creation Error")); delete tempFile; } @@ -1214,9 +1214,9 @@ void BaseTreeView::slotCreateFile() url.setPath(url.path() + "/" + fileName); else url.setPath(url.directory() + "/" + fileName); - if (QExtFileInfo::exists(url, false, this)) + if (TQExtFileInfo::exists(url, false, this)) { - KMessageBox::error(this, i18n("<qt>Cannot create file, because a file named <b>%1</b> already exists.</qt>").arg(fileName), i18n("Error Creating File")); + KMessageBox::error(this, i18n("<qt>Cannot create file, because a file named <b>%1</b> already exists.</qt>").tqarg(fileName), i18n("Error Creating File")); return; } KTempFile *tempFile = new KTempFile(tmpDir); |