mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-21 03:21:43 -06:00
dbhub: Add very basic support for opening remote files
This adds some initial support for opening remote files. You can enter a URL and DB4S will try to download the file. When successful you'll be able to specify a place and name to save the file under, and after saving it locally to disk it'll be opened just like any local database file. See the included TODO comments for missing features. Most notably missing is the HTTPS and certificate handling code. Also any support for storing the remote source of a database is lacking.
This commit is contained in:
32
src/RemoteDatabase.h
Normal file
32
src/RemoteDatabase.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef REMOTEDATABASE_H
|
||||
#define REMOTEDATABASE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QString;
|
||||
class QNetworkReply;
|
||||
class QSslError;
|
||||
|
||||
class RemoteDatabase : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
RemoteDatabase();
|
||||
virtual ~RemoteDatabase();
|
||||
|
||||
void fetchDatabase(const QString& url);
|
||||
|
||||
signals:
|
||||
void openFile(QString path);
|
||||
|
||||
private:
|
||||
void gotEncrypted(QNetworkReply* reply);
|
||||
void gotReply(QNetworkReply* reply);
|
||||
void gotError(QNetworkReply* reply, const QList<QSslError>& errors);
|
||||
|
||||
QNetworkAccessManager* m_manager;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user