Browse Source

Started code reorganizing (Moved libtorrent specific files and webui files to subfolders)

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
6e7309316c
  1. 2
      src/GUI.cpp
  2. 2
      src/console_imp.h
  3. 2
      src/feeddownloader.h
  4. 2
      src/headlessloader.h
  5. 2
      src/propertieswidget.cpp
  6. 2
      src/qtlibtorrent/qbtsession.cpp
  7. 0
      src/qtlibtorrent/qbtsession.h
  8. 7
      src/qtlibtorrent/qtlibtorrent.pri
  9. 0
      src/qtlibtorrent/qtorrenthandle.cpp
  10. 0
      src/qtlibtorrent/qtorrenthandle.h
  11. 2
      src/rss.h
  12. 2
      src/rss_imp.cpp
  13. 2
      src/searchengine.cpp
  14. 2
      src/speedlimitdlg.h
  15. 21
      src/src.pro
  16. 2
      src/statusbar.h
  17. 2
      src/torrentadditiondlg.h
  18. 2
      src/trackerlist.cpp
  19. 2
      src/transferlistwidget.cpp
  20. 37
      src/webui.qrc
  21. 2
      src/webui/eventmanager.cpp
  22. 0
      src/webui/eventmanager.h
  23. 0
      src/webui/html/about.html
  24. 0
      src/webui/html/addtrackers.html
  25. 0
      src/webui/html/download.html
  26. 0
      src/webui/html/downloadlimit.html
  27. 0
      src/webui/html/filters.html
  28. 0
      src/webui/html/index.html
  29. 0
      src/webui/html/preferences.html
  30. 0
      src/webui/html/preferences_content.html
  31. 0
      src/webui/html/prop-files.html
  32. 0
      src/webui/html/prop-general.html
  33. 0
      src/webui/html/prop-trackers.html
  34. 0
      src/webui/html/properties.html
  35. 0
      src/webui/html/transferlist.html
  36. 0
      src/webui/html/upload.html
  37. 0
      src/webui/html/uploadframe.html
  38. 0
      src/webui/html/uploadlimit.html
  39. 11
      src/webui/httpconnection.cpp
  40. 0
      src/webui/httpconnection.h
  41. 0
      src/webui/httprequestparser.cpp
  42. 0
      src/webui/httprequestparser.h
  43. 0
      src/webui/httpresponsegenerator.cpp
  44. 0
      src/webui/httpresponsegenerator.h
  45. 2
      src/webui/httpserver.cpp
  46. 0
      src/webui/httpserver.h
  47. 0
      src/webui/json.h
  48. 16
      src/webui/webui.pri
  49. 37
      src/webui/webui.qrc

2
src/GUI.cpp

@ -52,7 +52,7 @@
#include "torrentadditiondlg.h" #include "torrentadditiondlg.h"
#include "searchengine.h" #include "searchengine.h"
#include "rss_imp.h" #include "rss_imp.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "about_imp.h" #include "about_imp.h"
#include "trackerlogin.h" #include "trackerlogin.h"
#include "options_imp.h" #include "options_imp.h"

2
src/console_imp.h

@ -31,7 +31,7 @@
#ifndef CONSOLE_H #ifndef CONSOLE_H
#define CONSOLE_H #define CONSOLE_H
#include "bittorrent.h" #include "qbtsession.h"
#include "ui_console.h" #include "ui_console.h"
using namespace libtorrent; using namespace libtorrent;

2
src/feeddownloader.h

@ -42,7 +42,7 @@
#include <QDataStream> #include <QDataStream>
#include <QFileDialog> #include <QFileDialog>
#include "bittorrent.h" #include "qbtsession.h"
#include "ui_feeddownloader.h" #include "ui_feeddownloader.h"
#include "qinisettings.h" #include "qinisettings.h"

2
src/headlessloader.h

