From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- parts/fileview/filetreewidget.cpp | 94 +++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'parts/fileview/filetreewidget.cpp') diff --git a/parts/fileview/filetreewidget.cpp b/parts/fileview/filetreewidget.cpp index e0d7538b..6f049370 100644 --- a/parts/fileview/filetreewidget.cpp +++ b/parts/fileview/filetreewidget.cpp @@ -13,11 +13,11 @@ #include "filetreewidget.h" -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include @@ -51,7 +51,7 @@ using namespace filetreeview; // class FileTreeWidget /////////////////////////////////////////////////////////////////////////////// -FileTreeWidget::FileTreeWidget( FileViewPart *part, QWidget *parent, KDevVCSFileInfoProvider *infoProvider ) +FileTreeWidget::FileTreeWidget( FileViewPart *part, TQWidget *parent, KDevVCSFileInfoProvider *infoProvider ) : KFileTreeView( parent, "filetreewidget" ), m_part( part ), m_rootBranch( 0 ) { kdDebug(9017) << "Requested FileTree for: " << projectDirectory() << endl; @@ -63,32 +63,32 @@ FileTreeWidget::FileTreeWidget( FileViewPart *part, QWidget *parent, KDevVCSFile else m_impl = new StdFileTreeWidgetImpl( this ); - //setResizeMode( QListView::LastColumn ); + //setResizeMode( TQListView::LastColumn ); setSorting( 0 ); setAllColumnsShowFocus( true ); - setSelectionMode( QListView::Extended ); // Enable multiple items selection by use of Ctrl/Shift + setSelectionMode( TQListView::Extended ); // Enable multiple items selection by use of Ctrl/Shift setDragEnabled( false ); // Slot connections - connect( this, SIGNAL(executed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*)) ); - connect( this, SIGNAL(returnPressed(QListViewItem*)), this, SLOT(slotItemExecuted(QListViewItem*)) ); - connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&)) ); + connect( this, TQT_SIGNAL(executed(TQListViewItem*)), this, TQT_SLOT(slotItemExecuted(TQListViewItem*)) ); + connect( this, TQT_SIGNAL(returnPressed(TQListViewItem*)), this, TQT_SLOT(slotItemExecuted(TQListViewItem*)) ); + connect( this, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + this, TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&)) ); // Intercepts KDevelop core signals and VCS notifications (if available) - connect( m_part->project(), SIGNAL( activeDirectoryChanged( const QString&, const QString& ) ), - this, SLOT( changeActiveDirectory( const QString&, const QString& ) ) ); - connect( m_part->project(), SIGNAL( addedFilesToProject( const QStringList & ) ), - this, SLOT( addProjectFiles( const QStringList & ) ) ); - connect( m_part->project(), SIGNAL( removedFilesFromProject( const QStringList & ) ), - this, SLOT( removeProjectFiles( const QStringList & ) ) ); + connect( m_part->project(), TQT_SIGNAL( activeDirectoryChanged( const TQString&, const TQString& ) ), + this, TQT_SLOT( changeActiveDirectory( const TQString&, const TQString& ) ) ); + connect( m_part->project(), TQT_SIGNAL( addedFilesToProject( const TQStringList & ) ), + this, TQT_SLOT( addProjectFiles( const TQStringList & ) ) ); + connect( m_part->project(), TQT_SIGNAL( removedFilesFromProject( const TQStringList & ) ), + this, TQT_SLOT( removeProjectFiles( const TQStringList & ) ) ); // Safeguard against VCS plug-in unloading at run-time - connect( m_impl, SIGNAL(implementationInvalidated()), this, SLOT(slotImplementationInvalidated()) ); + connect( m_impl, TQT_SIGNAL(implementationInvalidated()), this, TQT_SLOT(slotImplementationInvalidated()) ); // Hide pattern for files - QDomDocument &dom = *m_part->projectDom(); - QString defaultHidePattern = "*.o,*.lo,CVS"; - QString hidePattern = DomUtil::readEntry( dom, "/kdevfileview/tree/hidepatterns", defaultHidePattern ); - m_hidePatterns = QStringList::split( ",", hidePattern ); + TQDomDocument &dom = *m_part->projectDom(); + TQString defaultHidePattern = "*.o,*.lo,CVS"; + TQString hidePattern = DomUtil::readEntry( dom, "/kdevfileview/tree/hidepatterns", defaultHidePattern ); + m_hidePatterns = TQStringList::split( ",", hidePattern ); } /////////////////////////////////////////////////////////////////////////////// @@ -97,7 +97,7 @@ FileTreeWidget::~FileTreeWidget() { kdDebug(9017) << "FileTreeWidget::~FileTreeWidget()" << endl; - QDomDocument &dom = *m_part->projectDom(); + TQDomDocument &dom = *m_part->projectDom(); DomUtil::writeEntry( dom, "/kdevfileview/tree/hidepatterns", hidePatterns() ); // delete m_impl; @@ -105,14 +105,14 @@ FileTreeWidget::~FileTreeWidget() /////////////////////////////////////////////////////////////////////////////// -void FileTreeWidget::openDirectory( const QString& dirName ) +void FileTreeWidget::openDirectory( const TQString& dirName ) { kdDebug(9017) << "FileTreeWidget::openDirectory(): " + dirName << endl; // if we're reloading if (m_rootBranch) { - disconnect( m_rootBranch, SIGNAL(populateFinished(KFileTreeViewItem*)), this, SLOT(finishPopulate(KFileTreeViewItem*)) ); + disconnect( m_rootBranch, TQT_SIGNAL(populateFinished(KFileTreeViewItem*)), this, TQT_SLOT(finishPopulate(KFileTreeViewItem*)) ); removeBranch( m_rootBranch ); m_projectFiles.clear(); } @@ -120,7 +120,7 @@ void FileTreeWidget::openDirectory( const QString& dirName ) addProjectFiles( m_part->project()->allFiles(), true ); KURL url = KURL::fromPathOrURL( dirName ); - const QPixmap& pix = KMimeType::mimeType("inode/directory")->pixmap( KIcon::Small ); + const TQPixmap& pix = KMimeType::mimeType("inode/directory")->pixmap( KIcon::Small ); // this is a bit odd, but the order of these calls seems to be important //FileTreeBranch *b = new FileTreeBranch( this, url, url.prettyURL(), pix ); @@ -128,7 +128,7 @@ void FileTreeWidget::openDirectory( const QString& dirName ) b->setChildRecurse( false ); m_rootBranch = addBranch( b ); m_rootBranch->setOpen( true ); - connect( m_rootBranch, SIGNAL(populateFinished(KFileTreeViewItem*)), this, SLOT(finishPopulate(KFileTreeViewItem*)) ); + connect( m_rootBranch, TQT_SIGNAL(populateFinished(KFileTreeViewItem*)), this, TQT_SLOT(finishPopulate(KFileTreeViewItem*)) ); } /////////////////////////////////////////////////////////////////////////////// @@ -142,11 +142,11 @@ bool FileTreeWidget::shouldBeShown( KFileTreeViewItem* item ) /////////////////////////////////////////////////////////////////////////////// -bool FileTreeWidget::matchesHidePattern(const QString &fileName) +bool FileTreeWidget::matchesHidePattern(const TQString &fileName) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for (it = m_hidePatterns.begin(); it != m_hidePatterns.end(); ++it) { - QRegExp re(*it, true, true); + TQRegExp re(*it, true, true); if (re.search(fileName) == 0 && (uint)re.matchedLength() == fileName.length()) return true; } @@ -184,7 +184,7 @@ void FileTreeWidget::finishPopulate(KFileTreeViewItem* item) /////////////////////////////////////////////////////////////////////////////// -void FileTreeWidget::slotItemExecuted( QListViewItem* item ) +void FileTreeWidget::slotItemExecuted( TQListViewItem* item ) { if (!item) return; @@ -199,7 +199,7 @@ void FileTreeWidget::slotItemExecuted( QListViewItem* item ) /////////////////////////////////////////////////////////////////////////////// -void FileTreeWidget::slotContextMenu( KListView *, QListViewItem* item, const QPoint &p ) +void FileTreeWidget::slotContextMenu( KListView *, TQListViewItem* item, const TQPoint &p ) { kdDebug(9017) << "FileTreeWidget::slotContextMenu(...)" << endl; @@ -219,7 +219,7 @@ void FileTreeWidget::slotContextMenu( KListView *, QListViewItem* item, const QP /////////////////////////////////////////////////////////////////////////////// -QString FileTreeWidget::projectDirectory() +TQString FileTreeWidget::projectDirectory() { return m_part->project()->projectDirectory(); } @@ -231,7 +231,7 @@ QString FileTreeWidget::projectDirectory() * * @param fileName or directory to test for presence. */ -bool FileTreeWidget::isInProject(const QString &fileName) const +bool FileTreeWidget::isInProject(const TQString &fileName) const { return m_projectFiles.contains(fileName); } @@ -250,22 +250,22 @@ bool FileTreeWidget::isInProject(const QString &fileName) const * * @see m_projectFiles */ -void FileTreeWidget::addProjectFiles( QStringList const & fileList, bool constructing ) +void FileTreeWidget::addProjectFiles( TQStringList const & fileList, bool constructing ) { kdDebug(9017) << "files added to project: " << fileList << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { if( (*it).isEmpty() ) continue; kdDebug(9017) << "adding file: " << *it << endl; - const QString file = projectDirectory() + "/" + ( *it ); + const TQString file = projectDirectory() + "/" + ( *it ); if ( !m_projectFiles.contains( file ) ) { // We got a new file to add to this project. // Ensure all the parent directories are part of the project set, too. - QStringList paths = QStringList::split( "/", *it); + TQStringList paths = TQStringList::split( "/", *it); paths.pop_back(); while( !paths.isEmpty() ) { @@ -274,7 +274,7 @@ void FileTreeWidget::addProjectFiles( QStringList const & fileList, bool constru // Whenever we find out that a directory is already recorded as part of our project, // we may stop adding, because its parent directories were already added - // in some previous addition. - QString joinedPaths = paths.join("/"); + TQString joinedPaths = paths.join("/"); if( m_projectFiles.contains( joinedPaths ) ) break; m_projectFiles.insert( projectDirectory() + "/" + joinedPaths, true ); @@ -297,14 +297,14 @@ void FileTreeWidget::addProjectFiles( QStringList const & fileList, bool constru /////////////////////////////////////////////////////////////////////////////// -void FileTreeWidget::removeProjectFiles( QStringList const & fileList ) +void FileTreeWidget::removeProjectFiles( TQStringList const & fileList ) { kdDebug(9017) << "files removed from project: " << fileList.count() << endl; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for ( it = fileList.begin(); it != fileList.end(); ++it ) { - QString file = m_part->project()->projectDirectory() + "/" + ( *it ); + TQString file = m_part->project()->projectDirectory() + "/" + ( *it ); m_projectFiles.remove( file ); kdDebug(9017) << "file removed: " << file << endl; @@ -316,7 +316,7 @@ void FileTreeWidget::removeProjectFiles( QStringList const & fileList ) } } -void FileTreeWidget::changeActiveDirectory( const QString& olddir, const QString& newdir ) +void FileTreeWidget::changeActiveDirectory( const TQString& olddir, const TQString& newdir ) { FileTreeViewItem* item = static_cast(firstChild()); if( item ) @@ -327,15 +327,15 @@ void FileTreeWidget::changeActiveDirectory( const QString& olddir, const QString /////////////////////////////////////////////////////////////////////////////// -void FileTreeWidget::applyHidePatterns( const QString &hidePatterns ) +void FileTreeWidget::applyHidePatterns( const TQString &hidePatterns ) { - m_hidePatterns = QStringList::split( ",", hidePatterns ); + m_hidePatterns = TQStringList::split( ",", hidePatterns ); hideOrShow(); } /////////////////////////////////////////////////////////////////////////////// -QString FileTreeWidget::hidePatterns() const +TQString FileTreeWidget::hidePatterns() const { return m_hidePatterns.join( "," ); } -- cgit v1.2.3