|
|
@ -554,19 +554,17 @@ PluginVersion SearchPluginManager::getPluginVersion(QString filePath) |
|
|
|
|
|
|
|
|
|
|
|
PluginVersion version; |
|
|
|
PluginVersion version; |
|
|
|
while (!plugin.atEnd()) { |
|
|
|
while (!plugin.atEnd()) { |
|
|
|
QByteArray line = plugin.readLine(); |
|
|
|
const QString line = QString(plugin.readLine()).remove(' '); |
|
|
|
if (line.startsWith("#VERSION: ")) { |
|
|
|
if (!line.startsWith("#VERSION:", Qt::CaseInsensitive)) continue; |
|
|
|
line = line.split(' ').last().trimmed(); |
|
|
|
|
|
|
|
version = PluginVersion::tryParse(line, invalidVersion); |
|
|
|
const QString versionStr = line.mid(9); |
|
|
|
|
|
|
|
version = PluginVersion::tryParse(versionStr, invalidVersion); |
|
|
|
if (version == invalidVersion) { |
|
|
|
if (version == invalidVersion) { |
|
|
|
LogMsg(tr("Search plugin '%1' contains invalid version string ('%2')") |
|
|
|
LogMsg(tr("Search plugin '%1' contains invalid version string ('%2')") |
|
|
|
.arg(Utils::Fs::fileName(filePath), QString::fromUtf8(line)), Log::MsgType::WARNING); |
|
|
|
.arg(Utils::Fs::fileName(filePath), line), Log::MsgType::WARNING); |
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
qDebug() << "plugin" << filePath << "version: " << version; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return version; |
|
|
|
return version; |
|
|
|
} |
|
|
|
} |
|
|
|