summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/odict/odict.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index 4c99964..497de36 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -53,65 +53,67 @@ ODict::ODict(QWidget* parent, const char* name, WFlags fl ) : QMainWindow(parent
53 browser_top = new QTextBrowser( vbox ); 53 browser_top = new QTextBrowser( vbox );
54 bottom_name = new QLabel( vbox ); 54 bottom_name = new QLabel( vbox );
55 bottom_name->setAlignment( AlignHCenter ); 55 bottom_name->setAlignment( AlignHCenter );
56 browser_bottom = new QTextBrowser( vbox ); 56 browser_bottom = new QTextBrowser( vbox );
57 57
58 ding = new DingWidget(); 58 ding = new DingWidget();
59 59
60 loadConfig(); 60 loadConfig();
61 setCentralWidget( vbox ); 61 setCentralWidget( vbox );
62} 62}
63 63
64void ODict::loadConfig() 64void ODict::loadConfig()
65{ 65{
66 /* 66 /*
67 * the name of the last used dictionary 67 * the name of the last used dictionary
68 */ 68 */
69 QString lastname; 69 QString lastname;
70 70
71 Config cfg ( "odict" ); 71 Config cfg ( "odict" );
72 cfg.setGroup( "generalsettings" ); 72 cfg.setGroup( "generalsettings" );
73 casesens = cfg.readEntry( "casesens" ).toInt(); 73 casesens = cfg.readEntry( "casesens" ).toInt();
74 74
75 QString lastDict = cfg.readEntry( "lastdict" ); 75 QString lastDict = cfg.readEntry( "lastdict" );
76 int i = 0, e = 0; 76 int i = 0, e = 0;
77 77
78 QStringList groupListCfg = cfg.groupList().grep( "Method_" ); 78 QStringList groupListCfg = cfg.groupList().grep( "Method_" );
79 query_co->clear(); 79 query_co->clear();
80 for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it ) 80 for ( QStringList::Iterator it = groupListCfg.begin() ; it != groupListCfg.end() ; ++it )
81 { 81 {
82 QString name; 82 QString name;
83 cfg.setGroup( *it ); 83 cfg.setGroup( *it );
84 name = cfg.readEntry( "Name" ); 84 name = cfg.readEntry( "Name" );
85 query_co->insertItem( name ); 85 if ( name != QString::null ) {
86 query_co->insertItem( name );
87 }
86 88
87 /* 89 /*
88 * this check is to look up what dictionary has been used the 90 * this check is to look up what dictionary has been used the
89 * last time 91 * last time
90 */ 92 */
91 if ( lastDict == name ) 93 if ( lastDict == name )
92 { 94 {
93 e = i; 95 e = i;
94 lastname = name; 96 lastname = name;
95 } 97 }
96 i++; 98 i++;
97 } 99 }
98 /* 100 /*
99 * now set the two names of the dictionary and the correct QComboBox-Entry 101 * now set the two names of the dictionary and the correct QComboBox-Entry
100 */ 102 */
101 103
102 lookupLanguageNames( lastname ); 104 lookupLanguageNames( lastname );
103 ding->loadDict( lastname ); 105 ding->loadDict( lastname );
104 ding->loadValues(); 106 ding->loadValues();
105 107
106 query_co->setCurrentItem( e ); 108 query_co->setCurrentItem( e );
107 top_name->setText( top_name_content ); 109 top_name->setText( top_name_content );
108 bottom_name->setText( bottom_name_content ); 110 bottom_name->setText( bottom_name_content );
109} 111}
110 112
111void ODict::lookupLanguageNames( QString dictname ) 113void ODict::lookupLanguageNames( QString dictname )
112{ 114{
113 Config cfg ( "odict" ); 115 Config cfg ( "odict" );
114 cfg.setGroup( "Method_"+dictname ); 116 cfg.setGroup( "Method_"+dictname );
115 top_name_content = cfg.readEntry( "Lang1" ); 117 top_name_content = cfg.readEntry( "Lang1" );
116 bottom_name_content = cfg.readEntry( "Lang2" ); 118 bottom_name_content = cfg.readEntry( "Lang2" );
117} 119}