summaryrefslogtreecommitdiff
path: root/noncore/apps/odict
authorcniehaus <cniehaus>2003-04-30 19:28:50 (UTC)
committer cniehaus <cniehaus>2003-04-30 19:28:50 (UTC)
commitb48845bf24f1361a349c86a48a7b54e49df94533 (patch) (unidiff)
tree38e6e2e027c6ed0c2d1bd94aa78e27b8434daea7 /noncore/apps/odict
parente6428d30a5dc90ed3ec6ca7e1cb3f92c81437cc0 (diff)
downloadopie-b48845bf24f1361a349c86a48a7b54e49df94533.zip
opie-b48845bf24f1361a349c86a48a7b54e49df94533.tar.gz
opie-b48845bf24f1361a349c86a48a7b54e49df94533.tar.bz2
I hope I will code more in the next days
Diffstat (limited to 'noncore/apps/odict') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/dingwidget.cpp59
-rw-r--r--noncore/apps/odict/odict.cpp4
2 files changed, 14 insertions, 49 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp
index cfef84d..16164ed 100644
--- a/noncore/apps/odict/dingwidget.cpp
+++ b/noncore/apps/odict/dingwidget.cpp
@@ -32,3 +32,2 @@
32 32
33
34DingWidget::DingWidget( ) 33DingWidget::DingWidget( )
@@ -91,2 +90,10 @@ void DingWidget::setQueryWord( QString qword )
91 90
91
92void DingWidget::loadValues()
93{
94 Config cfg( "odict" );
95 cfg.setGroup( "Method_" + methodname );
96 trenner = cfg.readEntry( "Seperator" );
97}
98
92BroswerContent DingWidget::setText( QString word ) 99BroswerContent DingWidget::setText( QString word )
@@ -99,8 +106,2 @@ BroswerContent DingWidget::setText( QString word )
99 106
100void DingWidget::loadValues()
101{
102 Config cfg( "odict" );
103 cfg.setGroup( "Method_" + methodname );
104 trenner = cfg.readEntry( "Seperator" );
105}
106 107
@@ -108,3 +109,4 @@ BroswerContent DingWidget::parseInfo()
108{ 109{
109 if ( isCompleteWord ) queryword = " " + queryword + " "; 110 if ( isCompleteWord )
111 queryword = " " + queryword + " ";
110 QStringList search = lines.grep( queryword , isCaseSensitive ); 112 QStringList search = lines.grep( queryword , isCaseSensitive );
@@ -120,35 +122,2 @@ BroswerContent DingWidget::parseInfo()
120 122
121 /* Dieser Block ist von Patrik. Ich versuche einen neuen
122 * Ansatz. Zum einen ist HTML scheiße an dieser Stelle und
123 * zum andern funktioniert der Code nicht so wie er sollte.
124 QString substitute = "<a href=''>"+queryword+"</a>";
125
126 QString html_header = "<html><table>";
127 QString html_footer = "</table></html>";
128 QString html_table_left = "<tr><td width='50'>";
129 QString html_table_sep = "</td><td>";
130 QString html_table_right = "</td></tr>";
131
132 for( QStringList::Iterator it = search.begin() ; it != search.end() ; ++it )
133 {
134 current = *it;
135 left = current.left( current.find(reg_div) );
136 right = current.right( current.length() - current.find(reg_div) - 1 );
137 if ( left.contains( reg_word ) )
138 {
139 left.replace( queryword, substitute );
140 toplist.append( html_table_left + left + html_table_sep + right + html_table_right );
141 }
142 else
143 {
144 right.replace( reg_word, substitute );
145 bottomlist.append( html_table_left + right + html_table_sep + left + html_table_right );
146 }
147 }
148
149 //thats it, the lists are rendered. Lets put them in one string
150 s_strings.bottom = html_header + bottomlist.join( "<br>" ) + html_footer;
151 s_strings.top = html_header + toplist.join( "<br>" ) + html_footer;
152 */
153
154 for( QStringList::Iterator it = search.begin() ; it != search.end() ; ++it ) 123 for( QStringList::Iterator it = search.begin() ; it != search.end() ; ++it )
@@ -158,3 +127,3 @@ BroswerContent DingWidget::parseInfo()
158 127
159 right = current.right( current.length() - current.find(trenner) -2 ); 128 right = current.right( current.length() - current.find(trenner) - trenner.length() );
160 129
@@ -163,3 +132,3 @@ BroswerContent DingWidget::parseInfo()
163 left.replace( queryword, substitute ); 132 left.replace( queryword, substitute );
164 left = left + "-->" + right; 133 left = left + " -- " + right;
165 toplist.append( left ); 134 toplist.append( left );
@@ -169,3 +138,3 @@ BroswerContent DingWidget::parseInfo()
169 right.replace( queryword, substitute ); 138 right.replace( queryword, substitute );
170 left = right + "-->" + left; 139 left = right + " -- " + left;
171 bottomlist.append( right ); 140 bottomlist.append( right );
@@ -174,4 +143,4 @@ BroswerContent DingWidget::parseInfo()
174 143
175 s_strings.bottom = bottomlist.join( "\n" );
176 s_strings.top = toplist.join( "\n" ); 144 s_strings.top = toplist.join( "\n" );
145 s_strings.bottom = bottomlist.join( "\n" );
177 146
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index c4114f7..58cff5f 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -203,8 +203,4 @@ void ODict::setupMenus()
203 203
204 help = new QPopupMenu( menu );
205 help->insertItem("&About",this,SLOT( slotDisplayAbout() ));
206
207 menu->insertItem( tr( "Settings" ) , settings ); 204 menu->insertItem( tr( "Settings" ) , settings );
208 menu->insertItem( tr( "Parameter" ) , parameter ); 205 menu->insertItem( tr( "Parameter" ) , parameter );
209 menu->insertItem( tr( "Help" ) , help );
210} 206}