Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
a841c058
Commit
a841c058
authored
15 years ago
by
con
Browse files
Options
Downloads
Patches
Plain Diff
Correctly update the status of the current file find filter.
parent
cbe034e0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/texteditor/findincurrentfile.cpp
+25
-7
25 additions, 7 deletions
src/plugins/texteditor/findincurrentfile.cpp
src/plugins/texteditor/findincurrentfile.h
+6
-0
6 additions, 0 deletions
src/plugins/texteditor/findincurrentfile.h
with
31 additions
and
7 deletions
src/plugins/texteditor/findincurrentfile.cpp
+
25
−
7
View file @
a841c058
...
@@ -43,8 +43,12 @@ using namespace TextEditor::Internal;
...
@@ -43,8 +43,12 @@ using namespace TextEditor::Internal;
FindInCurrentFile
::
FindInCurrentFile
(
SearchResultWindow
*
resultWindow
)
FindInCurrentFile
::
FindInCurrentFile
(
SearchResultWindow
*
resultWindow
)
:
BaseFileFind
(
resultWindow
),
:
BaseFileFind
(
resultWindow
),
m_configWidget
(
0
)
m_configWidget
(
0
),
m_currentFile
(
0
)
{
{
connect
(
Core
::
ICore
::
instance
()
->
editorManager
(),
SIGNAL
(
currentEditorChanged
(
Core
::
IEditor
*
)),
this
,
SLOT
(
handleFileChange
(
Core
::
IEditor
*
)));
handleFileChange
(
Core
::
ICore
::
instance
()
->
editorManager
()
->
currentEditor
());
}
}
QString
FindInCurrentFile
::
id
()
const
QString
FindInCurrentFile
::
id
()
const
...
@@ -65,19 +69,33 @@ QKeySequence FindInCurrentFile::defaultShortcut() const
...
@@ -65,19 +69,33 @@ QKeySequence FindInCurrentFile::defaultShortcut() const
QStringList
FindInCurrentFile
::
files
()
QStringList
FindInCurrentFile
::
files
()
{
{
QStringList
fileList
;
QStringList
fileList
;
if
(
Core
::
IEditor
*
editor
=
Core
::
ICore
::
instance
()
->
editorManager
()
->
currentEditor
())
{
if
(
isEnabled
())
if
(
editor
->
file
()
&&
!
editor
->
file
()
->
fileName
().
isEmpty
())
fileList
<<
m_currentFile
->
fileName
();
fileList
<<
editor
->
file
()
->
fileName
();
}
return
fileList
;
return
fileList
;
}
}
bool
FindInCurrentFile
::
isEnabled
()
const
bool
FindInCurrentFile
::
isEnabled
()
const
{
{
Core
::
IEditor
*
editor
=
Core
::
ICore
::
instance
()
->
editorManager
()
->
currentEditor
();
return
m_currentFile
&&
!
m_currentFile
->
fileName
().
isEmpty
();
return
editor
&&
editor
->
file
()
&&
!
editor
->
file
()
->
fileName
().
isEmpty
();
}
void
FindInCurrentFile
::
handleFileChange
(
Core
::
IEditor
*
editor
)
{
if
(
!
editor
)
{
if
(
m_currentFile
)
{
m_currentFile
=
0
;
emit
changed
();
}
}
else
{
Core
::
IFile
*
file
=
editor
->
file
();
if
(
file
!=
m_currentFile
)
{
m_currentFile
=
file
;
emit
changed
();
}
}
}
}
QWidget
*
FindInCurrentFile
::
createConfigWidget
()
QWidget
*
FindInCurrentFile
::
createConfigWidget
()
{
{
if
(
!
m_configWidget
)
{
if
(
!
m_configWidget
)
{
...
...
This diff is collapsed.
Click to expand it.
src/plugins/texteditor/findincurrentfile.h
+
6
−
0
View file @
a841c058
...
@@ -32,6 +32,8 @@
...
@@ -32,6 +32,8 @@
#include
"basefilefind.h"
#include
"basefilefind.h"
#include
<coreplugin/ifile.h>
#include
<coreplugin/editormanager/ieditor.h>
#include
<find/ifindfilter.h>
#include
<find/ifindfilter.h>
#include
<find/searchresultwindow.h>
#include
<find/searchresultwindow.h>
...
@@ -62,8 +64,12 @@ public:
...
@@ -62,8 +64,12 @@ public:
protected:
protected:
QStringList
files
();
QStringList
files
();
private
slots
:
void
handleFileChange
(
Core
::
IEditor
*
editor
);
private:
private:
QPointer
<
QWidget
>
m_configWidget
;
QPointer
<
QWidget
>
m_configWidget
;
Core
::
IFile
*
m_currentFile
;
};
};
}
// namespace Internal
}
// namespace Internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment