Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Hunger
qt-creator
Commits
ef0e1a64
Commit
ef0e1a64
authored
Oct 06, 2009
by
Roberto Raggi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show a warning message when using global renaming.
parent
c70f968f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
7 deletions
+39
-7
src/plugins/cppeditor/cppeditor.cpp
src/plugins/cppeditor/cppeditor.cpp
+10
-0
src/plugins/cppeditor/cppeditor.h
src/plugins/cppeditor/cppeditor.h
+1
-0
src/plugins/cpptools/cppfindreferences.cpp
src/plugins/cpptools/cppfindreferences.cpp
+13
-7
src/plugins/find/searchresultwindow.cpp
src/plugins/find/searchresultwindow.cpp
+12
-0
src/plugins/find/searchresultwindow.h
src/plugins/find/searchresultwindow.h
+3
-0
No files found.
src/plugins/cppeditor/cppeditor.cpp
View file @
ef0e1a64
...
...
@@ -869,6 +869,16 @@ void CPPEditor::findUsages()
void
CPPEditor
::
renameUsages
()
{
Core
::
EditorManager
::
instance
()
->
showEditorInfoBar
(
QLatin1String
(
"CppEditor.Rename"
),
tr
(
"This change cannot be undone."
),
tr
(
"Yes, I know what I am doing."
),
this
,
SLOT
(
renameUsagesNow
()));
}
void
CPPEditor
::
renameUsagesNow
()
{
Core
::
EditorManager
::
instance
()
->
hideEditorInfoBar
(
QLatin1String
(
"CppEditor.Rename"
));
m_currentRenameSelection
=
-
1
;
QList
<
QTextEdit
::
ExtraSelection
>
selections
;
...
...
src/plugins/cppeditor/cppeditor.h
View file @
ef0e1a64
...
...
@@ -192,6 +192,7 @@ public Q_SLOTS:
void
renameSymbolUnderCursor
();
void
renameUsages
();
void
findUsages
();
void
renameUsagesNow
();
void
moveToPreviousToken
();
void
moveToNextToken
();
...
...
src/plugins/cpptools/cppfindreferences.cpp
View file @
ef0e1a64
...
...
@@ -58,7 +58,7 @@
#include <QtCore/QTime>
#include <QtCore/QtConcurrentRun>
#include <QtCore/QDir>
#include <QtGui/QApplication>
#include <qtconcurrent/runextensions.h>
using
namespace
CppTools
::
Internal
;
...
...
@@ -545,15 +545,20 @@ void CppFindReferences::findUsages(Symbol *symbol)
void
CppFindReferences
::
renameUsages
(
Symbol
*
symbol
)
{
Find
::
SearchResult
*
search
=
_resultWindow
->
startNewSearch
(
Find
::
SearchResultWindow
::
SearchAndReplace
);
if
(
Identifier
*
id
=
symbol
->
identifier
())
{
const
QString
textToReplace
=
QString
::
fromUtf8
(
id
->
chars
(),
id
->
size
());
connect
(
search
,
SIGNAL
(
activated
(
Find
::
SearchResultItem
)),
this
,
SLOT
(
openEditor
(
Find
::
SearchResultItem
))
);
Find
::
SearchResult
*
search
=
_resultWindow
->
startNewSearch
(
Find
::
SearchResultWindow
::
SearchAndReplace
);
_resultWindow
->
setTextToReplace
(
textToReplace
);
connect
(
search
,
SIGNAL
(
replaceButtonClicked
(
QString
,
QList
<
Find
::
SearchResultItem
>
)),
SLOT
(
onReplaceButtonClicked
(
QString
,
QList
<
Find
::
SearchResultItem
>
)));
connect
(
search
,
SIGNAL
(
activated
(
Find
::
SearchResultItem
)),
this
,
SLOT
(
openEditor
(
Find
::
SearchResultItem
)));
findAll_helper
(
symbol
);
connect
(
search
,
SIGNAL
(
replaceButtonClicked
(
QString
,
QList
<
Find
::
SearchResultItem
>
)),
SLOT
(
onReplaceButtonClicked
(
QString
,
QList
<
Find
::
SearchResultItem
>
)));
findAll_helper
(
symbol
);
}
}
void
CppFindReferences
::
findAll_helper
(
Symbol
*
symbol
)
...
...
@@ -651,6 +656,7 @@ void CppFindReferences::onReplaceButtonClicked(const QString &text,
const
QStringList
fileNames
=
changes
.
keys
();
_modelManager
->
updateSourceFiles
(
fileNames
);
_resultWindow
->
hide
();
}
void
CppFindReferences
::
displayResult
(
int
index
)
...
...
src/plugins/find/searchresultwindow.cpp
View file @
ef0e1a64
...
...
@@ -104,6 +104,17 @@ SearchResultWindow::~SearchResultWindow()
m_items
.
clear
();
}
void
SearchResultWindow
::
setTextToReplace
(
const
QString
&
textToReplace
)
{
m_replaceTextEdit
->
setText
(
textToReplace
);
m_replaceTextEdit
->
selectAll
();
}
QString
SearchResultWindow
::
textToReplace
()
const
{
return
m_replaceTextEdit
->
text
();
}
void
SearchResultWindow
::
setShowReplaceUI
(
bool
show
)
{
m_searchResultTreeView
->
model
()
->
setShowReplaceUI
(
show
);
...
...
@@ -169,6 +180,7 @@ SearchResult *SearchResultWindow::startNewSearch(SearchMode searchOrSearchAndRep
void
SearchResultWindow
::
clearContents
()
{
setReplaceUIEnabled
(
false
);
m_replaceTextEdit
->
clear
();
m_searchResultTreeView
->
clear
();
m_items
.
clear
();
m_widget
->
setCurrentWidget
(
m_searchResultTreeView
);
...
...
src/plugins/find/searchresultwindow.h
View file @
ef0e1a64
...
...
@@ -106,6 +106,9 @@ public:
void
setShowReplaceUI
(
bool
show
);
bool
isShowingReplaceUI
()
const
;
void
setTextToReplace
(
const
QString
&
textToReplace
);
QString
textToReplace
()
const
;
// search result object only lives till next startnewsearch call
SearchResult
*
startNewSearch
(
SearchMode
searchOrSearchAndReplace
=
SearchOnly
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment