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
Marco Bubke
flatpak-qt-creator
Commits
897f8dbb
Commit
897f8dbb
authored
Sep 08, 2010
by
hjk
Browse files
debugger: fix ancient bug.
Note the ++i2.
parent
31de3860
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/projectexplorer.cpp
View file @
897f8dbb
...
...
@@ -850,24 +850,15 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
return
true
;
}
// Find a factory by file mime type in a sequence of factories
template
<
class
Factory
,
class
Iterator
>
Factory
*
findFactory
(
const
QString
&
mimeType
,
Iterator
i1
,
Iterator
i2
)
{
for
(
;
i1
!=
i2
;
++
i2
)
{
Factory
*
f
=
*
i1
;
if
(
f
->
mimeTypes
().
contains
(
mimeType
))
return
f
;
}
return
0
;
}
ProjectFileFactory
*
ProjectExplorerPlugin
::
findProjectFileFactory
(
const
QString
&
filename
)
const
ProjectFileFactory
*
ProjectExplorerPlugin
::
findProjectFileFactory
(
const
QString
&
filename
)
const
{
// Find factory
if
(
const
Core
::
MimeType
mt
=
Core
::
ICore
::
instance
()
->
mimeDatabase
()
->
findByFile
(
QFileInfo
(
filename
)))
if
(
ProjectFileFactory
*
pf
=
findFactory
<
ProjectFileFactory
>
(
mt
.
type
(),
d
->
m_fileFactories
.
constBegin
(),
d
->
m_fileFactories
.
constEnd
()))
return
pf
;
if
(
const
Core
::
MimeType
mt
=
Core
::
ICore
::
instance
()
->
mimeDatabase
()
->
findByFile
(
QFileInfo
(
filename
)))
{
const
QString
mimeType
=
mt
.
type
();
foreach
(
ProjectFileFactory
*
f
,
d
->
m_fileFactories
)
if
(
f
->
mimeTypes
().
contains
(
mimeType
))
return
f
;
}
qWarning
(
"Unable to find project file factory for '%s'"
,
filename
.
toUtf8
().
constData
());
return
0
;
}
...
...
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