*******************************************************************************/
/*!
\file StarDictPlugin.cpp
+ \brief Implementation of stardict plugin's main class.
+
\author Jakub Jaszczynski
*/
this, SIGNAL(notify(Notify::NotifyType,QString)));
_settings->setValue("type","stardict");
- _icon = QIcon("/usr/share/mdictionary/stardict.png");
+ _iconPath = "/usr/share/mdictionary/stardict.png";
+ _icon = QIcon(_iconPath);
stopped = false;
+ _settings->setValue("strip_accents","true");
+
initAccents();
+
}
offset = reader->readInt64BigEndian();
len = reader->readInt32BigEndian();
- if(keyword.exactMatch(fkey)) {
+ if(keyword.exactMatch(fkey) ) {
TranslationStarDict tran(fkey, infoNote(), this);
- // qDebug() << "off/len" << offset << len;
int id = translations.indexOf(tran);
if(id == -1) {
tran.add(offset, len);
QString StarDictPlugin::interpret(QByteArray::iterator it,
- QByteArray::iterator end, QChar mode,QString key, bool last) {
+ QByteArray::iterator end, QChar mode,QString key, bool) {
QString result;
-// qDebug()<<"****** mode: "<<mode;
- if(mode == 'm' ||
- mode == 'l' ||
- mode == 'g' ||
- mode == 't' ||
- mode == 'y' ||
- mode == 'k' ||
- mode == 'w' ||
- mode == 'h' ||
- mode == 'r' ){
+ if(mode == 'm'
+ || mode == 'l'
+ || mode == 'g'
+ || mode == 't'
+ || mode == 'y'
+ || mode == 'k'
+ || mode == 'w'
+ || mode == 'h'
+ || mode == 'r'){
result += "<key>" + key + "</key>";
result += "<t>" + QString::fromUtf8(read(it++, end)) + "</t>";
}
return &_icon;
}
+QString StarDictPlugin::iconPath(){
+ return _iconPath;
+}
+
Q_EXPORT_PLUGIN2(stardict, StarDictPlugin)