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. 20
      src/searchEngine.cpp
  4. 2
      src/searchEngine.h
  5. 10
      src/search_engine/nova.py

1
Changelog

@ -38,6 +38,7 @@
- BUGFIX: Search plugin update is not making the GUI freeze anymore (moved to a thread) - BUGFIX: Search plugin update is not making the GUI freeze anymore (moved to a thread)
- BUGFIX: DHT settings were not saved correctly - BUGFIX: DHT settings were not saved correctly
- BUGFIX: Workaround to build on Fedora system (pkg-config problem) - 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 torrent properties a little
- COSMETIC: Redesigned options a little - COSMETIC: Redesigned options a little
- COSMETIC: Display more logs messages concerning features - COSMETIC: Display more logs messages concerning features

1
TODO

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

20
src/searchEngine.cpp

@ -386,7 +386,7 @@ float SearchEngine::getNovaVersion(QString novaPath) const{
} }
// Returns changelog of nova.py search engine // 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); QFile dest_nova(novaPath);
if(!dest_nova.exists()){ if(!dest_nova.exists()){
return QByteArray("None"); return QByteArray("None");
@ -402,10 +402,15 @@ QByteArray SearchEngine::getNovaChangelog(QString novaPath) const{
if(line.startsWith("# Changelog:")){ if(line.startsWith("# Changelog:")){
in_changelog = true; in_changelog = true;
}else{ }else{
if(in_changelog && line.isEmpty()){ if(line.isEmpty()){
// end of changelog in_changelog = false;
return changelog; }
} 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){ if(in_changelog){
line.remove(0,1); line.remove(0,1);
changelog.append(line); changelog.append(line);
@ -437,10 +442,11 @@ void SearchEngine::updateNova() const{
void SearchEngine::novaUpdateDownloaded(QString url, QString filePath){ void SearchEngine::novaUpdateDownloaded(QString url, QString filePath){
float version_on_server = getNovaVersion(filePath); float version_on_server = getNovaVersion(filePath);
qDebug("Version on qbittorrent.org: %.2f", version_on_server); 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, if(QMessageBox::question(this,
tr("Search plugin update -- qBittorrent"), 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"), tr("&Yes"), tr("&No"),
QString(), 0, 1)){ QString(), 0, 1)){
return; return;

2
src/searchEngine.h

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

10
src/search_engine/nova.py

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

Loading…
Cancel
Save