From 5eb58a2799773cfb4b30c2f61d9d8c16b53da558 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 11 Feb 2013 01:06:45 -0600 Subject: Fix FTBFS --- Helperstuff/BuildService/debian.changelog | 4 +- Helperstuff/BuildService/debian.control | 8 +- Helperstuff/BuildService/tdesvn.dsc.in | 2 +- Helperstuff/BuildService/tdesvn.spec.in | 2 +- doc/en/index.docbook | 18 +- doc/nl/index.docbook | 18 +- src/svnfrontend/tdesvnfilelist.cpp | 8 +- src/tdeiosvn/kiobytestream.cpp | 63 ----- src/tdeiosvn/kiobytestream.h | 66 ----- src/tdeiosvn/kiolistener.cpp | 408 ------------------------------ src/tdeiosvn/kiolistener.h | 83 ------ src/tdeiosvn/tdeiobytestream.cpp | 63 +++++ src/tdeiosvn/tdeiobytestream.h | 66 +++++ src/tdeiosvn/tdeiolistener.cpp | 408 ++++++++++++++++++++++++++++++ src/tdeiosvn/tdeiolistener.h | 83 ++++++ src/tdeiosvn/tdeiosvn.cpp | 4 +- src/tdeiosvn/tdeiosvn.h | 4 +- tdesvn.spec | 2 +- tdesvn.spec.in | 2 +- 19 files changed, 656 insertions(+), 656 deletions(-) delete mode 100644 src/tdeiosvn/kiobytestream.cpp delete mode 100644 src/tdeiosvn/kiobytestream.h delete mode 100644 src/tdeiosvn/kiolistener.cpp delete mode 100644 src/tdeiosvn/kiolistener.h create mode 100644 src/tdeiosvn/tdeiobytestream.cpp create mode 100644 src/tdeiosvn/tdeiobytestream.h create mode 100644 src/tdeiosvn/tdeiolistener.cpp create mode 100644 src/tdeiosvn/tdeiolistener.h diff --git a/Helperstuff/BuildService/debian.changelog b/Helperstuff/BuildService/debian.changelog index 8d18bdb..40ba985 100644 --- a/Helperstuff/BuildService/debian.changelog +++ b/Helperstuff/BuildService/debian.changelog @@ -14,7 +14,7 @@ tdesvn (0.14.5-1) unstable; urgency=low * New upstream release. * debian/control - - Don't conflict with kde4 versions of tdesdk-kio-plugins. Closes: #483260 + - Don't conflict with kde4 versions of tdesdk-tdeio-plugins. Closes: #483260 - Bump Standards-Version to 3.8.0. No further changes. * debian/watch - Update watch file to match the new download location. @@ -306,7 +306,7 @@ tdesvn (0.7.1-1) unstable; urgency=low * Tightened build dependency on libsvn0-dev as tdesvn now requires subversion 1.2 or higher. * Split up package into core application tdesvn and KIO plugin package - tdesvn-kio-plugins. + tdesvn-tdeio-plugins. * Updated menu icon. * Use Debian libtool and regenerate the autotools files. Closes: #343952 + Add build dependencies to automake1.9, autoconf and libtool. diff --git a/Helperstuff/BuildService/debian.control b/Helperstuff/BuildService/debian.control index efded04..cc66426 100644 --- a/Helperstuff/BuildService/debian.control +++ b/Helperstuff/BuildService/debian.control @@ -28,7 +28,7 @@ Description: Qt wrapper library for subversion (development files) Package: tdesvn Section: devel Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, tdesvn-kio-plugins (= ${binary:Version}) +Depends: ${shlibs:Depends}, ${misc:Depends}, tdesvn-tdeio-plugins (= ${binary:Version}) Recommends: kompare, graphviz Suggests: khelpcenter, kdiff3 Description: subversion client with tight KDE integration @@ -39,12 +39,12 @@ Description: subversion client with tight KDE integration a tight integration into KDE and can be embedded into other KDE applications like konqueror via the KDE component technology KParts. -Package: tdesvn-kio-plugins +Package: tdesvn-tdeio-plugins Section: devel Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} -Conflicts: tdesdk-misc (<< 4:3.5.0-1), tdesdk-kio-plugins (<< 4:4.0.0) -Replaces: tdesdk-kio-plugins (<< 4:4.0.0) +Conflicts: tdesdk-misc (<< 4:3.5.0-1), tdesdk-tdeio-plugins (<< 4:4.0.0) +Replaces: tdesdk-tdeio-plugins (<< 4:4.0.0) Description: subversion I/O slaves for KDE This packages includes KIO slaves for svn, svn+file, svn+http, svn+https, svn+ssh. This allows you to access subversion repositories diff --git a/Helperstuff/BuildService/tdesvn.dsc.in b/Helperstuff/BuildService/tdesvn.dsc.in index f3f2ab6..2d4b8c8 100644 --- a/Helperstuff/BuildService/tdesvn.dsc.in +++ b/Helperstuff/BuildService/tdesvn.dsc.in @@ -1,6 +1,6 @@ Format: 1.0 Source: tdesvn -Binary: libsvnqt4, libsvnqt-dev, tdesvn, tdesvn-kio-plugins +Binary: libsvnqt4, libsvnqt-dev, tdesvn, tdesvn-tdeio-plugins Architecture: any Version: @VERSION@-1 Maintainer: Rajko Albrecht diff --git a/Helperstuff/BuildService/tdesvn.spec.in b/Helperstuff/BuildService/tdesvn.spec.in index 871d860..60ffeaf 100644 --- a/Helperstuff/BuildService/tdesvn.spec.in +++ b/Helperstuff/BuildService/tdesvn.spec.in @@ -51,7 +51,7 @@ via a KIO protocol, too. %package tdeiosvn Requires: tdesvn = %{version} Group: Development/Tools -Summary: A kde-kio integration for subversion based on tdesvn +Summary: A kde-tdeio integration for subversion based on tdesvn %description tdeiosvn KIO integration (TDEIO::svn) based on tdesvn alternative protocol name. diff --git a/doc/en/index.docbook b/doc/en/index.docbook index e33077d..08332f2 100644 --- a/doc/en/index.docbook +++ b/doc/en/index.docbook @@ -375,7 +375,7 @@ Deleting items is always recursive. Eg., when you delete a folder all subitems w Working on repositories -Simple repository browsing may done within &konqi; &krus; or similar filebrowsers: Open a URL with protocol described in (the variants starting with "k") and them will display the content. So simple operations like copy, move and delete may work. When appending a query "?rev=<xxx>" the listing comes from a specific revision. Format of revision-query is described in , some more information about TDEIO::ksvn are in +Simple repository browsing may done within &konqi; &krus; or similar filebrowsers: Open a URL with protocol described in (the variants starting with "k") and them will display the content. So simple operations like copy, move and delete may work. When appending a query "?rev=<xxx>" the listing comes from a specific revision. Format of revision-query is described in , some more information about TDEIO::ksvn are in All work except "Copy" may only done when browsing at revision HEAD. @@ -783,9 +783,9 @@ you may store you ssh-key-password for your current session so no further enteri - + Konqueror, KIO, &kappname; - + Description As of version 0.7.0 of &kappname; it comes with some modules integrating some commands directly into konqueror menus. @@ -800,7 +800,7 @@ As of version 0.7.0 of &kappname; it comes with some modules integrating some co ksvn+ssh ksvn -The same maybe for "svn+..." but as from kde 3.4, tdesdk has it own small svn-kio called "svn+http"etc. So packages are organized that way - or should that "svn+..." comes as an extra package so it may installed if tdesdk hasn't installed it. +The same maybe for "svn+..." but as from kde 3.4, tdesdk has it own small svn-tdeio called "svn+http"etc. So packages are organized that way - or should that "svn+..." comes as an extra package so it may installed if tdesdk hasn't installed it. These protocols are designed only for repositories, not for working copies. E.g. "ksvn+file:///<path>" must point to the beginning of a repository different to the application itself or KPart. @@ -844,7 +844,7 @@ Let kdiff3 print all differences between two revisions. Note! Using this within - + Programmers information about TDEIO::ksvn You may skip this if not interested in KIO programming. @@ -854,7 +854,7 @@ so, for instance, tdevelop may use it if tdesdk isn't installed but uses tdesvn: Commandlist - +
Command overview for TDEIO::ksvn::special @@ -1002,7 +1002,7 @@ Use this with care - this may produce a lot of data. Return values may given via metadata, see apidoc for details. -
+
Content of metadata @@ -1606,7 +1606,7 @@ Target name, eg., the origin name. For kdiff3 (as an example) this would be name - + KIO / commandline @@ -1645,7 +1645,7 @@ tdesvn action menu for konqueror but only copy/move/mkdir/delete made with konqu Standard message -The message tdesvn-kio should set on operations from within konqueror when the flag above is set. Default is "Revision made with tdesvn KIO." +The message tdesvn-tdeio should set on operations from within konqueror when the flag above is set. Default is "Revision made with tdesvn KIO." diff --git a/doc/nl/index.docbook b/doc/nl/index.docbook index 128ea66..7a52e35 100644 --- a/doc/nl/index.docbook +++ b/doc/nl/index.docbook @@ -371,7 +371,7 @@ Items verwijderen is altijd recursief. B.V.,wanneer een map verwijderd wordt, da Werken met repositories -Eenvoudig bladeren door de repository kan gedaan worden met &konqi; &krus; of vergelijkbare bestandsbeheerders: Open een URL met een protocool zoals beschreven in (Alle varianten die starten met "k") en zij zullen de inhoud tonen. Hierdoor kunnen eenvoudige opdrachten zoals kopieren, verplaatsen en verwijderen uitgevoerd worden. Wanneer het volgende filter "?rev=<xxx>" wordt ingesteld, zijn alleen de gegevens van een specifiek revisie te zien. De syntax van een revisie-filter wordt beschreven in , lees meer over TDEIO::ksvn in +Eenvoudig bladeren door de repository kan gedaan worden met &konqi; &krus; of vergelijkbare bestandsbeheerders: Open een URL met een protocool zoals beschreven in (Alle varianten die starten met "k") en zij zullen de inhoud tonen. Hierdoor kunnen eenvoudige opdrachten zoals kopieren, verplaatsen en verwijderen uitgevoerd worden. Wanneer het volgende filter "?rev=<xxx>" wordt ingesteld, zijn alleen de gegevens van een specifiek revisie te zien. De syntax van een revisie-filter wordt beschreven in , lees meer over TDEIO::ksvn in Alle opdrachten behalve "Kopieren" kunnen alleen uitgevoerd worden in de revisie HEAD. @@ -695,9 +695,9 @@ Dit item - als het een map is - een item daarin heeft conflicten met (die opgelo --> - + Konqueror, KIO, &kappname; - + Omschrijving Vanaf versie 0.7.0 van &kappname; , zijn er enkele modules die enkele commando's direct in de menu's van konqueror integreren. @@ -712,7 +712,7 @@ Vanaf versie 0.7.0 van &kappname; , zijn er enkele modules die enkele commando's ksvn+ssh ksvn -Dit geldt mischien ook voor "svn+..." maar vanaf kde 3.4, heeft tdesdk zijn eigen kleine svn-kio genaamd "svn+http"enz. Deze pakketten zijn zo georganiseerd - of zouden dat moeten zijn - dat "svn+..." als een extra pakket komt zodat het geïnstalleerd kan worden als kdesk het niet geïnstalleerd heeft. +Dit geldt mischien ook voor "svn+..." maar vanaf kde 3.4, heeft tdesdk zijn eigen kleine svn-tdeio genaamd "svn+http"enz. Deze pakketten zijn zo georganiseerd - of zouden dat moeten zijn - dat "svn+..." als een extra pakket komt zodat het geïnstalleerd kan worden als kdesk het niet geïnstalleerd heeft. Deze protocools zijn alleen ontworpen voor repositories, niet voor werkkopieën. B.v. "ksvn+file:///<pad>" moet naar een ander startpunt wijzen dan het programma zelf of Kpart. Werkkopieën kunnen bekeken worden met konqueror. @@ -754,7 +754,7 @@ Laat kdiff3 alle verschillen tussen twee revisie's tonen. Letop! Gebruik hiervan - + Informatie over TDEIO::ksvn voor programmeurs U kunt dit gedeelte overslaan indien U niet geïnterreseerd bent in KIO-programmeren. @@ -764,7 +764,7 @@ dus, bijvoorbeeld, tdevelop kan het gebruiken als kdesk niet is geïnstalleerd i Overzicht met commando's -
+
Commando overzicht voor TDEIO::ksvn::special @@ -911,7 +911,7 @@ Gebruik dit voorzichtig - dit kan veel data produceren. Return waarden mogen gegeven worden via metadata, lees apidoc voor de details. -
+
Inhoud van metadata @@ -1460,7 +1460,7 @@ Vervang door doel. - + KIO / commandoregel @@ -1497,7 +1497,7 @@ Wanneer dit is ingeschakeld, zal de KIO-implementatie van &kappname; niet vragen Standaard berichten -Het bericht dat tdesvn-kio zou moeten geven bij bewerkingen vanuit konqueror wanneer bovenstaande vlag is gezet. Standaard is "Revision made with tdesvn KIO." +Het bericht dat tdesvn-tdeio zou moeten geven bij bewerkingen vanuit konqueror wanneer bovenstaande vlag is gezet. Standaard is "Revision made with tdesvn KIO." diff --git a/src/svnfrontend/tdesvnfilelist.cpp b/src/svnfrontend/tdesvnfilelist.cpp index 6af7c8f..2625951 100644 --- a/src/svnfrontend/tdesvnfilelist.cpp +++ b/src/svnfrontend/tdesvnfilelist.cpp @@ -1988,12 +1988,12 @@ void tdesvnfilelist::slotDelete() TQValueList items; TQStringList displist; - KURL::List kioList; + KURL::List tdeioList; while ((cur=liter.current())!=0){ ++liter; if (!cur->isRealVersioned()) { KURL _uri; _uri.setPath(cur->fullName()); - kioList.append(_uri); + tdeioList.append(_uri); } else { items.push_back(cur->fullName()); } @@ -2003,8 +2003,8 @@ void tdesvnfilelist::slotDelete() if (answer!=KMessageBox::Yes) { return; } - if (kioList.count()>0) { - TDEIO::Job*aJob = TDEIO::del(kioList); + if (tdeioList.count()>0) { + TDEIO::Job*aJob = TDEIO::del(tdeioList); connect(aJob,TQT_SIGNAL(result (TDEIO::Job *)),this,TQT_SLOT(slotDeleteFinished(TDEIO::Job*))); dispDummy(); } diff --git a/src/tdeiosvn/kiobytestream.cpp b/src/tdeiosvn/kiobytestream.cpp deleted file mode 100644 index 81c6fc8..0000000 --- a/src/tdeiosvn/kiobytestream.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * 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. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#include "kiobytestream.h" - -KioByteStream::KioByteStream(StreamWrittenCb*aCb,const TQString&filename) - : svn::stream::SvnStream(false,true,0L), - m_Cb(aCb),m_Written(0), - m_mimeSend(false),m_Filename(filename) -{ - m_MessageTick.start(); -} - -KioByteStream::~KioByteStream() -{ -} - -bool KioByteStream::isOk() const -{ - return m_Cb != 0; -} - -long KioByteStream::write(const char* data, const unsigned long max) -{ - bool forceInfo = !m_mimeSend; - if (m_Cb) { - if (!m_mimeSend) { - m_mimeSend = true; - array.setRawData(data, max); - KMimeMagicResult * result = KMimeMagic::self()->findBufferFileType(array,m_Filename); - m_Cb->streamSendMime(result); - array.resetRawData(data, max); - m_Cb->streamTotalSizeNull(); - } - array.setRawData(data, max); - m_Cb->streamPushData(array); - array.resetRawData(data, max); - - m_Written+=max; - if (m_MessageTick.elapsed() >=100 || forceInfo) { - m_Cb->streamWritten(m_Written); - m_MessageTick.restart(); - } - return max; - } - return -1; -} diff --git a/src/tdeiosvn/kiobytestream.h b/src/tdeiosvn/kiobytestream.h deleted file mode 100644 index 48addfe..0000000 --- a/src/tdeiosvn/kiobytestream.h +++ /dev/null @@ -1,66 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * 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. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef KIOBYTESTREAM_H -#define KIOBYTESTREAM_H - -#include "svnstream.hpp" - -#include -#include -#include -#include -#include - -class StreamWrittenCb -{ -public: - StreamWrittenCb(){} - virtual ~StreamWrittenCb(){} - virtual void streamWritten(const TDEIO::filesize_t current) = 0; - virtual void streamPushData(TQByteArray)=0; - virtual void streamSendMime(KMimeMagicResult*mt)=0; - virtual void streamTotalSizeNull()=0; -}; - -/** - @author Rajko Albrecht -*/ -class KioByteStream : public svn::stream::SvnStream -{ -public: - KioByteStream(StreamWrittenCb*,const TQString&filename); - - ~KioByteStream(); - - virtual bool isOk() const; - virtual long write(const char* data, const unsigned long max); - - TDEIO::filesize_t written(){return m_Written;} - -protected: - StreamWrittenCb*m_Cb; - TDEIO::filesize_t m_Written; - bool m_mimeSend; - TQString m_Filename; - TQByteArray array; - TQTime m_MessageTick; -}; - -#endif diff --git a/src/tdeiosvn/kiolistener.cpp b/src/tdeiosvn/kiolistener.cpp deleted file mode 100644 index f4cd940..0000000 --- a/src/tdeiosvn/kiolistener.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * 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. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#include "kiolistener.h" -#include "tdeiosvn.h" - -#include -#include -#include - -namespace TDEIO { - -KioListener::KioListener(TDEIO::tdeio_svnProtocol*_par) - : svn::ContextListener(),m_notifyCounter(0),m_External(false),m_HasChanges(false),m_FirstTxDelta(false),m_Canceld(false) -{ - par = _par; -} - - -KioListener::~KioListener() -{ -} - - - - -/*! - \fn KioListener::contextCancel() - */ -bool KioListener::contextCancel() -{ - return par->wasKilled()||m_Canceld; -} - - -/*! - \fn KioListener::contextGetLogMessage (TQString & msg) - */ -bool KioListener::contextGetLogMessage (TQString & msg,const svn::CommitItemList&_items) -{ -#if 1 - TQByteArray reply; - TQByteArray params; - TQCString replyType; - TQDataStream stream(params,IO_WriteOnly); - - if (_items.count()>0) { - TQMap list; - for (unsigned i = 0;i<_items.count();++i) { - if (_items[i].path().isEmpty()) { - list[_items[i].url()]=TQChar(_items[i].actionType()); - } else { - list[_items[i].path()]=TQChar(_items[i].actionType()); - } - } - stream << list; - if (!par->dcopClient()->call("kded","tdesvnd","get_logmsg(TQMap)",params,replyType,reply)) { - msg = "Communication with dcop failed"; - kdWarning()<dcopClient()->call("kded","tdesvnd","get_logmsg()",params,replyType,reply)) { - msg = "Communication with dcop failed"; - kdWarning()<>lt; - if (lt.count()!=1) { - msg = "Wrong or missing log (may cancel pressed)."; - kdDebug()<< msg << endl; - return false; - } - msg = lt[0]; -#else - msg = "Made with a kio::svn client"; -#endif - return true; -} - -/*! the content of that method is taken from the notify in kio::svn in KDE SDK */ -/* this moment we don't use it full 'cause not all is made via KIO */ -void KioListener::contextNotify (const char * path,svn_wc_notify_action_t action,svn_node_kind_t kind ,const char * mime_type ,svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state,svn_revnum_t revision) -{ - if (par->wasKilled()) { - return; - } - TQString userstring; - - switch(action) { - case svn_wc_notify_add: - { - if (mime_type && (svn_mime_type_is_binary (mime_type))) - userstring = i18n( "A (bin) %1" ).arg( path ); - else - userstring = i18n( "A %1" ).arg( path ); - break; - } - break; - case svn_wc_notify_copy: //copy - break; - case svn_wc_notify_delete: //delete - m_HasChanges = TRUE; - userstring = i18n( "D %1" ).arg( path ); - break; - case svn_wc_notify_restore : //restore - userstring=i18n( "Restored %1." ).arg( path ); - break; - case svn_wc_notify_revert : //revert - userstring=i18n( "Reverted %1." ).arg( path ); - break; - case svn_wc_notify_failed_revert: //failed revert - userstring=i18n( "Failed to revert %1.\nTry updating instead." ).arg( path ); - break; - case svn_wc_notify_resolved: //resolved - userstring=i18n( "Resolved conflicted state of %1." ).arg( path ); - break; - case svn_wc_notify_skip: //skip - if ( content_state == svn_wc_notify_state_missing ) - userstring=i18n("Skipped missing target %1.").arg( path ); - else - userstring=i18n("Skipped %1.").arg( path ); - break; - case svn_wc_notify_update_delete: //update_delete - m_HasChanges = TRUE; - userstring=i18n( "D %1" ).arg( path ); - break; - case svn_wc_notify_update_add: //update_add - m_HasChanges = TRUE; - userstring=i18n( "A %1" ).arg( path ); - break; - case svn_wc_notify_update_update: //update_update - { - /* If this is an inoperative dir change, do no notification. - An inoperative dir change is when a directory gets closed - without any props having been changed. */ - if (! ((kind == svn_node_dir) - && ((prop_state == svn_wc_notify_state_inapplicable) - || (prop_state == svn_wc_notify_state_unknown) - || (prop_state == svn_wc_notify_state_unchanged)))) { - m_HasChanges = TRUE; - - if (kind == svn_node_file) { - if (content_state == svn_wc_notify_state_conflicted) - userstring = "C"; - else if (content_state == svn_wc_notify_state_merged) - userstring = "G"; - else if (content_state == svn_wc_notify_state_changed) - userstring = "U"; - } - - if (prop_state == svn_wc_notify_state_conflicted) - userstring += "C"; - else if (prop_state == svn_wc_notify_state_merged) - userstring += "G"; - else if (prop_state == svn_wc_notify_state_changed) - userstring += "U"; - else - userstring += " "; - - if (! ((content_state == svn_wc_notify_state_unchanged - || content_state == svn_wc_notify_state_unknown) - && (prop_state == svn_wc_notify_state_unchanged - || prop_state == svn_wc_notify_state_unknown))) - userstring += TQString( " " ) + path; - } - break; - } - case svn_wc_notify_update_completed: //update_completed - { - if (!m_External) { - if (SVN_IS_VALID_REVNUM(revision)) { - userstring = i18n("Finished at revision %1.").arg(revision); - } else { - userstring = i18n("Finished."); - } - } else { - if (SVN_IS_VALID_REVNUM(revision)) { - userstring = i18n("Finished external at revision %1.").arg(revision); - } else { - userstring = i18n("Finished external."); - } - } - } - if (m_External) - m_External = FALSE; - break; - case svn_wc_notify_update_external: //update_external - m_External = TRUE; - userstring = i18n("Fetching external item into %1." ).arg( path ); - break; - case svn_wc_notify_status_completed: //status_completed - if (SVN_IS_VALID_REVNUM (revision)) - userstring = i18n( "Status against revision: %1.").arg( revision ); - break; - case svn_wc_notify_status_external: //status_external - userstring = i18n("Performing status on external item at %1.").arg( path ); - break; - case svn_wc_notify_commit_modified: //commit_modified - userstring = i18n( "Sending %1.").arg( path ); - break; - case svn_wc_notify_commit_added: //commit_added - if (mime_type && svn_mime_type_is_binary (mime_type)) { - userstring = i18n( "Adding (bin) %1.").arg( path ); - } else { - userstring = i18n( "Adding %1.").arg( path ); - } - break; - case svn_wc_notify_commit_deleted: //commit_deleted - userstring = i18n( "Deleting %1.").arg( path ); - break; - case svn_wc_notify_commit_replaced: //commit_replaced - userstring = i18n( "Replacing %1.").arg( path ); - break; - case svn_wc_notify_commit_postfix_txdelta: //commit_postfix_txdelta - if (!m_FirstTxDelta) { - m_FirstTxDelta = TRUE; - // check fullstops! - userstring=i18n("Transmitting file data "); - } else { - userstring="."; - } - break; - - break; - case svn_wc_notify_blame_revision: //blame_revision - break; - default: - break; - } - par->setMetaData(TQString::number(counter()).rightJustify( 10,'0' )+ "path" , TQString::FROMUTF8( path )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "action", TQString::number( action )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "kind", TQString::number( kind )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "mime_t", TQString::FROMUTF8( mime_type )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "content", TQString::number( content_state )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "prop", TQString::number( prop_state )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "rev", TQString::number( revision )); - par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "string", userstring ); - incCounter(); -} - -void KioListener::contextNotify (const svn_wc_notify_t *action) -{ - if (!action) return; -// if (action->actionpath,action->action,action->kind,action->mime_type, - action->content_state,action->prop_state,action->revision); -// return; -// } -// TQString aString = NotifyAction(action->action); -} - -svn::ContextListener::SslServerTrustAnswer -KioListener::contextSslServerTrustPrompt (const SslServerTrustData & data, apr_uint32_t & acceptedFailures) -{ - TQByteArray reply; - TQByteArray params; - TQCString replyType; - TQDataStream stream(params,IO_WriteOnly); - stream << data.hostname - << data.fingerprint - << data.validFrom - << data.validUntil - << data.issuerDName - << data.realm; - - if (!par->dcopClient()->call("kded","tdesvnd", - "get_sslaccept(TQString,TQString,TQString,TQString,TQString,TQString)", - params,replyType,reply)) { - kdWarning()<<"Communication with dcop failed"<>res; - switch (res) { - case -1: - return DONT_ACCEPT; - break; - case 1: - return ACCEPT_PERMANENTLY; - break; - default: - case 0: - return ACCEPT_TEMPORARILY; - break; - } - /* avoid compiler warnings */ - return ACCEPT_TEMPORARILY; -} - -bool KioListener::contextLoadSslClientCertPw(TQString&password,const TQString&realm) -{ - return PwStorage::self()->getCertPw(realm,password); -} - -bool KioListener::contextSslClientCertPrompt (TQString & certFile) -{ - TQByteArray reply; - TQByteArray params; - TQCString replyType; - if (!par->dcopClient()->call("kded","tdesvnd", - "get_sslclientcertfile()", - params,replyType,reply)) { - kdWarning()<<"Communication with dcop failed"<>certFile; - if (certFile.isEmpty()) { - return false; - } - return true; -} - -bool KioListener::contextSslClientCertPwPrompt (TQString & password, - const TQString & realm, bool & maySave) -{ - return false; -} - -bool KioListener::contextGetSavedLogin (const TQString & realm,TQString & username,TQString & password) -{ - PwStorage::self()->getLogin(realm,username,password); - return true; -} - -bool KioListener::contextGetCachedLogin (const TQString & realm,TQString & username,TQString & password) -{ - return true; -} - -bool KioListener::contextGetLogin (const TQString & realm, TQString & username, TQString & password, bool & maySave) -{ - TQByteArray reply; - TQByteArray params; - TQCString replyType; - - TQDataStream stream(params,IO_WriteOnly); - stream << realm; - stream << username; - - if (!par->dcopClient()->call("kded","tdesvnd","get_login(TQString,TQString)",params,replyType,reply)) { - kdWarning()<<"Communication with dcop failed"<>lt; - if (lt.count()!=3) { - kdDebug()<<"Wrong or missing auth list (may cancel pressed)." << endl; - return false; - } - username = lt[0]; - password = lt[1]; - maySave = lt[2]=="true"; - return true; -} - - -/*! - \fn KioListener::contextProgress(long long int current, long long int max) - */ -void KioListener::contextProgress(long long int cur, long long int max) -{ - if (par) { - par->contextProgress(cur,max); - } -} - -} // namespace TDEIO diff --git a/src/tdeiosvn/kiolistener.h b/src/tdeiosvn/kiolistener.h deleted file mode 100644 index f836b65..0000000 --- a/src/tdeiosvn/kiolistener.h +++ /dev/null @@ -1,83 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2005-2007 by Rajko Albrecht * - * ral@alwins-world.de * - * * - * 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. * - * * - * This program 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 General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - ***************************************************************************/ -#ifndef KIOLISTENER_H -#define KIOLISTENER_H - -#include "context_listener.hpp" -#include "pwstorage.h" - -namespace TDEIO { - class SlaveBase; - class tdeio_svnProtocol; - -/** -@author Rajko Albrecht -*/ -class KioListener : public svn::ContextListener -{ -public: - KioListener(TDEIO::tdeio_svnProtocol*_par); - virtual ~KioListener(); - - /* context-listener methods */ - virtual bool contextGetLogin (const TQString & realm, - TQString & username, - TQString & password, - bool & maySave); - virtual bool contextGetSavedLogin (const TQString & realm,TQString & username,TQString & password); - virtual bool contextGetCachedLogin (const TQString & realm,TQString & username,TQString & password); - - virtual void contextNotify (const char *path, - svn_wc_notify_action_t action, - svn_node_kind_t kind, - const char *mime_type, - svn_wc_notify_state_t content_state, - svn_wc_notify_state_t prop_state, - svn_revnum_t revision); - virtual void contextNotify (const svn_wc_notify_t *action); - - virtual bool contextCancel(); - virtual bool contextGetLogMessage (TQString & msg,const svn::CommitItemList&); - virtual SslServerTrustAnswer contextSslServerTrustPrompt (const SslServerTrustData & data, - apr_uint32_t & acceptedFailures); - virtual bool contextSslClientCertPrompt (TQString & certFile); - virtual bool contextSslClientCertPwPrompt (TQString & password, - const TQString & realm, bool & maySave); - virtual bool contextLoadSslClientCertPw(TQString&password,const TQString&realm); - /* context listener virtuals end */ - unsigned int counter()const{return m_notifyCounter;} - void incCounter(){++m_notifyCounter;} - virtual void contextProgress(long long int current, long long int max); - - void setCancel(bool value){m_Canceld=value;} - -private: - TDEIO::tdeio_svnProtocol *par; - -protected: - unsigned int m_notifyCounter; - bool m_External; - bool m_HasChanges; - bool m_FirstTxDelta; - bool m_Canceld; -}; -} - -#endif diff --git a/src/tdeiosvn/tdeiobytestream.cpp b/src/tdeiosvn/tdeiobytestream.cpp new file mode 100644 index 0000000..fe3c3a9 --- /dev/null +++ b/src/tdeiosvn/tdeiobytestream.cpp @@ -0,0 +1,63 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * 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. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#include "tdeiobytestream.h" + +KioByteStream::KioByteStream(StreamWrittenCb*aCb,const TQString&filename) + : svn::stream::SvnStream(false,true,0L), + m_Cb(aCb),m_Written(0), + m_mimeSend(false),m_Filename(filename) +{ + m_MessageTick.start(); +} + +KioByteStream::~KioByteStream() +{ +} + +bool KioByteStream::isOk() const +{ + return m_Cb != 0; +} + +long KioByteStream::write(const char* data, const unsigned long max) +{ + bool forceInfo = !m_mimeSend; + if (m_Cb) { + if (!m_mimeSend) { + m_mimeSend = true; + array.setRawData(data, max); + KMimeMagicResult * result = KMimeMagic::self()->findBufferFileType(array,m_Filename); + m_Cb->streamSendMime(result); + array.resetRawData(data, max); + m_Cb->streamTotalSizeNull(); + } + array.setRawData(data, max); + m_Cb->streamPushData(array); + array.resetRawData(data, max); + + m_Written+=max; + if (m_MessageTick.elapsed() >=100 || forceInfo) { + m_Cb->streamWritten(m_Written); + m_MessageTick.restart(); + } + return max; + } + return -1; +} diff --git a/src/tdeiosvn/tdeiobytestream.h b/src/tdeiosvn/tdeiobytestream.h new file mode 100644 index 0000000..48addfe --- /dev/null +++ b/src/tdeiosvn/tdeiobytestream.h @@ -0,0 +1,66 @@ +/*************************************************************************** + * Copyright (C) 2006-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * 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. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef KIOBYTESTREAM_H +#define KIOBYTESTREAM_H + +#include "svnstream.hpp" + +#include +#include +#include +#include +#include + +class StreamWrittenCb +{ +public: + StreamWrittenCb(){} + virtual ~StreamWrittenCb(){} + virtual void streamWritten(const TDEIO::filesize_t current) = 0; + virtual void streamPushData(TQByteArray)=0; + virtual void streamSendMime(KMimeMagicResult*mt)=0; + virtual void streamTotalSizeNull()=0; +}; + +/** + @author Rajko Albrecht +*/ +class KioByteStream : public svn::stream::SvnStream +{ +public: + KioByteStream(StreamWrittenCb*,const TQString&filename); + + ~KioByteStream(); + + virtual bool isOk() const; + virtual long write(const char* data, const unsigned long max); + + TDEIO::filesize_t written(){return m_Written;} + +protected: + StreamWrittenCb*m_Cb; + TDEIO::filesize_t m_Written; + bool m_mimeSend; + TQString m_Filename; + TQByteArray array; + TQTime m_MessageTick; +}; + +#endif diff --git a/src/tdeiosvn/tdeiolistener.cpp b/src/tdeiosvn/tdeiolistener.cpp new file mode 100644 index 0000000..d8d3210 --- /dev/null +++ b/src/tdeiosvn/tdeiolistener.cpp @@ -0,0 +1,408 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * 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. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#include "tdeiolistener.h" +#include "tdeiosvn.h" + +#include +#include +#include + +namespace TDEIO { + +KioListener::KioListener(TDEIO::tdeio_svnProtocol*_par) + : svn::ContextListener(),m_notifyCounter(0),m_External(false),m_HasChanges(false),m_FirstTxDelta(false),m_Canceld(false) +{ + par = _par; +} + + +KioListener::~KioListener() +{ +} + + + + +/*! + \fn KioListener::contextCancel() + */ +bool KioListener::contextCancel() +{ + return par->wasKilled()||m_Canceld; +} + + +/*! + \fn KioListener::contextGetLogMessage (TQString & msg) + */ +bool KioListener::contextGetLogMessage (TQString & msg,const svn::CommitItemList&_items) +{ +#if 1 + TQByteArray reply; + TQByteArray params; + TQCString replyType; + TQDataStream stream(params,IO_WriteOnly); + + if (_items.count()>0) { + TQMap list; + for (unsigned i = 0;i<_items.count();++i) { + if (_items[i].path().isEmpty()) { + list[_items[i].url()]=TQChar(_items[i].actionType()); + } else { + list[_items[i].path()]=TQChar(_items[i].actionType()); + } + } + stream << list; + if (!par->dcopClient()->call("kded","tdesvnd","get_logmsg(TQMap)",params,replyType,reply)) { + msg = "Communication with dcop failed"; + kdWarning()<dcopClient()->call("kded","tdesvnd","get_logmsg()",params,replyType,reply)) { + msg = "Communication with dcop failed"; + kdWarning()<>lt; + if (lt.count()!=1) { + msg = "Wrong or missing log (may cancel pressed)."; + kdDebug()<< msg << endl; + return false; + } + msg = lt[0]; +#else + msg = "Made with a tdeio::svn client"; +#endif + return true; +} + +/*! the content of that method is taken from the notify in tdeio::svn in KDE SDK */ +/* this moment we don't use it full 'cause not all is made via KIO */ +void KioListener::contextNotify (const char * path,svn_wc_notify_action_t action,svn_node_kind_t kind ,const char * mime_type ,svn_wc_notify_state_t content_state, svn_wc_notify_state_t prop_state,svn_revnum_t revision) +{ + if (par->wasKilled()) { + return; + } + TQString userstring; + + switch(action) { + case svn_wc_notify_add: + { + if (mime_type && (svn_mime_type_is_binary (mime_type))) + userstring = i18n( "A (bin) %1" ).arg( path ); + else + userstring = i18n( "A %1" ).arg( path ); + break; + } + break; + case svn_wc_notify_copy: //copy + break; + case svn_wc_notify_delete: //delete + m_HasChanges = TRUE; + userstring = i18n( "D %1" ).arg( path ); + break; + case svn_wc_notify_restore : //restore + userstring=i18n( "Restored %1." ).arg( path ); + break; + case svn_wc_notify_revert : //revert + userstring=i18n( "Reverted %1." ).arg( path ); + break; + case svn_wc_notify_failed_revert: //failed revert + userstring=i18n( "Failed to revert %1.\nTry updating instead." ).arg( path ); + break; + case svn_wc_notify_resolved: //resolved + userstring=i18n( "Resolved conflicted state of %1." ).arg( path ); + break; + case svn_wc_notify_skip: //skip + if ( content_state == svn_wc_notify_state_missing ) + userstring=i18n("Skipped missing target %1.").arg( path ); + else + userstring=i18n("Skipped %1.").arg( path ); + break; + case svn_wc_notify_update_delete: //update_delete + m_HasChanges = TRUE; + userstring=i18n( "D %1" ).arg( path ); + break; + case svn_wc_notify_update_add: //update_add + m_HasChanges = TRUE; + userstring=i18n( "A %1" ).arg( path ); + break; + case svn_wc_notify_update_update: //update_update + { + /* If this is an inoperative dir change, do no notification. + An inoperative dir change is when a directory gets closed + without any props having been changed. */ + if (! ((kind == svn_node_dir) + && ((prop_state == svn_wc_notify_state_inapplicable) + || (prop_state == svn_wc_notify_state_unknown) + || (prop_state == svn_wc_notify_state_unchanged)))) { + m_HasChanges = TRUE; + + if (kind == svn_node_file) { + if (content_state == svn_wc_notify_state_conflicted) + userstring = "C"; + else if (content_state == svn_wc_notify_state_merged) + userstring = "G"; + else if (content_state == svn_wc_notify_state_changed) + userstring = "U"; + } + + if (prop_state == svn_wc_notify_state_conflicted) + userstring += "C"; + else if (prop_state == svn_wc_notify_state_merged) + userstring += "G"; + else if (prop_state == svn_wc_notify_state_changed) + userstring += "U"; + else + userstring += " "; + + if (! ((content_state == svn_wc_notify_state_unchanged + || content_state == svn_wc_notify_state_unknown) + && (prop_state == svn_wc_notify_state_unchanged + || prop_state == svn_wc_notify_state_unknown))) + userstring += TQString( " " ) + path; + } + break; + } + case svn_wc_notify_update_completed: //update_completed + { + if (!m_External) { + if (SVN_IS_VALID_REVNUM(revision)) { + userstring = i18n("Finished at revision %1.").arg(revision); + } else { + userstring = i18n("Finished."); + } + } else { + if (SVN_IS_VALID_REVNUM(revision)) { + userstring = i18n("Finished external at revision %1.").arg(revision); + } else { + userstring = i18n("Finished external."); + } + } + } + if (m_External) + m_External = FALSE; + break; + case svn_wc_notify_update_external: //update_external + m_External = TRUE; + userstring = i18n("Fetching external item into %1." ).arg( path ); + break; + case svn_wc_notify_status_completed: //status_completed + if (SVN_IS_VALID_REVNUM (revision)) + userstring = i18n( "Status against revision: %1.").arg( revision ); + break; + case svn_wc_notify_status_external: //status_external + userstring = i18n("Performing status on external item at %1.").arg( path ); + break; + case svn_wc_notify_commit_modified: //commit_modified + userstring = i18n( "Sending %1.").arg( path ); + break; + case svn_wc_notify_commit_added: //commit_added + if (mime_type && svn_mime_type_is_binary (mime_type)) { + userstring = i18n( "Adding (bin) %1.").arg( path ); + } else { + userstring = i18n( "Adding %1.").arg( path ); + } + break; + case svn_wc_notify_commit_deleted: //commit_deleted + userstring = i18n( "Deleting %1.").arg( path ); + break; + case svn_wc_notify_commit_replaced: //commit_replaced + userstring = i18n( "Replacing %1.").arg( path ); + break; + case svn_wc_notify_commit_postfix_txdelta: //commit_postfix_txdelta + if (!m_FirstTxDelta) { + m_FirstTxDelta = TRUE; + // check fullstops! + userstring=i18n("Transmitting file data "); + } else { + userstring="."; + } + break; + + break; + case svn_wc_notify_blame_revision: //blame_revision + break; + default: + break; + } + par->setMetaData(TQString::number(counter()).rightJustify( 10,'0' )+ "path" , TQString::FROMUTF8( path )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "action", TQString::number( action )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "kind", TQString::number( kind )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "mime_t", TQString::FROMUTF8( mime_type )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "content", TQString::number( content_state )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "prop", TQString::number( prop_state )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "rev", TQString::number( revision )); + par->setMetaData(TQString::number( counter() ).rightJustify( 10,'0' )+ "string", userstring ); + incCounter(); +} + +void KioListener::contextNotify (const svn_wc_notify_t *action) +{ + if (!action) return; +// if (action->actionpath,action->action,action->kind,action->mime_type, + action->content_state,action->prop_state,action->revision); +// return; +// } +// TQString aString = NotifyAction(action->action); +} + +svn::ContextListener::SslServerTrustAnswer +KioListener::contextSslServerTrustPrompt (const SslServerTrustData & data, apr_uint32_t & acceptedFailures) +{ + TQByteArray reply; + TQByteArray params; + TQCString replyType; + TQDataStream stream(params,IO_WriteOnly); + stream << data.hostname + << data.fingerprint + << data.validFrom + << data.validUntil + << data.issuerDName + << data.realm; + + if (!par->dcopClient()->call("kded","tdesvnd", + "get_sslaccept(TQString,TQString,TQString,TQString,TQString,TQString)", + params,replyType,reply)) { + kdWarning()<<"Communication with dcop failed"<>res; + switch (res) { + case -1: + return DONT_ACCEPT; + break; + case 1: + return ACCEPT_PERMANENTLY; + break; + default: + case 0: + return ACCEPT_TEMPORARILY; + break; + } + /* avoid compiler warnings */ + return ACCEPT_TEMPORARILY; +} + +bool KioListener::contextLoadSslClientCertPw(TQString&password,const TQString&realm) +{ + return PwStorage::self()->getCertPw(realm,password); +} + +bool KioListener::contextSslClientCertPrompt (TQString & certFile) +{ + TQByteArray reply; + TQByteArray params; + TQCString replyType; + if (!par->dcopClient()->call("kded","tdesvnd", + "get_sslclientcertfile()", + params,replyType,reply)) { + kdWarning()<<"Communication with dcop failed"<>certFile; + if (certFile.isEmpty()) { + return false; + } + return true; +} + +bool KioListener::contextSslClientCertPwPrompt (TQString & password, + const TQString & realm, bool & maySave) +{ + return false; +} + +bool KioListener::contextGetSavedLogin (const TQString & realm,TQString & username,TQString & password) +{ + PwStorage::self()->getLogin(realm,username,password); + return true; +} + +bool KioListener::contextGetCachedLogin (const TQString & realm,TQString & username,TQString & password) +{ + return true; +} + +bool KioListener::contextGetLogin (const TQString & realm, TQString & username, TQString & password, bool & maySave) +{ + TQByteArray reply; + TQByteArray params; + TQCString replyType; + + TQDataStream stream(params,IO_WriteOnly); + stream << realm; + stream << username; + + if (!par->dcopClient()->call("kded","tdesvnd","get_login(TQString,TQString)",params,replyType,reply)) { + kdWarning()<<"Communication with dcop failed"<>lt; + if (lt.count()!=3) { + kdDebug()<<"Wrong or missing auth list (may cancel pressed)." << endl; + return false; + } + username = lt[0]; + password = lt[1]; + maySave = lt[2]=="true"; + return true; +} + + +/*! + \fn KioListener::contextProgress(long long int current, long long int max) + */ +void KioListener::contextProgress(long long int cur, long long int max) +{ + if (par) { + par->contextProgress(cur,max); + } +} + +} // namespace TDEIO diff --git a/src/tdeiosvn/tdeiolistener.h b/src/tdeiosvn/tdeiolistener.h new file mode 100644 index 0000000..f836b65 --- /dev/null +++ b/src/tdeiosvn/tdeiolistener.h @@ -0,0 +1,83 @@ +/*************************************************************************** + * Copyright (C) 2005-2007 by Rajko Albrecht * + * ral@alwins-world.de * + * * + * 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. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef KIOLISTENER_H +#define KIOLISTENER_H + +#include "context_listener.hpp" +#include "pwstorage.h" + +namespace TDEIO { + class SlaveBase; + class tdeio_svnProtocol; + +/** +@author Rajko Albrecht +*/ +class KioListener : public svn::ContextListener +{ +public: + KioListener(TDEIO::tdeio_svnProtocol*_par); + virtual ~KioListener(); + + /* context-listener methods */ + virtual bool contextGetLogin (const TQString & realm, + TQString & username, + TQString & password, + bool & maySave); + virtual bool contextGetSavedLogin (const TQString & realm,TQString & username,TQString & password); + virtual bool contextGetCachedLogin (const TQString & realm,TQString & username,TQString & password); + + virtual void contextNotify (const char *path, + svn_wc_notify_action_t action, + svn_node_kind_t kind, + const char *mime_type, + svn_wc_notify_state_t content_state, + svn_wc_notify_state_t prop_state, + svn_revnum_t revision); + virtual void contextNotify (const svn_wc_notify_t *action); + + virtual bool contextCancel(); + virtual bool contextGetLogMessage (TQString & msg,const svn::CommitItemList&); + virtual SslServerTrustAnswer contextSslServerTrustPrompt (const SslServerTrustData & data, + apr_uint32_t & acceptedFailures); + virtual bool contextSslClientCertPrompt (TQString & certFile); + virtual bool contextSslClientCertPwPrompt (TQString & password, + const TQString & realm, bool & maySave); + virtual bool contextLoadSslClientCertPw(TQString&password,const TQString&realm); + /* context listener virtuals end */ + unsigned int counter()const{return m_notifyCounter;} + void incCounter(){++m_notifyCounter;} + virtual void contextProgress(long long int current, long long int max); + + void setCancel(bool value){m_Canceld=value;} + +private: + TDEIO::tdeio_svnProtocol *par; + +protected: + unsigned int m_notifyCounter; + bool m_External; + bool m_HasChanges; + bool m_FirstTxDelta; + bool m_Canceld; +}; +} + +#endif diff --git a/src/tdeiosvn/tdeiosvn.cpp b/src/tdeiosvn/tdeiosvn.cpp index fe17ab1..1365dd2 100644 --- a/src/tdeiosvn/tdeiosvn.cpp +++ b/src/tdeiosvn/tdeiosvn.cpp @@ -19,7 +19,7 @@ ***************************************************************************/ #include "tdesvn-config.h" #include "tdeiosvn.h" -#include "kiolistener.h" +#include "tdeiolistener.h" #include "svnqttypes.hpp" #include "dirent.hpp" @@ -147,7 +147,7 @@ tdeio_svnProtocol::tdeio_svnProtocol(const TQCString &pool_socket, const TQCStri tdeio_svnProtocol::~tdeio_svnProtocol() { - kdDebug()<<"Delete kio protocol"< #include @@ -64,7 +64,7 @@ public: virtual void wc_delete(const KURL::List&); virtual void special(const TQByteArray& data); virtual void wc_resolve(const KURL&,bool); - /* looked on kio::svn from tdesdk */ + /* looked on tdeio::svn from tdesdk */ enum KSVN_METHOD { /* KURL repository, KURL target, int revnumber, TQString revkind */ SVN_CHECKOUT = 1, diff --git a/tdesvn.spec b/tdesvn.spec index 1ac1d56..15e9f04 100644 --- a/tdesvn.spec +++ b/tdesvn.spec @@ -24,7 +24,7 @@ via a KIO protocol, too. %package tdeiosvn Requires: tdesvn = %{version} Group: Development/Tools -Summary: A kde-kio integration for subversion based on tdesvn +Summary: A kde-tdeio integration for subversion based on tdesvn %description tdeiosvn KIO integration (TDEIO::svn) based on tdesvn alternative protocol name. diff --git a/tdesvn.spec.in b/tdesvn.spec.in index a51fa10..9b729ba 100644 --- a/tdesvn.spec.in +++ b/tdesvn.spec.in @@ -24,7 +24,7 @@ via a KIO protocol, too. %package tdeiosvn Requires: tdesvn = %{version} Group: Development/Tools -Summary: A kde-kio integration for subversion based on tdesvn +Summary: A kde-tdeio integration for subversion based on tdesvn %description tdeiosvn KIO integration (TDEIO::svn) based on tdesvn alternative protocol name. -- cgit v1.2.1