return "";
}
-void StarDictPlugin::parseIfoFile() {
- QFile file(settings()->value("path"));
- if (!file.open(QIODevice::ReadOnly)) {
- // TODO notification
- return ;
- }
- QTextStream in(&file);
- while (!in.atEnd()) {
- QString line = in.readLine();
- QStringList list = line.split("=");
- if(list.size() == 2) {
- settings()->setValue(list.at(0),list.at(1));
- }
- }
-}
void StarDictPlugin::stop() {
bool StarDictPlugin::getDictionaryInfo() {
- QFile dictionaryFile(_settings->value("path"));
- if(!QFile::exists(_settings->value("path"))
- || !dictionaryFile.open(QFile::ReadOnly | QFile::Text)) {
+ QFile file(settings()->value("ifoFileName"));
+ if(!QFile::exists(_settings->value("ifoFileName"))
+ || !file.open(QFile::ReadOnly | QFile::Text)) {
Q_EMIT notify(Notify::Warning,
QString(tr("StarDict dictionary cannot be read from file")));
qDebug()<<"Error: could not open the file";
return false;
}
- return false;
+ QTextStream in(&file);
+ while (!in.atEnd()) {
+ QString line = in.readLine();
+ QStringList list = line.split("=");
+ if(list.size() == 2) {
+ settings()->setValue(list.at(0),list.at(1));
+ }
+ }
+
+ return true;
}