Change where the freVerDic variable initializes.
authorNguyễn Hồng Quân <ng.hong.quan@gmail.com>
Sun, 28 Oct 2012 05:22:25 +0000 (12:22 +0700)
committerNguyễn Hồng Quân <ng.hong.quan@gmail.com>
Sun, 28 Oct 2012 05:22:25 +0000 (12:22 +0700)
mainwindow.cpp

index 43f6e29..f5a38aa 100644 (file)
@@ -112,6 +112,15 @@ void MainWindow::showExpanded()
 void  MainWindow::initverbiste()
 {
     langCode = "fr";
+
+    FrenchVerbDictionary::Language lang = FrenchVerbDictionary::parseLanguageCode(langCode);
+    if (lang != FrenchVerbDictionary::FRENCH)
+    {
+        // TODO: If lang code is not supported?
+    }
+
+    /* Create verb dictionary, accept non-accent input */
+    freVerbDic = new FrenchVerbDictionary(true);
 }
 
 void MainWindow::startLookup()
@@ -123,15 +132,6 @@ void MainWindow::startLookup()
     QApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
     QString input = wordinput->text();
 
-    FrenchVerbDictionary::Language lang = FrenchVerbDictionary::parseLanguageCode(langCode);
-    if (lang != FrenchVerbDictionary::FRENCH)
-    {
-        // TODO: If lang code is not supported?
-    }
-
-    /* Create verb dictionary, accept non-accent input */
-    freVerbDic = new FrenchVerbDictionary(true);
-
     /* Get input word to look up */
     const std::string word = input.toLower().toUtf8().constData();