Fixed phantom errors linked with saving/loading settings
authorBartosz Szatkowski <bulislaw@linux.com>
Wed, 11 Aug 2010 12:31:09 +0000 (14:31 +0200)
committerBartosz Szatkowski <bulislaw@linux.com>
Wed, 11 Aug 2010 12:31:09 +0000 (14:31 +0200)
data/mdictionary.defaults
trunk/src/base/backbone/backbone.cpp
trunk/src/base/backbone/backbone.h
trunk/tests/mDictionaryTests/tst_Backbone.cpp

index 16de5f6..33db5c9 100644 (file)
@@ -1,4 +1,14 @@
 [%General]
-plugin_path=/usr/lib/mdictiona
+plugin_path=/usr/lib/mdictionary
 history_length=10
 search_limit=15
+
+[dictionary_0]
+type=xdxf
+path=/usr/lib/mdictionary/en-fin.xdxf
+_default_=true
+
+[dictionary_1]
+type=xdxf
+path=/usr/lib/mdictionary/pol-eng.xdxf
+_default_=true
index ce169e9..97e302f 100644 (file)
@@ -55,14 +55,16 @@ void Backbone::init() {
    _history = new History(5, this);
 }
 
-Backbone::Backbone(QString pluginPath, QString configPath, QObject *parent)
+Backbone::Backbone(QString pluginPath, QString configPath, bool dry,
+                   QObject *parent)
     : QObject(parent)
 {
-    init();
-    dryRun = true;
     _pluginPath = pluginPath;
     _configPath = configPath;
     _defaultConfigPath = configPath;
+    init();
+    if(dry)
+        dryRun = true;
 }
 
 
@@ -356,6 +358,7 @@ void Backbone::loadDicts(QString fileName, bool _default) {
 void Backbone::dictUpdated() {
     if(dryRun)
         return;
+    qDebug() << "UPDATE";
     QFileInfo file(QDir::toNativeSeparators(_configPath));
     QDir confDir(file.dir());
     if(!confDir.exists())
index 74a3737..685569f 100644 (file)
@@ -57,7 +57,8 @@ class Backbone : public QObject
 public:
     /*!\param pluginPath path to plugins (leave blank for default)
       \param configPath path to folder with configuration files*/
-    Backbone(QString pluginPath="", QString configPath="", QObject *parent = 0);
+    Backbone(QString pluginPath="", QString configPath="",
+             bool dry = 0, QObject *parent = 0);
     ~Backbone();
     Backbone(const Backbone& b);
 
index 9f615fe..013f98b 100644 (file)
@@ -76,7 +76,7 @@ void BackboneTest::init()
         cd->namev = QString("name%1").arg(i);
         cd->typev = QString("type%1").arg(i);
     }
-    back = new Backbone("empty","empty");
+    back = new Backbone("empty","empty", 1);
     qDebug() << back->getDictionaries().size();
     addDicts();
 }