summaryrefslogtreecommitdiffstats
path: root/kopete/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/plugins')
-rwxr-xr-xkopete/plugins/latex/kopete_latexconvert.sh8
-rw-r--r--kopete/plugins/nowlistening/Makefile.am4
-rw-r--r--kopete/plugins/nowlistening/nlxmms.cpp11
-rw-r--r--kopete/plugins/nowlistening/nlxmms.h4
-rw-r--r--kopete/plugins/translator/translatorlanguages.cpp40
-rw-r--r--kopete/plugins/translator/translatorplugin.cpp10
6 files changed, 46 insertions, 31 deletions
diff --git a/kopete/plugins/latex/kopete_latexconvert.sh b/kopete/plugins/latex/kopete_latexconvert.sh
index b7f92263..298ebbde 100755
--- a/kopete/plugins/latex/kopete_latexconvert.sh
+++ b/kopete/plugins/latex/kopete_latexconvert.sh
@@ -94,9 +94,7 @@ done
#
if test -n "`type -p mktemp`" ; then
- tmpdir="`mktemp /tmp/tex2imXXXXXX`"
- rm $tmpdir
- mkdir $tmpdir
+ tmpdir="`mktemp -d /tmp/tex2imXXXXXX`"
else
tmpdir=/tmp/tex2im$$
if [ -e $tmpdir ] ; then
@@ -171,7 +169,7 @@ fi
#if [ -e "$infile" ]; then
# cat $infile >> $tmpdir/out.tex
#else
- echo "$infile" >> $tmpdir/out.tex
+ printf '%s' "$infile" >> $tmpdir/out.tex
#fi
if [ $noformula -eq 1 ]; then
@@ -222,7 +220,7 @@ else
mv $tmpdir/out.$format.0 $outfile
fi
-let OPTIND=$OPTIND+1
+OPTIND=$((${OPTIND}+1))
outfile=""
done
diff --git a/kopete/plugins/nowlistening/Makefile.am b/kopete/plugins/nowlistening/Makefile.am
index a9357d5f..dbbeec1a 100644
--- a/kopete/plugins/nowlistening/Makefile.am
+++ b/kopete/plugins/nowlistening/Makefile.am
@@ -5,8 +5,8 @@ AM_CPPFLAGS = $(KOPETE_INCLUDES) $(XMMS_INCLUDES) $(all_includes)
kde_module_LTLIBRARIES = kopete_nowlistening.la kcm_kopete_nowlistening.la
kopete_nowlistening_la_SOURCES = nowlisteningconfig.kcfgc nowlisteningplugin.cpp nlkscd.cpp nlnoatun.cpp nlxmms.cpp nowlisteningguiclient.cpp nljuk.cpp nlamarok.cpp nlkaffeine.cpp
-kopete_nowlistening_la_LDFLAGS = -module $(KDE_PLUGIN) $(XMMS_LDFLAGS) $(all_libraries)
-kopete_nowlistening_la_LIBADD = ../../libkopete/libkopete.la $(XMMS_LIBS)
+kopete_nowlistening_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+kopete_nowlistening_la_LIBADD = ../../libkopete/libkopete.la
kcm_kopete_nowlistening_la_SOURCES = nowlisteningprefs.ui nowlisteningpreferences.cpp nowlisteningconfig.kcfgc
kcm_kopete_nowlistening_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries)
diff --git a/kopete/plugins/nowlistening/nlxmms.cpp b/kopete/plugins/nowlistening/nlxmms.cpp
index f0a9f47a..a2d3637d 100644
--- a/kopete/plugins/nowlistening/nlxmms.cpp
+++ b/kopete/plugins/nowlistening/nlxmms.cpp
@@ -24,6 +24,7 @@
#ifdef HAVE_XMMS
+#include <dlfcn.h>
#include <kdebug.h>
#include <xmmsctrl.h> // need to fix Makefile.am for this?
#include "nlmediaplayer.h"
@@ -32,13 +33,21 @@
NLXmms::NLXmms() : NLMediaPlayer()
{
m_name = "Xmms";
+
+ xmmslib = dlopen("libxmms.so.1", RTLD_LAZY | RTLD_GLOBAL);
}
+NLXmms::~NLXmms()
+{
+ if (xmmslib)
+ dlclose(xmmslib);
+}
void NLXmms::update()
{
//look for running xmms
- if ( xmms_remote_get_version( 0 ) )
+ if ( xmmslib &&
+ xmms_remote_get_version( 0 ) )
{
QString newTrack;
// see if it's playing
diff --git a/kopete/plugins/nowlistening/nlxmms.h b/kopete/plugins/nowlistening/nlxmms.h
index 14c74ea8..d64fc08f 100644
--- a/kopete/plugins/nowlistening/nlxmms.h
+++ b/kopete/plugins/nowlistening/nlxmms.h
@@ -31,7 +31,11 @@ class NLXmms : public NLMediaPlayer
{
public:
NLXmms();
+ ~NLXmms();
virtual void update();
+
+ private:
+ void *xmmslib;
};
#endif
diff --git a/kopete/plugins/translator/translatorlanguages.cpp b/kopete/plugins/translator/translatorlanguages.cpp
index 4e59fa79..d0a1e0a0 100644
--- a/kopete/plugins/translator/translatorlanguages.cpp
+++ b/kopete/plugins/translator/translatorlanguages.cpp
@@ -29,7 +29,7 @@ TranslatorLanguages::TranslatorLanguages()
{
m_lc = 0;
m_sc = 0;
- m_services.insert("babelfish", "BabelFish");
+// m_services.insert("babelfish", "BabelFish");
m_services.insert("google", "Google");
m_langs.insert("null", i18n("Unknown"));
@@ -45,29 +45,29 @@ TranslatorLanguages::TranslatorLanguages()
m_langs.insert("es", i18n("Spanish"));
/* English to .. */
- m_supported["babelfish"].append("en_zh");
- m_supported["babelfish"].append("en_fr");
- m_supported["babelfish"].append("en_de");
- m_supported["babelfish"].append("en_it");
- m_supported["babelfish"].append("en_ja");
- m_supported["babelfish"].append("en_ko");
- m_supported["babelfish"].append("en_pt");
- m_supported["babelfish"].append("en_es");
+// m_supported["babelfish"].append("en_zh");
+// m_supported["babelfish"].append("en_fr");
+// m_supported["babelfish"].append("en_de");
+// m_supported["babelfish"].append("en_it");
+// m_supported["babelfish"].append("en_ja");
+// m_supported["babelfish"].append("en_ko");
+// m_supported["babelfish"].append("en_pt");
+// m_supported["babelfish"].append("en_es");
/* Chinese to .. */
- m_supported["babelfish"].append("zh_en");
+// m_supported["babelfish"].append("zh_en");
/* French to ... */
- m_supported["babelfish"].append("fr_en");
- m_supported["babelfish"].append("fr_de");
+// m_supported["babelfish"].append("fr_en");
+// m_supported["babelfish"].append("fr_de");
/* German to ... */
- m_supported["babelfish"].append("de_en");
- m_supported["babelfish"].append("de_fr");
+// m_supported["babelfish"].append("de_en");
+// m_supported["babelfish"].append("de_fr");
- m_supported["babelfish"].append("it_en");
- m_supported["babelfish"].append("ja_en");
- m_supported["babelfish"].append("ko_en");
- m_supported["babelfish"].append("pt_en");
- m_supported["babelfish"].append("ru_en");
- m_supported["babelfish"].append("es_en");
+// m_supported["babelfish"].append("it_en");
+// m_supported["babelfish"].append("ja_en");
+// m_supported["babelfish"].append("ko_en");
+// m_supported["babelfish"].append("pt_en");
+// m_supported["babelfish"].append("ru_en");
+// m_supported["babelfish"].append("es_en");
/* Google Service */
m_supported["google"].append("en_de");
diff --git a/kopete/plugins/translator/translatorplugin.cpp b/kopete/plugins/translator/translatorplugin.cpp
index 694f0bd1..4ac8367f 100644
--- a/kopete/plugins/translator/translatorplugin.cpp
+++ b/kopete/plugins/translator/translatorplugin.cpp
@@ -16,6 +16,8 @@
* (at your option) any later version. *
* *
*************************************************************************
+ Patched by Francesco Rossi <redsh@email.it> in order to support new
+ google translation page layout (13-sept-2007)
*/
#include <qapplication.h>
@@ -290,7 +292,8 @@ QString TranslatorPlugin::googleTranslateMessage( const QString &msg, const QStr
// kdDebug( 14308 ) << k_funcinfo << "Google response:"<< endl << data << endl;
- QRegExp re( "<textarea name=q rows=5 cols=45 wrap=PHYSICAL>(.*)</textarea>" );
+// QRegExp re( "<textarea name=q rows=5 cols=45 wrap=PHYSICAL>(.*)</textarea>" );
+ QRegExp re( "<textarea name=utrans wrap=PHYSICAL dilr=ltr rows=5 id=suggestion>(.*)</textarea>");
re.setMinimal( true );
re.search( data );
@@ -325,7 +328,8 @@ QString TranslatorPlugin::babelTranslateMessage( const QString &msg, const QStri
//kdDebug( 14308 ) << k_funcinfo << "Babelfish response: " << endl << data << endl;
- QRegExp re( "<Div style=padding:10px; lang=..>(.*)</div" );
+// QRegExp re( "<Div style=padding:10px; lang=..>(.*)</div" );
+ QRegExp re( "<div style=padding:10px;>(.*)</div>" );
re.setMinimal( true );
re.search( data );
@@ -360,7 +364,7 @@ void TranslatorPlugin::sendTranslation( Kopete::Message &msg, const QString &tra
msg.setBody( translated, msg.format() );
break;
case ShowOriginal:
- msg.setBody( i18n( "%2\nAuto Translated: %1" ).arg( translated, msg.plainBody() ), msg.format() );
+ msg.setBody( i18n( "%2 \nAuto Translated: \n%1" ).arg( translated, msg.plainBody() ), msg.format() );
break;
case ShowDialog:
{