diff --git a/doomsday/apps/client/src/network/packagedownloader.cpp b/doomsday/apps/client/src/network/packagedownloader.cpp
index 19aad04518..fd1927f3e6 100644
--- a/doomsday/apps/client/src/network/packagedownloader.cpp
+++ b/doomsday/apps/client/src/network/packagedownloader.cpp
@@ -240,15 +240,15 @@ void PackageDownloader::mountFileRepository(shell::ServerInfo const &info)
// The remote repository feature was added in 2.1. Trying to send a RemoteFeed
// request to an older server would just result in us getting immediately
// disconnected.
+
if (info.version() > Version(2, 1, 0, 2484))
{
- d->fileRepository = info.address().asText();
+ d->fileRepository = "doomsday:" + info.address().asText();
d->isCancelled = false;
FS::get().makeFolderWithFeed
(PATH_REMOTE_SERVER,
- RemoteFeedRelay::get().addRepository(RemoteFeedRelay::Server,
- d->fileRepository,
- PATH_SERVER_REPOSITORY_ROOT),
+ filesys::RemoteFeedRelay::get().addRepository(d->fileRepository,
+ PATH_SERVER_REPOSITORY_ROOT),
Folder::PopulateAsyncFullTree);
}
}
@@ -261,7 +261,7 @@ void PackageDownloader::unmountFileRepository()
{
trash(remoteFiles);
}
- RemoteFeedRelay::get().removeRepository(d->fileRepository);
+ filesys::RemoteFeedRelay::get().removeRepository(d->fileRepository);
d->fileRepository.clear();
d->isCancelled = false;
}
diff --git a/doomsday/apps/libdoomsday/include/doomsday/filesys/idgameslink.h b/doomsday/apps/libdoomsday/include/doomsday/filesys/idgameslink.h
index c1f3705de2..c1286cb41b 100644
--- a/doomsday/apps/libdoomsday/include/doomsday/filesys/idgameslink.h
+++ b/doomsday/apps/libdoomsday/include/doomsday/filesys/idgameslink.h
@@ -27,6 +27,8 @@ class IdgamesLink : public de::filesys::WebHostedLink
IdgamesLink(de::String const &address);
void parseRepositoryIndex(QByteArray data) override;
+
+ static de::filesys::Link *construct(de::String const &address);
};
#endif // LIBDOOMSDAY_FILESYS_IDGAMESLINK_H
diff --git a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp
index b0f0548d83..77b4f6bd2e 100644
--- a/doomsday/apps/libdoomsday/src/doomsdayapp.cpp
+++ b/doomsday/apps/libdoomsday/src/doomsdayapp.cpp
@@ -28,6 +28,7 @@
#include "doomsday/filesys/datafile.h"
#include "doomsday/filesys/datafolder.h"
#include "doomsday/filesys/virtualmappings.h"
+#include "doomsday/filesys/idgameslink.h"
#include "doomsday/busymode.h"
#include "doomsday/world/world.h"
#include "doomsday/world/entitydef.h"
@@ -151,6 +152,9 @@ DENG2_PIMPL(DoomsdayApp)
}
});
configSaveTimer.start();
+
+ // File system extensions.
+ filesys::RemoteFeedRelay::get().defineLink(IdgamesLink::construct);
}
~Impl()
@@ -389,8 +393,7 @@ DENG2_PIMPL(DoomsdayApp)
void initRemoteRepositories()
{
FS::get().makeFolderWithFeed("/remote/idgames",
- RemoteFeedRelay::get().addRepository(RemoteFeedRelay::IdgamesFileTree,
- "http://www.gamers.org/pub/idgames/"),
+ filesys::RemoteFeedRelay::get().addRepository("http://www.gamers.org/pub/idgames/"),
Folder::PopulateAsyncFullTree);
}
diff --git a/doomsday/apps/libdoomsday/src/filesys/idgameslink.cpp b/doomsday/apps/libdoomsday/src/filesys/idgameslink.cpp
index 9fbd42ca41..9710826d77 100644
--- a/doomsday/apps/libdoomsday/src/filesys/idgameslink.cpp
+++ b/doomsday/apps/libdoomsday/src/filesys/idgameslink.cpp
@@ -108,5 +108,15 @@ void IdgamesLink::parseRepositoryIndex(QByteArray data)
handleError("Failed to parse directory listing: " + errorMessage);
wasDisconnected();
}
- });
+});
+}
+
+filesys::Link *IdgamesLink::construct(String const &address)
+{
+ if ((address.startsWith("http:") || address.startsWith("https:")) &&
+ !address.contains("dengine.net"))
+ {
+ return new IdgamesLink(address);
+ }
+ return nullptr;
}
diff --git a/doomsday/sdk/libcore/include/de/core/app.h b/doomsday/sdk/libcore/include/de/core/app.h
index 010d872c68..3fb8eb771e 100644
--- a/doomsday/sdk/libcore/include/de/core/app.h
+++ b/doomsday/sdk/libcore/include/de/core/app.h
@@ -48,11 +48,11 @@ class Module;
class Path;
class NativePath;
class PackageLoader;
-class RemoteFeedRelay;
class ScriptSystem;
class System;
class UnixInfo;
+namespace filesys { class RemoteFeedRelay; }
namespace game { class Game; }
/**
@@ -296,7 +296,7 @@ class DENG2_PUBLIC App : DENG2_OBSERVES(Clock, TimeChange)
/**
* Returns the remote feed relay that manages connections to remote file repositories.
*/
- static RemoteFeedRelay &remoteFeedRelay();
+ static filesys::RemoteFeedRelay &remoteFeedRelay();
/**
* Returns the application's package loader.
diff --git a/doomsday/sdk/libcore/include/de/filesys/Query b/doomsday/sdk/libcore/include/de/filesys/Query
new file mode 100644
index 0000000000..a2d9071e83
--- /dev/null
+++ b/doomsday/sdk/libcore/include/de/filesys/Query
@@ -0,0 +1,2 @@
+#include "remote/query.h"
+
diff --git a/doomsday/sdk/libcore/include/de/filesys/remote/link.h b/doomsday/sdk/libcore/include/de/filesys/remote/link.h
index 81a2968321..a4222b4bc7 100644
--- a/doomsday/sdk/libcore/include/de/filesys/remote/link.h
+++ b/doomsday/sdk/libcore/include/de/filesys/remote/link.h
@@ -21,8 +21,8 @@
#include "../../DictionaryValue"
#include "../../IdentifiedPacket"
-#include "../../RemoteFeedRelay"
#include "../../String"
+#include "../Query"
namespace de {
@@ -31,49 +31,31 @@ class AsyncScope;
namespace filesys {
/**
- * Active connection to a remote repository. One link is shared by all
- * RemoteFeed instances accessing the same repository.
+ * Base class for an active connection to a remote repository. Specialized subclasses
+ * handle specific types of repositories. One link instance is shared by all RemoteFeed
+ * instances accessing the same repository.
+ *
+ * @ingroup fs
*/
class DENG2_PUBLIC Link
{
public:
enum State { Deinitialized, Initializing, Ready };
- using QueryId = IdentifiedPacket::Id;
-
- struct DENG2_PUBLIC Query
- {
- QueryId id;
- String path;
- RemoteFeedRelay::FileListRequest fileList;
- RemoteFeedRelay::FileContentsRequest fileContents;
- duint64 receivedBytes = 0;
- duint64 fileSize = 0;
-
- Query(RemoteFeedRelay::FileListRequest req, String path);
- Query(RemoteFeedRelay::FileContentsRequest req, String path);
- bool isValid() const;
- void cancel();
- };
+ typedef std::function Constructor;
public:
- Link(String const &address);
-
virtual ~Link();
String address() const;
State state() const;
- virtual void wasConnected();
-
- virtual void wasDisconnected();
-
- virtual void handleError(QString errorMessage);
-
void sendQuery(Query query);
protected:
+ Link(String const &address);
+
AsyncScope &scope();
Query *findQuery(QueryId id);
@@ -86,6 +68,12 @@ class DENG2_PUBLIC Link
void chunkReceived(QueryId id, duint64 startOffset, Block const &chunk, duint64 fileSize);
+ virtual void wasConnected();
+
+ virtual void wasDisconnected();
+
+ virtual void handleError(QString errorMessage);
+
virtual void transmit(Query const &query) = 0;
private:
@@ -95,4 +83,4 @@ class DENG2_PUBLIC Link
} // namespace filesys
} // namespace de
-#endif // DENG2_REMOTE_REPOSITORYLINK_H
+#endif // DENG2_FILESYS_LINK_H
diff --git a/doomsday/sdk/libcore/include/de/filesys/remote/nativelink.h b/doomsday/sdk/libcore/include/de/filesys/remote/nativelink.h
index bbdb130781..0a17d5947f 100644
--- a/doomsday/sdk/libcore/include/de/filesys/remote/nativelink.h
+++ b/doomsday/sdk/libcore/include/de/filesys/remote/nativelink.h
@@ -30,9 +30,11 @@ namespace filesys {
class DENG2_PUBLIC NativeLink : public Link
{
public:
- NativeLink(String const &address);
+ static Link *construct(String const &address);
protected:
+ NativeLink(String const &address);
+
void wasConnected() override;
void transmit(Query const &query) override;
diff --git a/doomsday/sdk/libcore/include/de/filesys/remote/query.h b/doomsday/sdk/libcore/include/de/filesys/remote/query.h
new file mode 100644
index 0000000000..16ba0a0bbc
--- /dev/null
+++ b/doomsday/sdk/libcore/include/de/filesys/remote/query.h
@@ -0,0 +1,66 @@
+/** @file remote/query.h
+ *
+ * @authors Copyright (c) 2017 Jaakko Keränen
+ *
+ * @par License
+ * LGPL: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 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 Lesser
+ * General Public License for more details. You should have received a copy of
+ * the GNU Lesser General Public License along with this program; if not, see:
+ * http://www.gnu.org/licenses
+ */
+
+#ifndef DENG2_FILESYS_QUERY_H
+#define DENG2_FILESYS_QUERY_H
+
+#include "../../AsyncCallback"
+#include "../../DictionaryValue"
+#include "../../IdentifiedPacket"
+
+namespace de {
+namespace filesys {
+
+typedef DictionaryValue FileList;
+
+typedef std::function FileListFunc;
+typedef std::function DataReceivedFunc;
+
+typedef std::shared_ptr> FileListRequest;
+typedef std::shared_ptr> FileContentsRequest;
+
+using QueryId = IdentifiedPacket::Id;
+
+/**
+ * Query about information stored in the remote repository. The callbacks will
+ * be called when a reply is received.
+ */
+struct DENG2_PUBLIC Query
+{
+ // Query parameters:
+ QueryId id;
+ String path;
+
+ // Callbacks:
+ FileListRequest fileList;
+ FileContentsRequest fileContents;
+
+ // Internal status:
+ duint64 receivedBytes = 0;
+ duint64 fileSize = 0;
+
+ Query(FileListRequest req, String path);
+ Query(FileContentsRequest req, String path);
+ bool isValid() const;
+ void cancel();
+};
+
+} // namespace filesys
+} // namespace de
+
+#endif // DENG2_FILESYS_QUERY_H
diff --git a/doomsday/sdk/libcore/include/de/filesys/remote/remotefeedrelay.h b/doomsday/sdk/libcore/include/de/filesys/remote/remotefeedrelay.h
index bca6a7d48e..3460d73998 100644
--- a/doomsday/sdk/libcore/include/de/filesys/remote/remotefeedrelay.h
+++ b/doomsday/sdk/libcore/include/de/filesys/remote/remotefeedrelay.h
@@ -23,10 +23,13 @@
#include "../../Record"
#include "../../DictionaryValue"
#include "../../AsyncCallback"
+#include "../Query"
+#include "../Link"
#include
namespace de {
+namespace filesys {
/**
* Connects to one or more remote file repositories and provides metadata and file
@@ -35,21 +38,13 @@ namespace de {
class DENG2_PUBLIC RemoteFeedRelay
{
public:
- typedef DictionaryValue FileList;
-
- typedef std::function FileListFunc;
- typedef std::function DataReceivedFunc;
-
- typedef std::shared_ptr> FileListRequest;
- typedef std::shared_ptr> FileContentsRequest;
-
static RemoteFeedRelay &get();
- enum RepositoryType {
- Server,
- NativePackages,
- IdgamesFileTree,
- };
+// enum RepositoryType {
+// Server,
+// NativePackages,
+// IdgamesFileTree,
+// };
enum Status { Disconnected, Connected };
@@ -58,7 +53,16 @@ class DENG2_PUBLIC RemoteFeedRelay
public:
RemoteFeedRelay();
- RemoteFeed *addRepository(RepositoryType type, String const &address, String const &remoteRoot = "/");
+ /**
+ * Defines a new type of remote repository link. The defined links are each
+ * offered a remote repository address, and the first one to create a Link instance
+ * based on the address will be used to communicate with the repository.
+ *
+ * @param linkConstructor Constructor method.
+ */
+ void defineLink(Link::Constructor linkConstructor);
+
+ RemoteFeed *addRepository(String const &address, String const &remoteRoot = "/");
void removeRepository(String const &address);
@@ -80,6 +84,7 @@ class DENG2_PUBLIC RemoteFeedRelay
DENG2_PRIVATE(d)
};
+} // namespace filesys
} // namespace de
#endif // LIBDENG2_REMOTEFEEDRELAY_H
diff --git a/doomsday/sdk/libcore/src/core/app.cpp b/doomsday/sdk/libcore/src/core/app.cpp
index 9753ec95e6..866f60c798 100644
--- a/doomsday/sdk/libcore/src/core/app.cpp
+++ b/doomsday/sdk/libcore/src/core/app.cpp
@@ -101,7 +101,7 @@ DENG2_PIMPL(App)
std::unique_ptr unixInfo;
- RemoteFeedRelay remoteFeedRelay;
+ filesys::RemoteFeedRelay remoteFeedRelay;
/// The configuration.
Path configPath;
@@ -892,7 +892,7 @@ Folder &App::homeFolder()
return rootFolder().locate("home");
}
-RemoteFeedRelay &App::remoteFeedRelay()
+filesys::RemoteFeedRelay &App::remoteFeedRelay()
{
return DENG2_APP->d->remoteFeedRelay;
}
diff --git a/doomsday/sdk/libcore/src/filesys/remote/link.cpp b/doomsday/sdk/libcore/src/filesys/remote/link.cpp
index 84237fd773..f62580ebce 100644
--- a/doomsday/sdk/libcore/src/filesys/remote/link.cpp
+++ b/doomsday/sdk/libcore/src/filesys/remote/link.cpp
@@ -16,7 +16,8 @@
* http://www.gnu.org/licenses
*/
-#include "de/filesys/remote/link.h"
+#include "de/filesys/Link"
+#include "de/RemoteFeedRelay"
#include
#include
@@ -120,6 +121,9 @@ Link::Link(String const &address)
d->address = address;
}
+Link::~Link()
+{}
+
String Link::address() const
{
return d->address;
@@ -170,7 +174,7 @@ void Link::cleanupQueries()
d->cleanup();
}
-Link::Query *Link::findQuery(QueryId id)
+Query *Link::findQuery(QueryId id)
{
auto found = d->pendingQueries.find(id);
if (found != d->pendingQueries.end())
@@ -246,28 +250,5 @@ void Link::chunkReceived(QueryId id, duint64 startOffset, Block const &chunk, du
}
}
-//---------------------------------------------------------------------------------------
-
-Link::Query::Query(RemoteFeedRelay::FileListRequest req, String path)
- : path(path), fileList(req)
-{}
-
-Link::Query::Query(RemoteFeedRelay::FileContentsRequest req, String path)
- : path(path), fileContents(req)
-{}
-
-bool Link::Query::isValid() const
-{
- if (fileList) return fileList ->isValid();
- if (fileContents) return fileContents->isValid();
- return false;
-}
-
-void Link::Query::cancel()
-{
- if (fileList) fileList ->cancel();
- if (fileContents) fileContents->cancel();
-}
-
} // namespace filesys
} // namespace de
diff --git a/doomsday/sdk/libcore/src/filesys/remote/nativelink.cpp b/doomsday/sdk/libcore/src/filesys/remote/nativelink.cpp
index 4bdc12bd91..605587aadc 100644
--- a/doomsday/sdk/libcore/src/filesys/remote/nativelink.cpp
+++ b/doomsday/sdk/libcore/src/filesys/remote/nativelink.cpp
@@ -26,6 +26,8 @@
namespace de {
namespace filesys {
+static String const URL_SCHEME("doomsday:");
+
DENG2_PIMPL(NativeLink)
{
RemoteFeedProtocol protocol;
@@ -76,13 +78,24 @@ NativeLink::NativeLink(String const &address)
: Link(address)
, d(new Impl(this))
{
+ DENG2_ASSERT(address.startsWith(URL_SCHEME));
+
QObject::connect(&d->socket, &Socket::connected, [this] () { wasConnected(); });
QObject::connect(&d->socket, &Socket::disconnected, [this] () { wasDisconnected(); });
QObject::connect(&d->socket, &Socket::error, [this] (QString msg) { handleError(msg); });
QObject::connect(&d->socket, &Socket::messagesReady, [this] () { d->receiveMessages(); });
- d->socket.open(address);
+ d->socket.open(address.mid(URL_SCHEME.size()));
+}
+
+Link *NativeLink::construct(String const &address)
+{
+ if (address.startsWith(URL_SCHEME))
+ {
+ return new NativeLink(address);
+ }
+ return nullptr;
}
void NativeLink::wasConnected()
diff --git a/doomsday/sdk/libcore/src/filesys/remote/query.cpp b/doomsday/sdk/libcore/src/filesys/remote/query.cpp
new file mode 100644
index 0000000000..8b80f440e6
--- /dev/null
+++ b/doomsday/sdk/libcore/src/filesys/remote/query.cpp
@@ -0,0 +1,46 @@
+/** @file remote/query.cpp
+ *
+ * @authors Copyright (c) 2017 Jaakko Keränen
+ *
+ * @par License
+ * LGPL: http://www.gnu.org/licenses/lgpl.html
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 3 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 Lesser
+ * General Public License for more details. You should have received a copy of
+ * the GNU Lesser General Public License along with this program; if not, see:
+ * http://www.gnu.org/licenses
+ */
+
+#include "de/filesys/Query"
+
+namespace de {
+namespace filesys {
+
+Query::Query(FileListRequest req, String path)
+ : path(path), fileList(req)
+{}
+
+Query::Query(FileContentsRequest req, String path)
+ : path(path), fileContents(req)
+{}
+
+bool Query::isValid() const
+{
+ if (fileList) return fileList ->isValid();
+ if (fileContents) return fileContents->isValid();
+ return false;
+}
+
+void Query::cancel()
+{
+ if (fileList) fileList ->cancel();
+ if (fileContents) fileContents->cancel();
+}
+
+} // namespace filesys
+} // namespace de
diff --git a/doomsday/sdk/libcore/src/filesys/remote/remotefeed.cpp b/doomsday/sdk/libcore/src/filesys/remote/remotefeed.cpp
index 7067947fab..e374bd4e54 100644
--- a/doomsday/sdk/libcore/src/filesys/remote/remotefeed.cpp
+++ b/doomsday/sdk/libcore/src/filesys/remote/remotefeed.cpp
@@ -35,11 +35,11 @@ namespace de {
static TimeDelta const POPULATE_TIMEOUT = 15.0;
DENG2_PIMPL(RemoteFeed)
-, DENG2_OBSERVES(RemoteFeedRelay, Status)
+, DENG2_OBSERVES(filesys::RemoteFeedRelay, Status)
{
String repository;
Path remotePath;
- std::unique_ptr fileList;
+ std::unique_ptr fileList;
SafePtr pendingPopulation;
Impl(Public *i) : Base(i)
@@ -85,9 +85,9 @@ DENG2_PIMPL(RemoteFeed)
return populated;
}
- void remoteRepositoryStatusChanged(String const &address, RemoteFeedRelay::Status status) override
+ void remoteRepositoryStatusChanged(String const &address, filesys::RemoteFeedRelay::Status status) override
{
- if (repository == address && status == RemoteFeedRelay::Connected)
+ if (repository == address && status == filesys::RemoteFeedRelay::Connected)
{
if (pendingPopulation)
{
@@ -95,7 +95,7 @@ DENG2_PIMPL(RemoteFeed)
pendingPopulation->populate(Folder::PopulateAsyncFullTree);
pendingPopulation.reset();
}
- RemoteFeedRelay::get().audienceForStatus() -= this;
+ filesys::RemoteFeedRelay::get().audienceForStatus() -= this;
}
}
};
@@ -128,7 +128,7 @@ String RemoteFeed::description() const
Feed::PopulatedFiles RemoteFeed::populate(Folder const &folder)
{
LOG_AS("RemoteFeed");
- auto &relay = RemoteFeedRelay::get();
+ auto &relay = filesys::RemoteFeedRelay::get();
PopulatedFiles files;
if (!relay.isConnected(d->repository))
{
@@ -141,7 +141,7 @@ Feed::PopulatedFiles RemoteFeed::populate(Folder const &folder)
(d->repository,
d->remotePath,
[this, &folder, &files]
- (RemoteFeedRelay::FileList const &fileList)
+ (filesys::FileList const &fileList)
{
//qDebug() << "Received file listing of" << d->remotePath;
//qDebug() << fileList.asText();
diff --git a/doomsday/sdk/libcore/src/filesys/remote/remotefeedrelay.cpp b/doomsday/sdk/libcore/src/filesys/remote/remotefeedrelay.cpp
index fb64808b03..b21e101bdb 100644
--- a/doomsday/sdk/libcore/src/filesys/remote/remotefeedrelay.cpp
+++ b/doomsday/sdk/libcore/src/filesys/remote/remotefeedrelay.cpp
@@ -23,16 +23,12 @@
#include "de/Date"
#include "de/DictionaryValue"
#include "de/filesys/Link"
+#include "de/filesys/NativeLink"
#include "de/Loop"
#include "de/Message"
-//#include "de/PathTree"
-//#include "de/RecordValue"
#include "de/RemoteFeedProtocol"
-//#include "de/Socket"
-//#include "de/TextValue"
#include "de/Version"
#include "de/charsymbols.h"
-//#include "de/data/gzip.h"
#include
#include
@@ -43,9 +39,11 @@
#include
namespace de {
+namespace filesys {
DENG2_PIMPL(RemoteFeedRelay)
{
+ QList linkConstructors;
QHash repositories; // owned
std::unique_ptr network;
@@ -77,34 +75,30 @@ RemoteFeedRelay &RemoteFeedRelay::get()
RemoteFeedRelay::RemoteFeedRelay()
: d(new Impl(this))
-{}
-
-RemoteFeed *RemoteFeedRelay::addRepository(RepositoryType type, String const &address, String const &remoteRoot)
{
- Impl::RepositoryLink *repo = nullptr;
- switch (type)
- {
- case Server:
- repo = new Impl::NativeRepositoryLink(d, address);
- break;
+ // Built-in constructors.
+ defineLink(NativeLink::construct);
+}
- case NativePackages:
- break;
+void RemoteFeedRelay::defineLink(filesys::Link::Constructor linkConstructor)
+{
+ d->linkConstructors.push_front(linkConstructor);
+}
- case IdgamesFileTree:
- repo = new Impl::IdgamesRepositoryLink(d, address);
- break;
- }
- DENG2_ASSERT(repo);
- if (repo)
+RemoteFeed *RemoteFeedRelay::addRepository(String const &address, String const &remoteRoot)
+{
+ for (auto constructor : d->linkConstructors)
{
- d->repositories.insert(address, repo);
- return new RemoteFeed(address, remoteRoot);
+ if (auto *link = constructor(address))
+ {
+ d->repositories.insert(address, link);
+ return new RemoteFeed(address, remoteRoot);
+ }
}
return nullptr;
}
-void RemoteFeedRelay::removeRepository(const de::String &address)
+void RemoteFeedRelay::removeRepository(String const &address)
{
if (auto *repo = d->repositories.take(address))
{
@@ -132,7 +126,7 @@ bool RemoteFeedRelay::isConnected(String const &address) const
return false;
}
-RemoteFeedRelay::FileListRequest
+FileListRequest
RemoteFeedRelay::fetchFileList(String const &repository, String folderPath, FileListFunc result)
{
DENG2_ASSERT(d->repositories.contains(repository));
@@ -144,14 +138,14 @@ RemoteFeedRelay::fetchFileList(String const &repository, String folderPath, File
// The repository sockets are handled in the main thread.
auto *repo = d->repositories[repository];
request.reset(new FileListRequest::element_type(result));
- repo->sendQuery(filesys::Link::Query(request, folderPath));
+ repo->sendQuery(Query(request, folderPath));
done.post();
});
done.wait();
return request;
}
-RemoteFeedRelay::FileContentsRequest
+FileContentsRequest
RemoteFeedRelay::fetchFileContents(String const &repository, String filePath, DataReceivedFunc dataReceived)
{
DENG2_ASSERT(d->repositories.contains(repository));
@@ -163,7 +157,7 @@ RemoteFeedRelay::fetchFileContents(String const &repository, String filePath, Da
// The repository sockets are handled in the main thread.
auto *repo = d->repositories[repository];
FileContentsRequest request(new FileContentsRequest::element_type(dataReceived));
- repo->sendQuery(filesys::Link::Query(request, filePath));
+ repo->sendQuery(Query(request, filePath));
done.post();
});
done.wait();
@@ -175,4 +169,5 @@ QNetworkAccessManager &RemoteFeedRelay::network()
return *d->network;
}
+} // namespace filesys
} // namespace de
diff --git a/doomsday/sdk/libcore/src/filesys/remote/remotefile.cpp b/doomsday/sdk/libcore/src/filesys/remote/remotefile.cpp
index 7fa347417e..487a49dbd7 100644
--- a/doomsday/sdk/libcore/src/filesys/remote/remotefile.cpp
+++ b/doomsday/sdk/libcore/src/filesys/remote/remotefile.cpp
@@ -36,7 +36,7 @@ DENG2_PIMPL(RemoteFile)
String remotePath;
Block remoteMetaId;
Block buffer;
- RemoteFeedRelay::FileContentsRequest fetching;
+ filesys::FileContentsRequest fetching;
Impl(Public *i) : Base(i) {}
@@ -137,7 +137,7 @@ void RemoteFile::fetchContents()
LOG_NET_MSG("Requesting download of \"%s\"") << name();
- d->fetching = RemoteFeedRelay::get().fetchFileContents
+ d->fetching = filesys::RemoteFeedRelay::get().fetchFileContents
(originFeed()->as().repository(),
d->remotePath,
[this] (duint64 startOffset, Block const &chunk, duint64 remainingBytes)
diff --git a/doomsday/sdk/libcore/src/filesys/remote/webhostedlink.cpp b/doomsday/sdk/libcore/src/filesys/remote/webhostedlink.cpp
index 239d77bdd0..e0f710d9ff 100644
--- a/doomsday/sdk/libcore/src/filesys/remote/webhostedlink.cpp
+++ b/doomsday/sdk/libcore/src/filesys/remote/webhostedlink.cpp
@@ -17,10 +17,12 @@
*/
#include "de/filesys/WebHostedLink"
-#include "de/PathTree"
+
#include "de/Async"
-#include "de/TextValue"
+#include "de/PathTree"
#include "de/RecordValue"
+#include "de/RemoteFeedRelay"
+#include "de/TextValue"
#include
#include
@@ -126,7 +128,7 @@ WebHostedLink::WebHostedLink(String const &address, String const &indexPath)
QNetworkRequest req(QUrl(address / indexPath /*"ls-laR.gz"*/));
req.setRawHeader("User-Agent", Version::currentBuild().userAgent().toLatin1());
- QNetworkReply *reply = RemoteFeedRelay::get().network().get(req);
+ QNetworkReply *reply = filesys::RemoteFeedRelay::get().network().get(req);
QObject::connect(reply, &QNetworkReply::finished, [this, reply] ()
{
reply->deleteLater();