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
Games
Kubrick
Commits
004b5b39
Commit
004b5b39
authored
Apr 24, 2017
by
Andrius Štikonas
Browse files
Fix loading of background svgz file.
parent
c1b27ee0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gameglview.cpp
View file @
004b5b39
...
...
@@ -20,11 +20,12 @@
#include "gameglview.h"
// Qt includes
#include <QStringList>
#include <QPoint>
#include <QDir>
#include <QImage>
#include <QMouseEvent>
#include <QPainter>
#include <QPoint>
#include <QStringList>
// IDW - This is temporary code for KDE 4.1. Do themes properly in KDE 4.2.
#include <KCmdLineArgs>
...
...
@@ -62,13 +63,15 @@ GameGLView::GameGLView(Game * g, QWidget * parent)
void
GameGLView
::
initializeGL
()
{
// Look for themes in files "---/share/apps/kubrick/themes/*.desktop".
#if 0 //QT5
KGlobal::dirs()->addResourceType ("theme", "data",
QString (KCmdLineArgs::aboutData()->appName()) + QString ("/themes/"));
#endif
// IDW - This is temporary code for KDE 4.1. Do themes properly in KDE 4.2.
QStringList
themeFilepaths
=
KGlobal
::
dirs
()
->
findAllResources
(
"theme"
,
"*.svgz"
,
KStandardDirs
::
NoDuplicates
);
// Find files.
QStringList
themeFilepaths
;
const
QStringList
dirs
=
QStandardPaths
::
locateAll
(
QStandardPaths
::
DataLocation
,
"themes"
,
QStandardPaths
::
LocateDirectory
);
for
(
const
QString
&
dir
:
dirs
)
{
const
QStringList
fileNames
=
QDir
(
dir
).
entryList
(
QStringList
()
<<
QStringLiteral
(
"*.svgz"
));
// Find files.
for
(
const
QString
&
file
:
fileNames
)
{
themeFilepaths
.
append
(
dir
+
'/'
+
file
);
}
}
if
(
!
themeFilepaths
.
isEmpty
())
{
backgroundType
=
PICTURE
;
// Use a picture for the background.
loadBackground
(
themeFilepaths
.
first
());
...
...
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