diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-27 01:02:02 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-01-27 01:02:02 -0600 |
commit | de7e5867a65e0a46f1388e3e50bc7eeddd1aecbf (patch) | |
tree | dbb3152c372f8620f9290137d461f3d9f9eba1cb /kioslave/finger | |
parent | 936d3cec490c13f2c5f7dd14f5e364fddaa6da71 (diff) | |
download | tdebase-de7e5867a65e0a46f1388e3e50bc7eeddd1aecbf.tar.gz tdebase-de7e5867a65e0a46f1388e3e50bc7eeddd1aecbf.zip |
Rename a number of libraries and executables to avoid conflicts with KDE4
Diffstat (limited to 'kioslave/finger')
-rw-r--r-- | kioslave/finger/CMakeLists.txt | 37 | ||||
-rw-r--r-- | kioslave/finger/Makefile.am | 27 | ||||
-rw-r--r-- | kioslave/finger/finger.protocol | 9 | ||||
-rw-r--r-- | kioslave/finger/kio_finger.cpp | 266 | ||||
-rw-r--r-- | kioslave/finger/kio_finger.css | 69 | ||||
-rw-r--r-- | kioslave/finger/kio_finger.h | 64 | ||||
-rw-r--r-- | kioslave/finger/kio_finger.pl | 175 |
7 files changed, 0 insertions, 647 deletions
diff --git a/kioslave/finger/CMakeLists.txt b/kioslave/finger/CMakeLists.txt deleted file mode 100644 index 8f70b4188..000000000 --- a/kioslave/finger/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${TDE_INCLUDE_DIR} - ${TQT_INCLUDE_DIRS} -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES finger.protocol DESTINATION ${SERVICES_INSTALL_DIR} ) -install( FILES kio_finger.pl kio_finger.css DESTINATION ${DATA_INSTALL_DIR}/kio_finger ) - - -##### kio_finger (module) ####################### - -set( target kio_finger ) - -tde_add_kpart( ${target} AUTOMOC - SOURCES kio_finger.cpp - LINK kio-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kioslave/finger/Makefile.am b/kioslave/finger/Makefile.am deleted file mode 100644 index 55066bf74..000000000 --- a/kioslave/finger/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -## Makfile.am for kio_finger -## Edit from Makefile.am of tdebase/kioslave/man - -INCLUDES= $(all_includes) -AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor - -####### Files - -kde_module_LTLIBRARIES = kio_finger.la - -kio_finger_la_SOURCES = kio_finger.cpp -kio_finger_la_LIBADD = -lkio -kio_finger_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) - -noinst_HEADERS = kio_finger.h - -kdelnk_DATA = finger.protocol -kdelnkdir = $(kde_servicesdir) - -kio_finger_data_DATA = kio_finger.pl kio_finger.css -kio_finger_datadir = $(kde_datadir)/kio_finger -EXTRA_DIST=$(kio_finger_data_DATA) - -METASOURCES = AUTO - -messages: - $(XGETTEXT) *.cpp -o $(podir)/kio_finger.pot diff --git a/kioslave/finger/finger.protocol b/kioslave/finger/finger.protocol deleted file mode 100644 index d11553c41..000000000 --- a/kioslave/finger/finger.protocol +++ /dev/null @@ -1,9 +0,0 @@ -[Protocol] -exec=kio_finger -protocol=finger -input=none -output=stream -reading=true -defaultMimetype=text/html -DocPath=kioslave/finger.html -Icon=tdmconfig diff --git a/kioslave/finger/kio_finger.cpp b/kioslave/finger/kio_finger.cpp deleted file mode 100644 index 8f330b95e..000000000 --- a/kioslave/finger/kio_finger.cpp +++ /dev/null @@ -1,266 +0,0 @@ - -/*************************************************************************** - kio_finger.cpp - description - ------------------- - begin : Sun Aug 12 2000 - copyright : (C) 2000 by Andreas Schlapbach - email : schlpbch@iam.unibe.ch - ***************************************************************************/ - -/*************************************************************************** - * * - * 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 <stdio.h> -#include <stdlib.h> -#include <sys/stat.h> -#include <string.h> - -#include <tqtextstream.h> -#include <tqdict.h> -#include <tqcstring.h> -#include <tqfile.h> -#include <tqregexp.h> - -#include <kdebug.h> -#include <kinstance.h> -#include <kglobal.h> -#include <kstandarddirs.h> -#include <klocale.h> -#include <kurl.h> - -#include "kio_finger.h" - - -using namespace TDEIO; - -static const TQString defaultRefreshRate = "60"; - -extern "C" -{ - KDE_EXPORT int kdemain( int argc, char **argv ) - { - TDEInstance instance( "kio_finger" ); - - //kdDebug() << "*** Starting kio_finger " << getpid() << endl; - - if (argc != 4) - { - fprintf(stderr, "Usage: kio_finger protocol domain-socket1 domain-socket2\n"); - exit(-1); - } - - FingerProtocol slave(argv[2], argv[3]); - slave.dispatchLoop(); - - //kdDebug() << "*** kio_finger Done" << endl; - return 0; - } -} - - -/* ---------------------------------------------------------------------------------- */ - - -FingerProtocol::FingerProtocol(const TQCString &pool_socket, const TQCString &app_socket) - : TQObject(), SlaveBase("finger", pool_socket, app_socket) -{ - myStdStream = new TQString(); - getProgramPath(); -} - - -/* ---------------------------------------------------------------------------------- */ - - -FingerProtocol::~FingerProtocol() -{ - //kdDebug() << "FingerProtocol::~FingerProtocol()" << endl; - delete myURL; - delete myPerlPath; - delete myFingerPath; - delete myFingerPerlScript; - delete myFingerCSSFile; - delete myStdStream; -} - - -/* ---------------------------------------------------------------------------------- */ - - -void FingerProtocol::get(const KURL& url ) -{ - //kdDebug() << "kio_finger::get(const KURL& url)" << endl ; - - this->parseCommandLine(url); - - //kdDebug() << "myURL: " << myURL->prettyURL() << endl; - - // Reset the stream - *myStdStream=""; - - TQString query = myURL->query(); - TQString refreshRate = defaultRefreshRate; - - //kdDebug() << "query: " << query << endl; - - // Check the validity of the query - - TQRegExp regExp("?refreshRate=[0-9][0-9]*", true, true); - if (query.contains(regExp)) { - //kdDebug() << "looks like a valid query" << endl; - TQRegExp regExp( "([0-9]+)" ); - regExp.search(query); - refreshRate = regExp.cap(0); - } - - //kdDebug() << "Refresh rate: " << refreshRate << endl; - - myTDEProcess = new TDEProcess(); - *myTDEProcess << *myPerlPath << *myFingerPerlScript - << *myFingerPath << *myFingerCSSFile - << refreshRate << myURL->host() << myURL->user() ; - - connect(myTDEProcess, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)), - this, TQT_SLOT(slotGetStdOutput(TDEProcess *, char *, int))); - //connect(myTDEProcess, TQT_SIGNAL(receivedStderr(TDEProcess *, char *, int)), - // this, TQT_SLOT(slotGetStdOutput(TDEProcess *, char *, int))); - - myTDEProcess->start(TDEProcess::Block, TDEProcess::All); - - data(TQCString(TQString(*myStdStream).local8Bit())); - - data(TQByteArray()); - finished(); - - //clean up - - delete myTDEProcess; -} - - -/* ---------------------------------------------------------------------------------- */ - - -void FingerProtocol::slotGetStdOutput(TDEProcess* /* p */, char *s, int len) -{ - //kdDebug() << "void FingerProtocol::slotGetStdoutOutput()" << endl; - *myStdStream += TQString::fromLocal8Bit(s, len); -} - - -/* ---------------------------------------------------------------------------------- */ - - -void FingerProtocol::mimetype(const KURL & /*url*/) -{ - mimeType("text/html"); - finished(); -} - - -/* ---------------------------------------------------------------------------------- */ - - -void FingerProtocol::getProgramPath() -{ - //kdDebug() << "kfingerMainWindow::getProgramPath()" << endl; - // Not to sure wether I'm using the right error number here. - schlpbch - - - myPerlPath = new TQString(TDEGlobal::dirs()->findExe("perl")); - if (myPerlPath->isEmpty()) - { - //kdDebug() << "Perl command not found" << endl; - this->error(ERR_CANNOT_LAUNCH_PROCESS, - i18n("Could not find the Perl program on your system, please install.")); - exit(); - } - else - { - //kdDebug() << "Perl command found:" << *myPerlPath << endl; - } - - myFingerPath = new TQString(TDEGlobal::dirs()->findExe("finger")); - if ((myFingerPath->isEmpty())) - { - //kdDebug() << "Finger command not found" << endl; - this->error(ERR_CANNOT_LAUNCH_PROCESS, - i18n("Could not find the Finger program on your system, please install.")); - exit(); - } - else - { - //kdDebug() << "Finger command found:" << *myFingerPath << endl; - } - - myFingerPerlScript = new TQString(locate("data","kio_finger/kio_finger.pl")); - if (myFingerPerlScript->isEmpty()) - { - //kdDebug() << "kio_finger.pl script not found" << endl; - this->error(ERR_CANNOT_LAUNCH_PROCESS, - i18n("kio_finger Perl script not found.")); - exit(); - } - else - { - //kdDebug() << "kio_finger perl script found: " << *myFingerPerlScript << endl; - } - - myFingerCSSFile = new TQString(locate("data","kio_finger/kio_finger.css")); - if (myFingerCSSFile->isEmpty()) - { - //kdDebug() << "kio_finger.css file not found" << endl; - this->warning(i18n("kio_finger CSS script not found. Output will look ugly.")); - } - else - { - //kdDebug() << "kio_finger CSS file found: " << *myFingerCSSFile << endl; - } -} - - -/* --------------------------------------------------------------------------- */ - - -void FingerProtocol::parseCommandLine(const KURL& url) -{ - myURL = new KURL(url); - - /* - * Generate a valid finger url - */ - - if(myURL->isEmpty() || !myURL->isValid() || - (myURL->user().isEmpty() && myURL->host().isEmpty())) - { - myURL->setProtocol("finger"); - myURL->setUser(""); - myURL->setHost("localhost"); - } - - /* - * If no specific port is specified, set it to 79. - */ - - if(myURL->port() == 0) { - myURL->setPort(79); - } - - /* - * If no refresh rate is given, set it to defaultRefreshRate - */ - - if (myURL->query().isEmpty()) { - myURL->setQuery("?refreshRate="+defaultRefreshRate); - } -} - -/* ---------------------------------------------------------------------------------- */ -#include "kio_finger.moc" -/* ---------------------------------------------------------------------------------- */ - diff --git a/kioslave/finger/kio_finger.css b/kioslave/finger/kio_finger.css deleted file mode 100644 index 06deb81aa..000000000 --- a/kioslave/finger/kio_finger.css +++ /dev/null @@ -1,69 +0,0 @@ -BODY { - color: #FFFFCC; - background-color: #000000; - padding: 2em; - margin: auto; -} - -A:link {color: #82A7D0} -A:visited {color: #999999} -A:active {color: #999999} - -H1 { - color: #999999; - background-color: #000000; - font: 200% Helvetica, sans-serif; - font-variant: normal; - padding: 1em; - margin: auto; -} - -.mainTable { - background-color: #000000; - border: thin solid; - margin: auto; -} - - -.courierText { - color: #FFFFCC; - background-color: #000000; - font: 120% Courier, sans-serif; - font-variant: normal; - text-align: left; - padding: 0em; -} - -.commandText { - color: #FFFFCC; - background-color: #000000; - font: 120% Courier, sans-serif; - font-variant: normal; - text-align: center; - padding: 0.5em; -} - -.niceText { - color: #009999; - background-color: #000000; - font: 120% Arial, sans-serif; - font-variant: normal; - text-align: center; - padding: 0.5em; -} - -.finger { color: #82A7D0} -.domainName { color: #D0A000} -.ipNumber { color: #D0A000} -.os { color: #82A7D0} -.username { color: #82A7D0} -.directory { color: #D0A000} -.shell { color: #D0A000} -.notLoggedIn { color: #00A000} -.loggedIn { color: #B00000} -.newMail { color: #82A7D0} -.plan { color: #D0A000} -.noNewMail { color: #BB0000} -.noPlan { color: #BB0000} - - diff --git a/kioslave/finger/kio_finger.h b/kioslave/finger/kio_finger.h deleted file mode 100644 index e9044f26d..000000000 --- a/kioslave/finger/kio_finger.h +++ /dev/null @@ -1,64 +0,0 @@ - -/*************************************************************************** - kio_finger.h - description - ------------------- - begin : Sun Aug 12 2000 - copyright : (C) 2000 by Andreas Schlapbach - email : schlpbch@iam.unibe.ch - ***************************************************************************/ - -/*************************************************************************** - * * - * 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 __kio_finger_h__ -#define __kio_finger_h__ - -#include <tqstring.h> -#include <tqcstring.h> - -#include <kurl.h> -#include <kprocess.h> -#include <kio/global.h> -#include <kio/slavebase.h> - -class FingerProtocol : public TQObject, public TDEIO::SlaveBase -{ - Q_OBJECT - -public: - - FingerProtocol(const TQCString &pool_socket, const TQCString &app_socket); - virtual ~FingerProtocol(); - - virtual void mimetype(const KURL& url); - virtual void get(const KURL& url); - -private slots: - void slotGetStdOutput(TDEProcess*, char*, int); - -private: - KURL *myURL; - - QString *myPerlPath; - TQString *myFingerPath; - TQString *myFingerPerlScript; - TQString *myFingerCSSFile; - - QString *myStdStream; - - - TDEProcess *myTDEProcess; - - void getProgramPath(); - void parseCommandLine(const KURL& url); -}; - - -#endif diff --git a/kioslave/finger/kio_finger.pl b/kioslave/finger/kio_finger.pl deleted file mode 100644 index 8965ea523..000000000 --- a/kioslave/finger/kio_finger.pl +++ /dev/null @@ -1,175 +0,0 @@ -##!/usr/bin/perl -# -# Copyright Andreas Schlapbach, schlpbch@iam.unibe.ch, 2001 -# http://iamexwiwww.unibe.ch/studenten/kfinger -# -# Touch at your own risk. - - -# Highlight mail addresses or url - -$mails = '<A HREF="mailto:'; -$urls = '<A HREF="'; -$urlspace = '">'; -$urlend = '</A>'; - -# Highlight various information, configurable via the CSS file, - -$finger = '<CODE class="finger">'; -$domainName = '<CODE class="domainName">'; -$ipNumber = '<CODE class="ipNumber">'; -$os = '<CODE class="os">'; -$username = '<CODE class="username">'; -$directory = '<CODE class="directory">'; -$shell = '<CODE class="shell">'; -$notLoggedIn = '<CODE class="Login">'; -$loggedIn = '<CODE class="noLogin">'; -$newMail = '<CODE class="newMail">'; -$plan = '<CODE class="plan">'; -$noNewMail = '<CODE class="noNewMail">'; -$noPlan = '<CODE class="noPlan">'; -$close = '</CODE>'; - -# Those names get skipped, so if there's a user with such a name, bad luck. - -@keywords=('Welcome','Login','finger','No'); -$keywordlist = join '|', @keywords; - -$FINGERCMD = "$ARGV[0]"; # The complete path to the finger cmd -$CSSFILE = "$ARGV[1]"; # The complete path to the CSS file -$REFRESHRATE = "$ARGV[2]"; # The intervals in seconds until the page gets updated -$HOST = "$ARGV[3]"; # host name -$USER = "$ARGV[4]"; # user name - -$HOST =~ s/&/&/g; -$HOST =~ s/</</g; -$HOST =~ s/>/>/g; - -$USER =~ s/&/&/g; -$USER =~ s/</</g; -$USER =~ s/>/>/g; - -# HTML Header - -print <<HTMLHeader; -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> -<HTML> -<HEAD> - <meta http-equiv="refresh" content="$REFRESHRATE"> - <TITLE>finger $USER\@$HOST</TITLE> - <LINK type="text/css" rel="stylesheet" href="file:$CSSFILE"> -</HEAD> -<BODY> - <TABLE class="mainTable" cellspacing="0"> - <TR> - <TH colspan="1"> - <H1>finger $USER\@$HOST</H1> - </TH> - </TR> - <TR> - <TH> - <TABLE class="courierText" cellpadding="0" cellspacing="2"> -HTMLHeader - -# Run finger command and save it into a buffer - -open(F, "-|") || exec $FINGERCMD, "$USER\@$HOST"; -@lines = <F>; -close(F); - -# Do highlighting using perl regular expressions on every line received. -# Order is important here. - -foreach $output (@lines) - { - $output =~ s/((\w)+\@((\w)+(.))*(\w)+)/$mails$1$urlspace$1$urlend/gi; # Highlight email address - $output =~ s/((http|ftp)(:\/\/)(\S)+)/$urls$1$urlspace$1$urlend/gi; # Highlight urls - $output =~ s/((\d)+\.(\d)+\.(\d)+\.(\d)+)/$ipNumber$1$close/gi; # Highlight IP number - $output =~ s/((\w)+\.(\w)+\.(\w|-)+\s)/$domainName$1$close/gi; # Highlight domain name (\s is important) - $output =~ s/(finger:)/$finger$1$close/gim; # Highlight finger - $output =~ s/(Linux)/$os$1$close/gim; # Highlight Linux - if ($USER) # is $USER nil ? - { - $output =~ s/^Login:\s*(\w*)/Login: $mails$1\@$HOST$urlspace$1$urlend/gi; - $output =~ s/^Login Name:\s*(\w*)/Login Name:$mails$1\@$HOST$urlspace$1$urlend/gi; - $output =~ s/Name:(((\s*)(\w+))+\n)/Name:$username$1$close\n/gi; # Linux - $output =~ s/In real life:(((\s*)(\w+))+\n)/In real life:$username$1$close\n/gi; # Solaris - $output =~ s/^Directory:((\s*)(\/(\w)+)+)/Directory:$directory$1$close/gi; # Highlight Directory - $output =~ s/Shell:((\s*)(\/(\w)+)+)/Shell:$shell$1$close/gi; # Highlight Shell - $output =~ s/(not presently logged)/$notLoggedIn$1$close/gi; - $output =~ s/con (\w*)/con $loggedIn$1$close/gi; - $output =~ s/^(New mail)/$newMail$1$close/gi; - $output =~ s/^(No mail.)/$noNewMail$1$close/gim; - $output =~ s/^(Plan:)/$plan$1$close/gi; - $output =~ s/^(No plan.)/$noPlan$1$close/gim; - } - else - { - $output =~ s/^(\w+)/$mails$1\@$HOST$urlspace$1$urlend/m unless ($output =~ m/$keywordlist/m); - } - # line consists of white space only? - if ($output =~ m/\S/gi) - { - print " <TR><TD><PRE>$output</PRE></TD></TR>\n"; - } - else - { - print " <TR><TD><PRE> </PRE></TD></TR>\n"; - } -} - -print " </TABLE>\n"; -print " </TH>\n"; - -# Finger-Talk options - -if ($USER) # is $USER nil ? -{ -print <<UserQuery; - </TR> - <TR> - <TH class="commandText" colspan="2"> - <A HREF='finger://$USER\@$HOST'>finger</A> - </TH> - </TR> -UserQuery -} -else -{ -print <<HostQueryHead; - <TH> - <TABLE class="courierText" cellpadding="0" cellspacing="2"> -HostQueryHead - - @lines = split /^/m, $buffer; - foreach $output2 (@lines) - { - if ($output2 =~ m/^(\w+)/gi and not ($output2 =~ m/$keywordlist/m)) - { - $USER = $&; - print " <TR><TD><PRE><A HREF='finger://$USER\@$HOST'>finger</A>\n</PRE></TD></TR>\n"; - # - <A HREF='talk://$USER\@$HOST'>talk</A>\n</PRE></TD></TR>\n"; - } - else - { - print " <TR><TD><PRE> </PRE></TD></TR>\n"; - } - } - -print <<HostQueryTail; - </TABLE> - </TH> - </TR> -HostQueryTail -} - -# HTMLTail - -print <<HTMLTail; - <TR> - <TH class="niceText">refresh rate: $REFRESHRATE seconds.</TH> - </TR> -</TABLE> -</BODY> -</HTML> -HTMLTail |