summaryrefslogtreecommitdiff
path: root/noncore/apps/odict/dingwidget.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/odict/dingwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/odict/dingwidget.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/apps/odict/dingwidget.cpp b/noncore/apps/odict/dingwidget.cpp
index 55a716d..c804385 100644
--- a/noncore/apps/odict/dingwidget.cpp
+++ b/noncore/apps/odict/dingwidget.cpp
@@ -31,13 +31,12 @@ DingWidget::DingWidget( )
}
void DingWidget::loadDict( QString name )
{
lines.clear(); //as we will load a new list we have to
//remove the old one
- qDebug( "DingWidget::loadDict( ... )" );
Config cfg( "odict" );
cfg.setGroup( "Method_" + name );
QFile file( cfg.readEntry( "file" ) );
if( file.open( IO_ReadOnly ) )
@@ -46,12 +45,15 @@ void DingWidget::loadDict( QString name )
while ( !stream.eof() )
{
lines.append( stream.readLine() );
}
file.close();
}
+
+ setDict( name );
+
loadValues();
}
QString DingWidget::loadedDict() const
{
return dictName;
@@ -76,12 +78,13 @@ void DingWidget::setQueryWord( QString qword )
void DingWidget::loadValues()
{
if ( !methodname ) return;
Config cfg( "odict" );
cfg.setGroup( "Method_" + methodname );
trenner = cfg.readEntry( "Seperator" );
+
lang1_name = cfg.readEntry( "Lang1" );
lang2_name = cfg.readEntry( "Lang2" );
}
BroswerContent DingWidget::setText( QString word )
{
@@ -113,13 +116,13 @@ BroswerContent DingWidget::parseInfo()
if ( left.contains( queryword , isCaseSensitive ) )
{
left.replace( queryword, substitute );
left = left + " --> " + right;
toplist.append( left );
}
- else
+ else if( right.contains( queryword , isCaseSensitive ) )
{
right.replace( queryword, substitute );
right = right + " --> " + left;
bottomlist.append( right );
}
}