Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions dconfig-center/common/helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ static ResourceList resourcesForAllApp(const QString &localPrefix = QString())
return result.values();
}

// Return every resource that can be opened with appid. Generic resources are
// valid for every application and are the only resources available when the
// appid is empty.
static ResourceList availableResourcesForApp(const QString &appid, const QString &localPrefix = QString())
{
QSet<ResourceId> result;
if (!appid.isEmpty()) {
const auto resources = resourcesForApp(appid, localPrefix);
for (const auto &resource : resources)
result.insert(resource);
}

const auto genericResources = resourcesForAllApp(localPrefix);
for (const auto &resource : genericResources)
result.insert(resource);
return result.values();
}

static SubpathList subpathsForResource(const AppId &appid, const ResourceId &resourceId, const QString &localPrefix = QString())
{
SubpathList result;
Expand Down
Loading
Loading