Changeset View
Changeset View
Standalone View
Standalone View
plugins/htmlinterface/htmlinterfaceplugin.cpp
- This file was added.
1 | /*************************************************************************** | ||||
---|---|---|---|---|---|
2 | * Copyright (C) 2008 by Joris Guisson and Ivan Vasic * | ||||
3 | * joris.guisson@gmail.com * | ||||
4 | * ivasic@gmail.com * | ||||
5 | * * | ||||
6 | * Copyright (C) 2018 by Emmanuel Eytan * | ||||
7 | * eje211@gmail.com * | ||||
8 | * * | ||||
9 | * This program is free software; you can redistribute it and/or modify * | ||||
10 | * it under the terms of the GNU General Public License as published by * | ||||
11 | * the Free Software Foundation; either version 2 of the License, or * | ||||
12 | * (at your option) any later version. * | ||||
13 | * * | ||||
14 | * This program is distributed in the hope that it will be useful, * | ||||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * | ||||
17 | * GNU General Public License for more details. * | ||||
18 | * * | ||||
19 | * You should have received a copy of the GNU General Public License * | ||||
20 | * along with this program; if not, write to the * | ||||
21 | * Free Software Foundation, Inc., * | ||||
22 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * | ||||
23 | ***************************************************************************/ | ||||
24 | | ||||
25 | #include <KActionCollection> | ||||
26 | #include <KLocalizedString> | ||||
27 | #include <KMainWindow> | ||||
28 | #include <KPluginFactory> | ||||
29 | #include <QThread> | ||||
30 | | ||||
31 | #include "htmlinterfaceplugin.h" | ||||
32 | #include <interfaces/coreinterface.h> | ||||
33 | #include <interfaces/torrentinterface.h> | ||||
34 | #include <torrent/queuemanager.h> | ||||
35 | #include "webserver.h" | ||||
36 | | ||||
37 | | ||||
38 | | ||||
39 | K_PLUGIN_FACTORY_WITH_JSON(ktorrent_htmlinterface, "ktorrent_htmlinterface.json", registerPlugin<kt::HtmlInterfacePlugin>();) | ||||
40 | | ||||
41 | using namespace bt; | ||||
42 | using namespace std; | ||||
43 | | ||||
44 | namespace kt | ||||
45 | { | ||||
46 | HtmlInterfacePlugin::HtmlInterfacePlugin(QObject* parent, const QVariantList &args): Plugin(parent) | ||||
47 | { | ||||
48 | Q_UNUSED(args); | ||||
49 | qInfo("I've still been constructed!"); | ||||
50 | } | ||||
51 | | ||||
52 | | ||||
53 | HtmlInterfacePlugin::~HtmlInterfacePlugin() | ||||
54 | { | ||||
55 | } | ||||
56 | | ||||
57 | | ||||
58 | bool HtmlInterfacePlugin::versionCheck(const QString& version) const | ||||
59 | { | ||||
60 | return version == QStringLiteral(KT_VERSION_MACRO); | ||||
61 | } | ||||
62 | | ||||
63 | void HtmlInterfacePlugin::load() | ||||
64 | { | ||||
65 | qInfo("I've been loaded"); | ||||
66 | ws = new WebServer(getCore()); | ||||
67 | ws->process(); | ||||
68 | } | ||||
69 | | ||||
70 | void HtmlInterfacePlugin::unload() | ||||
71 | { | ||||
72 | delete ws; | ||||
73 | } | ||||
74 | | ||||
75 | void HtmlInterfacePlugin::currentTorrentChanged(bt::TorrentInterface* tc) | ||||
76 | { | ||||
77 | } | ||||
78 | | ||||
79 | } | ||||
80 | | ||||
81 | | ||||
82 | | ||||
83 | #include <htmlinterfaceplugin.moc> |