Git: Add input validation to RemoteAdditionDialog

Use FancyLineEdits to indicate invalid inputs for
remote names and URLs.

For remote names:
* Check for duplicate remote names and indicate these
* Remove invalid chars during input

For remote URLs:
* Check if the input matches a valid URL or
  existing local directory

Task-number: QTCREATORBUG-15998
Change-Id: I224e669f16e34e2cd3d075c602b431ce5bbdd391
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2017-03-04 17:38:12 +01:00
committed by André Hartmann
parent b0ac6435b3
commit 209cc21434
4 changed files with 68 additions and 4 deletions

View File

@@ -27,6 +27,8 @@
#include "gitplugin.h"
#include "gitclient.h"
#include <utils/algorithm.h>
namespace Git {
namespace Internal {
@@ -34,6 +36,11 @@ namespace Internal {
RemoteModel::RemoteModel(QObject *parent) : QAbstractTableModel(parent)
{ }
QStringList RemoteModel::allRemoteNames() const
{
return Utils::transform(m_remotes, std::mem_fn(&Remote::name));
}
QString RemoteModel::remoteName(int row) const
{
return m_remotes.at(row).name;