Skip to content

Commit

Permalink
- Updated configure file to check for libcommoncpp2 instead of libcurl
Browse files Browse the repository at this point in the history
- Used downloadThread in search plugin update instead of libcurl (no more gui freeze by the same occasion)
- Still need to handle download from urls errors and use fallback url in search plugin update (before beta2)
  • Loading branch information
Christophe Dumez committed Jul 20, 2007
1 parent 7c8677d commit 2fd0de0
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 204 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- BUGFIX: Fixed a crash when filtering all the files in a torrent
- BUGFIX: Reload torrent only when necessary (properties)
- BUGFIX: qBittorrent is not exiting anymore when a dialog is closed and main window is hidden
- BUGFIX: Search plugin update is not making the GUI freeze anymore (moved to a thread)
- COSMETIC: Redesigned torrent properties a little
- COSMETIC: Redesigned options a little
- COSMETIC: Display more logs messages concerning features
Expand Down
2 changes: 1 addition & 1 deletion INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Dependencies:

- libboost: libboost-filesystem, libboost-date-time, libboost-thread, libboost-serialization

- libcurl
- libcommoncpp2

- python >= 2.3 (previous might work - not tested): needed by search engine.

Expand Down
4 changes: 2 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
qBittorrent - A BitTorrent client in Qt4.2
qBittorrent - A BitTorrent client in Qt4
------------------------------------------

Description:
********************************
qBittorrent is a bittorrent client programmed in C++ / Qt4.2 that use
qBittorrent is a bittorrent client programmed in C++ / Qt4 that use
libtorrent (sometimes called rb_libtorrent) by Arvid Norberg.

It aims to be a good alternative to all other bittorrent clients
Expand Down
3 changes: 1 addition & 2 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
// Unsure
- Azureus spoofing to prevent ban from trackers?
- Web interface?
- Use downloader class to download search plugin updates
- Allow to set upload limit for each torrent
- Option to shutdown computer when downloads are finished
- Add a torrent scheduler
Expand All @@ -43,7 +42,7 @@
- Allow to hide columns (gtsoul)
- Complete documentation and english translation
* beta2
- Fix configure file for libcommoncpp
- Handle downloadFromUrl errors (Display a messagebox to catch user's attention)
- Wait for some bug fixes in libtorrent :
- upload/download limit per torrent
- ipfilter crash
Expand Down
90 changes: 42 additions & 48 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,19 @@ Usage: $0 [OPTION]...
This script creates necessary configuration files to build/install.
Main options:
--prefix=[path] Base path for build/install. Default: /usr/local
--bindir=[path] Directory for binaries. Default: PREFIX/bin
--datadir=[path] Directory for data. Default: PREFIX/share
--qtdir=[path] Directory where Qt is installed.
--verbose Show extra configure output.
--help This help text.
--prefix=[path] Base path for build/install. Default: /usr/local
--bindir=[path] Directory for binaries. Default: PREFIX/bin
--qtdir=[path] Directory where Qt is installed.
--verbose Show extra configure output.
--help This help text.
Dependency options:
--with-libtorrent-inc=[path] Path to libtorrent include files
--with-libtorrent-lib=[path] Path to libtorrent library files
--with-libtorrent-static-lib=[path] Path to libtorrent .a file
--with-libboost-inc=[path] Path to libboost include files
--with-libcurl-inc=[path] Path to libcurl include files
--with-libcurl-lib=[path] Path to libcurl library files
--with-libcommoncpp2-inc=[path] Path to libcommoncpp2 include files
--with-libcommoncpp2-lib=[path] Path to libcommoncpp2 library files
EOT
}
Expand Down Expand Up @@ -130,11 +129,6 @@ while [ $# -gt 0 ]; do
shift
;;

--datadir=*)
DATADIR=$optarg
shift
;;

--qtdir=*)
EX_QTDIR=$optarg
shift
Expand All @@ -160,13 +154,13 @@ while [ $# -gt 0 ]; do
shift
;;

--with-libcurl-inc=*)
QC_WITH_LIBCURL_INC=$optarg
--with-libcommoncpp2-inc=*)
QC_WITH_LIBCOMMONCPP2_INC=$optarg
shift
;;

--with-libcurl-lib=*)
QC_WITH_LIBCURL_LIB=$optarg
--with-libcommoncpp2-lib=*)
QC_WITH_LIBCOMMONCPP2_LIB=$optarg
shift
;;

Expand All @@ -181,22 +175,20 @@ done

PREFIX=${PREFIX:-/usr/local}
BINDIR=${BINDIR:-$PREFIX/bin}
DATADIR=${DATADIR:-$PREFIX/share}

echo "Configuring qbittorrent ..."

if [ "$QC_DEBUG" = "Y" ]; then
echo
echo PREFIX=$PREFIX
echo BINDIR=$BINDIR
echo DATADIR=$DATADIR
echo EX_QTDIR=$EX_QTDIR
echo QC_WITH_LIBTORRENT_INC=$QC_WITH_LIBTORRENT_INC
echo QC_WITH_LIBTORRENT_LIB=$QC_WITH_LIBTORRENT_LIB
echo QC_WITH_LIBTORRENT_STATIC_LIB=$QC_WITH_LIBTORRENT_STATIC_LIB
echo QC_WITH_LIBBOOST_INC=$QC_WITH_LIBBOOST_INC
echo QC_WITH_LIBCURL_INC=$QC_WITH_LIBCURL_INC
echo QC_WITH_LIBCURL_LIB=$QC_WITH_LIBCURL_LIB
echo QC_WITH_LIBCOMMONCPP2_INC=$QC_WITH_LIBCOMMONCPP2_INC
echo QC_WITH_LIBCOMMONCPP2_LIB=$QC_WITH_LIBCOMMONCPP2_LIB
echo
fi

