diff options
| author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2024-01-20 14:26:36 +0100 |
|---|---|---|
| committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2024-01-20 16:40:28 +0000 |
| commit | 2d5499562274504960ee70e425ba807953dbdcf2 (patch) | |
| tree | c2164a1f812629d4c65881240ee045233f57abe5 /src/plugins/git/gitutils.cpp | |
| parent | 98c0e9764a77bf60c6f57b62cedbc0835f8f3e9e (diff) | |
GitUtils: Get rid of unused Stash::clear() method
Make parseStashLine() a local static method returning optional Stash.
Change-Id: If702a4485ce87336ab829b522258e62a930589bf
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/git/gitutils.cpp')
| -rw-r--r-- | src/plugins/git/gitutils.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/plugins/git/gitutils.cpp b/src/plugins/git/gitutils.cpp index f7684141a9e..3730efef325 100644 --- a/src/plugins/git/gitutils.cpp +++ b/src/plugins/git/gitutils.cpp @@ -8,40 +8,6 @@ namespace Git::Internal { -void Stash::clear() -{ - name.clear(); - branch.clear(); - message.clear(); -} - -/* Parse a stash line in its 2 manifestations (with message/without message containing - * <base_sha1>+subject): -\code -stash@{1}: WIP on <branch>: <base_sha1> <subject_base_sha1> -stash@{2}: On <branch>: <message> -\endcode */ - -bool Stash::parseStashLine(const QString &l) -{ - const QChar colon = ':'; - const int branchPos = l.indexOf(colon); - if (branchPos < 0) - return false; - const int messagePos = l.indexOf(colon, branchPos + 1); - if (messagePos < 0) - return false; - // Branch spec - const int onIndex = l.indexOf("on ", branchPos + 2, Qt::CaseInsensitive); - if (onIndex == -1 || onIndex >= messagePos) - return false; - // Happy! - name = l.left(branchPos); - branch = l.mid(onIndex + 3, messagePos - onIndex - 3); - message = l.mid(messagePos + 2); // skip blank - return true; -} - // Make QInputDialog play nicely, widen it a bit. bool inputText(QWidget *parent, const QString &title, const QString &prompt, QString *s) { |
