forked from openkylin/ukui-menu
修复卸载应用组中应用出错的问题
This commit is contained in:
parent
b2fc1ad387
commit
aabf9bd747
|
@ -151,6 +151,22 @@ void AllAppDataProvider::updateData(const QList<DataEntity> &apps)
|
||||||
std::sort(m_appData.begin(), m_appData.end(), appDataSort);
|
std::sort(m_appData.begin(), m_appData.end(), appDataSort);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AllAppDataProvider::updateFolderData(QStringList &idList)
|
||||||
|
{
|
||||||
|
QList<Folder> folders = AppFolderHelper::instance()->folderData();
|
||||||
|
if (folders.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (const auto &folder : folders) {
|
||||||
|
for (const auto &app : folder.getApps()) {
|
||||||
|
if (idList.contains(app)) {
|
||||||
|
AppFolderHelper::instance()->removeAppFromFolder(app, folder.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AppFolderHelper::instance()->forceSync();
|
||||||
|
}
|
||||||
|
|
||||||
bool AllAppDataProvider::appDataSort(const DataEntity &a, const DataEntity &b)
|
bool AllAppDataProvider::appDataSort(const DataEntity &a, const DataEntity &b)
|
||||||
{
|
{
|
||||||
if ((a.top() != 0) && (b.top() != 0)) {
|
if ((a.top() != 0) && (b.top() != 0)) {
|
||||||
|
@ -236,6 +252,7 @@ void AllAppDataProvider::onAppDeleted(QStringList idList)
|
||||||
{
|
{
|
||||||
removeApps(idList);
|
removeApps(idList);
|
||||||
reloadFolderData();
|
reloadFolderData();
|
||||||
|
updateFolderData(idList);
|
||||||
sendData();
|
sendData();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@ private:
|
||||||
void reloadFolderData();
|
void reloadFolderData();
|
||||||
void mergeData(QVector<DataEntity> &data);
|
void mergeData(QVector<DataEntity> &data);
|
||||||
void updateData(const QList<DataEntity>& apps);
|
void updateData(const QList<DataEntity>& apps);
|
||||||
|
void updateFolderData(QStringList& idList);
|
||||||
static bool appDataSort(const DataEntity &a, const DataEntity &b);
|
static bool appDataSort(const DataEntity &a, const DataEntity &b);
|
||||||
static void setRecentState(DataEntity &app);
|
static void setRecentState(DataEntity &app);
|
||||||
static bool letterSort(const QString &a, const QString &b);
|
static bool letterSort(const QString &a, const QString &b);
|
||||||
|
|
Loading…
Reference in New Issue