summaryrefslogtreecommitdiffstats
path: root/karm/test
diff options
context:
space:
mode:
Diffstat (limited to 'karm/test')
-rw-r--r--karm/test/lockerthread.cpp10
-rw-r--r--karm/test/lockerthread.h8
-rw-r--r--karm/test/locking.cpp16
-rw-r--r--karm/test/runscripts.cpp44
-rw-r--r--karm/test/script.cpp36
-rw-r--r--karm/test/script.h10
6 files changed, 62 insertions, 62 deletions
diff --git a/karm/test/lockerthread.cpp b/karm/test/lockerthread.cpp
index 6ec6e7ba2..914682210 100644
--- a/karm/test/lockerthread.cpp
+++ b/karm/test/lockerthread.cpp
@@ -1,5 +1,5 @@
-#include <qthread.h>
-#include <qstring.h>
+#include <tqthread.h>
+#include <tqstring.h>
#include <resourcecalendar.h>
#include <resourcelocal.h>
@@ -7,14 +7,14 @@
#include "lockerthread.h"
-LockerThread::LockerThread( const QString &icsfile )
+LockerThread::LockerThread( const TQString &icsfile )
{
m_gotlock = false;
m_icsfile = icsfile;
}
/*
-void LockerThread::setIcsFile( const QString &filename )
+void LockerThread::setIcsFile( const TQString &filename )
{
m_icsfile = filename;
}
@@ -26,7 +26,7 @@ void LockerThread::run()
KCal::ResourceCalendar *calendar = 0;
KCal::CalendarResources::Ticket *lock = 0;
- calendars = new KCal::CalendarResources( QString::fromLatin1( "UTC" ) );
+ calendars = new KCal::CalendarResources( TQString::fromLatin1( "UTC" ) );
calendar = new KCal::ResourceLocal( m_icsfile );
lock = calendars->requestSaveTicket( calendar );
if ( lock )
diff --git a/karm/test/lockerthread.h b/karm/test/lockerthread.h
index d40f234ad..95915b478 100644
--- a/karm/test/lockerthread.h
+++ b/karm/test/lockerthread.h
@@ -1,4 +1,4 @@
-#include <qthread.h>
+#include <tqthread.h>
class QString;
@@ -10,12 +10,12 @@ class QString;
class LockerThread : public QThread
{
public:
- LockerThread( const QString &filename );
- //void setIcsFile( const QString &filename );
+ LockerThread( const TQString &filename );
+ //void setIcsFile( const TQString &filename );
void run();
bool gotlock() const { return m_gotlock; };
private:
- QString m_icsfile;
+ TQString m_icsfile;
bool m_gotlock;
};
diff --git a/karm/test/locking.cpp b/karm/test/locking.cpp
index 49c7637d3..940a344d1 100644
--- a/karm/test/locking.cpp
+++ b/karm/test/locking.cpp
@@ -1,8 +1,8 @@
#include <assert.h>
-#include <qstring.h>
-#include <qfile.h>
-#include <qdir.h>
+#include <tqstring.h>
+#include <tqfile.h>
+#include <tqdir.h>
#include <kcmdlineargs.h>
#include <kapplication.h>
@@ -12,7 +12,7 @@
#include "lockerthread.h"
-const QString icalfilename = "karmtest.ics";
+const TQString icalfilename = "karmtest.ics";
// If one thread has the file is locked, the other cannot get the lock.
short test1()
@@ -23,7 +23,7 @@ short test1()
KCal::ResourceCalendar *calendar = 0;
KCal::CalendarResources::Ticket *lock = 0;
- calendars = new KCal::CalendarResources( QString::fromLatin1( "UTC" ) );
+ calendars = new KCal::CalendarResources( TQString::fromLatin1( "UTC" ) );
calendar = new KCal::ResourceLocal( icalfilename );
lock = calendars->requestSaveTicket( calendar );
@@ -62,7 +62,7 @@ short test2()
KCal::ResourceCalendar *calendar = 0;
KCal::CalendarResources::Ticket *lock = 0;
- calendars = new KCal::CalendarResources( QString::fromLatin1( "UTC" ) );
+ calendars = new KCal::CalendarResources( TQString::fromLatin1( "UTC" ) );
calendar = new KCal::ResourceLocal( icalfilename );
LockerThread thread( icalfilename );
@@ -88,7 +88,7 @@ short test3()
KCal::ResourceCalendar *calendar = 0;
KCal::CalendarResources::Ticket *lock = 0;
- calendars = new KCal::CalendarResources( QString::fromLatin1( "UTC" ) );
+ calendars = new KCal::CalendarResources( TQString::fromLatin1( "UTC" ) );
calendar = new KCal::ResourceLocal( icalfilename );
// lock then unlock
@@ -130,7 +130,7 @@ int main( int argc, char *argv[] )
// Use another directory than the real one, just to keep things clean
// KDEHOME needs to be writable though, for a ksycoca database
// FIXME: Delete this directory when done with test.
- setenv( "KDEHOME", QFile::encodeName( QDir::homeDirPath() + "/.kde-testresource" ), true );
+ setenv( "KDEHOME", TQFile::encodeName( TQDir::homeDirPath() + "/.kde-testresource" ), true );
// Copied from Till's test in libkcal. Not sure what this is for.
setenv( "KDE_FORK_SLAVES", "yes", true ); // simpler, for the final cleanup
diff --git a/karm/test/runscripts.cpp b/karm/test/runscripts.cpp
index aa5449541..1b44f4821 100644
--- a/karm/test/runscripts.cpp
+++ b/karm/test/runscripts.cpp
@@ -18,32 +18,32 @@
*/
#include <kdebug.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextstream.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtextstream.h>
#include "script.h"
-static QString srcdir();
+static TQString srcdir();
static int runscripts
-( const QString &interpreter, const QString &extension, const QString &path );
+( const TQString &interpreter, const TQString &extension, const TQString &path );
-const QString dots = "..................................................";
-const QString not_a_test_filename_prefix = "__";
+const TQString dots = "..................................................";
+const TQString not_a_test_filename_prefix = "__";
// Read srcdir from Makefile (for builddir != srcdir).
-QString srcdir()
+TQString srcdir()
{
bool found = false;
- QString dir;
+ TQString dir;
- QFile file( "Makefile" );
+ TQFile file( "Makefile" );
if ( !file.open( IO_ReadOnly | IO_Translate ) ) return "";
- QTextStream in( &file );
- QString line;
+ TQTextStream in( &file );
+ TQString line;
while ( !found && !in.atEnd() )
{
line = in.readLine();
@@ -60,29 +60,29 @@ QString srcdir()
}
int runscripts
-( const QString &interpreter, const QString &extension, const QString &path )
+( const TQString &interpreter, const TQString &extension, const TQString &path )
{
int rval = 0;
int oneBadApple = 0;
- QStringList files;
+ TQStringList files;
- QDir dir( path );
+ TQDir dir( path );
Script* s = new Script( dir );
dir.setNameFilter( extension );
- dir.setFilter( QDir::Files );
- dir.setSorting( QDir::Name | QDir::IgnoreCase );
+ dir.setFilter( TQDir::Files );
+ dir.setSorting( TQDir::Name | TQDir::IgnoreCase );
const QFileInfoList *list = dir.entryInfoList();
QFileInfoListIterator it( *list );
- QFileInfo *fi;
+ TQFileInfo *fi;
while ( !rval && ( fi = it.current() ) != 0 )
{
// Don't run scripts that are shared routines.
if ( ! fi->fileName().startsWith( not_a_test_filename_prefix ) )
{
s->addArgument( interpreter );
- s->addArgument( path + QDir::separator() + fi->fileName().latin1() );
+ s->addArgument( path + TQDir::separator() + fi->fileName().latin1() );
// Thorsten's xautomation tests run with user interaction by default.
if ( interpreter == "sh" ) s->addArgument( "--batch" );
@@ -116,7 +116,7 @@ int main( int, char** )
{
int rval = 0;
- QString path = srcdir();
+ TQString path = srcdir();
if ( !rval ) rval = runscripts( "python", "*.py *.Py *.PY *.pY", path );
diff --git a/karm/test/script.cpp b/karm/test/script.cpp
index 37fe058d3..f9fa9d9e0 100644
--- a/karm/test/script.cpp
+++ b/karm/test/script.cpp
@@ -17,11 +17,11 @@
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
-#include <qdir.h>
-#include <qprocess.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtimer.h>
+#include <tqdir.h>
+#include <tqprocess.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
#include <kdebug.h>
@@ -38,23 +38,23 @@
// kill() doesn't let script interpreter try to clean up.
const int NICE_KILL_TIMEOUT_IN_SECS = 5;
-Script::Script( const QDir& workingDirectory )
+Script::Script( const TQDir& workingDirectory )
{
m_status = 0;
m_stderr = false;
m_timeoutInSeconds = 5;
- m_proc = new QProcess( this );
+ m_proc = new TQProcess( this );
m_proc->setWorkingDirectory( workingDirectory );
- connect ( m_proc, SIGNAL( readyReadStdout() ),
- this , SLOT ( stdout() )
+ connect ( m_proc, TQT_SIGNAL( readyReadStdout() ),
+ this , TQT_SLOT ( stdout() )
);
- connect ( m_proc, SIGNAL( readyReadStderr() ),
- this , SLOT ( stderr() )
+ connect ( m_proc, TQT_SIGNAL( readyReadStderr() ),
+ this , TQT_SLOT ( stderr() )
);
- connect ( m_proc, SIGNAL( processExited() ),
- this , SLOT ( exit() )
+ connect ( m_proc, TQT_SIGNAL( processExited() ),
+ this , TQT_SLOT ( exit() )
);
}
@@ -64,7 +64,7 @@ Script::~Script()
m_proc = 0;
}
-void Script::addArgument( const QString &arg )
+void Script::addArgument( const TQString &arg )
{
m_proc->addArgument( arg );
}
@@ -79,7 +79,7 @@ int Script::run()
{
m_proc->start();
// This didn't work. But Ctrl-C does. :P
- //QTimer::singleShot( m_timeoutInSeconds * 1000, m_proc, SLOT( kill() ) );
+ //TQTimer::singleShot( m_timeoutInSeconds * 1000, m_proc, TQT_SLOT( kill() ) );
//while ( ! m_proc->normalExit() );
while ( m_proc->isRunning() );
return m_status;
@@ -89,7 +89,7 @@ void Script::terminate()
{
// These both trigger processExited, so exit() will run.
m_proc->tryTerminate();
- QTimer::singleShot( NICE_KILL_TIMEOUT_IN_SECS*1000, m_proc, SLOT( kill() ) );
+ TQTimer::singleShot( NICE_KILL_TIMEOUT_IN_SECS*1000, m_proc, TQT_SLOT( kill() ) );
}
void Script::exit()
@@ -103,13 +103,13 @@ void Script::stderr()
{
// Treat any output to std err as a script failure
m_status = 1;
- QString data = QString( m_proc->readStderr() );
+ TQString data = TQString( m_proc->readStderr() );
m_stderr= true;
}
void Script::stdout()
{
- QString data = QString( m_proc->readStdout() );
+ TQString data = TQString( m_proc->readStdout() );
}
#include "script.moc"
diff --git a/karm/test/script.h b/karm/test/script.h
index f5ae1e227..318d2872b 100644
--- a/karm/test/script.h
+++ b/karm/test/script.h
@@ -20,8 +20,8 @@
#ifndef _script_h_
#define _script_h_
-//#include <qvariant.h>
-#include <qobject.h>
+//#include <tqvariant.h>
+#include <tqobject.h>
class QDir;
class QProcess;
@@ -32,9 +32,9 @@ class Script : public QObject
{
Q_OBJECT
public:
- Script( const QDir& workingDirectory );
+ Script( const TQDir& workingDirectory );
virtual ~Script();
- void addArgument( const QString &arg );
+ void addArgument( const TQString &arg );
void setTimeout( int seconds );
int run();
private slots:
@@ -43,7 +43,7 @@ private slots:
void stdout();
void terminate();
private:
- QProcess *m_proc;
+ TQProcess *m_proc;
int m_status;
bool m_stderr;
int m_timeoutInSeconds;