Expand Down Expand Up @@ -417,65 +409,68 @@ public:
return true;
}
};
#line 1 "libcurl.qcm"
#line 1 "libcommoncpp2.qcm"
/*
-----BEGIN QCMOD-----
name: libcurl
arg: with-libcurl-inc=[path], Path to libcurl include files
arg: with-libcurl-lib=[path], Path to libcurl library files
name: libcommoncpp2
arg: with-libcommoncpp2-inc=[path], Path to libcommoncpp2 include files
arg: with-libcommoncpp2-lib=[path], Path to libcommoncpp2 library files
-----END QCMOD-----
*/
class qc_libcurl : public ConfObj
class qc_libcommoncpp2 : public ConfObj
{
public:
qc_libcurl(Conf *c) : ConfObj(c) {}
QString name() const { return "libcurl"; }
QString shortname() const { return "libcurl"; }
qc_libcommoncpp2(Conf *c) : ConfObj(c) {}
QString name() const { return "GNU Common C++"; }
QString shortname() const { return "libcommoncpp2"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBCURL_INC");
QString s;
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "curl/curl.h")) {
if(!conf->checkHeader(s, "cc++/common.h")) {
return false;
}
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "curl/curl.h")){
if(conf->checkHeader(s, "cc++/common.h")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
}
conf->addIncludePath(s);
s = conf->getenv("QC_WITH_LIBCURL_LIB");
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "curl")) {
return false;
}
conf->addLib(QString("-L") + s);
if(!QFile::exists(s+QString("libccext2.so")))
return false;
if(!QFile::exists(s+QString("libccgnu2.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(conf->checkLibrary(s, "curl")){
found = true;
break;
if(QFile::exists(s+QString("libccext2.so"))){
if(QFile::exists(s+QString("libccgnu2.so"))){
found = true;
break;
}
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
conf->addLib("-lcurl");
conf->addLib("-lccext2 -lccgnu2");
return true;
}
};
Expand Down Expand Up @@ -511,7 +506,7 @@ cat >$1/modules_new.cpp <<EOT
o = new qc_libboost(conf);
o->required = true;
o->disabled = false;
o = new qc_libcurl(conf);
o = new qc_libcommoncpp2(conf);
o->required = true;
o->disabled = false;
o = new qc_python(conf);
Expand Down Expand Up @@ -1441,14 +1436,13 @@ EOT

export PREFIX
export BINDIR
export DATADIR
export EX_QTDIR
export QC_WITH_LIBTORRENT_INC
export QC_WITH_LIBTORRENT_LIB
export QC_WITH_LIBTORRENT_STATIC_LIB
export QC_WITH_LIBBOOST_INC
export QC_WITH_LIBCURL_INC
export QC_WITH_LIBCURL_LIB
export QC_WITH_LIBCOMMONCPP2_INC
export QC_WITH_LIBCOMMONCPP2_LIB
export QC_DEBUG
rm -rf .qconftemp
(
Expand Down
2 changes: 1 addition & 1 deletion qbittorrent.qc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<dep type='libboost'>
<required/>
</dep>
<dep type='libcurl'>
<dep type='libcommoncpp2'>
<required/>
</dep>
<dep type='python'>
Expand Down
64 changes: 64 additions & 0 deletions qcm/libcommoncpp2.qcm
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
-----BEGIN QCMOD-----
name: libcommoncpp2
arg: with-libcommoncpp2-inc=[path], Path to libcommoncpp2 include files
arg: with-libcommoncpp2-lib=[path], Path to libcommoncpp2 library files
-----END QCMOD-----
*/
class qc_libcommoncpp2 : public ConfObj
{
public:
qc_libcommoncpp2(Conf *c) : ConfObj(c) {}
QString name() const { return "GNU Common C++"; }
QString shortname() const { return "libcommoncpp2"; }
bool exec(){
QString s;
s = conf->getenv("QC_WITH_LIBCOMMONCPP2_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "cc++/common.h")) {
return false;
}
}else{
QStringList sl;
sl << "/usr/include";
sl << "/usr/local/include";
bool found = false;
foreach(s, sl){
if(conf->checkHeader(s, "cc++/common.h")){
found = true;
break;
}
}
if(!found) {
return false;
}
}
conf->addIncludePath(s);

s = conf->getenv("QC_WITH_LIBCOMMONCPP2_LIB");
if(!s.isEmpty()) {
if(!QFile::exists(s+QString("libccext2.so")))
return false;
if(!QFile::exists(s+QString("libccgnu2.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("libccext2.so"))){
if(QFile::exists(s+QString("libccgnu2.so"))){
found = true;
break;
}
}
}
if(!found) return false;
conf->addLib(QString("-L") + s);
}
conf->addLib("-lccext2 -lccgnu2");
return true;
}
};
61 changes: 0 additions & 61 deletions qcm/libcurl.qcm

This file was deleted.

5 changes: 0 additions & 5 deletions src/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,6 @@ class misc : public QObject{
return true;
}

// Function called by curl to write the data to the file
static int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream){
return fwrite(buffer, size, nmemb, (FILE*)stream);
}

static QString findFileInDir(const QString& dir_path, const QString& fileName){
QDir dir(dir_path);
if(dir.exists(fileName)){
Expand Down
Loading

0 comments on commit 2fd0de0

Please sign in to comment.