From kde-commits Fri Apr 25 23:25:24 2014 From: John Firebaugh Date: Fri, 25 Apr 2014 23:25:24 +0000 To: kde-commits Subject: [kde-baseapps/frameworks] about: Simple about protocol so we can remove some hacks in konqueror... Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=139846833812192 Git commit 24466203cc413a7c1cf15cc260a9e91077f1eec7 by John Firebaugh. Committed on 30/09/2002 at 03:59. Pushed by ervin into branch 'frameworks'. Simple about protocol so we can remove some hacks in konqueror... svn path=3D/trunk/kdebase/kioslave/; revision=3D181193 A +21 -0 about/Makefile.am A +7 -0 about/about.protocol A +76 -0 about/kio_about.cpp [License: LGPL (v2+) (wrong address)= ] * A +39 -0 about/kio_about.h [License: LGPL (v2+) (wrong address)] = * The files marked with a * at the end have a non valid license. Please read:= http://techbase.kde.org/Policies/Licensing_Policy and use the headers whic= h are listed at that page. http://commits.kde.org/kde-baseapps/24466203cc413a7c1cf15cc260a9e91077f1eec7 diff --git a/about/Makefile.am b/about/Makefile.am new file mode 100644 index 0000000..fb77338 --- /dev/null +++ b/about/Makefile.am @@ -0,0 +1,21 @@ +## Makefile.am of kdebase/kioslave/about + +INCLUDES=3D $(all_includes) +LDFLAGS =3D $(all_libraries) $(KDE_RPATH) + +####### Files + +kde_module_LTLIBRARIES =3D kio_about.la + +kio_about_la_SOURCES =3D kio_about.cpp +kio_about_la_LIBADD =3D $(LIB_KSYCOCA) +kio_about_la_LDFLAGS =3D $(all_libraries) -module $(KDE_PLUGIN) +noinst_HEADERS =3D kio_about.h + +kdelnk_DATA =3D about.protocol +kdelnkdir =3D $(kde_servicesdir) + +METASOURCES =3D AUTO + +messages: + $(XGETTEXT) -C *.cpp *.h -o $(podir)/kio_about.pot diff --git a/about/about.protocol b/about/about.protocol new file mode 100644 index 0000000..d988b8e --- /dev/null +++ b/about/about.protocol @@ -0,0 +1,7 @@ +[Protocol] +exec=3Dkio_about +protocol=3Dabout +input=3Dnone +output=3Dfilesystem +reading=3Dtrue +defaultMimetype=3Dtext/html diff --git a/about/kio_about.cpp b/about/kio_about.cpp new file mode 100644 index 0000000..06ee4e9 --- /dev/null +++ b/about/kio_about.cpp @@ -0,0 +1,76 @@ +/* This file is part of the KDE libraries + + Copyright (c) 2002 John Firebaugh + + 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 Lice= nse + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +#include "kio_about.h" + +#include +#include +#include +#include + +using namespace KIO; + +AboutProtocol::AboutProtocol(const QCString &pool_socket, const QCString &= app_socket) + : SlaveBase("about", pool_socket, app_socket) +{ +} + +AboutProtocol::~AboutProtocol() +{ +} + +void AboutProtocol::get( const KURL& ) +{ + QString output; + = + QTextStream os(&output, IO_WriteOnly); + os.setEncoding(QTextStream::Locale); + + os << "about:blank"; + = + data( output.local8Bit() ); + finished(); +} + +void AboutProtocol::mimetype( const KURL& ) +{ + mimeType("text/html"); + finished(); +} + +extern "C" +{ + int kdemain( int argc, char **argv ) { + + KInstance instance("kio_about"); + + if (argc !=3D 4) + { + fprintf(stderr, "Usage: kio_about protocol domain-socket1 doma= in-socket2\n"); + exit(-1); + } + + AboutProtocol slave(argv[2], argv[3]); + slave.dispatchLoop(); + + return 0; + } +} + diff --git a/about/kio_about.h b/about/kio_about.h new file mode 100644 index 0000000..929a582 --- /dev/null +++ b/about/kio_about.h @@ -0,0 +1,39 @@ +/* This file is part of the KDE libraries + + Copyright (c) 2002 John Firebaugh + + 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 Lice= nse + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ +#ifndef __kio_about_h__ +#define __kio_about_h__ + +#include + +#include +#include + + +class AboutProtocol : public KIO::SlaveBase +{ +public: + AboutProtocol(const QCString &pool_socket, const QCString &app_socket); + virtual ~AboutProtocol(); + + virtual void get(const KURL& url); + virtual void mimetype(const KURL& url); +}; + +#endif