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)
/*! 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;
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);
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;
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
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);
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;
}
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;
}
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;
}
<< 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;
}