summaryrefslogtreecommitdiffstats
path: root/vcs/cvsservice/cvsdir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'vcs/cvsservice/cvsdir.cpp')
-rw-r--r--vcs/cvsservice/cvsdir.cpp122
1 files changed, 61 insertions, 61 deletions
diff --git a/vcs/cvsservice/cvsdir.cpp b/vcs/cvsservice/cvsdir.cpp
index 2b7602e6..28a4b566 100644
--- a/vcs/cvsservice/cvsdir.cpp
+++ b/vcs/cvsservice/cvsdir.cpp
@@ -9,8 +9,8 @@
* *
***************************************************************************/
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include "cvsdir.h"
@@ -18,19 +18,19 @@
// class CVSDir
///////////////////////////////////////////////////////////////////////////////
-CVSDir::CVSDir() : QDir()
+CVSDir::CVSDir() : TQDir()
{
}
///////////////////////////////////////////////////////////////////////////////
-CVSDir::CVSDir( const QDir &dir )
- : QDir( dir )
+CVSDir::CVSDir( const TQDir &dir )
+ : TQDir( dir )
{
// We deal with absolute paths only
convertToAbs();
- m_cvsDir = absPath() + QDir::separator() + "CVS";
+ m_cvsDir = absPath() + TQDir::separator() + "CVS";
if (isValid())
refreshEntriesCache();
@@ -39,7 +39,7 @@ CVSDir::CVSDir( const QDir &dir )
///////////////////////////////////////////////////////////////////////////////
CVSDir::CVSDir( const CVSDir &aCvsDir )
- : QDir( aCvsDir )
+ : TQDir( aCvsDir )
{
*this = aCvsDir;
}
@@ -50,7 +50,7 @@ CVSDir &CVSDir::operator=( const CVSDir &aCvsDir )
{
m_cvsDir = aCvsDir.m_cvsDir;
m_cachedEntries = aCvsDir.m_cachedEntries;
- QDir::operator=( aCvsDir );
+ TQDir::operator=( aCvsDir );
return *this;
}
@@ -66,54 +66,54 @@ CVSDir::~CVSDir()
bool CVSDir::isValid() const
{
return exists() &&
- QFile::exists( entriesFileName() ) &&
- QFile::exists( rootFileName() ) &&
- QFile::exists( repoFileName() );
+ TQFile::exists( entriesFileName() ) &&
+ TQFile::exists( rootFileName() ) &&
+ TQFile::exists( repoFileName() );
}
///////////////////////////////////////////////////////////////////////////////
-QString CVSDir::entriesFileName() const
+TQString CVSDir::entriesFileName() const
{
- return m_cvsDir + QDir::separator() + "Entries";
+ return m_cvsDir + TQDir::separator() + "Entries";
}
///////////////////////////////////////////////////////////////////////////////
-QString CVSDir::rootFileName() const
+TQString CVSDir::rootFileName() const
{
- return m_cvsDir + QDir::separator() + "Root";
+ return m_cvsDir + TQDir::separator() + "Root";
}
///////////////////////////////////////////////////////////////////////////////
-QString CVSDir::repoFileName() const
+TQString CVSDir::repoFileName() const
{
- return m_cvsDir + QDir::separator() + "Repository";
+ return m_cvsDir + TQDir::separator() + "Repository";
}
///////////////////////////////////////////////////////////////////////////////
-QString CVSDir::cvsIgnoreFileName() const
+TQString CVSDir::cvsIgnoreFileName() const
{
- return absPath() + QDir::separator() + ".cvsignore";
+ return absPath() + TQDir::separator() + ".cvsignore";
}
///////////////////////////////////////////////////////////////////////////////
-QString CVSDir::repository() const
+TQString CVSDir::repository() const
{
// The content of CVS/Repository is a single line with the path into the
// repository of the modules checked out in this directory (just like
// "kdevelop/parts/cvsservice"): so we can read a single line of the file
// and we are done!
- QString content;
+ TQString content;
if (!isValid())
- return QString::null;
+ return TQString::null;
- QByteArray bytes = cacheFile( repoFileName() );
- QTextStream t( bytes, IO_ReadOnly );
+ TQByteArray bytes = cacheFile( repoFileName() );
+ TQTextStream t( bytes, IO_ReadOnly );
content += t.readLine();
return content;
@@ -121,18 +121,18 @@ QString CVSDir::repository() const
///////////////////////////////////////////////////////////////////////////////
-QString CVSDir::root() const
+TQString CVSDir::root() const
{
// Same as CVSDir::repository() but CVS/Root contains the path of the
// CVS server as used in "cvs -d <server-path>" (in example:
// ":pserver:marios@cvs.kde.org:/home/kde")
- QString content;
+ TQString content;
if (!isValid())
- return QString::null;
+ return TQString::null;
- QByteArray bytes = cacheFile( repoFileName() );
- QTextStream t( bytes, IO_ReadOnly );
+ TQByteArray bytes = cacheFile( repoFileName() );
+ TQTextStream t( bytes, IO_ReadOnly );
content += t.readLine();
return content;
@@ -140,28 +140,28 @@ QString CVSDir::root() const
///////////////////////////////////////////////////////////////////////////////
-QByteArray CVSDir::cacheFile( const QString &fileName )
+TQByteArray CVSDir::cacheFile( const TQString &fileName )
{
- QFile f( fileName );
+ TQFile f( fileName );
if (!f.open( IO_ReadOnly ))
- return QByteArray();
+ return TQByteArray();
return f.readAll();
}
///////////////////////////////////////////////////////////////////////////////
-QStringList CVSDir::registeredEntryList() const
+TQStringList CVSDir::registeredEntryList() const
{
- QStringList l;
+ TQStringList l;
if (!isValid())
return l;
- QByteArray bytes = cacheFile( entriesFileName() );
- QTextStream t( bytes, IO_ReadOnly );
+ TQByteArray bytes = cacheFile( entriesFileName() );
+ TQTextStream t( bytes, IO_ReadOnly );
CVSEntry entry;
while (!t.eof())
{
- QString line = t.readLine();
+ TQString line = t.readLine();
entry.parse( line, *this );
if (entry.isValid())
l.append( entry.fileName() );
@@ -171,7 +171,7 @@ QStringList CVSDir::registeredEntryList() const
///////////////////////////////////////////////////////////////////////////////
-bool CVSDir::isRegistered( const QString fileName ) const
+bool CVSDir::isRegistered( const TQString fileName ) const
{
CVSEntry entry = fileStatus( fileName );
return entry.isValid() && entry.fileName() == fileName;
@@ -183,12 +183,12 @@ void CVSDir::refreshEntriesCache() const
{
m_cachedEntries.clear();
- QByteArray bytes = cacheFile( entriesFileName() );
- QTextStream t( bytes, IO_ReadOnly );
+ TQByteArray bytes = cacheFile( entriesFileName() );
+ TQTextStream t( bytes, IO_ReadOnly );
CVSEntry entry;
while (!t.eof())
{
- QString line = t.readLine();
+ TQString line = t.readLine();
entry.parse( line, *this );
if (entry.isValid())
m_cachedEntries[ entry.fileName() ] = entry;
@@ -197,7 +197,7 @@ void CVSDir::refreshEntriesCache() const
///////////////////////////////////////////////////////////////////////////////
-CVSEntry CVSDir::fileStatus( const QString &fileName, bool refreshCache ) const
+CVSEntry CVSDir::fileStatus( const TQString &fileName, bool refreshCache ) const
{
if (refreshCache)
refreshEntriesCache();
@@ -212,19 +212,19 @@ CVSEntry CVSDir::fileStatus( const QString &fileName, bool refreshCache ) const
///////////////////////////////////////////////////////////////////////////////
-void CVSDir::ignoreFile( const QString &fileName )
+void CVSDir::ignoreFile( const TQString &fileName )
{
if (!isValid())
return;
- QFile f( cvsIgnoreFileName() );
+ TQFile f( cvsIgnoreFileName() );
if (!f.open( IO_ReadOnly))
return;
- QByteArray cachedFile = f.readAll();
- QTextStream t( cachedFile, IO_ReadOnly | IO_WriteOnly );
+ TQByteArray cachedFile = f.readAll();
+ TQTextStream t( cachedFile, IO_ReadOnly | IO_WriteOnly );
- QString readFileName;
+ TQString readFileName;
bool found = false;
while (!t.eof() && !found)
@@ -247,28 +247,28 @@ void CVSDir::ignoreFile( const QString &fileName )
///////////////////////////////////////////////////////////////////////////////
-void CVSDir::doNotIgnoreFile( const QString &fileName )
+void CVSDir::doNotIgnoreFile( const TQString &fileName )
{
if (!isValid())
return;
// 1. Read all .ignore file in memory
- QFile f( cvsIgnoreFileName() );
+ TQFile f( cvsIgnoreFileName() );
if (!f.open( IO_ReadOnly ))
return; // No .cvsignore file? Nothing to do then!
- QByteArray cachedFile = f.readAll();
- QTextIStream is( cachedFile );
+ TQByteArray cachedFile = f.readAll();
+ TQTextIStream is( cachedFile );
- QByteArray cachedOutputFile;
- QTextOStream os( cachedOutputFile );
+ TQByteArray cachedOutputFile;
+ TQTextOStream os( cachedOutputFile );
bool removed = false;
while (!is.eof())
{
- QString readLine = is.readLine();
+ TQString readLine = is.readLine();
if (readLine != fileName)
- os << readLine << "\n"; // QTextStream::readLine() eats the "\n" ...
+ os << readLine << "\n"; // TQTextStream::readLine() eats the "\n" ...
else
removed = true;
}
@@ -288,11 +288,11 @@ VCSFileInfoMap CVSDir::dirStatus() const
{
VCSFileInfoMap vcsInfo;
/// Convert to VCSFileInfoMap: \FIXME : any speed improvement here?
- QStringList entries = registeredEntryList();
- QStringList::const_iterator it = entries.begin(), end = entries.end();
+ TQStringList entries = registeredEntryList();
+ TQStringList::const_iterator it = entries.begin(), end = entries.end();
for ( ; it != end; ++it)
{
- const QString &fileName = (*it);
+ const TQString &fileName = (*it);
const CVSEntry entry = fileStatus( fileName );
vcsInfo.insert( fileName, entry.toVCSFileInfo() );
@@ -307,11 +307,11 @@ VCSFileInfoMap *CVSDir::cacheableDirStatus() const
{
VCSFileInfoMap *vcsInfo = new VCSFileInfoMap;
/// Convert to VCSFileInfoMap: \FIXME : any speed improvement here?
- QStringList entries = registeredEntryList();
- QStringList::const_iterator it = entries.begin(), end = entries.end();
+ TQStringList entries = registeredEntryList();
+ TQStringList::const_iterator it = entries.begin(), end = entries.end();
for ( ; it != end; ++it)
{
- const QString &fileName = (*it);
+ const TQString &fileName = (*it);
const CVSEntry entry = fileStatus( fileName );
vcsInfo->insert( fileName, entry.toVCSFileInfo() );