Browse Source

search plugin update - do not display only last version changelog

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
a370503eb3
  1. 1
      Changelog
  2. 1
      TODO
  3. 18
      src/searchEngine.cpp
  4. 2
      src/searchEngine.h
  5. 10
      src/search_engine/nova.py

1
Changelog

@ -38,6 +38,7 @@ @@ -38,6 +38,7 @@
- BUGFIX: Search plugin update is not making the GUI freeze anymore (moved to a thread)
- BUGFIX: DHT settings were not saved correctly
- BUGFIX: Workaround to build on Fedora system (pkg-config problem)
- BUGFIX: search plugin update - do not display only last version changelog
- COSMETIC: Redesigned torrent properties a little
- COSMETIC: Redesigned options a little
- COSMETIC: Display more logs messages concerning features

1
TODO

@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
- Windows port (Chris - Peerkoel)
- Translations update
- .ico support?
- improve mininova search engine support
- Download/Finished lists cleanup
- Move transfer lists refreshers to threads
- Wait for some bug fixes in libtorrent :

18
src/searchEngine.cpp

@ -386,7 +386,7 @@ float SearchEngine::getNovaVersion(QString novaPath) const{ @@ -386,7 +386,7 @@ float SearchEngine::getNovaVersion(QString novaPath) const{
}
// Returns changelog of nova.py search engine
QByteArray SearchEngine::getNovaChangelog(QString novaPath) const{
QByteArray SearchEngine::getNovaChangelog(QString novaPath, float my_version) const{
QFile dest_nova(novaPath);
if(!dest_nova.exists()){
return QByteArray("None");
@ -402,10 +402,15 @@ QByteArray SearchEngine::getNovaChangelog(QString novaPath) const{ @@ -402,10 +402,15 @@ QByteArray SearchEngine::getNovaChangelog(QString novaPath) const{
if(line.startsWith("# Changelog:")){
in_changelog = true;
}else{
if(in_changelog && line.isEmpty()){
// end of changelog
return changelog;
if(line.isEmpty()){
in_changelog = false;
}
if(line.startsWith("# End Changelog")) break;
QString end_version = "# Version: ";
char tmp[5];
snprintf(tmp, 5, "%.2f", my_version);
end_version+=QString(tmp);
if(line.startsWith((const char*)end_version.toUtf8())) break;
if(in_changelog){
line.remove(0,1);
changelog.append(line);
@ -437,10 +442,11 @@ void SearchEngine::updateNova() const{ @@ -437,10 +442,11 @@ void SearchEngine::updateNova() const{
void SearchEngine::novaUpdateDownloaded(QString url, QString filePath){
float version_on_server = getNovaVersion(filePath);
qDebug("Version on qbittorrent.org: %.2f", version_on_server);
if(version_on_server > getNovaVersion(misc::qBittorrentPath()+"nova.py")){
float my_version = getNovaVersion(misc::qBittorrentPath()+"nova.py");
if(version_on_server > my_version){
if(QMessageBox::question(this,
tr("Search plugin update -- qBittorrent"),
tr("Search plugin can be updated, do you want to update it?\n\nChangelog:\n")+getNovaChangelog(filePath),
tr("Search plugin can be updated, do you want to update it?\n\nChangelog:\n")+getNovaChangelog(filePath, my_version),
tr("&Yes"), tr("&No"),
QString(), 0, 1)){
return;

2
src/searchEngine.h

@ -57,7 +57,7 @@ class SearchEngine : public QWidget, public Ui::search_engine{ @@ -57,7 +57,7 @@ class SearchEngine : public QWidget, public Ui::search_engine{
SearchEngine(bittorrent *BTSession, QSystemTrayIcon *myTrayIcon, bool systrayIntegration);
~SearchEngine();
float getNovaVersion(QString novaPath) const;
QByteArray getNovaChangelog(QString novaPath) const;
QByteArray getNovaChangelog(QString novaPath, float my_version) const;
bool loadColWidthSearchList();
public slots:

10
src/search_engine/nova.py

@ -12,21 +12,21 @@ @@ -12,21 +12,21 @@
# Changelog:
# - Use multiple threads to optimize speed
# Version: 2.0
# Version: 2.00
# Changelog:
# - Fixed ThePirateBay search engine
# - Fixed Meganova search engine
# - Fixed Mininova search engine
# Version: 1.9
# Version: 1.90
# Changelog:
# - Various fixes
# Version: 1.8
# Version: 1.80
# Changelog:
# - Fixed links from isohunt
# Version: 1.7
# Version: 1.70
# Changelog:
# - merged with qbittorrent branch (code cleanup, indentation mistakes)
# - separate standalone and slave mode
@ -34,6 +34,8 @@ @@ -34,6 +34,8 @@
# - added meganova
# - added multithreaded mode
# End Changelog
# Author:
# Fabien Devaux <fab AT gnux DOT info>
# Contributors:

Loading…
Cancel
Save