dbhub: Add context menu action to delete local databases

Add a context menu action to the list of locally cloned databases which
allows you to delete the cloned databases.
This commit is contained in:
Martin Kleusberg
2020-07-15 15:22:52 +02:00
parent 10214b31e5
commit dd323faf2a
7 changed files with 120 additions and 22 deletions

View File

@@ -97,7 +97,7 @@ public:
const QString& commitMessage = QString(), const QString& licence = QString(), bool isPublic = false,
const QString& branch = QString("master"), bool forcePush = false);
// These function can be used to get information on locally checked out databases
// This class compiles all the information on a lcao database file
class LocalFileInfo
{
public:
@@ -121,15 +121,22 @@ public:
void clear() { name = url = commit_id = file = branch = identity = {}; }
QString user_name() const;
std::string name;
std::string url;
std::string commit_id;
std::string file;
std::string branch;
std::string identity;
std::string name; // Database name
std::string url; // URL for cloning
std::string commit_id; // Commit ID at the time of the cloning
std::string file; // Name of the local file on disk
std::string branch; // Cloned branch
std::string identity; // Identity used for cloning
};
std::vector<LocalFileInfo> localGetLocalFiles(QString identity); // Return a list of all checked out databases for a given identity
LocalFileInfo localGetLocalFileInfo(QString filename); // Return information on a single file
// Return a list of all checked out databases for a given identity
std::vector<LocalFileInfo> localGetLocalFiles(QString identity);
// Return information on a single file
LocalFileInfo localGetLocalFileInfo(QString filename);
// Delete a local database clone
void localDeleteFile(QString filename);
signals:
// As soon as you can safely open a network connection, this signal is emitted. This can be used to delay early network requests