From 642c256d47aef772f1ca802894dcced70404a81b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 27 Jan 2013 21:04:37 -0600 Subject: Rename kiobuffer and KHTML --- cmake | 2 +- kapptemplate/README | 2 +- kapptemplate/kpartplugin/plugin-Makefile.am | 8 +- kapptemplate/kpartplugin/plugin_app.cpp | 6 +- kbugbuster/Makefile.am | 2 +- kbugbuster/gui/README | 2 +- kbugbuster/gui/cwbugdetails.cpp | 2 +- kbugbuster/gui/cwbugdetails.h | 4 +- tdeioslave/svn/svnhelper/kio_svn_helper.cpp | 292 -------------------------- tdeioslave/svn/svnhelper/kio_svn_helper.h | 42 ---- tdeioslave/svn/svnhelper/tdeio_svn_helper.cpp | 292 ++++++++++++++++++++++++++ tdeioslave/svn/svnhelper/tdeio_svn_helper.h | 42 ++++ 12 files changed, 348 insertions(+), 348 deletions(-) delete mode 100644 tdeioslave/svn/svnhelper/kio_svn_helper.cpp delete mode 100644 tdeioslave/svn/svnhelper/kio_svn_helper.h create mode 100644 tdeioslave/svn/svnhelper/tdeio_svn_helper.cpp create mode 100644 tdeioslave/svn/svnhelper/tdeio_svn_helper.h diff --git a/cmake b/cmake index 9a217903..274366fb 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 9a217903f9fa35ca12213a6e9ee3d2cb87d1131d +Subproject commit 274366fb8b90704586d7beef216b765cc0688b08 diff --git a/kapptemplate/README b/kapptemplate/README index d48a2a3d..eb20be57 100644 --- a/kapptemplate/README +++ b/kapptemplate/README @@ -23,7 +23,7 @@ Currently, KAppTemplate creates four different types of frameworks: 3) KPart plugin - This creates a sample KPart plugin that acts on KHTMLPart + This creates a sample KPart plugin that acts on TDEHTMLPart 4) Existing application conversion diff --git a/kapptemplate/kpartplugin/plugin-Makefile.am b/kapptemplate/kpartplugin/plugin-Makefile.am index 21b5ccdd..7c01ef75 100644 --- a/kapptemplate/kpartplugin/plugin-Makefile.am +++ b/kapptemplate/kpartplugin/plugin-Makefile.am @@ -8,13 +8,13 @@ KDE_ICON = ${APP_NAME_LC} # Install this plugin in the KDE modules directory kde_module_LTLIBRARIES = lib${APP_NAME_LC}plugin.la -# This is all standard. Remove the LIB_KHTML reference if you are not -# using the KHTML Part +# This is all standard. Remove the LIB_TDEHTML reference if you are not +# using the TDEHTML Part lib${APP_NAME_LC}plugin_la_SOURCES = plugin_${APP_NAME_LC}.cpp -lib${APP_NAME_LC}plugin_la_LIBADD = \$(LIB_KPARTS) \$(LIB_KHTML) +lib${APP_NAME_LC}plugin_la_LIBADD = \$(LIB_KPARTS) \$(LIB_TDEHTML) lib${APP_NAME_LC}plugin_la_LDFLAGS = -module \$(KDE_PLUGIN) \$(all_libraries) # Install the .rc file in the Part's directory (in this case, the part -# is KHTMLPart) +# is TDEHTMLPart) pluginsdir = \$(kde_datadir)/tdehtml/kpartplugins plugins_DATA = plugin_${APP_NAME_LC}.rc diff --git a/kapptemplate/kpartplugin/plugin_app.cpp b/kapptemplate/kpartplugin/plugin_app.cpp index 98a44cad..29388b46 100644 --- a/kapptemplate/kpartplugin/plugin_app.cpp +++ b/kapptemplate/kpartplugin/plugin_app.cpp @@ -30,10 +30,10 @@ Plugin${APP_NAME}::~Plugin${APP_NAME}() void Plugin${APP_NAME}::slotAction() { - // This plugin assumes KHTMLPart. If your plugin can handle more + // This plugin assumes TDEHTMLPart. If your plugin can handle more // than this or a different Part than this, simply delete or // change the following block. - if ( !parent()->inherits("KHTMLPart") ) + if ( !parent()->inherits("TDEHTMLPart") ) { TQString title( i18n( "Cannot Translate Source" ) ); TQString text( i18n( "You cannot translate anything except web pages " @@ -45,7 +45,7 @@ void Plugin${APP_NAME}::slotAction() // Get a handle on our parent so we may get the necessary data for // processing - KHTMLPart *part = dynamic_cast(parent()); + TDEHTMLPart *part = dynamic_cast(parent()); // This plugin only uses the URL. You may use whatever data you // need. diff --git a/kbugbuster/Makefile.am b/kbugbuster/Makefile.am index 727c0b69..f1e6939d 100644 --- a/kbugbuster/Makefile.am +++ b/kbugbuster/Makefile.am @@ -11,7 +11,7 @@ bin_PROGRAMS = kbugbuster kbugbuster_SOURCES = main.cpp kbugbuster_LDADD = -ltdeutils gui/libkbbmainwindow.la \ - backend/libkbbbackend.la $(LIB_KHTML) $(LIB_KIO) -ltdefx $(LIB_KUTILS) + backend/libkbbbackend.la $(LIB_TDEHTML) $(LIB_KIO) -ltdefx $(LIB_KUTILS) kbugbuster_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor $(LIB_KUTILS) xdg_apps_DATA = kbugbuster.desktop diff --git a/kbugbuster/gui/README b/kbugbuster/gui/README index 54e5fa67..6f28720f 100644 --- a/kbugbuster/gui/README +++ b/kbugbuster/gui/README @@ -15,7 +15,7 @@ Widgets, including a Qt designer .ui file: centralwidget* The main widget of kbbmainwindow cwbuglistcontainer* The widget containing the bug list (top of central widget) cwbugdetailscontainer* The widget containing the bug details + the buttons in its right (bottom of central widget). -cwbugdetails* The widget showing details of a bug report, using KHTMLPart +cwbugdetails* The widget showing details of a bug report, using TDEHTMLPart cwsearchwidget* A future search widget on the left of the bug details. Same functionality is in the menus, this would take too much screen space IMHO (DF) preferencesdialog* Preferences dialog diff --git a/kbugbuster/gui/cwbugdetails.cpp b/kbugbuster/gui/cwbugdetails.cpp index 0ab78ff2..1c6fa6c5 100644 --- a/kbugbuster/gui/cwbugdetails.cpp +++ b/kbugbuster/gui/cwbugdetails.cpp @@ -40,7 +40,7 @@ CWBugDetails::CWBugDetails( TQWidget *parent , const char * name ) { TQBoxLayout *topLayout = new TQVBoxLayout( this ); - m_bugDesc = new KHTMLPart( this, "m_bugDesc" ); + m_bugDesc = new TDEHTMLPart( this, "m_bugDesc" ); connect( m_bugDesc->browserExtension(), TQT_SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), this, TQT_SLOT( handleOpenURLRequest( const KURL &, const KParts::URLArgs & ) ) ); diff --git a/kbugbuster/gui/cwbugdetails.h b/kbugbuster/gui/cwbugdetails.h index 5067b953..e6388f2f 100644 --- a/kbugbuster/gui/cwbugdetails.h +++ b/kbugbuster/gui/cwbugdetails.h @@ -24,7 +24,7 @@ #include -class KHTMLPart; +class TDEHTMLPart; namespace KBugBusterMainWindow { @@ -53,7 +53,7 @@ class CWBugDetails : public TQWidget TQString textBugDetailsAttribute( const TQString &value, const TQString &name ); - KHTMLPart *m_bugDesc; + TDEHTMLPart *m_bugDesc; TQString mSource; }; diff --git a/tdeioslave/svn/svnhelper/kio_svn_helper.cpp b/tdeioslave/svn/svnhelper/kio_svn_helper.cpp deleted file mode 100644 index eba0634a..00000000 --- a/tdeioslave/svn/svnhelper/kio_svn_helper.cpp +++ /dev/null @@ -1,292 +0,0 @@ -/* This file is part of the KDE project - Copyright (c) 2005 Mickael Marchand - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "tdeio_svn_helper.h" -#include "subversioncheckout.h" -#include "subversionswitch.h" -#include "subversiondiff.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include - -SvnHelper::SvnHelper():TDEApplication() { - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - KWinModule wm ( TQT_TQOBJECT(this) ); - m_id = wm.activeWindow(); - - KURL::List list; - for ( int i = 0 ; i < args->count() ; i++ ) - list << args->url(i); - - if (args->isSet("u")) { - kdDebug(7128) << "update " << list << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - //FIXME when 1.2 is out (move the loop inside tdeio_svn's ::update) - for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 2; - int rev = -1; - kdDebug(7128) << "updating : " << (*it).prettyURL() << endl; - s << cmd << *it << rev << TQString( "HEAD" ); - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } - } else if (args->isSet("c")) { - kdDebug(7128) << "commit " << list << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 3; - s< it = list.begin(); it != list.end() ; ++it ) { - kdDebug(7128) << "commiting : " << (*it).prettyURL() << endl; - s << *it; - } - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } else if (args->isSet("a")) { - kdDebug(7128) << "add " << list << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 6; - kdDebug(7128) << "adding : " << (*it).prettyURL() << endl; - s << cmd << *it; - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } - } else if (args->isSet("D")) { - kdDebug(7128) << "diff " << list << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 13; - kdDebug(7128) << "diffing : " << (*it).prettyURL() << endl; - int rev1=-1; - int rev2=-1; - TQString revkind1 = "BASE"; - TQString revkind2 = "WORKING"; - s << cmd << *it << *it << rev1 << revkind1 << rev2 << revkind2 << true ; - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - if ( diffresult.count() > 0 ) { - //check kompare is available - if ( !KStandardDirs::findExe( "kompare" ).isNull() ) { - KTempFile *tmp = new KTempFile; - tmp->setAutoDelete(true); - TQTextStream *stream = tmp->textStream(); - stream->setCodec( TQTextCodec::codecForName( "utf8" ) ); - for ( TQStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) { - ( *stream ) << ( *it2 ) << "\n"; - } - tmp->close(); - TDEProcess *p = new TDEProcess; - *p << "kompare" << "-n" << "-o" << tmp->name(); - p->start(); - } else { //else do it with message box - Subversion_Diff df; - for ( TQStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) { - df.text->append( *it2 ); - } - TQFont f = df.font(); - f.setFixedPitch( true ); - df.text->setFont( f ); - df.exec(); - } - } - diffresult.clear(); - } - } else if (args->isSet("d")) { - kdDebug(7128) << "delete " << list << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 7; - s< it = list.begin(); it != list.end() ; ++it ) { - kdDebug(7128) << "deleting : " << (*it).prettyURL() << endl; - s << *it; - } - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } else if (args->isSet("s")) { - kdDebug(7128) << "switch " << list << endl; - SubversionSwitch d; - int result = d.exec(); - if ( result == TQDialog::Accepted ) { - for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { - kdDebug(7128) << "switching : " << (*it).prettyURL() << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int revnumber = -1; - TQString revkind = "HEAD"; - if ( d.revision->value() != 0 ) { - revnumber = d.revision->value(); - revkind = ""; - } - bool recurse=true; - int cmd = 12; - s << cmd; - s << *it; - s << KURL( d.url->url() ); - s << recurse; - s << revnumber; - s << revkind; - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } - } - } else if (args->isSet("r")) { - kdDebug(7128) << "revert " << list << endl; - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 8; - s< it = list.begin(); it != list.end() ; ++it ) { - kdDebug(7128) << "reverting : " << (*it).prettyURL() << endl; - s << *it; - } - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } else if (args->isSet("C")) { - kdDebug(7128) << "checkout " << list << endl; - SubversionCheckout d; - int result = d.exec(); - if ( result == TQDialog::Accepted ) { - for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { - KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; - TQByteArray parms; - TQDataStream s( parms, IO_WriteOnly ); - int cmd = 1; - int rev = -1; - TQString revkind = "HEAD"; - if ( d.revision->value() != 0 ) { - rev = d.revision->value(); - revkind = ""; - } - s<url() ); - s << ( *it ); - s << rev; - s << revkind; - kdDebug(7128) << "checkouting : " << d.url->url() << " into " << (*it).prettyURL() << " at rev : " << rev << " or " << revkind << endl; - TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); - connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); - TDEIO::NetAccess::synchronousRun( job, 0 ); - } - } - } else { - KMessageBox::sorry(0, "Sorry, request not recognised. Perhaps not implemented yet?", "Feature Not Implemented"); - } - TQTimer::singleShot( 0, this, TQT_SLOT( finished() ) ); -} - -void SvnHelper::slotResult( TDEIO::Job* job ) { - if ( job->error() ) - job->showErrorDialog( ); - - TDEIO::MetaData ma = job->metaData(); - TQValueList keys = ma.keys(); - qHeapSort( keys ); - TQValueList::Iterator begin = keys.begin(), end = keys.end(), it; - - TQStringList message; - for ( it = begin; it != end; ++it ) { - // kdDebug(7128) << "METADATA helper : " << *it << ":" << ma[ *it ] << endl; - if ( ( *it ).endsWith( "string" ) ) { - if ( ma[ *it ].length() > 2 ) { - message << ma[ *it ]; - } - } - //extra check to retrieve the diff output in case with run a diff command - if ( ( *it ).endsWith( "diffresult" ) ) { - diffresult << ma[ *it ]; - } - } - if ( message.count() > 0 ) - KMessageBox::informationListWId(m_id, "", message, "Subversion"); -} - -void SvnHelper::finished() { - kapp->quit(); -} - -static KCmdLineOptions options[] = { - { "u", I18N_NOOP("Update given URL"), 0 }, - { "c", I18N_NOOP("Commit given URL"), 0 }, - { "C", I18N_NOOP("Checkout in given directory"), 0 }, - { "a", I18N_NOOP("Add given URL to the working copy"), 0 }, - { "d", I18N_NOOP("Delete given URL from the working copy"), 0 }, - { "s", I18N_NOOP("Switch given working copy to another branch"), 0 }, - { "r", I18N_NOOP("Revert local changes"), 0 }, - { "m", I18N_NOOP("Merge changes between two branches"), 0 }, - { "D", I18N_NOOP("Show locally made changements with diff"), 0 }, - {"!+URL", I18N_NOOP("URL to update/commit/add/delete from Subversion"), 0 }, - KCmdLineLastOption -}; - -int main(int argc, char **argv) { - TDECmdLineArgs::init(argc, argv, "tdeio_svn_helper", I18N_NOOP("Subversion Helper"), "TDE frontend for SVN", "0.1"); - - TDECmdLineArgs::addCmdLineOptions( options ); - TDEGlobal::locale()->setMainCatalogue("tdeio_svn"); - TDEApplication::addCmdLineOptions(); - - if ( TDECmdLineArgs::parsedArgs()->count()==0 ) - TDECmdLineArgs::usage(); - TDEApplication *app = new SvnHelper(); - -// app->dcopClient()->attach(); - app->exec(); -} - -#include "tdeio_svn_helper.moc" diff --git a/tdeioslave/svn/svnhelper/kio_svn_helper.h b/tdeioslave/svn/svnhelper/kio_svn_helper.h deleted file mode 100644 index 197d7c81..00000000 --- a/tdeioslave/svn/svnhelper/kio_svn_helper.h +++ /dev/null @@ -1,42 +0,0 @@ -/* This file is part of the KDE project - Copyright (c) 2005 Mickael Marchand - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef _KIO_SVN_HELPER_H_ -#define _KIO_SVN_HELPER_H_ - -#include -#include -#include -#include - -class SvnHelper:public TDEApplication { - Q_OBJECT - - -public: - SvnHelper(); -private slots: - void finished(); - void slotResult( TDEIO::Job *); -private: - WId m_id; - TQStringList diffresult; //for diff commands ;) -}; - -#endif diff --git a/tdeioslave/svn/svnhelper/tdeio_svn_helper.cpp b/tdeioslave/svn/svnhelper/tdeio_svn_helper.cpp new file mode 100644 index 00000000..eba0634a --- /dev/null +++ b/tdeioslave/svn/svnhelper/tdeio_svn_helper.cpp @@ -0,0 +1,292 @@ +/* This file is part of the KDE project + Copyright (c) 2005 Mickael Marchand + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tdeio_svn_helper.h" +#include "subversioncheckout.h" +#include "subversionswitch.h" +#include "subversiondiff.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +SvnHelper::SvnHelper():TDEApplication() { + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + KWinModule wm ( TQT_TQOBJECT(this) ); + m_id = wm.activeWindow(); + + KURL::List list; + for ( int i = 0 ; i < args->count() ; i++ ) + list << args->url(i); + + if (args->isSet("u")) { + kdDebug(7128) << "update " << list << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + //FIXME when 1.2 is out (move the loop inside tdeio_svn's ::update) + for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 2; + int rev = -1; + kdDebug(7128) << "updating : " << (*it).prettyURL() << endl; + s << cmd << *it << rev << TQString( "HEAD" ); + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } + } else if (args->isSet("c")) { + kdDebug(7128) << "commit " << list << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 3; + s< it = list.begin(); it != list.end() ; ++it ) { + kdDebug(7128) << "commiting : " << (*it).prettyURL() << endl; + s << *it; + } + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } else if (args->isSet("a")) { + kdDebug(7128) << "add " << list << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 6; + kdDebug(7128) << "adding : " << (*it).prettyURL() << endl; + s << cmd << *it; + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } + } else if (args->isSet("D")) { + kdDebug(7128) << "diff " << list << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 13; + kdDebug(7128) << "diffing : " << (*it).prettyURL() << endl; + int rev1=-1; + int rev2=-1; + TQString revkind1 = "BASE"; + TQString revkind2 = "WORKING"; + s << cmd << *it << *it << rev1 << revkind1 << rev2 << revkind2 << true ; + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + if ( diffresult.count() > 0 ) { + //check kompare is available + if ( !KStandardDirs::findExe( "kompare" ).isNull() ) { + KTempFile *tmp = new KTempFile; + tmp->setAutoDelete(true); + TQTextStream *stream = tmp->textStream(); + stream->setCodec( TQTextCodec::codecForName( "utf8" ) ); + for ( TQStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) { + ( *stream ) << ( *it2 ) << "\n"; + } + tmp->close(); + TDEProcess *p = new TDEProcess; + *p << "kompare" << "-n" << "-o" << tmp->name(); + p->start(); + } else { //else do it with message box + Subversion_Diff df; + for ( TQStringList::Iterator it2 = diffresult.begin();it2 != diffresult.end() ; ++it2 ) { + df.text->append( *it2 ); + } + TQFont f = df.font(); + f.setFixedPitch( true ); + df.text->setFont( f ); + df.exec(); + } + } + diffresult.clear(); + } + } else if (args->isSet("d")) { + kdDebug(7128) << "delete " << list << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 7; + s< it = list.begin(); it != list.end() ; ++it ) { + kdDebug(7128) << "deleting : " << (*it).prettyURL() << endl; + s << *it; + } + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } else if (args->isSet("s")) { + kdDebug(7128) << "switch " << list << endl; + SubversionSwitch d; + int result = d.exec(); + if ( result == TQDialog::Accepted ) { + for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { + kdDebug(7128) << "switching : " << (*it).prettyURL() << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int revnumber = -1; + TQString revkind = "HEAD"; + if ( d.revision->value() != 0 ) { + revnumber = d.revision->value(); + revkind = ""; + } + bool recurse=true; + int cmd = 12; + s << cmd; + s << *it; + s << KURL( d.url->url() ); + s << recurse; + s << revnumber; + s << revkind; + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } + } + } else if (args->isSet("r")) { + kdDebug(7128) << "revert " << list << endl; + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 8; + s< it = list.begin(); it != list.end() ; ++it ) { + kdDebug(7128) << "reverting : " << (*it).prettyURL() << endl; + s << *it; + } + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } else if (args->isSet("C")) { + kdDebug(7128) << "checkout " << list << endl; + SubversionCheckout d; + int result = d.exec(); + if ( result == TQDialog::Accepted ) { + for ( TQValueListConstIterator it = list.begin(); it != list.end() ; ++it ) { + KURL servURL = "svn+http://this_is_a_fake_URL_and_this_is_normal/"; + TQByteArray parms; + TQDataStream s( parms, IO_WriteOnly ); + int cmd = 1; + int rev = -1; + TQString revkind = "HEAD"; + if ( d.revision->value() != 0 ) { + rev = d.revision->value(); + revkind = ""; + } + s<url() ); + s << ( *it ); + s << rev; + s << revkind; + kdDebug(7128) << "checkouting : " << d.url->url() << " into " << (*it).prettyURL() << " at rev : " << rev << " or " << revkind << endl; + TDEIO::SimpleJob * job = TDEIO::special(servURL, parms, true); + connect( job, TQT_SIGNAL( result( TDEIO::Job * ) ), this, TQT_SLOT( slotResult( TDEIO::Job * ) ) ); + TDEIO::NetAccess::synchronousRun( job, 0 ); + } + } + } else { + KMessageBox::sorry(0, "Sorry, request not recognised. Perhaps not implemented yet?", "Feature Not Implemented"); + } + TQTimer::singleShot( 0, this, TQT_SLOT( finished() ) ); +} + +void SvnHelper::slotResult( TDEIO::Job* job ) { + if ( job->error() ) + job->showErrorDialog( ); + + TDEIO::MetaData ma = job->metaData(); + TQValueList keys = ma.keys(); + qHeapSort( keys ); + TQValueList::Iterator begin = keys.begin(), end = keys.end(), it; + + TQStringList message; + for ( it = begin; it != end; ++it ) { + // kdDebug(7128) << "METADATA helper : " << *it << ":" << ma[ *it ] << endl; + if ( ( *it ).endsWith( "string" ) ) { + if ( ma[ *it ].length() > 2 ) { + message << ma[ *it ]; + } + } + //extra check to retrieve the diff output in case with run a diff command + if ( ( *it ).endsWith( "diffresult" ) ) { + diffresult << ma[ *it ]; + } + } + if ( message.count() > 0 ) + KMessageBox::informationListWId(m_id, "", message, "Subversion"); +} + +void SvnHelper::finished() { + kapp->quit(); +} + +static KCmdLineOptions options[] = { + { "u", I18N_NOOP("Update given URL"), 0 }, + { "c", I18N_NOOP("Commit given URL"), 0 }, + { "C", I18N_NOOP("Checkout in given directory"), 0 }, + { "a", I18N_NOOP("Add given URL to the working copy"), 0 }, + { "d", I18N_NOOP("Delete given URL from the working copy"), 0 }, + { "s", I18N_NOOP("Switch given working copy to another branch"), 0 }, + { "r", I18N_NOOP("Revert local changes"), 0 }, + { "m", I18N_NOOP("Merge changes between two branches"), 0 }, + { "D", I18N_NOOP("Show locally made changements with diff"), 0 }, + {"!+URL", I18N_NOOP("URL to update/commit/add/delete from Subversion"), 0 }, + KCmdLineLastOption +}; + +int main(int argc, char **argv) { + TDECmdLineArgs::init(argc, argv, "tdeio_svn_helper", I18N_NOOP("Subversion Helper"), "TDE frontend for SVN", "0.1"); + + TDECmdLineArgs::addCmdLineOptions( options ); + TDEGlobal::locale()->setMainCatalogue("tdeio_svn"); + TDEApplication::addCmdLineOptions(); + + if ( TDECmdLineArgs::parsedArgs()->count()==0 ) + TDECmdLineArgs::usage(); + TDEApplication *app = new SvnHelper(); + +// app->dcopClient()->attach(); + app->exec(); +} + +#include "tdeio_svn_helper.moc" diff --git a/tdeioslave/svn/svnhelper/tdeio_svn_helper.h b/tdeioslave/svn/svnhelper/tdeio_svn_helper.h new file mode 100644 index 00000000..197d7c81 --- /dev/null +++ b/tdeioslave/svn/svnhelper/tdeio_svn_helper.h @@ -0,0 +1,42 @@ +/* This file is part of the KDE project + Copyright (c) 2005 Mickael Marchand + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _KIO_SVN_HELPER_H_ +#define _KIO_SVN_HELPER_H_ + +#include +#include +#include +#include + +class SvnHelper:public TDEApplication { + Q_OBJECT + + +public: + SvnHelper(); +private slots: + void finished(); + void slotResult( TDEIO::Job *); +private: + WId m_id; + TQStringList diffresult; //for diff commands ;) +}; + +#endif -- cgit v1.2.3