diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2017-03-04 17:38:12 +0100 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2017-03-09 22:03:05 +0000 |
commit | 209cc214341226cb5c04283b7c3c8b1221bf3b5b (patch) | |
tree | 35d61c28721fb8cadec0235cb60b451e44dddf8e /src/plugins/git/remotemodel.cpp | |
parent | b0ac6435b3786854e7a8d10cf4d8df49ca74618a (diff) | |
download | qt-creator-209cc214341226cb5c04283b7c3c8b1221bf3b5b.tar.gz |
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>
Diffstat (limited to 'src/plugins/git/remotemodel.cpp')
-rw-r--r-- | src/plugins/git/remotemodel.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/git/remotemodel.cpp b/src/plugins/git/remotemodel.cpp index 2ba274f983..7cd14b1258 100644 --- a/src/plugins/git/remotemodel.cpp +++ b/src/plugins/git/remotemodel.cpp @@ -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; |