Re: plasma dataengine question

2011-03-16 Thread Aaron J. Seigo
On Wednesday, March 16, 2011, Farhad Hedayati-Fard wrote:
 there is another problem here! I've inherited from Plasma::PackageStructure
 (Just like comic_package in comic dataengine)... but I still can't install
 my translator plugin with plasmapkg:
 Could not find a suitable installer for package of type Plasma/Translator

firstly, what language are your addons written in? are they also in 
javascript, like the comic engine?  

in any case, to let plasmapkg know about Plasma/Translator packages, there 
needs to either be a plasma package plugin (C++) installed, which is what the 
comic DataEngine (among others) do. in the comic engine, see:

comic_package.h
comic_package.cpp
comic_package_plugin.cpp
plasma-packagestructure-comic.desktop

if your plugins are javascript and your datengine and plugins don't need 
access to anything more than http or other facilities provided by the 
javascript bindings, then you could write your DataEngine in Javascript as 
well and you get addons for free. for an example of that see:

kdeexamples/plasma/javascript/generic/usingAddons/
kdeexamples/plasma/javascript/generic/exampleAddon/

 though! (there is no good tutorial on plasma packages too! at least I
 couldn't find any in techbase!)

you're right, there isn't. another bit fo docuemtnation that needs writing.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: plasma dataengine question

2011-03-15 Thread Farhad Hedayati-Fard
On Monday 14 March 2011 17:51:54 Aaron J. Seigo wrote:
 On Tuesday, March 15, 2011, Farhad Hedayati-Fard wrote:
  Hi!
  I've written a translation dataengine... It needs 3 arguments to
  initialize the translator object ( plugin name, source language and
  destination language). I've put a Q_ASSERT on args.size() in
  dataengine's constructor but now I can't test my dataengine using
  plasmaengineexplorer because it crashes on the Q_ASSERT (no argument is
  passed to the constructor):
  
  TranslatorEngine::TranslatorEngine(QObject* parent, const QVariantList
  args): DataEngine(parent, args)
  {
  
 Q_ASSERT(args.size() = 3);
 QString from = args[0].toString();
 QString to = args[1].toString();
 QString name = args[2].toString();
 translator = new Translator((QWidget*)this, from, to, name);
 
  
  }
  
  What should I do to get this working??
 
 the args passed in are currently always empty for the DataEngine
 constructor.
 
 perhaps the misunderstanding here is that there is only ever one instance of
 the DataEngine loaded, and that one engine hosts multiple sources of data.
 
 information such as the to/from language should be encoded in the source
 name, e.g. en:de:flower (which might have as its data: Blume). the
 DataEngine would process these requests in sourceRequestEvent.

Thank you Aaron, It's working now (using absolute path to the script file!) :)
I'm trying to add Plasma::Package support to the dataengine, but...

there is another problem here! I've inherited from Plasma::PackageStructure 
(Just like comic_package in comic dataengine)... but I still can't install my 
translator plugin with plasmapkg:
Could not find a suitable installer for package of type Plasma/Translator

I think there is a problem in my CMakeLists.txt file I'm not sure though! 
(there is no good tutorial on plasma packages too! at least I couldn't find any 
in techbase!)

btw, this is my CMakeLists file:


project(plasma-translator)
 
find_package(KDE4 REQUIRED)
include(KDE4Defaults)
 
add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
include_directories(
   ${CMAKE_SOURCE_DIR}
   ${CMAKE_BINARY_DIR}
   ${KDE4_INCLUDES}
   )
 
set(translator_engine_SRCS translator-engine.cpp translator.cpp)
 
kde4_add_plugin(plasma_engine_translator ${translator_engine_SRCS})
target_link_libraries(plasma_engine_translator ${KDE4_KDECORE_LIBS} 
${KDE4_PLASMA_LIBS} ${KDE4_KDEUI_LIBS} ${KDE4_KROSSUI_LIBS} ${KDE4_KIO_LIBS} 
${KDE4_KROSSCORE_LIBS})


install(TARGETS plasma_engine_translator
DESTINATION ${PLUGIN_INSTALL_DIR})
 
install(FILES plasma-engine-translator.desktop
DESTINATION ${SERVICES_INSTALL_DIR})

install( FILES plasma-translationprovider.desktop DESTINATION 
${SERVICETYPES_INSTALL_DIR} )


kde4_add_plugin( plasma-packagestructure-translator translatorpackage.cpp )
target_link_libraries( plasma-packagestructure-translator ${KDE4_KDEUI_LIBS} 
${KDE4_PLASMA_LIBS} )
install( TARGETS plasma-packagestructure-translator DESTINATION 
${PLUGIN_INSTALL_DIR} )
install( FILES plasma-packagestructure-translator.desktop DESTINATION 
${SERVICES_INSTALL_DIR} )


Thanks again  :)
Farhad

___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


plasma dataengine question

2011-03-14 Thread Farhad Hedayati-Fard
Hi!
I've written a translation dataengine... It needs 3 arguments to initialize 
the translator object ( plugin name, source language and destination 
language). I've put a Q_ASSERT on args.size() in dataengine's constructor but 
now I can't test my dataengine using plasmaengineexplorer because it crashes 
on the Q_ASSERT (no argument is passed to the constructor):

TranslatorEngine::TranslatorEngine(QObject* parent, const QVariantList args): 
DataEngine(parent, args)
{
   Q_ASSERT(args.size() = 3);
   QString from = args[0].toString();
   QString to = args[1].toString();
   QString name = args[2].toString();
   translator = new Translator((QWidget*)this, from, to, name);
   
}

What should I do to get this working??

Thanks in advance :)
Farhad
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


Re: plasma dataengine question

2011-03-14 Thread Aaron J. Seigo
On Tuesday, March 15, 2011, Farhad Hedayati-Fard wrote:
 Hi!
 I've written a translation dataengine... It needs 3 arguments to initialize
 the translator object ( plugin name, source language and destination
 language). I've put a Q_ASSERT on args.size() in dataengine's constructor
 but now I can't test my dataengine using plasmaengineexplorer because it
 crashes on the Q_ASSERT (no argument is passed to the constructor):
 
 TranslatorEngine::TranslatorEngine(QObject* parent, const QVariantList
 args): DataEngine(parent, args)
 {
Q_ASSERT(args.size() = 3);
QString from = args[0].toString();
QString to = args[1].toString();
QString name = args[2].toString();
translator = new Translator((QWidget*)this, from, to, name);

 }
 
 What should I do to get this working??

the args passed in are currently always empty for the DataEngine constructor.

perhaps the misunderstanding here is that there is only ever one instance of 
the DataEngine loaded, and that one engine hosts multiple sources of data.

information such as the to/from language should be encoded in the source name, 
e.g. en:de:flower (which might have as its data: Blume). the DataEngine 
would process these requests in sourceRequestEvent.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Development Frameworks


signature.asc
Description: This is a digitally signed message part.
___
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel