Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
f61b8fd6
Commit
f61b8fd6
authored
Apr 08, 2011
by
Tobias Hunger
Browse files
VCS: Fix crash in VCSManager
parent
4ae81436
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/vcsmanager.cpp
View file @
f61b8fd6
...
@@ -127,7 +127,7 @@ public:
...
@@ -127,7 +127,7 @@ public:
m_vcsInfoList
.
append
(
newInfo
);
m_vcsInfoList
.
append
(
newInfo
);
QString
tmpDir
=
directory
;
QString
tmpDir
=
directory
;
while
(
tmpDir
.
count
()
>=
topLevel
.
count
())
{
while
(
tmpDir
.
count
()
>=
topLevel
.
count
()
&&
tmpDir
.
count
()
>
0
)
{
m_cachedMatches
.
insert
(
tmpDir
,
newInfo
);
m_cachedMatches
.
insert
(
tmpDir
,
newInfo
);
int
slashPos
=
tmpDir
.
lastIndexOf
(
SLASH
);
int
slashPos
=
tmpDir
.
lastIndexOf
(
SLASH
);
tmpDir
=
slashPos
>=
0
?
tmpDir
.
left
(
tmpDir
.
lastIndexOf
(
SLASH
))
:
QString
();
tmpDir
=
slashPos
>=
0
?
tmpDir
.
left
(
tmpDir
.
lastIndexOf
(
SLASH
))
:
QString
();
...
@@ -174,7 +174,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &direc
...
@@ -174,7 +174,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &direc
if
(
directory
.
isEmpty
())
if
(
directory
.
isEmpty
())
return
0
;
return
0
;
VcsManagerPrivate
::
VcsInfo
*
cachedData
=
m_d
->
find
Up
InCache
(
directory
);
VcsManagerPrivate
::
VcsInfo
*
cachedData
=
m_d
->
findInCache
(
directory
);
if
(
cachedData
)
{
if
(
cachedData
)
{
if
(
topLevelDirectory
)
if
(
topLevelDirectory
)
*
topLevelDirectory
=
cachedData
->
topLevel
;
*
topLevelDirectory
=
cachedData
->
topLevel
;
...
@@ -186,7 +186,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &direc
...
@@ -186,7 +186,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &direc
QList
<
QPair
<
QString
,
IVersionControl
*>
>
allThatCanManage
;
QList
<
QPair
<
QString
,
IVersionControl
*>
>
allThatCanManage
;
foreach
(
IVersionControl
*
versionControl
,
versionControls
)
{
foreach
(
IVersionControl
*
versionControl
,
versionControls
)
{
QString
topLevel
=
cachedData
?
cachedData
->
topLevel
:
QString
()
;
QString
topLevel
;
if
(
versionControl
->
managesDirectory
(
directory
,
&
topLevel
))
if
(
versionControl
->
managesDirectory
(
directory
,
&
topLevel
))
allThatCanManage
.
push_back
(
qMakePair
(
topLevel
,
versionControl
));
allThatCanManage
.
push_back
(
qMakePair
(
topLevel
,
versionControl
));
}
}
...
@@ -196,7 +196,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &direc
...
@@ -196,7 +196,7 @@ IVersionControl* VcsManager::findVersionControlForDirectory(const QString &direc
qSort
(
allThatCanManage
.
begin
(),
allThatCanManage
.
end
(),
longerThanPath
);
qSort
(
allThatCanManage
.
begin
(),
allThatCanManage
.
end
(),
longerThanPath
);
if
(
allThatCanManage
.
isEmpty
())
{
if
(
allThatCanManage
.
isEmpty
())
{
m_d
->
cache
(
0
,
cachedData
->
topLevel
,
directory
);
// register that nothing was found!
m_d
->
cache
(
0
,
QString
()
,
directory
);
// register that nothing was found!
// report result;
// report result;
if
(
topLevelDirectory
)
if
(
topLevelDirectory
)
...
...
Write
Preview
Supports
Markdown
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