Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
blob fish
kdevelop
Commits
d09760fd
Commit
d09760fd
authored
Jan 19, 2015
by
Milian Wolff
Browse files
f
parent
47c0dc10
Changes
2
Hide whitespace changes
Inline
Side-by-side
projectmanagers/custommake/makefileresolver/makefileresolver.cpp
View file @
d09760fd
...
...
@@ -727,3 +727,22 @@ void MakeFileResolver::setOutOfSourceBuildSystem(const QString& source, const QS
m_source
=
QDir
::
cleanPath
(
source
);
m_build
=
QDir
::
cleanPath
(
m_build
);
}
Path
MakeFileResolver
::
internPath
(
const
QString
&
path
)
const
{
Path
&
ret
=
m_pathCache
[
path
];
if
(
ret
.
isEmpty
()
!=
path
.
isEmpty
())
{
ret
=
Path
(
path
);
}
return
ret
;
}
QString
MakeFileResolver
::
internString
(
const
QString
&
path
)
const
{
auto
it
=
m_stringCache
.
constFind
(
path
);
if
(
it
!=
m_stringCache
.
constEnd
())
{
return
*
it
;
}
m_stringCache
.
insert
(
path
);
return
path
;
}
\ No newline at end of file
projectmanagers/custommake/makefileresolver/makefileresolver.h
View file @
d09760fd
...
...
@@ -84,6 +84,13 @@ class MakeFileResolver
const
QString
&
makeParameters
,
const
SourcePathInformation
&
source
,
int
maxDepth
);
QString
m_source
;
QString
m_build
;
// reuse cached instances of Paths and strings, to share memory where possible
mutable
QHash
<
QString
,
KDevelop
::
Path
>
m_pathCache
;
mutable
QSet
<
QString
>
m_stringCache
;
KDevelop
::
Path
internPath
(
const
QString
&
path
)
const
;
QString
internString
(
const
QString
&
string
)
const
;
};
#endif
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment