Skip to content

Commit

Permalink
Respect the filter args
Browse files Browse the repository at this point in the history
  • Loading branch information
timxx committed Jul 19, 2024
1 parent 4812051 commit 07b50eb
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
8 changes: 4 additions & 4 deletions qgitc/aichatwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,8 @@ def currentChatThread(self):
def isLocalLLM(self):
return self.cbBots.currentIndex() == 0

def codeReview(self, sha1):
data: bytes = Git.commitRawDiff(sha1)
def codeReview(self, sha1, args):
data: bytes = Git.commitRawDiff(sha1, gitArgs=args)
if not data:
return

Expand All @@ -534,5 +534,5 @@ def __init__(self, parent=None):
centralWidget = AiChatWidget(self)
self.setCentralWidget(centralWidget)

def codeReview(self, sha1):
self.centralWidget().codeReview(sha1)
def codeReview(self, sha1, args=None):
self.centralWidget().codeReview(sha1, args)
2 changes: 1 addition & 1 deletion qgitc/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def event(self, event):
elif type == CodeReviewEvent.Type:
window = self.getWindow(Application.AiAssistant)
self._ensureVisible(window)
window.codeReview(event.sha1)
window.codeReview(event.sha1, event.args)

return super().event(event)

Expand Down
3 changes: 2 additions & 1 deletion qgitc/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def __init__(self):
class CodeReviewEvent(QEvent):
Type = QEvent.User + 6

def __init__(self, sha1):
def __init__(self, sha1, args=None):
super().__init__(QEvent.Type(CodeReviewEvent.Type))
self.sha1 = sha1
self.args = args
2 changes: 1 addition & 1 deletion qgitc/logview.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def __onCodeReview(self):
if not commit:
return

event = CodeReviewEvent(commit.sha1)
event = CodeReviewEvent(commit.sha1, self.window().getFilterArgs())
qApp.postEvent(qApp, event)

def __onFindDataAvailable(self):
Expand Down
5 changes: 5 additions & 0 deletions qgitc/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,11 @@ def setFilterFile(self, filePath):
self.ui.leOpts.setText(filePath)
self.__onOptsReturnPressed()

def getFilterArgs(self):
text = self.ui.leOpts.text().strip()
args = shlex.split(text, posix=sys.platform != "win32")
return args

def setMode(self, mode):
hasMergeMenu = False
if mode == MainWindow.LogMode:
Expand Down

0 comments on commit 07b50eb

Please sign in to comment.