summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CFilter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp
index 6d94d70..ab98829 100644
--- a/noncore/apps/opie-reader/CFilter.cpp
+++ b/noncore/apps/opie-reader/CFilter.cpp
@@ -644,49 +644,50 @@ class ErrorFilter : public CFilter
644{ 644{
645 QString error; 645 QString error;
646 int currentpos; 646 int currentpos;
647 public: 647 public:
648 ErrorFilter(const QString& _s) : error(_s), currentpos(0) {} 648 ErrorFilter(const QString& _s) : error(_s), currentpos(0) {}
649 ~ErrorFilter() {} 649 ~ErrorFilter() {}
650 void getch(tchar& ch, CStyle& sty, unsigned long& pos) 650 void getch(tchar& ch, CStyle& sty, unsigned long& pos)
651 { 651 {
652 if (currentpos == error.length()) 652 if (currentpos == error.length())
653 { 653 {
654 ch = UEOF; 654 ch = UEOF;
655 currentpos = 0; 655 currentpos = 0;
656 } 656 }
657 else 657 else
658 { 658 {
659 ch = error[currentpos++].unicode(); 659 ch = error[currentpos++].unicode();
660 } 660 }
661 } 661 }
662 QString about() { return parent->about(); } 662 QString about() { return parent->about(); }
663}; 663};
664 664
665#ifndef __STATIC 665#ifndef __STATIC
666ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL) 666ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL)
667{ 667{
668 QString filterpath(QTReaderUtil::getPluginPath("filters/lib")); 668 QString filterpath(QTReaderUtil::getPluginPath("filters"));
669 filterpath += "/lib";
669 filterpath += nm; 670 filterpath += nm;
670 filterpath += ".so"; 671 filterpath += ".so";
671 if (QFile::exists(filterpath)) 672 if (QFile::exists(filterpath))
672 { 673 {
673 qDebug("Filter:%s", (const char*)filterpath); 674 qDebug("Filter:%s", (const char*)filterpath);
674 handle = dlopen(filterpath, RTLD_LAZY); 675 handle = dlopen(filterpath, RTLD_LAZY);
675 if (handle == 0) 676 if (handle == 0)
676 { 677 {
677 qDebug("Can't find filter:%s", dlerror()); 678 qDebug("Can't find filter:%s", dlerror());
678 // status = -10; 679 // status = -10;
679 filt = new ErrorFilter(QString("Can't find plugin:")+nm); 680 filt = new ErrorFilter(QString("Can't find plugin:")+nm);
680 return; 681 return;
681 } 682 }
682 CFilter* (*newfilter)(const QString&); 683 CFilter* (*newfilter)(const QString&);
683 newfilter = (CFilter* (*)(const QString&))dlsym(handle, "newfilter"); 684 newfilter = (CFilter* (*)(const QString&))dlsym(handle, "newfilter");
684 if (newfilter == NULL) 685 if (newfilter == NULL)
685 { 686 {
686 qDebug("Can't find newfilter"); 687 qDebug("Can't find newfilter");
687 filt = new ErrorFilter(QString("Can't find entry point in plugin:")+nm); 688 filt = new ErrorFilter(QString("Can't find entry point in plugin:")+nm);
688 return; 689 return;
689 } 690 }
690 filt = (*newfilter)(optional); 691 filt = (*newfilter)(optional);
691 } 692 }
692 else 693 else