Merge branch 'master' of ssh://drop.maemo.org/git/mdictionary
[mdictionary] / src / mdictionary / backbone / backbone.cpp
index 16bb487..c7993cb 100644 (file)
@@ -32,9 +32,9 @@ class ConfigGenerator;
 
 int Backbone::_searchLimit;
 
-// Sadly QtConcurent::mapped dosent let me use something like calling method of
-// some class with supplied argument; so i have to sin against art and put
-// global function and variable so i could supply function with some parametr
+// Sadly QtConcurrent::mapped doesn't let me use something like calling method of
+// some class with supplied argument; so I have to sin against art and put
+// global function and variable so I could supply function with some parameter
 QString mappedSearch;
 QList<Translation*> mapSearch(CommonDictInterface *dict) {
     if(dict)
@@ -46,14 +46,14 @@ QList<Translation*> mapSearch(CommonDictInterface *dict) {
 
 /*! Smart pointer (kind of) for translation object
 
-    QtConcurent::mapped  use collection of data and one function, what i need is
-    to map signle data object to method calls for multiple objects. TranslationPtr
-    is try to store method call as a data -> moreover QtConcurent allow only for
+    QtConcurrent::mapped uses collection of data and one function, what I need is
+    to map single data object to method calls for multiple objects. TranslationPtr
+    is an attempt to store method call as a data -> moreover QtConcurrent allows only for
     methods without any parameters so TranslationPtr is created with Translation
     object -> ready to call toHtml() for supplied Translation.
 
-    Another thing is that QtConcurent dont like pointers in data collection
-    so TranslationPtr is way to hide real translation object (pointer for object)
+    Another thing is that QtConcurrent doesn't like pointers in data collection
+    so TranslationPtr is a way to hide real translation object (pointer to object)
     */
 class TranslationPtr {
     Translation* _tr;
@@ -101,7 +101,7 @@ void Backbone::init() {
            SLOT(translationReady()));
 
    // In common opinion perfect thread count is cores_number+1 (in qt perfect
-   // thread count is set to cores number
+   // thread count is set to cores number)
    QThreadPool::globalInstance()->setMaxThreadCount(
            QThreadPool::globalInstance()->maxThreadCount()+1);
 
@@ -207,8 +207,8 @@ void Backbone::search(QString word){
     stopped = false;
 
     // When dictFin and bookmarkFin is set to true then translationReady()
-    // signal is emited see translationReady(),
-    // so when searching only in one of them, coresponding *Fin is set to false
+    // signal is emitted see translationReady(),
+    // so when searching only in one of them, corresponding *Fin is set to false
     // and other to true so program is waiting only for one translation
     dictFin = !_searchDicts;
     bookmarkFin = !_searchBookmarks;
@@ -282,7 +282,7 @@ void Backbone::addDictionary(CommonDictInterface *dict, bool active) {
 
 
 void Backbone::translationReady() {
-    bool changed = 0; // prevents doubling ready() signal, when both if's are
+    bool changed = 0; // prevents from doubling ready() signal, when both if's are
                       //  executed in one translationReady() call then second
                       // translationReady() call doubles ready*() emit
 
@@ -326,7 +326,7 @@ QStringList Backbone::getFilesFromDir(QString dir, QStringList nameFilter) {
     if(!plug.exists()) {
         qDebug() << plug.absolutePath() << " folder doesn't exist";
         Q_EMIT notify(Notify::Warning,
-                QString("%1 folder doesn't exist.").arg(plug.path()));
+                tr("%1 folder doesn't exist.").arg(plug.path()));
         return QStringList();
     }
     plug.setFilter(QDir::Files);
@@ -349,7 +349,7 @@ void Backbone::loadPlugins() {
         QPluginLoader loader(file);
         if(!loader.load()) {
             Q_EMIT notify(Notify::Error,
-                    QString("%1 plugin cannot be loaded: %2.")
+                    tr("%1 plugin cannot be loaded: %2.")
                     .arg(file).arg(loader.errorString()));
             continue;
         }
@@ -387,7 +387,7 @@ void Backbone::loadPrefs(QString fileName) {
         qDebug() << "Configuration file doesn't exist ("
                 << file.filePath() << ")";
         Q_EMIT notify(Notify::Warning,
-                QString("%1 configuration file doesn't exist.")
+                tr("%1 configuration file doesn't exist.")
                 .arg(file.filePath()));
         return;
     }
@@ -425,7 +425,7 @@ void Backbone::loadDicts(QString fileName) {
         qDebug() << "Configuration file doesn't exist ("
                 << file.filePath() << ")";
         Q_EMIT notify(Notify::Warning,
-                QString("%1 configurationfile doesn't exist.")
+                tr("%1 configuration file doesn't exist.")
                 .arg(file.filePath()));
         return;
     }
@@ -442,7 +442,7 @@ void Backbone::loadDicts(QString fileName) {
                     << set.value(dict + "/type", "").toString()
                     << " doesn't exist";
             Q_EMIT notify(Notify::Warning,
-                    QString("Configuration file error. %2 plugin doesn't exist.")
+                    tr("Configuration file error. %2 plugin doesn't exist.")
                     .arg(set.value(dict + "/type", "").toString()));
             continue;
         }