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
Games
Palapeli
Commits
e794a848
Commit
e794a848
authored
Aug 08, 2022
by
Nicolas Fella
Browse files
Delay quitting import until notification was shown
If we quit immediately then the notification is never shown
parent
286a0d55
Pipeline
#217314
passed with stage
in 1 minute and 16 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/importhelper.cpp
View file @
e794a848
...
...
@@ -33,13 +33,20 @@ void Palapeli::ImportHelper::doWork()
//show notification
puzzle
->
get
(
Palapeli
::
PuzzleComponent
::
Metadata
);
const
Palapeli
::
MetadataComponent
*
cmp
=
puzzle
->
component
<
Palapeli
::
MetadataComponent
>
();
puzzle
->
get
(
Palapeli
::
PuzzleComponent
::
ArchiveStorage
);
if
(
cmp
)
{
KNotification
::
event
(
QStringLiteral
(
"importingPuzzle"
),
auto
*
noti
=
KNotification
::
event
(
QStringLiteral
(
"importingPuzzle"
),
i18n
(
"Importing puzzle
\"
%1
\"
into your collection"
,
cmp
->
metadata
.
name
),
QPixmap
::
fromImage
(
cmp
->
metadata
.
thumbnail
)
);
// Delay quitting until the notification expires
// Otherwise the notification is never shown
connect
(
noti
,
&
KNotification
::
closed
,
this
,
[]{
qApp
->
quit
();
});
}
else
{
qApp
->
quit
();
}
puzzle
->
get
(
Palapeli
::
PuzzleComponent
::
ArchiveStorage
);
qApp
->
quit
();
}
Nicolas Fella
@nicolasfella
mentioned in commit
22bb5fdb
·
Aug 12, 2022
mentioned in commit
22bb5fdb
mentioned in commit 22bb5fdb78f259c04cf9e19f0ce0fb683584f656
Toggle commit list
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