summaryrefslogtreecommitdiffstats
path: root/kfile-plugins/diff/kfile_diff.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
commit4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch)
treeb0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kfile-plugins/diff/kfile_diff.cpp
parent1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff)
downloadtdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz
tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kfile-plugins/diff/kfile_diff.cpp')
-rw-r--r--kfile-plugins/diff/kfile_diff.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/kfile-plugins/diff/kfile_diff.cpp b/kfile-plugins/diff/kfile_diff.cpp
index 0f2fa02d..957d0574 100644
--- a/kfile-plugins/diff/kfile_diff.cpp
+++ b/kfile-plugins/diff/kfile_diff.cpp
@@ -27,12 +27,12 @@
** Added support for Subversion diffs, September 11, 2003 Otto Bruggeman
*/
-#include <qcstring.h>
-#include <qdatetime.h>
-#include <qdict.h>
-#include <qfile.h>
-#include <qregexp.h>
-#include <qvalidator.h>
+#include <tqcstring.h>
+#include <tqdatetime.h>
+#include <tqdict.h>
+#include <tqfile.h>
+#include <tqregexp.h>
+#include <tqvalidator.h>
#include <kdebug.h>
#include <kgenericfactory.h>
@@ -44,8 +44,8 @@
K_EXPORT_COMPONENT_FACTORY(kfile_diff, KGenericFactory<KDiffPlugin>("kfile_diff"))
-KDiffPlugin::KDiffPlugin(QObject *parent, const char *name,
- const QStringList &preferredItems)
+KDiffPlugin::KDiffPlugin(TQObject *parent, const char *name,
+ const TQStringList &preferredItems)
: KFilePlugin(parent, name, preferredItems)
{
kdDebug(7034) << "diff plugin" << endl;
@@ -54,15 +54,15 @@ KDiffPlugin::KDiffPlugin(QObject *parent, const char *name,
KFileMimeTypeInfo::GroupInfo* group;
group = addGroupInfo( info, "General", i18n( "General" ) );
- addItemInfo( group, "Files", i18n( "Files" ), QVariant::UInt );
- addItemInfo( group, "First", i18n( "First File" ), QVariant::String );
- addItemInfo( group, "Format", i18n( "Format" ), QVariant::String );
- addItemInfo( group, "DiffProgram", i18n( "Diff Program" ), QVariant::String );
- addItemInfo( group, "Hunks", i18n( "Hunks" ), QVariant::UInt );
+ addItemInfo( group, "Files", i18n( "Files" ), TQVariant::UInt );
+ addItemInfo( group, "First", i18n( "First File" ), TQVariant::String );
+ addItemInfo( group, "Format", i18n( "Format" ), TQVariant::String );
+ addItemInfo( group, "DiffProgram", i18n( "Diff Program" ), TQVariant::String );
+ addItemInfo( group, "Hunks", i18n( "Hunks" ), TQVariant::UInt );
group = addGroupInfo( info, "Statistics", i18n( "Statistics" ) );
- addItemInfo( group, "Insert", i18n( "Insertions" ), QVariant::UInt );
- addItemInfo( group, "Modify", i18n( "Changes" ), QVariant::UInt );
- addItemInfo( group, "Delete", i18n( "Deletions" ), QVariant::UInt );
+ addItemInfo( group, "Insert", i18n( "Insertions" ), TQVariant::UInt );
+ addItemInfo( group, "Modify", i18n( "Changes" ), TQVariant::UInt );
+ addItemInfo( group, "Delete", i18n( "Deletions" ), TQVariant::UInt );
}
bool KDiffPlugin::readInfo( KFileMetaInfo& info, uint what )
@@ -75,12 +75,12 @@ bool KDiffPlugin::readInfo( KFileMetaInfo& info, uint what )
KFileMetaInfoGroup group;
- QFile file( info.path() );
- QStringList lines;
+ TQFile file( info.path() );
+ TQStringList lines;
if( file.open( IO_ReadOnly ) )
{
- QTextStream stream( &file );
+ TQTextStream stream( &file );
while (!stream.eof())
{
lines.append( stream.readLine() );
@@ -88,8 +88,8 @@ bool KDiffPlugin::readInfo( KFileMetaInfo& info, uint what )
file.close();
}
- QString format;
- QString program;
+ TQString format;
+ TQString program;
enum KDiffPlugin::Format diffFormat;
enum KDiffPlugin::DiffProgram diffProgram;
@@ -114,9 +114,9 @@ bool KDiffPlugin::readInfo( KFileMetaInfo& info, uint what )
determineDiffInfo( lines, diffFormat, &numberOfFiles, &numberOfHunks, &numberOfAdditions, &numberOfChanges, &numberOfDeletions );
}
- QString filename;
- QRegExp firstFile( "^Index: (.*)" );
- QStringList::ConstIterator it = lines.begin();
+ TQString filename;
+ TQRegExp firstFile( "^Index: (.*)" );
+ TQStringList::ConstIterator it = lines.begin();
it = lines.begin();
while ( it != lines.end() )
@@ -196,39 +196,39 @@ bool KDiffPlugin::readInfo( KFileMetaInfo& info, uint what )
return dataSet;
}
-enum KDiffPlugin::Format KDiffPlugin::determineDiffFormat( const QStringList lines ) const
+enum KDiffPlugin::Format KDiffPlugin::determineDiffFormat( const TQStringList lines ) const
{
- QString line;
+ TQString line;
if ( lines.count() == 0 )
{
return KDiffPlugin::Empty;
}
- QStringList::ConstIterator it = lines.begin();
+ TQStringList::ConstIterator it = lines.begin();
while ( it != lines.end() )
{
line = (*it);
- if ( line.find( QRegExp( "^[0-9]+[0-9,]*[acd][0-9]+[0-9,]*$" ), 0 ) == 0 )
+ if ( line.find( TQRegExp( "^[0-9]+[0-9,]*[acd][0-9]+[0-9,]*$" ), 0 ) == 0 )
{
return KDiffPlugin::Normal;
}
- else if ( line.find( QRegExp( "^--- " ), 0 ) == 0 )
+ else if ( line.find( TQRegExp( "^--- " ), 0 ) == 0 )
{
// unified has first a '^--- ' line, then a '^+++ ' line
return KDiffPlugin::Unified;
}
- else if ( line.find( QRegExp( "^\\*\\*\\* [^\\t]+\\t" ), 0 ) == 0 )
+ else if ( line.find( TQRegExp( "^\\*\\*\\* [^\\t]+\\t" ), 0 ) == 0 )
{
// context has first a '^*** ' line, then a '^--- ' line
return KDiffPlugin::Context;
}
- else if ( line.find( QRegExp( "^[acd][0-9]+ [0-9]+" ), 0 ) == 0 )
+ else if ( line.find( TQRegExp( "^[acd][0-9]+ [0-9]+" ), 0 ) == 0 )
{
return KDiffPlugin::RCS;
}
- else if ( line.find( QRegExp( "^[0-9]+[0-9,]*[acd]" ), 0 ) == 0 )
+ else if ( line.find( TQRegExp( "^[0-9]+[0-9,]*[acd]" ), 0 ) == 0 )
{
return KDiffPlugin::Ed;
}
@@ -237,17 +237,17 @@ enum KDiffPlugin::Format KDiffPlugin::determineDiffFormat( const QStringList lin
return KDiffPlugin::Unknown;
}
-enum KDiffPlugin::DiffProgram KDiffPlugin::determineDiffProgram( const QStringList lines ) const
+enum KDiffPlugin::DiffProgram KDiffPlugin::determineDiffProgram( const TQStringList lines ) const
{
if ( lines.count() == 0 )
{
return KDiffPlugin::Undeterminable;
}
- QStringList::ConstIterator it = lines.begin();
+ TQStringList::ConstIterator it = lines.begin();
// very crude, might need some more refining
- QRegExp diffRE( "^diff .*" );
- QRegExp p4sRE("^==== ");
+ TQRegExp diffRE( "^diff .*" );
+ TQRegExp p4sRE("^==== ");
bool indexFound = false;
@@ -271,9 +271,9 @@ enum KDiffPlugin::DiffProgram KDiffPlugin::determineDiffProgram( const QStringLi
return KDiffPlugin::Undeterminable;
}
-const QString KDiffPlugin::determineI18nedFormat( enum KDiffPlugin::Format diffFormat ) const
+const TQString KDiffPlugin::determineI18nedFormat( enum KDiffPlugin::Format diffFormat ) const
{
- QString format;
+ TQString format;
switch( diffFormat )
{
case KDiffPlugin::Context:
@@ -303,9 +303,9 @@ const QString KDiffPlugin::determineI18nedFormat( enum KDiffPlugin::Format diffF
return format;
}
-const QString KDiffPlugin::determineI18nedProgram( enum KDiffPlugin::DiffProgram diffProgram ) const
+const TQString KDiffPlugin::determineI18nedProgram( enum KDiffPlugin::DiffProgram diffProgram ) const
{
- QString program;
+ TQString program;
switch( diffProgram )
{
@@ -331,7 +331,7 @@ const QString KDiffPlugin::determineI18nedProgram( enum KDiffPlugin::DiffProgram
return program;
}
-void KDiffPlugin::determineDiffInfo( const QStringList lines,
+void KDiffPlugin::determineDiffInfo( const TQStringList lines,
enum KDiffPlugin::Format diffFormat,
int* numberOfFiles,
int* numberOfHunks,
@@ -339,20 +339,20 @@ void KDiffPlugin::determineDiffInfo( const QStringList lines,
int* numberOfChanges,
int* numberOfDeletions )
{
- QString line;
+ TQString line;
- QRegExp edAdd( "([0-9]+)(|,([0-9]+))a" );
- QRegExp edDel( "([0-9]+)(|,([0-9]+))d" );
- QRegExp edMod( "([0-9]+)(|,([0-9]+))c" );
+ TQRegExp edAdd( "([0-9]+)(|,([0-9]+))a" );
+ TQRegExp edDel( "([0-9]+)(|,([0-9]+))d" );
+ TQRegExp edMod( "([0-9]+)(|,([0-9]+))c" );
- QRegExp normalAdd( "[0-9]+a([0-9]+)(|,([0-9]+))" );
- QRegExp normalDel( "([0-9]+)(|,([0-9]+))d(|[0-9]+)" );
- QRegExp normalMod( "([0-9]+)(|,([0-9]+))c([0-9]+)(|,([0-9]+))" );
+ TQRegExp normalAdd( "[0-9]+a([0-9]+)(|,([0-9]+))" );
+ TQRegExp normalDel( "([0-9]+)(|,([0-9]+))d(|[0-9]+)" );
+ TQRegExp normalMod( "([0-9]+)(|,([0-9]+))c([0-9]+)(|,([0-9]+))" );
- QRegExp rcsAdd( "a[0-9]+ ([0-9]+)" );
- QRegExp rcsDel( "d[0-9]+ ([0-9]+)" );
+ TQRegExp rcsAdd( "a[0-9]+ ([0-9]+)" );
+ TQRegExp rcsDel( "d[0-9]+ ([0-9]+)" );
- QStringList::ConstIterator it = lines.begin();
+ TQStringList::ConstIterator it = lines.begin();
switch( diffFormat )
{