Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/odict/dingwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp index abb5e75..0707bfb 100644 --- a/noncore/apps/odict/dingwidget.cpp +++ b/noncore/apps/odict/dingwidget.cpp | |||
@@ -68,48 +68,50 @@ void DingWidget::setCaseSensitive( bool caseS ) | |||
68 | } | 68 | } |
69 | 69 | ||
70 | void DingWidget::setDict( QString dict ) | 70 | void DingWidget::setDict( QString dict ) |
71 | { | 71 | { |
72 | methodname = dict; | 72 | methodname = dict; |
73 | } | 73 | } |
74 | 74 | ||
75 | void DingWidget::setCompleteWord( bool cword ) | 75 | void DingWidget::setCompleteWord( bool cword ) |
76 | { | 76 | { |
77 | isCompleteWord = cword; | 77 | isCompleteWord = cword; |
78 | } | 78 | } |
79 | 79 | ||
80 | void DingWidget::setQueryWord( QString qword ) | 80 | void DingWidget::setQueryWord( QString qword ) |
81 | { | 81 | { |
82 | queryword = qword; | 82 | queryword = qword; |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
86 | void DingWidget::loadValues() | 86 | void DingWidget::loadValues() |
87 | { | 87 | { |
88 | if ( !methodname ) return; | 88 | if ( !methodname ) return; |
89 | Config cfg( "odict" ); | 89 | Config cfg( "odict" ); |
90 | cfg.setGroup( "Method_" + methodname ); | 90 | cfg.setGroup( "Method_" + methodname ); |
91 | trenner = cfg.readEntry( "Seperator" ); | 91 | trenner = cfg.readEntry( "Seperator" ); |
92 | lang1_name = cfg.readEntry( "Lang1" ); | ||
93 | lang2_name = cfg.readEntry( "Lang2" ); | ||
92 | } | 94 | } |
93 | 95 | ||
94 | BroswerContent DingWidget::setText( QString word ) | 96 | BroswerContent DingWidget::setText( QString word ) |
95 | { | 97 | { |
96 | queryword = word; | 98 | queryword = word; |
97 | return parseInfo(); | 99 | return parseInfo(); |
98 | } | 100 | } |
99 | 101 | ||
100 | 102 | ||
101 | BroswerContent DingWidget::parseInfo() | 103 | BroswerContent DingWidget::parseInfo() |
102 | { | 104 | { |
103 | if ( isCompleteWord ) | 105 | if ( isCompleteWord ) |
104 | queryword = " " + queryword + " "; | 106 | queryword = " " + queryword + " "; |
105 | QStringList search = lines.grep( queryword , isCaseSensitive ); | 107 | QStringList search = lines.grep( queryword , isCaseSensitive ); |
106 | 108 | ||
107 | QString current; | 109 | QString current; |
108 | QString left; | 110 | QString left; |
109 | QString right; | 111 | QString right; |
110 | QRegExp reg_div( trenner ); | 112 | QRegExp reg_div( trenner ); |
111 | QRegExp reg_word( queryword ); | 113 | QRegExp reg_word( queryword ); |
112 | reg_word.setCaseSensitive( isCaseSensitive ); | 114 | reg_word.setCaseSensitive( isCaseSensitive ); |
113 | QStringList toplist, bottomlist; | 115 | QStringList toplist, bottomlist; |
114 | QString substitute = "<strong>"+queryword+"</strong>"; | 116 | QString substitute = "<strong>"+queryword+"</strong>"; |
115 | 117 | ||