Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Discover
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Discover
Commits
ecffc981
Commit
ecffc981
authored
Jan 16, 2018
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the new Snap tuple when refreshing after installing
BUG: 389024
parent
6330ac30
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
1 deletion
+16
-1
libdiscover/backends/SnapBackend/SnapBackend.cpp
libdiscover/backends/SnapBackend/SnapBackend.cpp
+2
-0
libdiscover/backends/SnapBackend/SnapResource.cpp
libdiscover/backends/SnapBackend/SnapResource.cpp
+12
-0
libdiscover/backends/SnapBackend/SnapResource.h
libdiscover/backends/SnapBackend/SnapResource.h
+1
-0
libdiscover/backends/SnapBackend/SnapTransaction.cpp
libdiscover/backends/SnapBackend/SnapTransaction.cpp
+1
-1
No files found.
libdiscover/backends/SnapBackend/SnapBackend.cpp
View file @
ecffc981
...
...
@@ -112,6 +112,7 @@ ResultsStream * SnapBackend::populate(QSnapdListOneRequest* job, AbstractResourc
resources
+=
res
;
}
else
if
(
res
->
state
()
<
state
)
{
res
->
setState
(
state
);
res
->
setSnap
(
snap
);
}
m_resources
[
res
->
packageName
()]
=
res
;
...
...
@@ -147,6 +148,7 @@ ResultsStream* SnapBackend::populate(T* job, AbstractResource::State state)
resources
+=
res
;
}
else
if
(
res
->
state
()
<
state
)
{
res
->
setState
(
state
);
res
->
setSnap
(
snap
);
}
ret
+=
res
;
}
...
...
libdiscover/backends/SnapBackend/SnapResource.cpp
View file @
ecffc981
...
...
@@ -163,3 +163,15 @@ QUrl SnapResource::url() const
//FIXME interim, until it has an appstreamId
return
QUrl
(
QStringLiteral
(
"snap://"
)
+
packageName
());
}
void
SnapResource
::
setSnap
(
const
QSharedPointer
<
QSnapdSnap
>&
snap
)
{
Q_ASSERT
(
snap
->
name
()
==
m_snap
->
name
());
if
(
m_snap
==
snap
)
return
;
const
bool
newSize
=
m_snap
->
installedSize
()
!=
snap
->
installedSize
()
||
m_snap
->
downloadSize
()
!=
snap
->
downloadSize
();
m_snap
=
snap
;
if
(
newSize
)
Q_EMIT
sizeChanged
();
}
libdiscover/backends/SnapBackend/SnapResource.h
View file @
ecffc981
...
...
@@ -56,6 +56,7 @@ public:
void
fetchScreenshots
()
override
;
QList
<
PackageState
>
addonsInformation
()
override
{
return
{};
}
QUrl
url
()
const
override
;
void
setSnap
(
const
QSharedPointer
<
QSnapdSnap
>
&
snap
);
void
setState
(
AbstractResource
::
State
state
);
...
...
libdiscover/backends/SnapBackend/SnapTransaction.cpp
View file @
ecffc981
...
...
@@ -51,9 +51,9 @@ void SnapTransaction::cancel()
void
SnapTransaction
::
finishTransaction
()
{
qDebug
()
<<
"done!"
;
switch
(
m_request
->
error
())
{
case
QSnapdRequest
::
NoError
:
static_cast
<
SnapBackend
*>
(
m_app
->
backend
())
->
refreshStates
();
m_app
->
setState
(
m_newState
);
break
;
case
QSnapdRequest
::
AuthDataRequired
:
{
...
...
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