fic smal bug
authorJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Tue, 31 Aug 2010 07:26:26 +0000 (09:26 +0200)
committerJakub Jaszczynski <j.j.jaszczynski@gmail.com>
Tue, 31 Aug 2010 07:26:26 +0000 (09:26 +0200)
trunk/src/plugins/google/src/GooglePlugin.cpp
trunk/src/plugins/google/src/GoogleSettingsDialog.cpp
trunk/src/plugins/xdxf/src/xdxfplugin.cpp
trunk/src/plugins/xdxf/tests/test.cpp
trunk/src/plugins/xdxf/tests/test.h

index ff2228b..f354b95 100644 (file)
@@ -33,7 +33,7 @@ GooglePlugin::GooglePlugin(QObject *parent): CommonDictInterface(parent),
     _settings->setValue("lang_to","");
     _settings->setValue("lang_from","");
     _settings->setValue("type","google");
-    _settings->setValue("connection_acepted","true");
+    _settings->setValue("connection_accepted","true");
     _dictDialog = new GoogleDictDialog(this,this);
     _icon = QIcon(":/icons/drawing.png");
     _hash=123456;
@@ -98,13 +98,13 @@ bool GooglePlugin::isAvailable() const {
 
 void GooglePlugin::setConnectionAccept(QString connectionAcepted) {
     if(connectionAcepted=="true")
-        _settings->setValue("connection_acepted","true");
+        _settings->setValue("connection_accepted","true");
     else
-        _settings->setValue("connection_acepted","false");
+        _settings->setValue("connection_accepted","false");
 }
 
 bool GooglePlugin::isConnectionAccept() const {
-    if(_settings->value("connection_acepted")=="true")
+    if(_settings->value("connection_accepted")=="true")
         return true;
     else
         return false;
index 1714cff..f37fa53 100644 (file)
@@ -156,7 +156,7 @@ Settings* GoogleSettingsDialog::getSettings(QWidget *parent,
         Settings *settings = new Settings();
         settings->setValue("lang_to",languages.value(settingsDialog.langTo()));
         settings->setValue("lang_from",languages.value(settingsDialog.langFrom()));
-        settings->setValue("connection_accept","true");
+        settings->setValue("connection_accepted","true");
         settings->setValue("type","google");
         return settings;
     }
index d814594..6144fb6 100644 (file)
@@ -210,6 +210,7 @@ QString XdxfPlugin::searchCache(QString key) {
     }
 
     QSqlQuery cur(db);
+
     cur.prepare("select translation from dict where word like ?");
     cur.addBindValue(key);
     cur.exec();
@@ -288,8 +289,8 @@ DictDialog* XdxfPlugin::dictDialog() {
 }
 
 void XdxfPlugin::setPath(QString path){
-    if(this->path!=path && this->path!="" && _settings->value("cache_path")!="");
-        clean();
+ //   if(this->path!=path && this->path!="" && _settings->value("cache_path")!="")
+ //       clean();
     this->path=path;
     _settings->setValue("path",path);
     //getDictionaryInfo();
@@ -480,7 +481,7 @@ bool XdxfPlugin::makeCache(QString) {
     cur.exec("PRAGMA synchronous = 0");
     cur.exec("drop table dict");
     QCoreApplication::processEvents();
-    cur.exec("create table dict(word text, normalized text ,tanslation text)");
+    cur.exec("create table dict(word text, normalized text ,translation text)");
     int counter = 0;
     cur.exec("BEGIN;");
 
@@ -545,7 +546,7 @@ bool XdxfPlugin::makeCache(QString) {
 
     cur.exec("END;");
     cur.exec("select count(*) from dict");
-    settings()->setValue("strip_accents", stripAcc);
+//    settings()->setValue("strip_accents", stripAcc);
 
     countWords();
     cachingDialog->setVisible(false);
index db858b2..05aeee9 100644 (file)
@@ -273,7 +273,7 @@ void XdxfTest::timeFile() {
     File.close();
 }
 
-void XdxfTest::timeCacheNormalize() {
+void  XdxfTest::timeCacheNormalize() {
     QTime timer;
     QDate date;
     QFile File("../tests/time.xml");
@@ -319,7 +319,7 @@ void XdxfTest::timeCacheNormalize() {
     File.close();
 }
 
-void XdxfTest::removeAccents()
+void  XdxfTest::removeAccents()
 {
     XdxfPluginSub xdxf;
     xdxf.settings()->setValue(QString("strip_accents"), QString("true"));
index a88d6a7..a916908 100644 (file)
      void timeCache();
      void timeFile();
      void removeAccents();
+     void timeCacheNormalize();
+     void timeFileNormalize();
  };
 
  class XdxfPluginSub : public XdxfPlugin
  {
     public:
      XdxfPluginSub(QObject *parent = 0) : XdxfPlugin(parent){}
-     QString getRemoveAccents(QString s)
-     {
+     QString getRemoveAccents(QString s) {
          return removeAccents(s);
      }
-     void timeCacheNormalize();
-     void timeFileNormalize();
+
  };