mirror of
https://github.com/QRouland/UTPass.git
synced 2026-01-09 11:16:56 +00:00
Foramtting
This commit is contained in:
@@ -62,14 +62,16 @@ bool CloneJob::moveToDestination(QDir tmp_dir, const QString& path)
|
||||
qDebug() << "[CloneJob] Moving cloned content to destination dir";
|
||||
|
||||
if (!QDir().rename(tmp_dir.absolutePath(), destination_dir.absolutePath())) {
|
||||
qWarning() << "[CloneJob] Failed to move directory from" << tmp_dir.absolutePath() << "to" << destination_dir.absolutePath();
|
||||
qWarning() << "[CloneJob] Failed to move directory from" << tmp_dir.absolutePath() << "to" <<
|
||||
destination_dir.absolutePath();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const QPair<GitCloneErrorCode, QString> CloneJob::clone(QString url, QString path, cred_type cred, git_cred_acquire_cb cb)
|
||||
const QPair<GitCloneErrorCode, QString> CloneJob::clone(QString url, QString path, cred_type cred,
|
||||
git_cred_acquire_cb cb)
|
||||
{
|
||||
git_repository *repo = nullptr; // Use nullptr for type safety
|
||||
git_clone_options opts = GIT_CLONE_OPTIONS_INIT;
|
||||
@@ -82,11 +84,11 @@ const QPair<GitCloneErrorCode, QString> CloneJob::clone(QString url, QString pat
|
||||
|
||||
// Map the application specific cb errors if any
|
||||
if (ret == GIT_EUSER) {
|
||||
if(payload.err == ErrorCodeCB::NoUsername)
|
||||
if (payload.err == ErrorCodeCB::NoUsername)
|
||||
return {GitCloneErrorCode::NoUsername, "no username provided in URL"};
|
||||
if(payload.err == ErrorCodeCB::InvalidCreds)
|
||||
if (payload.err == ErrorCodeCB::InvalidCreds)
|
||||
return {GitCloneErrorCode::AuthentificationError, "authentification error"};
|
||||
if(payload.err == ErrorCodeCB::UrlTypeDoNotMatchCreds)
|
||||
if (payload.err == ErrorCodeCB::UrlTypeDoNotMatchCreds)
|
||||
return {GitCloneErrorCode::UrlTypeDoNotMatchCreds, "invalid creds types for provided url"};
|
||||
return {GitCloneErrorCode::UnexpectedError, "unexcepted error occured"};
|
||||
}
|
||||
|
||||
@@ -27,12 +27,12 @@ class CloneJob : public GitJob
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when the cloning operation is complete.
|
||||
*
|
||||
* This signal is emitted once the cloning operation finishes.
|
||||
*
|
||||
* @param err A Git error.
|
||||
*/
|
||||
* @brief Signal emitted when the cloning operation is complete.
|
||||
*
|
||||
* This signal is emitted once the cloning operation finishes.
|
||||
*
|
||||
* @param err A Git error.
|
||||
*/
|
||||
void resultReady(const int err_code, const QString message);
|
||||
|
||||
private:
|
||||
|
||||
@@ -57,7 +57,7 @@ int GitJob::credentialsCB(git_cred **out, const char *url, const char *username_
|
||||
}
|
||||
return git_cred_userpass_plaintext_new(out, username_from_url, x.pass.toLocal8Bit().constData());
|
||||
},
|
||||
[allowed_types, &out, &username_from_url , &p](const SSHKey & x)
|
||||
[allowed_types, &out, &username_from_url, &p](const SSHKey & x)
|
||||
{
|
||||
qDebug() << "[GitJob] credentialsCB : SSHKey ";
|
||||
if (!(allowed_types & GIT_CREDTYPE_SSH_KEY)) {
|
||||
|
||||
@@ -39,8 +39,7 @@ enum class ErrorCodeCB {
|
||||
};
|
||||
|
||||
|
||||
struct PayloadCB
|
||||
{
|
||||
struct PayloadCB {
|
||||
bool called;
|
||||
cred_type creds;
|
||||
ErrorCodeCB err;
|
||||
|
||||
Reference in New Issue
Block a user