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
Plasma
Discover
Commits
c72d68c8
Commit
c72d68c8
authored
May 13, 2021
by
Laurent Montel
😁
Browse files
Use Q_EMIT here too for helping to build against kf5.82
parent
ee151251
Changes
38
Hide whitespace changes
Inline
Side-by-side
discover/DiscoverObject.cpp
View file @
c72d68c8
...
...
@@ -216,7 +216,7 @@ void DiscoverObject::openMode(const QString &_mode)
void
DiscoverObject
::
openMimeType
(
const
QString
&
mime
)
{
emit
listMimeInternal
(
mime
);
Q_EMIT
listMimeInternal
(
mime
);
}
void
DiscoverObject
::
showLoadingPage
()
...
...
@@ -237,7 +237,7 @@ void DiscoverObject::openCategory(const QString &category)
[
this
,
category
]()
{
Category
*
cat
=
CategoryModel
::
global
()
->
findCategoryByName
(
category
);
if
(
cat
)
{
emit
listCategoryInternal
(
cat
);
Q_EMIT
listCategoryInternal
(
cat
);
}
else
{
openMode
(
QStringLiteral
(
"Browsing"
));
showPassiveNotification
(
i18n
(
"Could not find category '%1'"
,
category
));
...
...
@@ -267,7 +267,7 @@ void DiscoverObject::openLocalPackage(const QUrl &localfile)
auto
stream
=
new
StoredResultsStream
({
ResourcesModel
::
global
()
->
search
(
f
)});
connect
(
stream
,
&
StoredResultsStream
::
finishedResources
,
this
,
[
this
,
localfile
](
const
QVector
<
AbstractResource
*>
&
res
)
{
if
(
res
.
count
()
==
1
)
{
emit
openApplicationInternal
(
res
.
first
());
Q_EMIT
openApplicationInternal
(
res
.
first
());
}
else
{
QMimeDatabase
db
;
auto
mime
=
db
.
mimeTypeForUrl
(
localfile
);
...
...
@@ -306,7 +306,7 @@ void DiscoverObject::openApplication(const QUrl &url)
auto
stream
=
new
StoredResultsStream
({
ResourcesModel
::
global
()
->
search
(
f
)});
connect
(
stream
,
&
StoredResultsStream
::
finishedResources
,
this
,
[
this
,
url
](
const
QVector
<
AbstractResource
*>
&
res
)
{
if
(
res
.
count
()
>=
1
)
{
emit
openApplicationInternal
(
res
.
first
());
Q_EMIT
openApplicationInternal
(
res
.
first
());
}
else
if
(
url
.
scheme
()
==
QLatin1String
(
"snap"
))
{
openApplication
(
QUrl
(
QStringLiteral
(
"appstream://org.kde.discover.snap"
)));
showPassiveNotification
(
i18n
(
"Please make sure Snap support is installed"
));
...
...
discover/FeaturedModel.cpp
View file @
c72d68c8
...
...
@@ -142,7 +142,7 @@ void FeaturedModel::acquireFetching(bool f)
m_isFetching
--
;
if
((
!
f
&&
m_isFetching
==
0
)
||
(
f
&&
m_isFetching
==
1
))
{
emit
isFetchingChanged
();
Q_EMIT
isFetchingChanged
();
}
Q_ASSERT
(
m_isFetching
>=
0
);
}
...
...
discover/PaginateModel.cpp
View file @
c72d68c8
...
...
@@ -37,7 +37,7 @@ void PaginateModel::setFirstItem(int row)
beginResetModel
();
d
->
m_firstItem
=
row
;
endResetModel
();
emit
firstItemChanged
();
Q_EMIT
firstItemChanged
();
}
}
...
...
@@ -63,7 +63,7 @@ void PaginateModel::setPageSize(int count)
d
->
m_pageSize
=
count
;
endRemoveRows
();
}
emit
pageSizeChanged
();
Q_EMIT
pageSizeChanged
();
}
}
...
...
@@ -107,7 +107,7 @@ void PaginateModel::setSourceModel(QAbstractItemModel *model)
connect
(
d
->
m_sourceModel
,
&
QAbstractItemModel
::
modelReset
,
this
,
&
PaginateModel
::
pageCountChanged
);
}
endResetModel
();
emit
sourceModelChanged
();
Q_EMIT
sourceModelChanged
();
}
}
...
...
@@ -272,14 +272,14 @@ void PaginateModel::_k_sourceDataChanged(const QModelIndex &topLeft, const QMode
if
(
!
idxBottom
.
isValid
())
idxBottom
=
index
(
rowCount
()
-
1
);
emit
dataChanged
(
idxTop
,
idxBottom
,
roles
);
Q_EMIT
dataChanged
(
idxTop
,
idxBottom
,
roles
);
}
void
PaginateModel
::
_k_sourceHeaderDataChanged
(
Qt
::
Orientation
orientation
,
int
first
,
int
last
)
{
Q_UNUSED
(
last
)
if
(
first
==
0
)
emit
headerDataChanged
(
orientation
,
0
,
0
);
Q_EMIT
headerDataChanged
(
orientation
,
0
,
0
);
}
void
PaginateModel
::
_k_sourceModelAboutToBeReset
()
...
...
exporter/MuonExporter.cpp
View file @
c72d68c8
...
...
@@ -82,5 +82,5 @@ void MuonExporter::exportResources(const QVector<AbstractResource *> &resources)
qWarning
()
<<
"Could not write to "
<<
m_path
;
}
qDebug
()
<<
"exported items: "
<<
data
.
count
()
<<
" to "
<<
m_path
;
emit
exportDone
();
Q_EMIT
exportDone
();
}
libdiscover/ApplicationAddonsModel.cpp
View file @
c72d68c8
...
...
@@ -42,7 +42,7 @@ void ApplicationAddonsModel::setApplication(AbstractResource *app)
setApplication
(
nullptr
);
});
}
emit
applicationChanged
();
Q_EMIT
applicationChanged
();
}
void
ApplicationAddonsModel
::
resetState
()
...
...
@@ -52,7 +52,7 @@ void ApplicationAddonsModel::resetState()
m_initial
=
m_app
?
m_app
->
addonsInformation
()
:
QList
<
PackageState
>
();
endResetModel
();
emit
stateChanged
();
Q_EMIT
stateChanged
();
}
AbstractResource
*
ApplicationAddonsModel
::
application
()
const
...
...
@@ -96,7 +96,7 @@ void ApplicationAddonsModel::discardChanges()
// dataChanged should suffice, but it doesn't
beginResetModel
();
m_state
.
clear
();
emit
stateChanged
();
Q_EMIT
stateChanged
();
endResetModel
();
}
...
...
@@ -121,7 +121,7 @@ void ApplicationAddonsModel::changeState(const QString &packageName, bool instal
else
m_state
.
addAddon
(
packageName
,
installed
);
emit
stateChanged
();
Q_EMIT
stateChanged
();
}
bool
ApplicationAddonsModel
::
hasChanges
()
const
...
...
libdiscover/ReviewsBackend/ReviewsModel.cpp
View file @
c72d68c8
...
...
@@ -104,8 +104,8 @@ void ReviewsModel::setResource(AbstractResource *app)
QMetaObject
::
invokeMethod
(
this
,
"restartFetching"
,
Qt
::
QueuedConnection
);
}
endResetModel
();
emit
rowsChanged
();
emit
resourceChanged
();
Q_EMIT
rowsChanged
();
Q_EMIT
resourceChanged
();
}
}
...
...
@@ -117,7 +117,7 @@ void ReviewsModel::restartFetching()
m_canFetchMore
=
true
;
m_lastPage
=
0
;
fetchMore
();
emit
rowsChanged
();
Q_EMIT
rowsChanged
();
}
void
ReviewsModel
::
fetchMore
(
const
QModelIndex
&
parent
)
...
...
@@ -142,7 +142,7 @@ void ReviewsModel::addReviews(AbstractResource *app, const QVector<ReviewPtr> &r
beginInsertRows
(
QModelIndex
(),
rowCount
(),
rowCount
()
+
reviews
.
size
()
-
1
);
m_reviews
+=
reviews
;
endInsertRows
();
emit
rowsChanged
();
Q_EMIT
rowsChanged
();
}
}
...
...
@@ -158,7 +158,7 @@ void ReviewsModel::markUseful(int row, bool useful)
// qCDebug(LIBDISCOVER_LOG) << "submitting usefulness" << r->applicationName() << r->id() << useful;
m_backend
->
submitUsefulness
(
r
,
useful
);
const
QModelIndex
ind
=
index
(
row
,
0
,
QModelIndex
());
emit
dataChanged
(
ind
,
ind
,
{
UsefulnessTotal
,
UsefulnessFavorable
,
UsefulChoice
});
Q_EMIT
dataChanged
(
ind
,
ind
,
{
UsefulnessTotal
,
UsefulnessFavorable
,
UsefulChoice
});
}
void
ReviewsModel
::
deleteReview
(
int
row
)
...
...
libdiscover/ScreenshotsModel.cpp
View file @
c72d68c8
...
...
@@ -56,7 +56,7 @@ void ScreenshotsModel::screenshotsFetched(const QList<QUrl> &thumbnails, const Q
m_thumbnails
+=
thumbnails
;
m_screenshots
+=
screenshots
;
endInsertRows
();
emit
countChanged
();
Q_EMIT
countChanged
();
}
QVariant
ScreenshotsModel
::
data
(
const
QModelIndex
&
index
,
int
role
)
const
...
...
@@ -97,7 +97,7 @@ void ScreenshotsModel::remove(const QUrl &url)
m_thumbnails
.
removeAt
(
idxRemove
);
m_screenshots
.
removeAt
(
idxRemove
);
endRemoveRows
();
emit
countChanged
();
Q_EMIT
countChanged
();
qDebug
()
<<
"screenshot removed"
<<
url
;
}
...
...
libdiscover/Transaction/Transaction.cpp
View file @
c72d68c8
...
...
@@ -65,7 +65,7 @@ void Transaction::setStatus(Status status)
{
if
(
m_status
!=
status
)
{
m_status
=
status
;
emit
statusChanged
(
m_status
);
Q_EMIT
statusChanged
(
m_status
);
if
(
m_status
==
DoneStatus
||
m_status
==
CancelledStatus
||
m_status
==
DoneWithErrorStatus
)
{
setCancellable
(
false
);
...
...
@@ -79,7 +79,7 @@ void Transaction::setCancellable(bool isCancellable)
{
if
(
m_isCancellable
!=
isCancellable
)
{
m_isCancellable
=
isCancellable
;
emit
cancellableChanged
(
m_isCancellable
);
Q_EMIT
cancellableChanged
(
m_isCancellable
);
}
}
...
...
@@ -88,7 +88,7 @@ void Transaction::setProgress(int progress)
if
(
m_progress
!=
progress
)
{
Q_ASSERT
(
qBound
(
0
,
progress
,
100
)
==
progress
);
m_progress
=
qBound
(
0
,
progress
,
100
);
emit
progressChanged
(
m_progress
);
Q_EMIT
progressChanged
(
m_progress
);
}
}
...
...
libdiscover/Transaction/TransactionListener.cpp
View file @
c72d68c8
...
...
@@ -57,7 +57,7 @@ void TransactionListener::setResourceInternal(AbstractResource *resource)
return
;
m_resource
=
resource
;
emit
resourceChanged
();
Q_EMIT
resourceChanged
();
}
void
TransactionListener
::
transactionAdded
(
Transaction
*
trans
)
...
...
@@ -128,7 +128,7 @@ void TransactionListener::transactionStatusChanged(Transaction::Status status)
switch
(
status
)
{
case
Transaction
::
CancelledStatus
:
setTransaction
(
nullptr
);
emit
cancelled
();
Q_EMIT
cancelled
();
break
;
case
Transaction
::
DoneWithErrorStatus
:
case
Transaction
::
DoneStatus
:
...
...
@@ -138,7 +138,7 @@ void TransactionListener::transactionStatusChanged(Transaction::Status status)
break
;
}
emit
statusTextChanged
();
Q_EMIT
statusTextChanged
();
}
int
TransactionListener
::
progress
()
const
...
...
libdiscover/Transaction/TransactionModel.cpp
View file @
c72d68c8
...
...
@@ -141,7 +141,7 @@ void TransactionModel::addTransaction(Transaction *trans)
return
;
if
(
m_transactions
.
isEmpty
())
emit
startingFirstTransaction
();
Q_EMIT
startingFirstTransaction
();
int
before
=
m_transactions
.
size
();
beginInsertRows
(
QModelIndex
(),
before
,
before
+
1
);
...
...
@@ -159,7 +159,7 @@ void TransactionModel::addTransaction(Transaction *trans)
Q_EMIT
progressChanged
();
});
emit
transactionAdded
(
trans
);
Q_EMIT
transactionAdded
(
trans
);
}
void
TransactionModel
::
removeTransaction
(
Transaction
*
trans
)
...
...
@@ -178,16 +178,16 @@ void TransactionModel::removeTransaction(Transaction *trans)
m_transactions
.
removeAt
(
r
);
endRemoveRows
();
emit
transactionRemoved
(
trans
);
Q_EMIT
transactionRemoved
(
trans
);
if
(
m_transactions
.
isEmpty
())
emit
lastTransactionFinished
();
Q_EMIT
lastTransactionFinished
();
}
void
TransactionModel
::
transactionChanged
(
int
role
)
{
Transaction
*
trans
=
qobject_cast
<
Transaction
*>
(
sender
());
QModelIndex
transIdx
=
indexOf
(
trans
);
emit
dataChanged
(
transIdx
,
transIdx
,
{
role
});
Q_EMIT
dataChanged
(
transIdx
,
transIdx
,
{
role
});
}
int
TransactionModel
::
progress
()
const
...
...
libdiscover/UpdateModel/UpdateModel.cpp
View file @
c72d68c8
...
...
@@ -209,7 +209,7 @@ void UpdateModel::integrateChangelog(const QString &changelog)
const
QModelIndex
idx
=
indexFromItem
(
item
);
Q_ASSERT
(
idx
.
isValid
());
emit
dataChanged
(
idx
,
idx
,
{
ChangelogRole
});
Q_EMIT
dataChanged
(
idx
,
idx
,
{
ChangelogRole
});
}
void
UpdateModel
::
setResources
(
const
QList
<
AbstractResource
*>
&
resources
)
...
...
libdiscover/backends/DummyBackend/DummyBackend.cpp
View file @
c72d68c8
...
...
@@ -77,7 +77,7 @@ void DummyBackend::toggleFetching()
{
m_fetching
=
!
m_fetching
;
// qDebug() << "fetching..." << m_fetching;
emit
fetchingChanged
();
Q_EMIT
fetchingChanged
();
if
(
!
m_fetching
)
m_reviews
->
initialize
();
}
...
...
libdiscover/backends/DummyBackend/DummyNotifier.cpp
View file @
c72d68c8
...
...
@@ -18,5 +18,5 @@ DummyNotifier::~DummyNotifier()
void
DummyNotifier
::
recheckSystemUpdateNeeded
()
{
emit
foundUpdates
();
Q_EMIT
foundUpdates
();
}
libdiscover/backends/DummyBackend/DummyResource.cpp
View file @
c72d68c8
...
...
@@ -169,7 +169,7 @@ void DummyResource::fetchChangelog()
QString
log
=
longDescription
();
log
.
replace
(
QLatin1Char
(
'\n'
),
QLatin1String
(
"<br />"
));
emit
changelogFetched
(
log
);
Q_EMIT
changelogFetched
(
log
);
}
void
DummyResource
::
fetchScreenshots
()
...
...
@@ -180,7 +180,7 @@ void DummyResource::fetchScreenshots()
void
DummyResource
::
setState
(
AbstractResource
::
State
state
)
{
m_state
=
state
;
emit
stateChanged
();
Q_EMIT
stateChanged
();
}
void
DummyResource
::
setAddons
(
const
AddonList
&
addons
)
...
...
libdiscover/backends/DummyBackend/DummyReviewsBackend.cpp
View file @
c72d68c8
...
...
@@ -44,7 +44,7 @@ void DummyReviewsBackend::fetchReviews(AbstractResource *app, int page)
1
,
app
->
packageName
()));
}
emit
reviewsReady
(
app
,
review
,
false
);
Q_EMIT
reviewsReady
(
app
,
review
,
false
);
}
Rating
*
DummyReviewsBackend
::
ratingForApplication
(
AbstractResource
*
app
)
const
...
...
@@ -66,7 +66,7 @@ void DummyReviewsBackend::initialize()
m_ratings
.
insert
(
app
,
rating
);
Q_EMIT
app
->
ratingFetched
();
}
emit
ratingsReady
();
Q_EMIT
ratingsReady
();
}
void
DummyReviewsBackend
::
submitUsefulness
(
Review
*
r
,
bool
useful
)
...
...
libdiscover/backends/FlatpakBackend/FlatpakBackend.cpp
View file @
c72d68c8
...
...
@@ -1178,7 +1178,7 @@ void FlatpakBackend::acquireFetching(bool f)
m_isFetching
--
;
if
((
!
f
&&
m_isFetching
==
0
)
||
(
f
&&
m_isFetching
==
1
))
{
emit
fetchingChanged
();
Q_EMIT
fetchingChanged
();
}
if
(
m_isFetching
==
0
)
...
...
libdiscover/backends/FlatpakBackend/FlatpakResource.cpp
View file @
c72d68c8
...
...
@@ -420,7 +420,7 @@ void FlatpakResource::invokeApplication() const
void
FlatpakResource
::
fetchChangelog
()
{
emit
changelogFetched
(
AppStreamUtils
::
changelogToHtml
(
m_appdata
));
Q_EMIT
changelogFetched
(
AppStreamUtils
::
changelogToHtml
(
m_appdata
));
}
void
FlatpakResource
::
fetchScreenshots
()
...
...
libdiscover/backends/FwupdBackend/FwupdBackend.cpp
View file @
c72d68c8
...
...
@@ -276,8 +276,8 @@ void FwupdBackend::setDevices(GPtrArray *devices)
addUpdates
();
m_fetching
=
false
;
emit
fetchingChanged
();
emit
initialized
();
Q_EMIT
fetchingChanged
();
Q_EMIT
initialized
();
}
static
void
fwupd_client_get_remotes_cb
(
GObject
*
/*source*/
,
GAsyncResult
*
res
,
gpointer
user_data
)
...
...
@@ -327,7 +327,7 @@ void FwupdBackend::checkForUpdates()
}
m_fetching
=
true
;
emit
fetchingChanged
();
Q_EMIT
fetchingChanged
();
fwupd_client_get_devices_async
(
client
,
m_cancellable
,
fwupd_client_get_devices_cb
,
this
);
fwupd_client_get_remotes_async
(
client
,
m_cancellable
,
fwupd_client_get_remotes_cb
,
this
);
...
...
libdiscover/backends/FwupdBackend/FwupdResource.cpp
View file @
c72d68c8
...
...
@@ -125,14 +125,14 @@ void FwupdResource::fetchChangelog()
QString
log
=
longDescription
();
log
.
replace
(
QLatin1Char
(
'\n'
),
QLatin1String
(
"<br />"
));
emit
changelogFetched
(
log
);
Q_EMIT
changelogFetched
(
log
);
}
void
FwupdResource
::
setState
(
AbstractResource
::
State
state
)
{
if
(
m_state
!=
state
)
{
m_state
=
state
;
emit
stateChanged
();
Q_EMIT
stateChanged
();
}
}
...
...
libdiscover/backends/KNSBackend/KNSBackend.cpp
View file @
c72d68c8
...
...
@@ -300,7 +300,7 @@ void KNSBackend::setFetching(bool f)
{
if
(
m_fetching
!=
f
)
{
m_fetching
=
f
;
emit
fetchingChanged
();
Q_EMIT
fetchingChanged
();
if
(
!
m_fetching
)
{
Q_EMIT
initialized
();
...
...
Prev
1
2
Next
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