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
Multimedia
Kdenlive
Commits
9a5315d3
Commit
9a5315d3
authored
Jun 04, 2022
by
Jean-Baptiste Mardelle
Browse files
Fix AppImage icons.
Related to
#1447
CCBUG: 451406
parent
9c05c284
Pipeline
#185424
passed with stage
in 6 minutes and 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main.cpp
View file @
9a5315d3
...
...
@@ -102,6 +102,22 @@ int main(int argc, char *argv[])
splash
.
show
();
qApp
->
processEvents
(
QEventLoop
::
AllEvents
);
QString
packageType
;
if
(
qEnvironmentVariableIsSet
(
"PACKAGE_TYPE"
))
{
packageType
=
qgetenv
(
"PACKAGE_TYPE"
).
toLower
();
}
else
{
// no package type defined, try to detected it
QString
appPath
=
qApp
->
applicationDirPath
();
if
(
appPath
.
contains
(
QStringLiteral
(
"/tmp/.mount_"
)))
{
packageType
=
QStringLiteral
(
"appimage"
);
}
if
(
appPath
.
contains
(
QStringLiteral
(
"/snap"
)))
{
packageType
=
QStringLiteral
(
"snap"
);
}
else
{
qDebug
()
<<
"Could not detect package type, probably default? App dir is"
<<
qApp
->
applicationDirPath
();
}
}
#ifdef Q_OS_WIN
qputenv
(
"KDE_FORK_SLAVES"
,
"1"
);
QString
path
=
qApp
->
applicationDirPath
()
+
QLatin1Char
(
';'
)
+
qgetenv
(
"PATH"
);
...
...
@@ -125,21 +141,33 @@ int main(int argc, char *argv[])
}
}
}
#endif
QString
packageType
;
if
(
qEnvironmentVariableIsSet
(
"PACKAGE_TYPE"
))
{
packageType
=
qgetenv
(
"PACKAGE_TYPE"
).
toLower
();
}
else
{
// no package type defined, try to detected it
QString
appPath
=
qApp
->
applicationDirPath
();
if
(
appPath
.
contains
(
QStringLiteral
(
"/tmp/.mount_"
)))
{
packageType
=
QStringLiteral
(
"appimage"
);
}
if
(
appPath
.
contains
(
QStringLiteral
(
"/snap"
)))
{
packageType
=
QStringLiteral
(
"snap"
);
}
else
{
qDebug
()
<<
"Could not detect package type, probably default? App dir is"
<<
qApp
->
applicationDirPath
();
#else
// AppImage
if
(
packageType
==
QStringLiteral
(
"appimage"
))
{
QMap
<
QString
,
QString
>
themeMap
;
themeMap
.
insert
(
"breeze"
,
"/../icons/breeze/breeze-icons.rcc"
);
themeMap
.
insert
(
"breeze-dark"
,
"/../icons/breeze-dark/breeze-icons-dark.rcc"
);
QMapIterator
<
QString
,
QString
>
i
(
themeMap
);
while
(
i
.
hasNext
())
{
i
.
next
();
QString
themePath
=
QStandardPaths
::
locate
(
QStandardPaths
::
AppDataLocation
,
i
.
value
());
if
(
!
themePath
.
isEmpty
())
{
const
QString
iconSubdir
=
"/icons/"
+
i
.
key
();
if
(
QResource
::
registerResource
(
themePath
,
iconSubdir
))
{
if
(
QFileInfo
::
exists
(
QLatin1Char
(
':'
)
+
iconSubdir
+
QStringLiteral
(
"/index.theme"
)))
{
qDebug
()
<<
"Loaded icon theme:"
<<
i
.
key
();
}
else
{
qWarning
()
<<
"No index.theme found for"
<<
i
.
key
();
QResource
::
unregisterResource
(
themePath
,
iconSubdir
);
}
}
else
{
qWarning
()
<<
"Invalid rcc file"
<<
i
.
key
();
}
}
}
}
#endif
bool
inSandbox
=
false
;
if
(
packageType
==
QStringLiteral
(
"appimage"
)
||
packageType
==
QStringLiteral
(
"flatpak"
)
||
packageType
==
QStringLiteral
(
"snap"
))
{
...
...
Julius Künzel
⚠
@jlskuz
mentioned in merge request
frameworks/kiconthemes!65
·
Jun 08, 2022
mentioned in merge request
frameworks/kiconthemes!65
mentioned in merge request frameworks/kiconthemes!65
Toggle commit list
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