Browse Source

- Added .ico support, which is really useful for RSS favicons. We use libMagick++ in order to convert ICO icons to PNG. If this library is not installed, qBittorrent will still compile but this feature will be disabled.

adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
99268bfc06
  1. 2
      INSTALL
  2. 4
      TODO
  3. 86
      configure
  4. 3
      qbittorrent.qc
  5. 58
      qcm/libmagick.qcm
  6. 17
      src/rss.h
  7. 2
      src/src.pro

2
INSTALL

@ -28,6 +28,8 @@ Dependencies:
- python >= 2.3 (previous might work - not tested): needed by search engine. - python >= 2.3 (previous might work - not tested): needed by search engine.
- libmagick++ (advised, not required)
NOTE FOR GNOME USERS: NOTE FOR GNOME USERS:
- qt4-qtconfig package is advised when using Plastique style (default) - qt4-qtconfig package is advised when using Plastique style (default)
or just change qBittorrent style to Cleanlooks (GNOME like) or just change qBittorrent style to Cleanlooks (GNOME like)

4
TODO

@ -9,7 +9,6 @@
// Harder // Harder
- Display a progress bar that really displays the pieces we have (like in eMule) - Display a progress bar that really displays the pieces we have (like in eMule)
- .ico support (unsupported by Qt4.3 Free edition)
// Waiting for libtorrent // Waiting for libtorrent
- File selection in a torrent in compact mode - File selection in a torrent in compact mode
@ -38,6 +37,7 @@
- Allow to disable UPnP/NAT-PMP/LSD in options? - Allow to disable UPnP/NAT-PMP/LSD in options?
- Allow to automatically delete torrents when they reach a given ratio (in options) : easy - Allow to automatically delete torrents when they reach a given ratio (in options) : easy
- Allow to limit the number of downloading torrents simultaneously (other are paused until a download finishes) - Allow to limit the number of downloading torrents simultaneously (other are paused until a download finishes)
- Add "Mark all as read" feature for RSS
// in v1.0.0 (partial) - WIP // in v1.0.0 (partial) - WIP
- Check storage st creation + hasher in torrent creation - Check storage st creation + hasher in torrent creation
@ -48,6 +48,7 @@
- write a patch for file_priority(int index), actual_size(); - write a patch for file_priority(int index), actual_size();
- valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok) - valgrind --tool=memcheck --leak-check=full src/qbittorrent (Looks ok)
* beta 6 * beta 6
- clean rss icons on exit
- Translations update (IN PROGRESS) - Translations update (IN PROGRESS)
- Wait for some bug fixes in libtorrent : - Wait for some bug fixes in libtorrent :
- Number of seeds non null for finished torrent (Ticket #122) - Number of seeds non null for finished torrent (Ticket #122)
@ -73,6 +74,7 @@ LANGUAGES UPDATED:
beta5->beta6 changelog: beta5->beta6 changelog:
- FEATURE: Split download tab from GUI class and cleaned up code - FEATURE: Split download tab from GUI class and cleaned up code
- FEATURE: A lot of code optimization - FEATURE: A lot of code optimization
- FEATURE: Added support for .ico format (useful for RSS favicons)
- BUGFIX: Made torrent deletion from hard-drive safer - BUGFIX: Made torrent deletion from hard-drive safer
- BUGFIX: Fixed a bug when switching from finished to downloading list - BUGFIX: Fixed a bug when switching from finished to downloading list
- BUGFIX: Showing checking progress for paused torrents too - BUGFIX: Showing checking progress for paused torrents too

86
configure vendored

@ -24,6 +24,9 @@ Dependency options:
--with-libboost-inc=[path] Path to libboost include files --with-libboost-inc=[path] Path to libboost include files
--with-libcommoncpp2-inc=[path] Path to libcommoncpp2 include files --with-libcommoncpp2-inc=[path] Path to libcommoncpp2 include files
--with-libcommoncpp2-lib=[path] Path to libcommoncpp2 library files --with-libcommoncpp2-lib=[path] Path to libcommoncpp2 library files
--disable-libmagick Disable use of libmagick
--with-libmagick-inc=[path] Path to libmagick++ include files
--with-libmagick-lib=[path] Path to libmagick++ library files
EOT EOT
} }
@ -170,6 +173,21 @@ while [ $# -gt 0 ]; do
shift shift
;; ;;
--disable-libmagick)
QC_DISABLE_libmagick="Y"
shift
;;
--with-libmagick-inc=*)
QC_WITH_LIBMAGICK_INC=$optarg
shift
;;
--with-libmagick-lib=*)
QC_WITH_LIBMAGICK_LIB=$optarg
shift
;;
--verbose) --verbose)
QC_DEBUG="Y" QC_DEBUG="Y"
shift shift
@ -197,6 +215,9 @@ echo QC_WITH_LIBTORRENT_STATIC_LIB=$QC_WITH_LIBTORRENT_STATIC_LIB
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
echo QC_WITH_LIBCOMMONCPP2_INC=$QC_WITH_LIBCOMMONCPP2_INC echo QC_WITH_LIBCOMMONCPP2_INC=$QC_WITH_LIBCOMMONCPP2_INC
echo QC_WITH_LIBCOMMONCPP2_LIB=$QC_WITH_LIBCOMMONCPP2_LIB echo QC_WITH_LIBCOMMONCPP2_LIB=$QC_WITH_LIBCOMMONCPP2_LIB
echo QC_DISABLE_libmagick=$QC_DISABLE_libmagick
echo QC_WITH_LIBMAGICK_INC=$QC_WITH_LIBMAGICK_INC
echo QC_WITH_LIBMAGICK_LIB=$QC_WITH_LIBMAGICK_LIB
echo echo
fi fi
@ -500,6 +521,65 @@ public:
return true; return true;
} }
}; };
#line 1 "libmagick.qcm"
/*
-----BEGIN QCMOD-----
name: libmagick
arg: with-libmagick-inc=[path], Path to libmagick++ include files
arg: with-libmagick-lib=[path], Path to libmagick++ library files
-----END QCMOD-----
*/
class qc_libmagick : public ConfObj
{
public:
qc_libmagick(Conf *c) : ConfObj(c) {}
QString name() const { return "ImageMagick library (libmagick++)"; }
QString shortname() const { return "libmagick++"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBMAGICK_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "Magick++.h")) {
return false;
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "Magick++.h")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);
s = conf->getenv("QC_WITH_LIBMAGICK_LIB");
if(!s.isEmpty()) {
if(!QFile::exists(s+QString("libMagick++.so")))
return false;
conf->addLib(QString("-L") + s);
}else{
QStringList sl;
sl << "/usr/lib/";
sl << "/usr/local/lib/";
bool found = false;
foreach(s, sl){
if(QFile::exists(s+QString("libMagick++.so"))){
found = true;
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
return true;
}
};
#line 1 "python.qcm" #line 1 "python.qcm"
/* /*
-----BEGIN QCMOD----- -----BEGIN QCMOD-----
@ -535,6 +615,9 @@ cat >$1/modules_new.cpp <<EOT
o = new qc_libcommoncpp2(conf); o = new qc_libcommoncpp2(conf);
o->required = true; o->required = true;
o->disabled = false; o->disabled = false;
o = new qc_libmagick(conf);
o->required = false;
o->disabled = false;
o = new qc_python(conf); o = new qc_python(conf);
o->required = true; o->required = true;
o->disabled = false; o->disabled = false;
@ -1470,6 +1553,9 @@ export QC_WITH_LIBTORRENT_STATIC_LIB
export QC_WITH_LIBBOOST_INC export QC_WITH_LIBBOOST_INC
export QC_WITH_LIBCOMMONCPP2_INC export QC_WITH_LIBCOMMONCPP2_INC
export QC_WITH_LIBCOMMONCPP2_LIB export QC_WITH_LIBCOMMONCPP2_LIB
export QC_DISABLE_libmagick
export QC_WITH_LIBMAGICK_INC
export QC_WITH_LIBMAGICK_LIB
export QC_DEBUG export QC_DEBUG
rm -rf .qconftemp rm -rf .qconftemp
( (

3
qbittorrent.qc

@ -14,6 +14,9 @@
<dep type='libcommoncpp2'> <dep type='libcommoncpp2'>
<required/> <required/>
</dep> </dep>
<dep type='libmagick'>
<optional/>
</dep>
<dep type='python'> <dep type='python'>
<required/> <required/>
</dep> </dep>

58
qcm/libmagick.qcm

@ -0,0 +1,58 @@
/*
-----BEGIN QCMOD-----
name: libmagick
arg: with-libmagick-inc=[path], Path to libmagick++ include files
arg: with-libmagick-lib=[path], Path to libmagick++ library files
-----END QCMOD-----
*/
class qc_libmagick : public ConfObj
{
public:
qc_libmagick(Conf *c) : ConfObj(c) {}
QString name() const { return "ImageMagick library (libmagick++)"; }
QString shortname() const { return "libmagick++"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBMAGICK_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "Magick++.h")) {
return false;
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "Magick++.h")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);
s = conf->getenv("QC_WITH_LIBMAGICK_LIB");
if(!s.isEmpty()) {
if(!QFile::exists(s+QString("libMagick++.so")))
return false;
conf->addLib(QString("-L") + s);
}else{
QStringList sl;
sl << "/usr/lib/";
sl << "/usr/local/lib/";
bool found = false;
foreach(s, sl){
if(QFile::exists(s+QString("libMagick++.so"))){
found = true;
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
return true;
}
};

17
src/rss.h

@ -41,6 +41,11 @@
#include "misc.h" #include "misc.h"
#include "downloadThread.h" #include "downloadThread.h"
#ifndef NO_MAGICK
#include <Magick++.h>
using namespace Magick;
#endif
class RssManager; class RssManager;
class RssStream; class RssStream;
class RssItem; class RssItem;
@ -384,6 +389,18 @@ class RssManager : public QObject{
if(url.endsWith("favicon.ico")){ if(url.endsWith("favicon.ico")){
// Icon downloaded // Icon downloaded
QImage fileIcon; QImage fileIcon;
#ifndef NO_MAGICK
try{
QFile::copy(path, path+".ico");
Image image(QDir::cleanPath(path+".ico").toUtf8().data());
// Convert to PNG since we can't read ICO format
image.magick("PNG");
image.write(path.toUtf8().data());
QFile::remove(path+".ico");
}catch(Magick::Exception &error_){
qDebug("favicon conversion to PNG failure: %s", error_.what());
}
#endif
if(fileIcon.load(path)) { if(fileIcon.load(path)) {
QList<RssStream*> res = findFeedsWithIcon(url); QList<RssStream*> res = findFeedsWithIcon(url);
RssStream* stream; RssStream* stream;

2
src/src.pro

@ -31,7 +31,7 @@ QMAKE_CXXFLAGS_RELEASE += -fwrapv -O2
QMAKE_CXXFLAGS_DEBUG += -fwrapv -O1 QMAKE_CXXFLAGS_DEBUG += -fwrapv -O1
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
PKGCONFIG += libtorrent libccext2 libccgnu2 PKGCONFIG += libtorrent libccext2 libccgnu2 ImageMagick++
QT += network xml QT += network xml
DEFINES += QT_NO_CAST_TO_ASCII DEFINES += QT_NO_CAST_TO_ASCII

Loading…
Cancel
Save