diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-03-05 16:49:53 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-03-05 16:49:53 +0100 |
commit | 614a2e5f1b52557f5b3776544f59471cdeecffd2 (patch) | |
tree | d7b767f993923e9bcfc00d69c9cc4e32f26bad16 | |
parent | 86f7c7bf12703d9af75486b807a911b9daf70f35 (diff) | |
parent | b6908dee096c62ff4f84e87bfaf89b5841fae63a (diff) |
Merge remote-tracking branch 'origin/4.12'
Change-Id: I0cdc8a62b64666059e89b6b166800298b5467b2f
-rw-r--r-- | plugins/fossil/fossilclient.cpp | 27 | ||||
-rw-r--r-- | plugins/fossil/fossileditor.cpp | 46 | ||||
-rw-r--r-- | plugins/fossil/fossileditor.h | 1 | ||||
-rw-r--r-- | plugins/fossil/fossilplugin.cpp | 4 |
4 files changed, 20 insertions, 58 deletions
diff --git a/plugins/fossil/fossilclient.cpp b/plugins/fossil/fossilclient.cpp index 092cd56..16385c5 100644 --- a/plugins/fossil/fossilclient.cpp +++ b/plugins/fossil/fossilclient.cpp @@ -150,11 +150,12 @@ public: // So we kludge this by coding it as a meta-option (pipe-separated), // then parse it out in arguments. // All-choice is a blank argument with no additional parameters - QList<ComboBoxItem> lineageFilterChoices; - lineageFilterChoices << ComboBoxItem(tr("Ancestors"), "ancestors") - << ComboBoxItem(tr("Descendants"), "descendants") - << ComboBoxItem(tr("Unfiltered"), ""); - mapSetting(addComboBox(QStringList("|LINEAGE|%1|current"), lineageFilterChoices), + const QList<ChoiceItem> lineageFilterChoices = { + ChoiceItem(tr("Ancestors"), "ancestors"), + ChoiceItem(tr("Descendants"), "descendants"), + ChoiceItem(tr("Unfiltered"), "") + }; + mapSetting(addChoices(tr("Lineage"), QStringList("|LINEAGE|%1|current"), lineageFilterChoices), settings.stringPointer(FossilSettings::timelineLineageFilterKey)); } @@ -173,20 +174,20 @@ public: VcsBase::VcsBaseClientSettings &settings = m_client->settings(); // option: -t <val> - const QList<ComboBoxItem> itemTypeChoices = { - ComboBoxItem(tr("All Items"), "all"), - ComboBoxItem(tr("File Commits"), "ci"), - ComboBoxItem(tr("Technical Notes"), "e"), - ComboBoxItem(tr("Tags"), "g"), - ComboBoxItem(tr("Tickets"), "t"), - ComboBoxItem(tr("Wiki Commits"), "w") + const QList<ChoiceItem> itemTypeChoices = { + ChoiceItem(tr("All Items"), "all"), + ChoiceItem(tr("File Commits"), "ci"), + ChoiceItem(tr("Technical Notes"), "e"), + ChoiceItem(tr("Tags"), "g"), + ChoiceItem(tr("Tickets"), "t"), + ChoiceItem(tr("Wiki Commits"), "w") }; // here we setup the ComboBox to map to the "-t <val>", which will produce // the enquoted option-values (e.g "-t all"). // Fossil expects separate arguments for option and value ( i.e. "-t" "all") // so we need to handle the splitting explicitly in arguments(). - mapSetting(addComboBox(QStringList("-t %1"), itemTypeChoices), + mapSetting(addChoices(tr("Item Types"), QStringList("-t %1"), itemTypeChoices), settings.stringPointer(FossilSettings::timelineItemTypeKey)); } diff --git a/plugins/fossil/fossileditor.cpp b/plugins/fossil/fossileditor.cpp index 92fd935..826c705 100644 --- a/plugins/fossil/fossileditor.cpp +++ b/plugins/fossil/fossileditor.cpp @@ -49,19 +49,13 @@ class FossilEditorWidgetPrivate { public: FossilEditorWidgetPrivate() : - m_exactChangesetId(Constants::CHANGESET_ID_EXACT), - m_firstChangesetId(QString("\n") + Constants::CHANGESET_ID + " "), - m_nextChangesetId(m_firstChangesetId) + m_exactChangesetId(Constants::CHANGESET_ID_EXACT) { QTC_ASSERT(m_exactChangesetId.isValid(), return); - QTC_ASSERT(m_firstChangesetId.isValid(), return); - QTC_ASSERT(m_nextChangesetId.isValid(), return); } const QRegularExpression m_exactChangesetId; - const QRegularExpression m_firstChangesetId; - const QRegularExpression m_nextChangesetId; }; FossilEditorWidget::FossilEditorWidget() : @@ -69,14 +63,9 @@ FossilEditorWidget::FossilEditorWidget() : { setAnnotateRevisionTextFormat(tr("&Annotate %1")); setAnnotatePreviousRevisionTextFormat(tr("Annotate &Parent Revision %1")); - - const QRegExp exactDiffFileIdPattern(Constants::DIFFFILE_ID_EXACT); - QTC_ASSERT(exactDiffFileIdPattern.isValid(), return); - setDiffFilePattern(exactDiffFileIdPattern); - - const QRegExp logChangePattern("^.*\\[([0-9a-f]{5,40})\\]"); - QTC_ASSERT(logChangePattern.isValid(), return); - setLogEntryPattern(logChangePattern); + setDiffFilePattern(Constants::DIFFFILE_ID_EXACT); + setLogEntryPattern("^.*\\[([0-9a-f]{5,40})\\]"); + setAnnotationEntryPattern(QString("^") + Constants::CHANGESET_ID + " "); } FossilEditorWidget::~FossilEditorWidget() @@ -84,33 +73,6 @@ FossilEditorWidget::~FossilEditorWidget() delete d; } -QSet<QString> FossilEditorWidget::annotationChanges() const -{ - - const QString txt = toPlainText(); - if (txt.isEmpty()) - return QSet<QString>(); - - // extract changeset id at the beginning of each annotated line: - // <changeid> ...: - - QSet<QString> changes; - - QRegularExpressionMatch firstChangesetIdMatch = d->m_firstChangesetId.match(txt); - if (firstChangesetIdMatch.hasMatch()) { - QString changeId = firstChangesetIdMatch.captured(1); - changes.insert(changeId); - - QRegularExpressionMatchIterator i = d->m_nextChangesetId.globalMatch(txt); - while (i.hasNext()) { - const QRegularExpressionMatch nextChangesetIdMatch = i.next(); - changeId = nextChangesetIdMatch.captured(1); - changes.insert(changeId); - } - } - return changes; -} - QString FossilEditorWidget::changeUnderCursor(const QTextCursor &cursorIn) const { QTextCursor cursor = cursorIn; diff --git a/plugins/fossil/fossileditor.h b/plugins/fossil/fossileditor.h index db43d41..c9612f1 100644 --- a/plugins/fossil/fossileditor.h +++ b/plugins/fossil/fossileditor.h @@ -41,7 +41,6 @@ public: ~FossilEditorWidget() final; private: - QSet<QString> annotationChanges() const final; QString changeUnderCursor(const QTextCursor &cursor) const final; QString decorateVersion(const QString &revision) const final; QStringList annotationPreviousVersions(const QString &revision) const final; diff --git a/plugins/fossil/fossilplugin.cpp b/plugins/fossil/fossilplugin.cpp index e811443..88d93ca 100644 --- a/plugins/fossil/fossilplugin.cpp +++ b/plugins/fossil/fossilplugin.cpp @@ -1171,7 +1171,7 @@ void Fossil::Internal::FossilPlugin::testDiffFileResolving_data() void Fossil::Internal::FossilPlugin::testDiffFileResolving() { - VcsBase::VcsBaseEditorWidget::testDiffFileResolving(diffParameters.id); + VcsBase::VcsBaseEditorWidget::testDiffFileResolving(dd->diffFactory); } void Fossil::Internal::FossilPlugin::testLogResolving() @@ -1184,6 +1184,6 @@ void Fossil::Internal::FossilPlugin::testLogResolving() " EDITED src/core/scaler.cpp\n" " EDITED src/core/scaler.h\n" ); - VcsBase::VcsBaseEditorWidget::testLogResolving(fileLogParameters.id, data, "ac6d1129b8", "56d6917c3b"); + VcsBase::VcsBaseEditorWidget::testLogResolving(dd->fileLogFactory, data, "ac6d1129b8", "56d6917c3b"); } #endif |