Browse Source

- Added headlessloader class to prepare Fred's work

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
af166f53d3
  1. 43
      src/headlessloader.h
  2. 7
      src/main.cpp
  3. 4
      src/src.pro

43
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 <QObject>
class HeadlessLoader: QObject {
public:
HeadlessLoader() {
}
};
#endif

7
src/main.cpp

@ -33,7 +33,7 @@
#include <QTranslator> #include <QTranslator>
#include <QFile> #include <QFile>
#ifndef DIABLE_GUI #ifndef DISABLE_GUI
#include <QSplashScreen> #include <QSplashScreen>
#include <QPlastiqueStyle> #include <QPlastiqueStyle>
#include "qgnomelook.h" #include "qgnomelook.h"
@ -47,6 +47,8 @@
#endif #endif
#include "GUI.h" #include "GUI.h"
#include "ico.h" #include "ico.h"
#else
#include "headlessloader.h"
#endif #endif
#include <QSettings> #include <QSettings>
@ -231,11 +233,14 @@ int main(int argc, char *argv[]){
#else #else
// Load Headless class // Load Headless class
// TODO: by Frederic Lassabe // TODO: by Frederic Lassabe
HeadlessLoader *loader = new HeadlessLoader();
#endif #endif
int ret = app->exec(); int ret = app->exec();
#ifndef DISABLE_GUI #ifndef DISABLE_GUI
delete window; delete window;
qDebug("GUI was deleted!"); qDebug("GUI was deleted!");
#else
delete loader;
#endif #endif
qDebug("Deleting app..."); qDebug("Deleting app...");
delete app; delete app;

4
src/src.pro

@ -186,7 +186,9 @@ HEADERS += misc.h \
filesystemwatcher.h \ filesystemwatcher.h \
preferences.h preferences.h
!contains(DEFINES, DISABLE_GUI) { contains(DEFINES, DISABLE_GUI) {
HEADERS += headlessloader.h
} else {
FORMS += GUI.h \ FORMS += GUI.h \
feedList.h \ feedList.h \
supportedengines.h \ supportedengines.h \

Loading…
Cancel
Save