From 5af24c40137c80c4de65f63ce816f77ef8b7bea3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 2 Dec 2024 13:08:45 +0900 Subject: Use tdeprocess.h Signed-off-by: Michele Calgaro --- buildtools/ada/adaproject_part.cpp | 2 +- buildtools/autotools/addexistingdirectoriesdlg.cpp | 2 +- buildtools/autotools/addexistingfilesdlg.cpp | 2 +- buildtools/autotools/addicondlg.cpp | 2 +- buildtools/autotools/autoprojectpart.cpp | 2 +- buildtools/autotools/autosubprojectview.cpp | 2 +- buildtools/autotools/choosetargetdialog.cpp | 2 +- buildtools/custommakefiles/customprojectpart.cpp | 2 +- buildtools/pascal/pascalproject_part.cpp | 2 +- buildtools/qmake/qmakedefaultopts.cpp | 4 +- buildtools/qmake/trollprojectpart.cpp | 2 +- buildtools/qmake/trollprojectwidget.cpp | 3 +- languages/bash/bashsupport_part.cpp | 2 +- languages/bash/bashsupport_part.h | 2 +- languages/cpp/debugger/dbgcontroller.cpp | 2 +- languages/cpp/debugger/dbgpsdlg.cpp | 2 +- languages/cpp/debugger/gdbcontroller.cpp | 2 +- languages/cpp/includepathresolver.cpp | 4 +- languages/cpp/setuphelper.cpp | 2 +- languages/csharp/csharpdoc.cpp | 2 +- languages/csharp/csharpsupportpart.cpp | 2 +- languages/fortran/fortransupportpart.cpp | 2 +- languages/kjssupport/jscodecompletion.cpp | 2 +- languages/perl/perldoc.cpp | 2 +- languages/perl/perlsupportpart.cpp | 2 +- languages/php/phpconfigwidget.cpp | 2 +- languages/php/phpfile.cpp | 4 +- languages/php/phpfile.h | 2 +- languages/php/phpsupportpart.cpp | 2 +- languages/python/pydoc.cpp | 2 +- languages/ruby/debugger/dbgcontroller.cpp | 2 +- languages/ruby/debugger/dbgpsdlg.cpp | 2 +- languages/ruby/debugger/rdbcontroller.cpp | 2 +- languages/ruby/debugger/rdbcontroller.h | 2 +- languages/ruby/rubysupport_part.cpp | 2 +- languages/sql/sqlsupport_part.h | 2 +- lib/util/CMakeLists.txt | 2 +- lib/util/Makefile.am | 4 +- lib/util/blockingkprocess.cpp | 105 --------------------- lib/util/blockingkprocess.h | 93 ------------------ lib/util/blockingtdeprocess.cpp | 105 +++++++++++++++++++++ lib/util/blockingtdeprocess.h | 93 ++++++++++++++++++ lib/util/execcommand.cpp | 2 +- lib/util/kdevshellwidget.cpp | 2 +- lib/widgets/processlinemaker.cpp | 2 +- lib/widgets/processwidget.cpp | 2 +- lib/widgets/processwidget.h | 2 +- parts/appwizard/appwizarddlg.cpp | 4 +- parts/appwizard/appwizardpart.cpp | 2 +- parts/appwizard/importdlg.cpp | 2 +- parts/classview/digraphview.cpp | 2 +- parts/ctags2/ctags2_part.cpp | 2 +- parts/diff/diffpart.cpp | 2 +- parts/distpart/distpart_widget.cpp | 2 +- parts/distpart/specsupport.cpp | 2 +- parts/documentation/docglobalconfigwidget.cpp | 2 +- parts/documentation/find_documentation.cpp | 2 +- parts/documentation/searchview.cpp | 4 +- parts/documentation/tools/htdig/htdigindex.cpp | 2 +- parts/doxygen/doxygenpart.h | 2 +- parts/filter/shellfilterdlg.cpp | 2 +- parts/filter/shellinsertdlg.cpp | 2 +- parts/grepview/grepviewpart.cpp | 2 +- parts/grepview/grepviewwidget.cpp | 2 +- parts/outputviews/makewidget.cpp | 2 +- parts/tools/tools_part.cpp | 2 +- parts/valgrind/valgrind_dialog.cpp | 2 +- parts/valgrind/valgrind_part.cpp | 2 +- src/projectmanager.cpp | 2 +- vcs/clearcase/clearcasefileinfoprovider.cpp | 2 +- vcs/clearcase/clearcasemanipulator.cpp | 2 +- vcs/clearcase/clearcasemanipulator.h | 2 +- vcs/clearcase/clearcasepart.cpp | 2 +- vcs/cvsservice/cvspart.cpp | 2 +- vcs/cvsservice/cvspartimpl.cpp | 2 +- vcs/cvsservice/integrator/integratordlg.cpp | 2 +- vcs/perforce/commitdlg.cpp | 2 +- vcs/perforce/perforcepart.cpp | 2 +- vcs/subversion/integrator/svnintegratordlg.cpp | 4 +- vcs/subversion/subversion_core.cpp | 2 +- 80 files changed, 281 insertions(+), 282 deletions(-) delete mode 100644 lib/util/blockingkprocess.cpp delete mode 100644 lib/util/blockingkprocess.h create mode 100644 lib/util/blockingtdeprocess.cpp create mode 100644 lib/util/blockingtdeprocess.h diff --git a/buildtools/ada/adaproject_part.cpp b/buildtools/ada/adaproject_part.cpp index 4cd401a5..53086236 100644 --- a/buildtools/ada/adaproject_part.cpp +++ b/buildtools/ada/adaproject_part.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/buildtools/autotools/addexistingdirectoriesdlg.cpp b/buildtools/autotools/addexistingdirectoriesdlg.cpp index b98b0edb..72aff0a7 100644 --- a/buildtools/autotools/addexistingdirectoriesdlg.cpp +++ b/buildtools/autotools/addexistingdirectoriesdlg.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "autolistviewitems.h" #include "autosubprojectview.h" diff --git a/buildtools/autotools/addexistingfilesdlg.cpp b/buildtools/autotools/addexistingfilesdlg.cpp index ade9121d..3a3962ca 100644 --- a/buildtools/autotools/addexistingfilesdlg.cpp +++ b/buildtools/autotools/addexistingfilesdlg.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/buildtools/autotools/addicondlg.cpp b/buildtools/autotools/addicondlg.cpp index 1a32de18..f6fa8069 100644 --- a/buildtools/autotools/addicondlg.cpp +++ b/buildtools/autotools/addicondlg.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include // fix me! diff --git a/buildtools/autotools/autoprojectpart.cpp b/buildtools/autotools/autoprojectpart.cpp index 8646fc8c..6793afaf 100644 --- a/buildtools/autotools/autoprojectpart.cpp +++ b/buildtools/autotools/autoprojectpart.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/buildtools/autotools/autosubprojectview.cpp b/buildtools/autotools/autosubprojectview.cpp index 439a79fd..2fa7515f 100644 --- a/buildtools/autotools/autosubprojectview.cpp +++ b/buildtools/autotools/autosubprojectview.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/buildtools/autotools/choosetargetdialog.cpp b/buildtools/autotools/choosetargetdialog.cpp index 1bb58e15..112a3668 100644 --- a/buildtools/autotools/choosetargetdialog.cpp +++ b/buildtools/autotools/choosetargetdialog.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/buildtools/custommakefiles/customprojectpart.cpp b/buildtools/custommakefiles/customprojectpart.cpp index 746e9fe4..1941d2e8 100644 --- a/buildtools/custommakefiles/customprojectpart.cpp +++ b/buildtools/custommakefiles/customprojectpart.cpp @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include "domutil.h" #include "kdevcore.h" diff --git a/buildtools/pascal/pascalproject_part.cpp b/buildtools/pascal/pascalproject_part.cpp index 63f5e42d..c0bd71f3 100644 --- a/buildtools/pascal/pascalproject_part.cpp +++ b/buildtools/pascal/pascalproject_part.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "domutil.h" #include "kdevcore.h" diff --git a/buildtools/qmake/qmakedefaultopts.cpp b/buildtools/qmake/qmakedefaultopts.cpp index fdbcad64..f33c277a 100644 --- a/buildtools/qmake/qmakedefaultopts.cpp +++ b/buildtools/qmake/qmakedefaultopts.cpp @@ -14,9 +14,9 @@ #include #include #include -#include +#include -#include +#include TQMakeDefaultOpts::TQMakeDefaultOpts() { diff --git a/buildtools/qmake/trollprojectpart.cpp b/buildtools/qmake/trollprojectpart.cpp index de9b7f6e..ab5f8fad 100644 --- a/buildtools/qmake/trollprojectpart.cpp +++ b/buildtools/qmake/trollprojectpart.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/buildtools/qmake/trollprojectwidget.cpp b/buildtools/qmake/trollprojectwidget.cpp index 919ca69e..7d102ceb 100644 --- a/buildtools/qmake/trollprojectwidget.cpp +++ b/buildtools/qmake/trollprojectwidget.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include diff --git a/languages/bash/bashsupport_part.cpp b/languages/bash/bashsupport_part.cpp index 25ef4197..674ff798 100644 --- a/languages/bash/bashsupport_part.cpp +++ b/languages/bash/bashsupport_part.cpp @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/languages/bash/bashsupport_part.h b/languages/bash/bashsupport_part.h index 07b6104b..40488930 100644 --- a/languages/bash/bashsupport_part.h +++ b/languages/bash/bashsupport_part.h @@ -9,7 +9,7 @@ #include -#include +#include #include #include diff --git a/languages/cpp/debugger/dbgcontroller.cpp b/languages/cpp/debugger/dbgcontroller.cpp index 6ca94543..bc9d3cd5 100644 --- a/languages/cpp/debugger/dbgcontroller.cpp +++ b/languages/cpp/debugger/dbgcontroller.cpp @@ -14,7 +14,7 @@ ***************************************************************************/ #include "dbgcontroller.h" -#include +#include /***************************************************************************/ diff --git a/languages/cpp/debugger/dbgpsdlg.cpp b/languages/cpp/debugger/dbgpsdlg.cpp index f6791209..1d311aff 100644 --- a/languages/cpp/debugger/dbgpsdlg.cpp +++ b/languages/cpp/debugger/dbgpsdlg.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/languages/cpp/debugger/gdbcontroller.cpp b/languages/cpp/debugger/gdbcontroller.cpp index be796329..60c4366b 100644 --- a/languages/cpp/debugger/gdbcontroller.cpp +++ b/languages/cpp/debugger/gdbcontroller.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/languages/cpp/includepathresolver.cpp b/languages/cpp/includepathresolver.cpp index cc3f3244..338ea1c3 100644 --- a/languages/cpp/includepathresolver.cpp +++ b/languages/cpp/includepathresolver.cpp @@ -31,7 +31,7 @@ #include "tqdir.h" /* defines TQDir */ #include "tqregexp.h" /* defines TQRegExp */ #include "tdelocale.h" /* defines [function] i18n */ -#include "blockingkprocess.h" /* defines BlockingTDEProcess */ +#include "blockingtdeprocess.h" /* defines BlockingTDEProcess */ #include "includepathresolver.h" #include #include @@ -39,7 +39,7 @@ #include #ifdef TEST -#include "blockingkprocess.cpp" +#include "blockingtdeprocess.cpp" #include using namespace std; diff --git a/languages/cpp/setuphelper.cpp b/languages/cpp/setuphelper.cpp index 3d868c61..a89a7dee 100644 --- a/languages/cpp/setuphelper.cpp +++ b/languages/cpp/setuphelper.cpp @@ -11,7 +11,7 @@ ***************************************************************************/ #include "setuphelper.h" -#include "blockingkprocess.h" +#include "blockingtdeprocess.h" #include "driver.h" #include #include "tdetempfile.h" /* defines [function] KTempDir */ diff --git a/languages/csharp/csharpdoc.cpp b/languages/csharp/csharpdoc.cpp index 3b1c9450..eaae3fd0 100644 --- a/languages/csharp/csharpdoc.cpp +++ b/languages/csharp/csharpdoc.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/languages/csharp/csharpsupportpart.cpp b/languages/csharp/csharpsupportpart.cpp index a2684118..400cfcfa 100644 --- a/languages/csharp/csharpsupportpart.cpp +++ b/languages/csharp/csharpsupportpart.cpp @@ -28,7 +28,7 @@ #include #include "kdevmainwindow.h" -#include +#include #include #include diff --git a/languages/fortran/fortransupportpart.cpp b/languages/fortran/fortransupportpart.cpp index c9e44ff4..67f66279 100644 --- a/languages/fortran/fortransupportpart.cpp +++ b/languages/fortran/fortransupportpart.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/languages/kjssupport/jscodecompletion.cpp b/languages/kjssupport/jscodecompletion.cpp index ca7e7690..8a204c7a 100644 --- a/languages/kjssupport/jscodecompletion.cpp +++ b/languages/kjssupport/jscodecompletion.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/languages/perl/perldoc.cpp b/languages/perl/perldoc.cpp index 4255d633..ed2be986 100644 --- a/languages/perl/perldoc.cpp +++ b/languages/perl/perldoc.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/languages/perl/perlsupportpart.cpp b/languages/perl/perlsupportpart.cpp index a3ec40db..2b230cd7 100644 --- a/languages/perl/perlsupportpart.cpp +++ b/languages/perl/perlsupportpart.cpp @@ -28,7 +28,7 @@ #include #include "kdevmainwindow.h" -#include +#include #include #include diff --git a/languages/php/phpconfigwidget.cpp b/languages/php/phpconfigwidget.cpp index ac9a8531..7d6e7ea2 100644 --- a/languages/php/phpconfigwidget.cpp +++ b/languages/php/phpconfigwidget.cpp @@ -1,5 +1,5 @@ #include "domutil.h" -#include +#include #include #include #include diff --git a/languages/php/phpfile.cpp b/languages/php/phpfile.cpp index a9861678..c592c763 100644 --- a/languages/php/phpfile.cpp +++ b/languages/php/phpfile.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include @@ -480,7 +480,7 @@ void PHPFile::PHPCheck() { // int status = 0; m_phpCheckOutput = ""; -/// @todo try with kprocess in futur version actually this create zombie +/// @todo try with tdeprocess in futur version actually this create zombie /* phpCheckProc->clearArguments(); diff --git a/languages/php/phpfile.h b/languages/php/phpfile.h index da4da636..2972bfff 100644 --- a/languages/php/phpfile.h +++ b/languages/php/phpfile.h @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/languages/php/phpsupportpart.cpp b/languages/php/phpsupportpart.cpp index cf498060..273db008 100644 --- a/languages/php/phpsupportpart.cpp +++ b/languages/php/phpsupportpart.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/languages/python/pydoc.cpp b/languages/python/pydoc.cpp index 86027d3a..cdab5903 100644 --- a/languages/python/pydoc.cpp +++ b/languages/python/pydoc.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/languages/ruby/debugger/dbgcontroller.cpp b/languages/ruby/debugger/dbgcontroller.cpp index 7ee560b7..51e01c30 100644 --- a/languages/ruby/debugger/dbgcontroller.cpp +++ b/languages/ruby/debugger/dbgcontroller.cpp @@ -20,7 +20,7 @@ ***************************************************************************/ #include "dbgcontroller.h" -#include +#include /***************************************************************************/ diff --git a/languages/ruby/debugger/dbgpsdlg.cpp b/languages/ruby/debugger/dbgpsdlg.cpp index f17c3ce0..fe2c000e 100644 --- a/languages/ruby/debugger/dbgpsdlg.cpp +++ b/languages/ruby/debugger/dbgpsdlg.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/languages/ruby/debugger/rdbcontroller.cpp b/languages/ruby/debugger/rdbcontroller.cpp index 94204089..e1cef233 100644 --- a/languages/ruby/debugger/rdbcontroller.cpp +++ b/languages/ruby/debugger/rdbcontroller.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include diff --git a/languages/ruby/debugger/rdbcontroller.h b/languages/ruby/debugger/rdbcontroller.h index f28302db..5e10d848 100644 --- a/languages/ruby/debugger/rdbcontroller.h +++ b/languages/ruby/debugger/rdbcontroller.h @@ -149,7 +149,7 @@ private: int stdoutSizeofBuf_; // size of the buffer for holding stdout piped // from the ruby program int stdoutOutputLen_; // amount of data in the output buffer - char* stdoutOutput_; // buffer for the output from kprocess + char* stdoutOutput_; // buffer for the output from tdeprocess TQCString holdingZone_; int rdbSizeofBuf_; // size of the output buffer from rdb diff --git a/languages/ruby/rubysupport_part.cpp b/languages/ruby/rubysupport_part.cpp index 79cbac07..141d4081 100644 --- a/languages/ruby/rubysupport_part.cpp +++ b/languages/ruby/rubysupport_part.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/languages/sql/sqlsupport_part.h b/languages/sql/sqlsupport_part.h index 921743e2..6747522d 100644 --- a/languages/sql/sqlsupport_part.h +++ b/languages/sql/sqlsupport_part.h @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include "kdevplugin.h" diff --git a/lib/util/CMakeLists.txt b/lib/util/CMakeLists.txt index 1eb17f35..121f85c2 100644 --- a/lib/util/CMakeLists.txt +++ b/lib/util/CMakeLists.txt @@ -30,7 +30,7 @@ install( FILES tde_add_library( kdevutil STATIC_PIC AUTOMOC SOURCES - blockingkprocess.cpp configwidgetproxy.cpp + blockingtdeprocess.cpp configwidgetproxy.cpp domutil.cpp execcommand.cpp filetemplate.cpp kdeveditorutil.cpp kdevjobtimer.cpp kdevshellwidget.cpp tdescriptactionmanager.cpp diff --git a/lib/util/Makefile.am b/lib/util/Makefile.am index 8bf28091..1f457040 100644 --- a/lib/util/Makefile.am +++ b/lib/util/Makefile.am @@ -2,7 +2,7 @@ INCLUDES = -I$(top_srcdir)/lib/compat -I$(top_srcdir)/lib/interfaces -I$(top_s noinst_LTLIBRARIES = libkdevutil.la -libkdevutil_la_SOURCES = blockingkprocess.cpp configwidgetproxy.cpp domutil.cpp \ +libkdevutil_la_SOURCES = blockingtdeprocess.cpp configwidgetproxy.cpp domutil.cpp \ execcommand.cpp filetemplate.cpp kdeveditorutil.cpp kdevjobtimer.cpp \ kdevshellwidget.cpp tdescriptactionmanager.cpp rurl.cpp settings.cpp urlutil.cpp @@ -17,5 +17,5 @@ DOXYGEN_PROJECTNAME = KDevelop Utility Library DOXYGEN_DOCDIRPREFIX = kdev include ../../Doxyfile.am -noinst_HEADERS = blockingkprocess.h kdeveditorutil.h kdevjobtimer.h \ +noinst_HEADERS = blockingtdeprocess.h kdeveditorutil.h kdevjobtimer.h \ kdevshellwidget.h settings.h diff --git a/lib/util/blockingkprocess.cpp b/lib/util/blockingkprocess.cpp deleted file mode 100644 index 0c2b0650..00000000 --- a/lib/util/blockingkprocess.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2006 by Andras Mantia * -* amantia@kde.org * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - -#include "blockingkprocess.h" - -#include -#include - -BlockingTDEProcess::BlockingTDEProcess(TQObject *parent, const char *name) - : TDEProcess(parent, name) -{ - m_stdOut = ""; - m_stdErr = ""; - m_timeoutValue = 60; - m_timer = 0L; - - connect(this, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), - this, TQ_SLOT(slotReceivedStdOut(TDEProcess *, char *, int))); - connect(this, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), - this, TQ_SLOT(slotReceivedStdErr(TDEProcess *, char *, int))); - connect(this, TQ_SIGNAL(processExited(TDEProcess *)), - this, TQ_SLOT(slotProcessExited(TDEProcess *))); -} - -BlockingTDEProcess::BlockingTDEProcess() - : TDEProcess() -{ - m_stdOut = ""; - m_stdErr = ""; - m_timeoutValue = 60; - m_timer = 0L; - connect(this, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), - this, TQ_SLOT(slotReceivedStdOut(TDEProcess *, char *, int))); - connect(this, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), - this, TQ_SLOT(slotReceivedStdErr(TDEProcess *, char *, int))); - connect(this, TQ_SIGNAL(processExited(TDEProcess *)), - this, TQ_SLOT(slotProcessExited(TDEProcess *))); -} - - -BlockingTDEProcess::~BlockingTDEProcess() -{ -} -bool BlockingTDEProcess::start(RunMode runmode, Communication comm) -{ - if (TDEProcess::start(runmode, comm)) - { - m_timeout = false; - m_timer = new TQTimer(); - connect(m_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotTimeOut())); - m_timer->start(m_timeoutValue*1000, true); - enter_loop(); - delete m_timer; - m_timer = 0L; - return !m_timeout; - } else - return false; -} - - -void BlockingTDEProcess::slotReceivedStdOut(TDEProcess *, char *buffer, int buflen) -{ - m_stdOut += TQString::fromLatin1(buffer, buflen); -} - -void BlockingTDEProcess::slotReceivedStdErr(TDEProcess *, char *buffer, int buflen) -{ - m_stdErr += TQString::fromLatin1(buffer, buflen); -} - -void BlockingTDEProcess::slotProcessExited(TDEProcess *) -{ - tqApp->exit_loop(); -} - -void BlockingTDEProcess::slotTimeOut() -{ - m_timeout = true; - kill(); - tqApp->exit_loop(); -} - - -void tqt_enter_modal( TQWidget *widget ); -void tqt_leave_modal( TQWidget *widget ); - -void BlockingTDEProcess::enter_loop() -{ - TQWidget dummy(0,0,WType_Dialog | WShowModal); - dummy.setFocusPolicy( TQWidget::NoFocus ); - tqt_enter_modal(&dummy); - tqApp->enter_loop(); - tqt_leave_modal(&dummy); -} - - -#include "blockingkprocess.moc" diff --git a/lib/util/blockingkprocess.h b/lib/util/blockingkprocess.h deleted file mode 100644 index b5a7e71e..00000000 --- a/lib/util/blockingkprocess.h +++ /dev/null @@ -1,93 +0,0 @@ - -/*************************************************************************** -* Copyright (C) 2006 by Andras Mantia * -* amantia@kde.org * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -* * -***************************************************************************/ - - -#ifndef BLOCKINGKPROCESS_H -#define BLOCKINGKPROCESS_H - -#include - -/** - * Blocking version of TDEProcess, which stores the stdout. - * Differences between start(TDEProcess::Block, TDEProcess::StdOut) and this - * class are: - * - the GUI update is not blocked why the external process is running - * - in case of problems there is a timeout (defaults to 60 seconds), after which the - * process is terminated. - * - the stdout is caught - it the caller request it - and can be read by the caller - * @author Andras Mantia -*/ - -class TQTimer; -class BlockingTDEProcess : public TDEProcess -{ - TQ_OBJECT - - -public: - BlockingTDEProcess(TQObject *parent, const char *name=0); - BlockingTDEProcess(); - - virtual ~BlockingTDEProcess(); - - /** - * Start the process. It waits until the process exits or the timeout is hit. - * @param runmode @see TDEProcess, use TDEProcess::NotifyOnExit to get proper behaviour, - * not TDEProcess::Block - * @param comm if Stdout is passed, it catches the output. For the rest @see TDEProcess - * @return true in case of success, false if there are problems to start the process - * or it was killed because of the timeout. - */ - virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication); - - /** - * Get the output of the run process - * @return the output - */ - TQString stdOut() { return m_stdOut;} - /** - * Clear the internal stdout buffer. Useful in case the class is reused. - */ - void clearStdOut() { m_stdOut = "";} - /** - * Get the error output of the run process - * @return the output - */ - TQString stdErr() { return m_stdErr;} - /** - * Clear the internal stderr buffer. Useful in case the class is reused. - */ - void clearStdErr() { m_stdErr = "";} - - /** - * Sets the timeout - * @param timeout seconds after which the process is considered hung and killed. 0 disables the timeout. - */ - void setTimeOut(int timeout) { m_timeoutValue = timeout; } - -private slots: - void slotReceivedStdOut(TDEProcess *proc, char *buffer, int buflen); - void slotReceivedStdErr(TDEProcess *proc, char *buffer, int buflen); - void slotProcessExited(TDEProcess *proc); - void slotTimeOut(); - -private: - void enter_loop(); - - TQString m_stdOut; - TQString m_stdErr; - bool m_timeout; - int m_timeoutValue; - TQTimer *m_timer; -}; - -#endif diff --git a/lib/util/blockingtdeprocess.cpp b/lib/util/blockingtdeprocess.cpp new file mode 100644 index 00000000..f57ae77d --- /dev/null +++ b/lib/util/blockingtdeprocess.cpp @@ -0,0 +1,105 @@ +/*************************************************************************** +* Copyright (C) 2006 by Andras Mantia * +* amantia@kde.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + +#include "blockingtdeprocess.h" + +#include +#include + +BlockingTDEProcess::BlockingTDEProcess(TQObject *parent, const char *name) + : TDEProcess(parent, name) +{ + m_stdOut = ""; + m_stdErr = ""; + m_timeoutValue = 60; + m_timer = 0L; + + connect(this, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), + this, TQ_SLOT(slotReceivedStdOut(TDEProcess *, char *, int))); + connect(this, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), + this, TQ_SLOT(slotReceivedStdErr(TDEProcess *, char *, int))); + connect(this, TQ_SIGNAL(processExited(TDEProcess *)), + this, TQ_SLOT(slotProcessExited(TDEProcess *))); +} + +BlockingTDEProcess::BlockingTDEProcess() + : TDEProcess() +{ + m_stdOut = ""; + m_stdErr = ""; + m_timeoutValue = 60; + m_timer = 0L; + connect(this, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), + this, TQ_SLOT(slotReceivedStdOut(TDEProcess *, char *, int))); + connect(this, TQ_SIGNAL(receivedStderr(TDEProcess *, char *, int)), + this, TQ_SLOT(slotReceivedStdErr(TDEProcess *, char *, int))); + connect(this, TQ_SIGNAL(processExited(TDEProcess *)), + this, TQ_SLOT(slotProcessExited(TDEProcess *))); +} + + +BlockingTDEProcess::~BlockingTDEProcess() +{ +} +bool BlockingTDEProcess::start(RunMode runmode, Communication comm) +{ + if (TDEProcess::start(runmode, comm)) + { + m_timeout = false; + m_timer = new TQTimer(); + connect(m_timer, TQ_SIGNAL(timeout()), this, TQ_SLOT(slotTimeOut())); + m_timer->start(m_timeoutValue*1000, true); + enter_loop(); + delete m_timer; + m_timer = 0L; + return !m_timeout; + } else + return false; +} + + +void BlockingTDEProcess::slotReceivedStdOut(TDEProcess *, char *buffer, int buflen) +{ + m_stdOut += TQString::fromLatin1(buffer, buflen); +} + +void BlockingTDEProcess::slotReceivedStdErr(TDEProcess *, char *buffer, int buflen) +{ + m_stdErr += TQString::fromLatin1(buffer, buflen); +} + +void BlockingTDEProcess::slotProcessExited(TDEProcess *) +{ + tqApp->exit_loop(); +} + +void BlockingTDEProcess::slotTimeOut() +{ + m_timeout = true; + kill(); + tqApp->exit_loop(); +} + + +void tqt_enter_modal( TQWidget *widget ); +void tqt_leave_modal( TQWidget *widget ); + +void BlockingTDEProcess::enter_loop() +{ + TQWidget dummy(0,0,WType_Dialog | WShowModal); + dummy.setFocusPolicy( TQWidget::NoFocus ); + tqt_enter_modal(&dummy); + tqApp->enter_loop(); + tqt_leave_modal(&dummy); +} + + +#include "blockingtdeprocess.moc" diff --git a/lib/util/blockingtdeprocess.h b/lib/util/blockingtdeprocess.h new file mode 100644 index 00000000..2252f59f --- /dev/null +++ b/lib/util/blockingtdeprocess.h @@ -0,0 +1,93 @@ + +/*************************************************************************** +* Copyright (C) 2006 by Andras Mantia * +* amantia@kde.org * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +***************************************************************************/ + + +#ifndef BLOCKINGTDEPROCESS_H +#define BLOCKINGTDEPROCESS_H + +#include + +/** + * Blocking version of TDEProcess, which stores the stdout. + * Differences between start(TDEProcess::Block, TDEProcess::StdOut) and this + * class are: + * - the GUI update is not blocked why the external process is running + * - in case of problems there is a timeout (defaults to 60 seconds), after which the + * process is terminated. + * - the stdout is caught - it the caller request it - and can be read by the caller + * @author Andras Mantia +*/ + +class TQTimer; +class BlockingTDEProcess : public TDEProcess +{ + TQ_OBJECT + + +public: + BlockingTDEProcess(TQObject *parent, const char *name=0); + BlockingTDEProcess(); + + virtual ~BlockingTDEProcess(); + + /** + * Start the process. It waits until the process exits or the timeout is hit. + * @param runmode @see TDEProcess, use TDEProcess::NotifyOnExit to get proper behaviour, + * not TDEProcess::Block + * @param comm if Stdout is passed, it catches the output. For the rest @see TDEProcess + * @return true in case of success, false if there are problems to start the process + * or it was killed because of the timeout. + */ + virtual bool start(RunMode runmode=NotifyOnExit, Communication comm=NoCommunication); + + /** + * Get the output of the run process + * @return the output + */ + TQString stdOut() { return m_stdOut;} + /** + * Clear the internal stdout buffer. Useful in case the class is reused. + */ + void clearStdOut() { m_stdOut = "";} + /** + * Get the error output of the run process + * @return the output + */ + TQString stdErr() { return m_stdErr;} + /** + * Clear the internal stderr buffer. Useful in case the class is reused. + */ + void clearStdErr() { m_stdErr = "";} + + /** + * Sets the timeout + * @param timeout seconds after which the process is considered hung and killed. 0 disables the timeout. + */ + void setTimeOut(int timeout) { m_timeoutValue = timeout; } + +private slots: + void slotReceivedStdOut(TDEProcess *proc, char *buffer, int buflen); + void slotReceivedStdErr(TDEProcess *proc, char *buffer, int buflen); + void slotProcessExited(TDEProcess *proc); + void slotTimeOut(); + +private: + void enter_loop(); + + TQString m_stdOut; + TQString m_stdErr; + bool m_timeout; + int m_timeoutValue; + TQTimer *m_timer; +}; + +#endif diff --git a/lib/util/execcommand.cpp b/lib/util/execcommand.cpp index 6fb0f40c..0f6c7387 100644 --- a/lib/util/execcommand.cpp +++ b/lib/util/execcommand.cpp @@ -19,7 +19,7 @@ #include "execcommand.h" -#include +#include #include #include #include diff --git a/lib/util/kdevshellwidget.cpp b/lib/util/kdevshellwidget.cpp index 1db1b7e1..8cf5e265 100644 --- a/lib/util/kdevshellwidget.cpp +++ b/lib/util/kdevshellwidget.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "kdevshellwidget.h" diff --git a/lib/widgets/processlinemaker.cpp b/lib/widgets/processlinemaker.cpp index be881aa3..40ddf6c1 100644 --- a/lib/widgets/processlinemaker.cpp +++ b/lib/widgets/processlinemaker.cpp @@ -20,7 +20,7 @@ #include "processlinemaker.h" #include "processlinemaker.moc" -#include +#include ProcessLineMaker::ProcessLineMaker() { diff --git a/lib/widgets/processwidget.cpp b/lib/widgets/processwidget.cpp index 7d8a4d3b..8e32c5df 100644 --- a/lib/widgets/processwidget.cpp +++ b/lib/widgets/processwidget.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/lib/widgets/processwidget.h b/lib/widgets/processwidget.h index a80f3deb..d1c7676a 100644 --- a/lib/widgets/processwidget.h +++ b/lib/widgets/processwidget.h @@ -21,7 +21,7 @@ #define _PROCESSWIDGET_H_ #include -#include +#include /** @file processwidget.h diff --git a/parts/appwizard/appwizarddlg.cpp b/parts/appwizard/appwizarddlg.cpp index 76e33693..8787ea45 100644 --- a/parts/appwizard/appwizarddlg.cpp +++ b/parts/appwizard/appwizarddlg.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include @@ -80,7 +80,7 @@ #include "filetemplate.h" #include "settings.h" -#include "blockingkprocess.h" +#include "blockingtdeprocess.h" #include "profileengine.h" #include "profile.h" diff --git a/parts/appwizard/appwizardpart.cpp b/parts/appwizard/appwizardpart.cpp index dfdfc14a..7ba86a35 100644 --- a/parts/appwizard/appwizardpart.cpp +++ b/parts/appwizard/appwizardpart.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/appwizard/importdlg.cpp b/parts/appwizard/importdlg.cpp index 3a2c7c11..a8170173 100644 --- a/parts/appwizard/importdlg.cpp +++ b/parts/appwizard/importdlg.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include "kdevcore.h" #include "kdevversioncontrol.h" diff --git a/parts/classview/digraphview.cpp b/parts/classview/digraphview.cpp index 1e3fa8e0..2865f546 100644 --- a/parts/classview/digraphview.cpp +++ b/parts/classview/digraphview.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/ctags2/ctags2_part.cpp b/parts/ctags2/ctags2_part.cpp index 3e53b66c..05ade367 100644 --- a/parts/ctags2/ctags2_part.cpp +++ b/parts/ctags2/ctags2_part.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/diff/diffpart.cpp b/parts/diff/diffpart.cpp index 62fd20b2..480a2da5 100644 --- a/parts/diff/diffpart.cpp +++ b/parts/diff/diffpart.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/distpart/distpart_widget.cpp b/parts/distpart/distpart_widget.cpp index 48f90f31..0e583af3 100644 --- a/parts/distpart/distpart_widget.cpp +++ b/parts/distpart/distpart_widget.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/distpart/specsupport.cpp b/parts/distpart/specsupport.cpp index 1698b68b..8845744d 100644 --- a/parts/distpart/specsupport.cpp +++ b/parts/distpart/specsupport.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/documentation/docglobalconfigwidget.cpp b/parts/documentation/docglobalconfigwidget.cpp index 8cfacada..9822829b 100644 --- a/parts/documentation/docglobalconfigwidget.cpp +++ b/parts/documentation/docglobalconfigwidget.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/parts/documentation/find_documentation.cpp b/parts/documentation/find_documentation.cpp index 46027878..72563413 100644 --- a/parts/documentation/find_documentation.cpp +++ b/parts/documentation/find_documentation.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/parts/documentation/searchview.cpp b/parts/documentation/searchview.cpp index 49e9d425..b0496f03 100644 --- a/parts/documentation/searchview.cpp +++ b/parts/documentation/searchview.cpp @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include #include @@ -188,7 +188,7 @@ void SearchView::search() .arg("builtin-short") .arg(m_sortMethodBox->currentItem()==2? "date" : m_sortMethodBox->currentItem()==1? "title" : "score"); - kdDebug(9002) << "starting kprocess" << endl; + kdDebug(9002) << "starting tdeprocess" << endl; kdDebug(9002) << "htdig line:" << exe << " -c " << (indexdir + "/htdig.conf ") << query << endl; TDEProcess *proc = new TDEProcess; TQString picdir = kapp->dirs()->findResourceDir("data", "kdevdocumentation/pics/htdig.png"); diff --git a/parts/documentation/tools/htdig/htdigindex.cpp b/parts/documentation/tools/htdig/htdigindex.cpp index 109b36e8..ce02d6bc 100644 --- a/parts/documentation/tools/htdig/htdigindex.cpp +++ b/parts/documentation/tools/htdig/htdigindex.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/parts/doxygen/doxygenpart.h b/parts/doxygen/doxygenpart.h index 47d215ca..ea734510 100644 --- a/parts/doxygen/doxygenpart.h +++ b/parts/doxygen/doxygenpart.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff --git a/parts/filter/shellfilterdlg.cpp b/parts/filter/shellfilterdlg.cpp index 967f09a4..007e58f6 100644 --- a/parts/filter/shellfilterdlg.cpp +++ b/parts/filter/shellfilterdlg.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/parts/filter/shellinsertdlg.cpp b/parts/filter/shellinsertdlg.cpp index a379ec53..d75f6895 100644 --- a/parts/filter/shellinsertdlg.cpp +++ b/parts/filter/shellinsertdlg.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/grepview/grepviewpart.cpp b/parts/grepview/grepviewpart.cpp index 2d67bdb2..a2a60aff 100644 --- a/parts/grepview/grepviewpart.cpp +++ b/parts/grepview/grepviewpart.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/parts/grepview/grepviewwidget.cpp b/parts/grepview/grepviewwidget.cpp index d6c67cc0..be4c8dc9 100644 --- a/parts/grepview/grepviewwidget.cpp +++ b/parts/grepview/grepviewwidget.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/outputviews/makewidget.cpp b/parts/outputviews/makewidget.cpp index 2d8c9214..c1527a76 100644 --- a/parts/outputviews/makewidget.cpp +++ b/parts/outputviews/makewidget.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/parts/tools/tools_part.cpp b/parts/tools/tools_part.cpp index 94c3d2fa..9781f1b1 100644 --- a/parts/tools/tools_part.cpp +++ b/parts/tools/tools_part.cpp @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include "kdevcore.h" diff --git a/parts/valgrind/valgrind_dialog.cpp b/parts/valgrind/valgrind_dialog.cpp index 3770f5d6..151eb277 100644 --- a/parts/valgrind/valgrind_dialog.cpp +++ b/parts/valgrind/valgrind_dialog.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/parts/valgrind/valgrind_part.cpp b/parts/valgrind/valgrind_part.cpp index 0b984575..b857ee53 100644 --- a/parts/valgrind/valgrind_part.cpp +++ b/parts/valgrind/valgrind_part.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/projectmanager.cpp b/src/projectmanager.cpp index adebaee4..d94e5d71 100644 --- a/src/projectmanager.cpp +++ b/src/projectmanager.cpp @@ -21,7 +21,7 @@ class TQDomDocument; #include #include #include -#include +#include #include #include #include diff --git a/vcs/clearcase/clearcasefileinfoprovider.cpp b/vcs/clearcase/clearcasefileinfoprovider.cpp index dceb9b9e..aa311518 100644 --- a/vcs/clearcase/clearcasefileinfoprovider.cpp +++ b/vcs/clearcase/clearcasefileinfoprovider.cpp @@ -13,7 +13,7 @@ #include "clearcasepart.h" #include "kdevversioncontrol.h" -#include +#include #include ClearcaseFileinfoProvider::ClearcaseFileinfoProvider(ClearcasePart *parent) diff --git a/vcs/clearcase/clearcasemanipulator.cpp b/vcs/clearcase/clearcasemanipulator.cpp index 65f05c4e..54ad4faf 100644 --- a/vcs/clearcase/clearcasemanipulator.cpp +++ b/vcs/clearcase/clearcasemanipulator.cpp @@ -12,7 +12,7 @@ #include "config.h" #include "clearcasemanipulator.h" -#include +#include #include #include diff --git a/vcs/clearcase/clearcasemanipulator.h b/vcs/clearcase/clearcasemanipulator.h index 0cb795e3..276938f8 100644 --- a/vcs/clearcase/clearcasemanipulator.h +++ b/vcs/clearcase/clearcasemanipulator.h @@ -14,7 +14,7 @@ #include "kdevversioncontrol.h" -#include +#include #include diff --git a/vcs/clearcase/clearcasepart.cpp b/vcs/clearcase/clearcasepart.cpp index 700de36b..2f3017a5 100644 --- a/vcs/clearcase/clearcasepart.cpp +++ b/vcs/clearcase/clearcasepart.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/vcs/cvsservice/cvspart.cpp b/vcs/cvsservice/cvspart.cpp index ca7c26ab..47e1bd68 100644 --- a/vcs/cvsservice/cvspart.cpp +++ b/vcs/cvsservice/cvspart.cpp @@ -28,7 +28,7 @@ #include #include // Because of KShellProcess::quote() -#include +#include #include #include diff --git a/vcs/cvsservice/cvspartimpl.cpp b/vcs/cvsservice/cvspartimpl.cpp index 28203e91..26d3fbd2 100644 --- a/vcs/cvsservice/cvspartimpl.cpp +++ b/vcs/cvsservice/cvspartimpl.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcs/cvsservice/integrator/integratordlg.cpp b/vcs/cvsservice/integrator/integratordlg.cpp index e44ed9e7..b2605bf7 100644 --- a/vcs/cvsservice/integrator/integratordlg.cpp +++ b/vcs/cvsservice/integrator/integratordlg.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcs/perforce/commitdlg.cpp b/vcs/perforce/commitdlg.cpp index f343d9a8..daa882d4 100644 --- a/vcs/perforce/commitdlg.cpp +++ b/vcs/perforce/commitdlg.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcs/perforce/perforcepart.cpp b/vcs/perforce/perforcepart.cpp index 8d7975e8..e3229fb6 100644 --- a/vcs/perforce/perforcepart.cpp +++ b/vcs/perforce/perforcepart.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcs/subversion/integrator/svnintegratordlg.cpp b/vcs/subversion/integrator/svnintegratordlg.cpp index 87ccf488..468170b9 100644 --- a/vcs/subversion/integrator/svnintegratordlg.cpp +++ b/vcs/subversion/integrator/svnintegratordlg.cpp @@ -20,7 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "svnintegratordlg.h" -#include "blockingkprocess.h" +#include "blockingtdeprocess.h" #include #include #include @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/vcs/subversion/subversion_core.cpp b/vcs/subversion/subversion_core.cpp index c0a97129..3d096421 100644 --- a/vcs/subversion/subversion_core.cpp +++ b/vcs/subversion/subversion_core.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include -- cgit v1.2.1