From af166f53d391212c58766ec25537d67b3d09f44b Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 15 Dec 2009 11:08:22 +0000 Subject: [PATCH] - Added headlessloader class to prepare Fred's work --- src/headlessloader.h | 43 +++++++++++++++++++++++++++++++++++++++++++ src/main.cpp | 7 ++++++- src/src.pro | 4 +++- 3 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 src/headlessloader.h diff --git a/src/headlessloader.h b/src/headlessloader.h new file mode 100644 index 000000000..46c241f98 --- /dev/null +++ b/src/headlessloader.h @@ -0,0 +1,43 @@ +/* + * Bittorrent Client using Qt4 and libtorrent. + * Copyright (C) 2006 Christophe Dumez, Frédéric Lassabe + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * In addition, as a special exception, the copyright holders give permission to + * link this program with the OpenSSL project's "OpenSSL" library (or with + * modified versions of it that use the same license as the "OpenSSL" library), + * and distribute the linked executables. You must obey the GNU General Public + * License in all respects for all of the code used other than "OpenSSL". If you + * modify file(s), you may extend this exception to your version of the file(s), + * but you are not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + * + * Contact : chris@qbittorrent.org + */ + +#ifndef HEADLESSLOADER_H +#define HEADLESSLOADER_H + +#include + +class HeadlessLoader: QObject { + public: + HeadlessLoader() { + + } +}; + +#endif diff --git a/src/main.cpp b/src/main.cpp index 94172577c..a47398d10 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -33,7 +33,7 @@ #include #include -#ifndef DIABLE_GUI +#ifndef DISABLE_GUI #include #include #include "qgnomelook.h" @@ -47,6 +47,8 @@ #endif #include "GUI.h" #include "ico.h" +#else + #include "headlessloader.h" #endif #include @@ -231,11 +233,14 @@ int main(int argc, char *argv[]){ #else // Load Headless class // TODO: by Frederic Lassabe + HeadlessLoader *loader = new HeadlessLoader(); #endif int ret = app->exec(); #ifndef DISABLE_GUI delete window; qDebug("GUI was deleted!"); +#else + delete loader; #endif qDebug("Deleting app..."); delete app; diff --git a/src/src.pro b/src/src.pro index 585ca5a66..4f9698b6e 100644 --- a/src/src.pro +++ b/src/src.pro @@ -186,7 +186,9 @@ HEADERS += misc.h \ filesystemwatcher.h \ preferences.h -!contains(DEFINES, DISABLE_GUI) { +contains(DEFINES, DISABLE_GUI) { + HEADERS += headlessloader.h +} else { FORMS += GUI.h \ feedList.h \ supportedengines.h \