Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Graphics
Okular
Commits
9dcb5bc3
Commit
9dcb5bc3
authored
Jul 19, 2020
by
Albert Astals Cid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use KXMLGUIClient::findVersionNumber if using new enough xmlgui
instead of the code we copied from there
parent
5432541d
Pipeline
#28013
passed with stage
in 25 minutes and 41 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
xmlgui_helper.cpp
xmlgui_helper.cpp
+14
-0
No files found.
xmlgui_helper.cpp
View file @
9dcb5bc3
...
...
@@ -9,9 +9,17 @@
#include "xmlgui_helper.h"
#include "kxmlgui_version.h"
#if KXMLGUI_VERSION >= QT_VERSION_CHECK(5, 73, 0)
#include <KXMLGUIClient>
#endif
#include <QDebug>
#include <QFile>
#if KXMLGUI_VERSION < QT_VERSION_CHECK(5, 73, 0)
// Copied from KXmlGuiVersionHandler::findVersionNumber :/
static
QString
findVersionNumber
(
const
QString
&
xml
)
{
...
...
@@ -85,6 +93,8 @@ static QString findVersionNumber(const QString &xml)
return
QString
();
}
#endif
namespace
Okular
{
void
removeRCFileIfVersionSmallerThan
(
const
QString
&
filePath
,
int
version
)
...
...
@@ -93,7 +103,11 @@ void removeRCFileIfVersionSmallerThan(const QString &filePath, int version)
if
(
f
.
open
(
QIODevice
::
ReadOnly
))
{
const
QByteArray
contents
=
f
.
readAll
();
f
.
close
();
#if KXMLGUI_VERSION < QT_VERSION_CHECK(5, 73, 0)
const
QString
fileVersion
=
findVersionNumber
(
contents
);
#else
const
QString
fileVersion
=
KXMLGUIClient
::
findVersionNumber
(
contents
);
#endif
if
(
fileVersion
.
toInt
()
<
version
)
{
QFile
::
remove
(
filePath
);
}
...
...
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