Diffstat (limited to 'noncore/apps/opie-reader/CFilter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/CFilter.cpp | 54 |
1 files changed, 50 insertions, 4 deletions
diff --git a/noncore/apps/opie-reader/CFilter.cpp b/noncore/apps/opie-reader/CFilter.cpp index ab98829..25cdfae 100644 --- a/noncore/apps/opie-reader/CFilter.cpp +++ b/noncore/apps/opie-reader/CFilter.cpp | |||
@@ -3,4 +3,5 @@ | |||
3 | #include <qtextstream.h> | 3 | #include <qtextstream.h> |
4 | #include <qdir.h> | 4 | #include <qdir.h> |
5 | |||
5 | #ifdef USEQPE | 6 | #ifdef USEQPE |
6 | #include <qpe/global.h> | 7 | #include <qpe/global.h> |
@@ -9,5 +10,4 @@ | |||
9 | #include "CFilter.h" | 10 | #include "CFilter.h" |
10 | #include "hrule.h" | 11 | #include "hrule.h" |
11 | #include "util.h" | ||
12 | 12 | ||
13 | #include <qregexp.h> | 13 | #include <qregexp.h> |
@@ -666,6 +666,15 @@ class ErrorFilter : public CFilter | |||
666 | ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL) | 666 | ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NULL), handle(NULL) |
667 | { | 667 | { |
668 | QString filterpath(QTReaderUtil::getPluginPath("filters")); | 668 | #ifdef USEQPE |
669 | filterpath += "/lib"; | 669 | #ifdef OPIE |
670 | QString filterpath(getenv("OPIEDIR")); | ||
671 | #else | ||
672 | QString filterpath(getenv("QTDIR")); | ||
673 | #endif | ||
674 | filterpath += "/plugins/reader/filters/lib"; | ||
675 | #else | ||
676 | QString filterpath(getenv("READERDIR")); | ||
677 | filterpath += "/filters/lib"; | ||
678 | #endif | ||
670 | filterpath += nm; | 679 | filterpath += nm; |
671 | filterpath += ".so"; | 680 | filterpath += ".so"; |
@@ -693,5 +702,5 @@ ExternFilter::ExternFilter(const QString& nm, const QString& optional) : filt(NU | |||
693 | else | 702 | else |
694 | { | 703 | { |
695 | qDebug("No filter path"); | 704 | qDebug("No filter path:%s", (const char*)filterpath); |
696 | filt = new ErrorFilter(QString("No filter plugins installed:")+nm); | 705 | filt = new ErrorFilter(QString("No filter plugins installed:")+nm); |
697 | } | 706 | } |
@@ -814,2 +823,39 @@ void repara::getch(tchar& ch, CStyle& sty, unsigned long& pos) | |||
814 | return; | 823 | return; |
815 | } | 824 | } |
825 | |||
826 | void tableLink::getch(tchar& ch, CStyle& sty, unsigned long& pos) | ||
827 | { | ||
828 | if (offset >= (int)text.length()) | ||
829 | { | ||
830 | offset = -1; | ||
831 | sty.setColour(m_r, m_g, m_b); | ||
832 | do | ||
833 | { | ||
834 | parent->getch(ch, sty, pos); | ||
835 | } | ||
836 | while (sty.isTable()); | ||
837 | return; | ||
838 | } | ||
839 | if (offset >= 0) | ||
840 | { | ||
841 | ch = text[offset++].unicode(); | ||
842 | return; | ||
843 | } | ||
844 | parent->getch(ch, sty, pos); | ||
845 | if (sty.isTable()) | ||
846 | { | ||
847 | offset = 1; | ||
848 | ch = text[0].unicode(); | ||
849 | m_r = sty.Red(), m_g = sty.Green(), m_b = sty.Blue(); | ||
850 | sty.setColour(255, 0, 0); | ||
851 | } | ||
852 | return; | ||
853 | } | ||
854 | |||
855 | void underlineLink::getch(tchar& ch, CStyle& sty, unsigned long& pos) | ||
856 | { | ||
857 | parent->getch(ch, sty, pos); | ||
858 | if (sty.getLink()) sty.setUnderline(); | ||
859 | //if (isLink && !sty.getLink()) sty.unsetUnderline(); | ||
860 | //isLink = sty.getLink(); | ||
861 | } | ||