From e16866e072f94410321d70daedbcb855ea878cac Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 6 Nov 2011 15:56:40 -0600 Subject: Actually move the kde files that were renamed in the last commit --- tdecore/tests/kprociotest.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 tdecore/tests/kprociotest.cpp (limited to 'tdecore/tests/kprociotest.cpp') diff --git a/tdecore/tests/kprociotest.cpp b/tdecore/tests/kprociotest.cpp new file mode 100644 index 000000000..446dacb30 --- /dev/null +++ b/tdecore/tests/kprociotest.cpp @@ -0,0 +1,65 @@ +// +// MAIN -- a little demo of the capabilities of the "KProcess" class +// +// version 0.2, Aug 2nd 1997 +// $Id$ +// +// (C) Christian Czezatke +// e9025461@student.tuwien.ac.at +// + + +#include "kprocess.h" + +#include +#include +#include + +#include + +#include "kprociotest.h" + + + +// +// A nice input for "sort"... ;- ) +// +static const char txt[] = "hat\nder\nalte\nhexenmeister\nsich\ndoch\neinmal\nwegbegeben\n\ +und\nnun\nsollen\nseine\ngeister\nsich\nnach\nmeinem\nwillen\nregen\nseine\nwort\nund\n\ +werke\nmerkt\nich\nund\nden\nbrauch\nund\nmit\ngeistesstaerke\ntu\nich\nwunder\nauch\n"; + + +int main(int argc, char *argv[]) +{ + Dummy dummy; + KApplication app(argc, argv, "kprociotest"); + + printf("Welcome to the KProcIO Demo Application!\n"); + + + KProcIO p; + + p << "rev"; + + p.connect(&p, TQT_SIGNAL(processExited(KProcess*)), &dummy, TQT_SLOT(printMessage(KProcess*))); + p.connect(&p, TQT_SIGNAL(readReady(KProcIO*)), &dummy, TQT_SLOT(gotOutput(KProcIO*))); + + bool b; + + b = p.start(); + printf("Start returns %s\n", b ? "true" : "false"); + + b = p.fputs("Hello World!"); + printf("fputs returns %s\n", b ? "true" : "false"); + + b = p.fputs("This is a test. It should come out in reverse (esrever)"); + printf("fputs returns %s\n", b ? "true" : "false"); + + p.closeWhenDone(); + + printf("Entering man Qt event loop -- press to abort\n"); + app.exec(); + + return 0; +} +#include "kprociotest.moc" -- cgit v1.2.1