@ -34,7 +34,7 @@
#include <QObject> #include <QObject>
#include <QCoreApplication> #include <QCoreApplication>
#include "preferences.h" #include "preferences.h"
#include "bittorrent.h" #include "qbtsession.h"
class HeadlessLoader: public QObject { class HeadlessLoader: public QObject {
Q_OBJECT Q_OBJECT

2
src/propertieswidget.cpp

@ -44,7 +44,7 @@
#include "propertieswidget.h" #include "propertieswidget.h"
#include "transferlistwidget.h" #include "transferlistwidget.h"
#include "torrentpersistentdata.h" #include "torrentpersistentdata.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "proplistdelegate.h" #include "proplistdelegate.h"
#include "torrentfilesmodel.h" #include "torrentfilesmodel.h"
#include "peerlistwidget.h" #include "peerlistwidget.h"

2
src/bittorrent.cpp → src/qtlibtorrent/qbtsession.cpp

@ -39,7 +39,7 @@
#include "smtp.h" #include "smtp.h"
#include "filesystemwatcher.h" #include "filesystemwatcher.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "misc.h" #include "misc.h"
#include "downloadthread.h" #include "downloadthread.h"
#include "filterparserthread.h" #include "filterparserthread.h"

0
src/bittorrent.h → src/qtlibtorrent/qbtsession.h

7
src/qtlibtorrent/qtlibtorrent.pri

@ -0,0 +1,7 @@
INCLUDEPATH += $$PWD
HEADERS += $$PWD/qbtsession.h \
$$PWD/qtorrenthandle.h
SOURCES += $$PWD/qbtsession.cpp \
$$PWD/qtorrenthandle.cpp

0
src/qtorrenthandle.cpp → src/qtlibtorrent/qtorrenthandle.cpp

0
src/qtorrenthandle.h → src/qtlibtorrent/qtorrenthandle.h

2
src/rss.h

@ -45,7 +45,7 @@
#include "misc.h" #include "misc.h"
#include "feeddownloader.h" #include "feeddownloader.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "downloadthread.h" #include "downloadthread.h"
#if QT_VERSION >= 0x040500 #if QT_VERSION >= 0x040500

2
src/rss_imp.cpp

@ -40,7 +40,7 @@
#include "rss_imp.h" #include "rss_imp.h"
#include "feeddownloader.h" #include "feeddownloader.h"
#include "feedList.h" #include "feedList.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "cookiesdlg.h" #include "cookiesdlg.h"
#include "preferences.h" #include "preferences.h"
#include "rsssettings.h" #include "rsssettings.h"

2
src/searchengine.cpp

@ -48,7 +48,7 @@
#endif #endif
#include "searchengine.h" #include "searchengine.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "downloadthread.h" #include "downloadthread.h"
#include "misc.h" #include "misc.h"
#include "preferences.h" #include "preferences.h"

2
src/speedlimitdlg.h

@ -35,7 +35,7 @@
#include <QList> #include <QList>
#include "ui_bandwidth_limit.h" #include "ui_bandwidth_limit.h"
#include "misc.h" #include "misc.h"
#include "bittorrent.h" #include "qbtsession.h"
using namespace libtorrent; using namespace libtorrent;

21
src/src.pro

@ -220,10 +220,9 @@ os2 {
} }
# Resource files # Resource files
RESOURCES = icons.qrc \ RESOURCES += icons.qrc \
lang.qrc \ lang.qrc \
search.qrc \ search.qrc \
webui.qrc \
about.qrc about.qrc
# Add GeoIP resource file if the GeoIP database # Add GeoIP resource file if the GeoIP database
@ -276,14 +275,6 @@ TRANSLATIONS = $$LANG_PATH/qbittorrent_fr.ts \
# Source code # Source code
HEADERS += misc.h \ HEADERS += misc.h \
downloadthread.h \ downloadthread.h \
bittorrent.h \
qtorrenthandle.h \
httpserver.h \
httpconnection.h \
httprequestparser.h \
httpresponsegenerator.h \
json.h \
eventmanager.h \
filterparserthread.h \ filterparserthread.h \
stacktrace.h \ stacktrace.h \
torrentpersistentdata.h \ torrentpersistentdata.h \
@ -367,6 +358,9 @@ contains(DEFINES, USE_SYSTEM_QTSINGLEAPPLICATION) {
include(lineedit/lineedit.pri) include(lineedit/lineedit.pri)
} }
include(qtlibtorrent/qtlibtorrent.pri)
include(webui/webui.pri)
!contains(DEFINES, DISABLE_GUI) { !contains(DEFINES, DISABLE_GUI) {
FORMS += ui/mainwindow.ui \ FORMS += ui/mainwindow.ui \
ui/options.ui \ ui/options.ui \
@ -392,14 +386,7 @@ contains(DEFINES, USE_SYSTEM_QTSINGLEAPPLICATION) {
} }
SOURCES += main.cpp \ SOURCES += main.cpp \
bittorrent.cpp \
qtorrenthandle.cpp \
downloadthread.cpp \ downloadthread.cpp \
httpserver.cpp \
httpconnection.cpp \
httprequestparser.cpp \
httpresponsegenerator.cpp \
eventmanager.cpp \
scannedfoldersmodel.cpp \ scannedfoldersmodel.cpp \
misc.cpp \ misc.cpp \
smtp.cpp smtp.cpp

2
src/statusbar.h

@ -38,7 +38,7 @@
#include <QGridLayout> #include <QGridLayout>
#include <QPushButton> #include <QPushButton>
#include <QHBoxLayout> #include <QHBoxLayout>
#include "bittorrent.h" #include "qbtsession.h"
#include "speedlimitdlg.h" #include "speedlimitdlg.h"
#include "preferences.h" #include "preferences.h"
#include "misc.h" #include "misc.h"

2
src/torrentadditiondlg.h

@ -45,7 +45,7 @@
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
#include <libtorrent/session.hpp> #include <libtorrent/session.hpp>
#include <libtorrent/bencode.hpp> #include <libtorrent/bencode.hpp>
#include "bittorrent.h" #include "qbtsession.h"
#include "misc.h" #include "misc.h"
#include "proplistdelegate.h" #include "proplistdelegate.h"
#include "ui_torrentadditiondlg.h" #include "ui_torrentadditiondlg.h"

2
src/trackerlist.cpp

@ -40,7 +40,7 @@
#include "propertieswidget.h" #include "propertieswidget.h"
#include "trackersadditiondlg.h" #include "trackersadditiondlg.h"
#include "misc.h" #include "misc.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "qinisettings.h" #include "qinisettings.h"
TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) { TrackerList::TrackerList(PropertiesWidget *properties): QTreeWidget(), properties(properties) {

2
src/transferlistwidget.cpp

@ -29,7 +29,7 @@
*/ */
#include "transferlistwidget.h" #include "transferlistwidget.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "torrentpersistentdata.h" #include "torrentpersistentdata.h"
#include "transferlistdelegate.h" #include "transferlistdelegate.h"
#include "previewselect.h" #include "previewselect.h"

37
src/webui.qrc

@ -1,37 +0,0 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>webui/index.html</file>
<file>webui/download.html</file>
<file>webui/addtrackers.html</file>
<file>webui/upload.html</file>
<file>webui/uploadframe.html</file>
<file>webui/about.html</file>
<file>webui/filters.html</file>
<file>webui/transferlist.html</file>
<file>webui/prop-general.html</file>
<file>webui/prop-trackers.html</file>
<file>webui/prop-files.html</file>
<file>webui/properties.html</file>
<file>webui/uploadlimit.html</file>
<file>webui/downloadlimit.html</file>
<file>webui/preferences.html</file>
<file>webui/preferences_content.html</file>
<file>webui/css/Core.css</file>
<file>webui/css/Layout.css</file>
<file>webui/css/Window.css</file>
<file>webui/css/Tabs.css</file>
<file>webui/css/dynamicTable.css</file>
<file>webui/css/style.css</file>
<file>webui/scripts/excanvas-compressed.js</file>
<file>webui/scripts/mocha-yc.js</file>
<file>webui/scripts/mocha-init.js</file>
<file>webui/scripts/mootools-1.2-core-yc.js</file>
<file>webui/scripts/mootools-1.2-more.js</file>
<file>webui/scripts/dynamicTable.js</file>
<file>webui/scripts/client.js</file>
<file>webui/scripts/download.js</file>
<file>webui/scripts/progressbar.js</file>
<file>webui/scripts/contextmenu.js</file>
<file>webui/scripts/parametrics.js</file>
</qresource>
</RCC>

2
src/eventmanager.cpp → src/webui/eventmanager.cpp

@ -31,7 +31,7 @@
#include <libtorrent/version.hpp> #include <libtorrent/version.hpp>
#include "eventmanager.h" #include "eventmanager.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "scannedfoldersmodel.h" #include "scannedfoldersmodel.h"
#include "misc.h" #include "misc.h"
#include "preferences.h" #include "preferences.h"

0
src/eventmanager.h → src/webui/eventmanager.h

0
src/webui/about.html → src/webui/html/about.html

0
src/webui/addtrackers.html → src/webui/html/addtrackers.html

0
src/webui/download.html → src/webui/html/download.html

0
src/webui/downloadlimit.html → src/webui/html/downloadlimit.html

0
src/webui/filters.html → src/webui/html/filters.html

0
src/webui/index.html → src/webui/html/index.html

0
src/webui/preferences.html → src/webui/html/preferences.html

0
src/webui/preferences_content.html → src/webui/html/preferences_content.html

0
src/webui/prop-files.html → src/webui/html/prop-files.html

0
src/webui/prop-general.html → src/webui/html/prop-general.html

0
src/webui/prop-trackers.html → src/webui/html/prop-trackers.html

0
src/webui/properties.html → src/webui/html/properties.html

0
src/webui/transferlist.html → src/webui/html/transferlist.html

0
src/webui/upload.html → src/webui/html/upload.html

0
src/webui/uploadframe.html → src/webui/html/uploadframe.html

0
src/webui/uploadlimit.html → src/webui/html/uploadlimit.html

11
src/httpconnection.cpp → src/webui/httpconnection.cpp

@ -34,7 +34,7 @@
#include "eventmanager.h" #include "eventmanager.h"
#include "preferences.h" #include "preferences.h"
#include "json.h" #include "json.h"
#include "bittorrent.h" #include "qbtsession.h"
#include "misc.h" #include "misc.h"
#include <QTcpSocket> #include <QTcpSocket>
#include <QDateTime> #include <QDateTime>
@ -47,7 +47,7 @@
#include <QTemporaryFile> #include <QTemporaryFile>
HttpConnection::HttpConnection(QTcpSocket *socket, Bittorrent *BTSession, HttpServer *parent) HttpConnection::HttpConnection(QTcpSocket *socket, Bittorrent *BTSession, HttpServer *parent)
: QObject(parent), socket(socket), parent(parent), BTSession(BTSession) : QObject(parent), socket(socket), parent(parent), BTSession(BTSession)
{ {
socket->setParent(this); socket->setParent(this);
connect(socket, SIGNAL(readyRead()), this, SLOT(read())); connect(socket, SIGNAL(readyRead()), this, SLOT(read()));
@ -231,10 +231,13 @@ void HttpConnection::respond() {
return; return;
} }
} }
if (list[0] == "images") if (list[0] == "images") {
list[0] = "Icons"; list[0] = "Icons";
else } else {
if(list.last().endsWith(".html"))
list.prepend("html");
list.prepend("webui"); list.prepend("webui");
}
url = ":/" + list.join("/"); url = ":/" + list.join("/");
QFile file(url); QFile file(url);
if(!file.open(QIODevice::ReadOnly)) if(!file.open(QIODevice::ReadOnly))

0
src/httpconnection.h → src/webui/httpconnection.h

0
src/httprequestparser.cpp → src/webui/httprequestparser.cpp

0
src/httprequestparser.h → src/webui/httprequestparser.h

0
src/httpresponsegenerator.cpp → src/webui/httpresponsegenerator.cpp

0
src/httpresponsegenerator.h → src/webui/httpresponsegenerator.h

2
src/httpserver.cpp → src/webui/httpserver.cpp

@ -32,7 +32,7 @@
#include "httpserver.h" #include "httpserver.h"
#include "httpconnection.h" #include "httpconnection.h"
#include "eventmanager.h" #include "eventmanager.h"
#include "bittorrent.h" #include "qbtsession.h"
#include <QTimer> #include <QTimer>
#include <QCryptographicHash> #include <QCryptographicHash>
#include <QTime> #include <QTime>

0
src/httpserver.h → src/webui/httpserver.h

0
src/json.h → src/webui/json.h

16
src/webui/webui.pri

@ -0,0 +1,16 @@
INCLUDEPATH += $$PWD
HEADERS += $$PWD/httpserver.h \
$$PWD/httpconnection.h \
$$PWD/httprequestparser.h \
$$PWD/httpresponsegenerator.h \
$$PWD/eventmanager.h \
$$PWD/json.h
SOURCES += $$PWD/httpserver.cpp \
$$PWD/httpconnection.cpp \
$$PWD/httprequestparser.cpp \
$$PWD/httpresponsegenerator.cpp \
$$PWD/eventmanager.cpp
RESOURCES += $$PWD/webui.qrc

37
src/webui/webui.qrc

@ -0,0 +1,37 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="webui/">
<file>html/index.html</file>
<file>html/download.html</file>
<file>html/addtrackers.html</file>
<file>html/upload.html</file>
<file>html/uploadframe.html</file>
<file>html/about.html</file>
<file>html/filters.html</file>
<file>html/transferlist.html</file>
<file>html/prop-general.html</file>
<file>html/prop-trackers.html</file>
<file>html/prop-files.html</file>
<file>html/properties.html</file>
<file>html/uploadlimit.html</file>
<file>html/downloadlimit.html</file>
<file>html/preferences.html</file>
<file>html/preferences_content.html</file>
<file>css/Core.css</file>
<file>css/Layout.css</file>
<file>css/Window.css</file>
<file>css/Tabs.css</file>
<file>css/dynamicTable.css</file>
<file>css/style.css</file>
<file>scripts/excanvas-compressed.js</file>
<file>scripts/mocha-yc.js</file>
<file>scripts/mocha-init.js</file>
<file>scripts/mootools-1.2-core-yc.js</file>
<file>scripts/mootools-1.2-more.js</file>
<file>scripts/dynamicTable.js</file>
<file>scripts/client.js</file>
<file>scripts/download.js</file>
<file>scripts/progressbar.js</file>
<file>scripts/contextmenu.js</file>
<file>scripts/parametrics.js</file>
</qresource>
</RCC>
Loading…
Cancel
Save