Changeset View
Changeset View
Standalone View
Standalone View
src/bugzillaintegration/reportassistantpages_bugzilla_duplicates.h
1 | /******************************************************************* | 1 | /******************************************************************* | ||
---|---|---|---|---|---|
2 | * reportassistantpages_bugzilla_duplicates.h | 2 | * reportassistantpages_bugzilla_duplicates.h | ||
3 | * Copyright 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com> | 3 | * Copyright 2009 Dario Andres Rodriguez <andresbajotierra@gmail.com> | ||
4 | * Copyright 2019 Harald Sitter <sitter@kde.org> | ||||
4 | * | 5 | * | ||
5 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or | ||
6 | * modify it under the terms of the GNU General Public License as | 7 | * modify it under the terms of the GNU General Public License as | ||
7 | * published by the Free Software Foundation; either version 2 of | 8 | * published by the Free Software Foundation; either version 2 of | ||
8 | * the License, or (at your option) any later version. | 9 | * the License, or (at your option) any later version. | ||
9 | * | 10 | * | ||
10 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
Show All 40 Lines | 48 | public: | |||
52 | void aboutToHide() override; | 53 | void aboutToHide() override; | ||
53 | 54 | | |||
54 | bool isComplete() override; | 55 | bool isComplete() override; | ||
55 | bool showNextPage() override; | 56 | bool showNextPage() override; | ||
56 | 57 | | |||
57 | private Q_SLOTS: | 58 | private Q_SLOTS: | ||
58 | /* Search related methods */ | 59 | /* Search related methods */ | ||
59 | void searchMore(); | 60 | void searchMore(); | ||
60 | void performSearch(); | | |||
61 | void stopCurrentSearch(); | 61 | void stopCurrentSearch(); | ||
62 | 62 | | |||
63 | void markAsSearching(bool); | 63 | void markAsSearching(bool); | ||
64 | 64 | | |||
65 | bool canSearchMore(); | 65 | bool canSearchMore(); | ||
66 | 66 | | |||
67 | void searchFinished(const BugMapList&); | 67 | void searchFinished(const QList<Bugzilla::Bug::Ptr> &); | ||
68 | void searchError(QString); | 68 | void searchError(QString); | ||
69 | void analyzedDuplicates(KJob *job); | 69 | void analyzedDuplicates(KJob *job); | ||
70 | 70 | | |||
71 | void resetDates(); | | |||
72 | | ||||
73 | /* Duplicates list related methods */ | 71 | /* Duplicates list related methods */ | ||
74 | void openSelectedReport(); | 72 | void openSelectedReport(); | ||
75 | void itemClicked(QTreeWidgetItem *, int); | 73 | void itemClicked(QTreeWidgetItem *, int); | ||
76 | void itemClicked(QListWidgetItem *); | 74 | void itemClicked(QListWidgetItem *); | ||
77 | void showReportInformationDialog(int, bool relatedButtonEnabled = true); | 75 | void showReportInformationDialog(int, bool relatedButtonEnabled = true); | ||
78 | void itemSelectionChanged(); | 76 | void itemSelectionChanged(); | ||
79 | 77 | | |||
80 | /* Selected duplicates list related methods */ | 78 | /* Selected duplicates list related methods */ | ||
81 | void addPossibleDuplicateNumber(int); | 79 | void addPossibleDuplicateNumber(int); | ||
82 | void removeSelectedDuplicate(); | 80 | void removeSelectedDuplicate(); | ||
83 | 81 | | |||
84 | void showDuplicatesPanel(bool); | 82 | void showDuplicatesPanel(bool); | ||
85 | 83 | | |||
86 | void possibleDuplicateSelectionChanged(); | 84 | void possibleDuplicateSelectionChanged(); | ||
87 | 85 | | |||
88 | /* Attach to bug related methods */ | 86 | /* Attach to bug related methods */ | ||
89 | void attachToBugReport(int); | 87 | void attachToBugReport(int); | ||
90 | void cancelAttachToBugReport(); | 88 | void cancelAttachToBugReport(); | ||
91 | void informationClicked(const QString &activatedLink); | 89 | void informationClicked(const QString &activatedLink); | ||
92 | 90 | | |||
93 | private: | 91 | private: | ||
94 | bool m_searching; | 92 | bool m_searching = false; | ||
95 | bool m_foundDuplicate; | 93 | bool m_foundDuplicate = false; | ||
96 | 94 | | |||
97 | Ui::AssistantPageBugzillaDuplicates ui; | 95 | Ui::AssistantPageBugzillaDuplicates ui; | ||
98 | 96 | | |||
99 | //Dates of current Results | | |||
100 | QDate m_startDate; | | |||
101 | QDate m_endDate; | | |||
102 | //Dates of searching process | | |||
103 | QDate m_searchingStartDate; | | |||
104 | QDate m_searchingEndDate; | | |||
105 | | ||||
106 | KGuiItem m_searchMoreGuiItem; | 97 | KGuiItem m_searchMoreGuiItem; | ||
107 | KGuiItem m_retrySearchGuiItem; | 98 | KGuiItem m_retrySearchGuiItem; | ||
108 | DuplicateFinderJob::Result m_result; | 99 | DuplicateFinderJob::Result m_result; | ||
100 | | ||||
101 | int m_offset = -1; | ||||
102 | bool m_atEnd = false; | ||||
109 | }; | 103 | }; | ||
110 | 104 | | |||
111 | /** Internal bug-info dialog **/ | 105 | /** Internal bug-info dialog **/ | ||
112 | class BugzillaReportInformationDialog : public QDialog | 106 | class BugzillaReportInformationDialog : public QDialog | ||
113 | { | 107 | { | ||
114 | Q_OBJECT | 108 | Q_OBJECT | ||
115 | 109 | | |||
116 | public: | 110 | public: | ||
117 | explicit BugzillaReportInformationDialog(BugzillaDuplicatesPage*parent=nullptr); | 111 | explicit BugzillaReportInformationDialog(BugzillaDuplicatesPage*parent=nullptr); | ||
118 | ~BugzillaReportInformationDialog() override; | 112 | ~BugzillaReportInformationDialog() override; | ||
119 | 113 | | |||
120 | void showBugReport(int bugNumber, bool relatedButtonEnabled = true); | 114 | void showBugReport(int bugNumber, bool relatedButtonEnabled = true); | ||
121 | 115 | | |||
122 | void markAsDuplicate(); | 116 | void markAsDuplicate(); | ||
123 | void attachToBugReport(); | 117 | void attachToBugReport(); | ||
124 | void cancelAssistant(); | 118 | void cancelAssistant(); | ||
125 | 119 | | |||
126 | private Q_SLOTS: | 120 | private Q_SLOTS: | ||
127 | void bugFetchFinished(BugReport,QObject *); | 121 | void bugFetchFinished(Bugzilla::Bug::Ptr bug, QObject *); | ||
122 | void onCommentsFetched(QList<Bugzilla::Comment::Ptr> bugComments, | ||||
123 | QObject *jobOwner); | ||||
124 | | ||||
128 | void bugFetchError(QString, QObject *); | 125 | void bugFetchError(QString, QObject *); | ||
129 | 126 | | |||
130 | void reloadReport(); | 127 | void reloadReport(); | ||
131 | 128 | | |||
132 | void relatedReportClicked(); | 129 | void relatedReportClicked(); | ||
133 | 130 | | |||
134 | void toggleShowOwnBacktrace(bool); | 131 | void toggleShowOwnBacktrace(bool); | ||
135 | 132 | | |||
136 | Q_SIGNALS: | 133 | Q_SIGNALS: | ||
137 | void possibleDuplicateSelected(int); | 134 | void possibleDuplicateSelected(int); | ||
138 | void attachToBugReportSelected(int); | 135 | void attachToBugReportSelected(int); | ||
139 | 136 | | |||
140 | private: | 137 | private: | ||
141 | Ui::AssistantPageBugzillaDuplicatesDialog ui; | 138 | Ui::AssistantPageBugzillaDuplicatesDialog ui; | ||
142 | bool m_relatedButtonEnabled; | 139 | bool m_relatedButtonEnabled; | ||
143 | BugzillaDuplicatesPage * m_parent; | 140 | BugzillaDuplicatesPage * m_parent; | ||
144 | 141 | | |||
145 | int m_bugNumber; | 142 | int m_bugNumber; | ||
146 | QString m_closedStateString; | 143 | QString m_closedStateString; | ||
147 | int m_duplicatesCount; | 144 | int m_duplicatesCount; | ||
148 | QPushButton* m_suggestButton; | 145 | QPushButton* m_suggestButton; | ||
146 | | ||||
147 | Bugzilla::Bug::Ptr m_bug = nullptr; | ||||
149 | }; | 148 | }; | ||
150 | 149 | | |||
151 | class BugzillaReportConfirmationDialog : public QDialog | 150 | class BugzillaReportConfirmationDialog : public QDialog | ||
152 | { | 151 | { | ||
153 | Q_OBJECT | 152 | Q_OBJECT | ||
154 | 153 | | |||
155 | public: | 154 | public: | ||
156 | BugzillaReportConfirmationDialog(int bugNumber, bool commonCrash, QString closedState, | 155 | BugzillaReportConfirmationDialog(int bugNumber, bool commonCrash, QString closedState, | ||
Show All 18 Lines |