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
Tobias Hunger
qt-creator
Commits
cfa47a71
Commit
cfa47a71
authored
Sep 15, 2009
by
con
Browse files
Also remove old Qt Creator filters.
parent
119bb180
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/help/helpplugin.cpp
View file @
cfa47a71
...
...
@@ -574,9 +574,13 @@ void HelpPlugin::extensionsInitialized()
bool
needsSetup
=
false
;
bool
assistantInternalDocRegistered
=
false
;
QStringList
documentationToRemove
;
QStringList
filtersToRemove
;
const
QString
&
docInternal
=
QString
(
"com.nokia.qtcreator.%1%2%3"
)
.
arg
(
IDE_VERSION_MAJOR
).
arg
(
IDE_VERSION_MINOR
).
arg
(
IDE_VERSION_RELEASE
);
const
QString
filterInternal
=
QString
(
"Qt Creator %1.%2.%3"
)
.
arg
(
IDE_VERSION_MAJOR
).
arg
(
IDE_VERSION_MINOR
).
arg
(
IDE_VERSION_RELEASE
);
const
QRegExp
filterRegExp
(
"Qt Creator
\\
d*
\\
.
\\
d*
\\
.
\\
d*"
);
const
QStringList
&
docs
=
m_helpEngine
->
registeredDocumentations
();
foreach
(
const
QString
&
ns
,
docs
)
{
if
(
ns
==
docInternal
)
{
...
...
@@ -585,36 +589,38 @@ void HelpPlugin::extensionsInitialized()
documentationToRemove
<<
ns
;
}
}
foreach
(
const
QString
&
filter
,
m_helpEngine
->
customFilters
())
{
if
(
filterRegExp
.
exactMatch
(
filter
)
&&
filter
!=
filterInternal
)
{
filtersToRemove
<<
filter
;
}
}
//remove any qtcreator documentation that doesn't belong to current version
if
(
!
documentationToRemove
.
isEmpty
())
{
if
(
!
documentationToRemove
.
isEmpty
()
||
!
filtersToRemove
.
isEmpty
()
||
!
assistantInternalDocRegistered
)
{
QHelpEngineCore
hc
(
m_helpEngine
->
collectionFile
());
hc
.
setupData
();
foreach
(
const
QString
&
ns
,
documentationToRemove
)
{
if
(
hc
.
unregisterDocumentation
(
ns
))
needsSetup
=
true
;
}
}
if
(
!
assistantInternalDocRegistered
)
{
QFileInfo
fi
(
m_helpEngine
->
collectionFile
());
foreach
(
const
QString
&
filter
,
filtersToRemove
)
{
if
(
hc
.
removeCustomFilter
(
filter
))
needsSetup
=
true
;
}
const
QString
qchFileName
=
QDir
::
cleanPath
(
QCoreApplication
::
applicationDirPath
()
if
(
!
assistantInternalDocRegistered
)
{
const
QString
qchFileName
=
QDir
::
cleanPath
(
QCoreApplication
::
applicationDirPath
()
#if defined(Q_OS_MAC)
+
QLatin1String
(
"/../Resources/doc/qtcreator.qch"
));
+
QLatin1String
(
"/../Resources/doc/qtcreator.qch"
));
#else
+
QLatin1String
(
"../../share/doc/qtcreator/qtcreator.qch"
));
+
QLatin1String
(
"../../share/doc/qtcreator/qtcreator.qch"
));
#endif
QHelpEngineCore
hc
(
fi
.
absoluteFilePath
());
hc
.
setupData
();
QString
fileNamespace
=
QHelpEngineCore
::
namespaceName
(
qchFileName
);
if
(
!
fileNamespace
.
isEmpty
()
&&
!
hc
.
registeredDocumentations
().
contains
(
fileNamespace
))
{
if
(
!
hc
.
registerDocumentation
(
qchFileName
))
qDebug
()
<<
hc
.
error
();
needsSetup
=
true
;
if
(
!
hc
.
registerDocumentation
(
qchFileName
))
qDebug
()
<<
hc
.
error
();
needsSetup
=
true
;
}
}
QLatin1String
key
(
"UnfilteredFilterInserted"
);
...
...
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