Merge branch 'cache' of ssh://drop.maemo.org/git/mdictionary into cache
[mdictionary] / trunk / src / plugins / xdxf / src / xdxfplugin.cpp
index b57a80f..fee5602 100644 (file)
@@ -137,8 +137,7 @@ QList<Translation*> XdxfPlugin::searchWordListFile(QString word, int limit) {
             if(regWord.exactMatch(removeAccents(a)) && (i<limit || limit==0)) {
                 bool ok=true;
                 Translation *tran;
-                foreach(tran,translations)
-                {
+                foreach(tran,translations) {
                     if(tran->key()==a)
                         ok=false;  /*if key word is in the dictionary more that one */
                 }
@@ -282,13 +281,11 @@ bool XdxfPlugin::isAvailable() const {
     return true;
 }
 
-void XdxfPlugin::setHash(uint _hash)
-{
+void XdxfPlugin::setHash(uint _hash) {
     this->_hash=_hash;
 }
 
-uint XdxfPlugin::hash() const
-{
+uint XdxfPlugin::hash() const {
    return _hash;
 }
 
@@ -296,8 +293,7 @@ Settings* XdxfPlugin::settings() {
     return _settings;
 }
 
-bool XdxfPlugin::isCached()
-{
+bool XdxfPlugin::isCached() {
     if(_settings->value("cached") == "true")
         return true;
     return false;
@@ -417,10 +413,9 @@ bool XdxfPlugin::makeCache(QString dir) {
 
     QXmlStreamReader reader(&dictionaryFile);
 
-
     db.setDatabaseName(cachePathN);
     if(!db.open()) {
-        qDebug() << "Database error" << endl;
+        qDebug() << "Database error" << db.lastError().text() << endl;
         return false;
     }
     QCoreApplication::processEvents();
@@ -445,7 +440,6 @@ bool XdxfPlugin::makeCache(QString dir) {
     while (!reader.atEnd() && !stopped) {
 
         QCoreApplication::processEvents();
-       // usleep(50);
         reader.readNext();
 
         if(reader.tokenType() == QXmlStreamReader::StartElement) {