Changeset View
Changeset View
Standalone View
Standalone View
runners/bookmarks/browsers/chromefindprofile.cpp
Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Line(s) | 38 | { | |||
---|---|---|---|---|---|
53 | if(jdoc.isNull()) { | 53 | if(jdoc.isNull()) { | ||
54 | qDebug() << "error opening " << QFileInfo(localStateFile).absoluteFilePath(); | 54 | qDebug() << "error opening " << QFileInfo(localStateFile).absoluteFilePath(); | ||
55 | return profiles; | 55 | return profiles; | ||
56 | } | 56 | } | ||
57 | 57 | | |||
58 | QVariantMap localState = jdoc.object().toVariantMap(); | 58 | QVariantMap localState = jdoc.object().toVariantMap(); | ||
59 | QVariantMap profilesConfig = localState.value(QStringLiteral("profile")).toMap().value(QStringLiteral("info_cache")).toMap(); | 59 | QVariantMap profilesConfig = localState.value(QStringLiteral("profile")).toMap().value(QStringLiteral("info_cache")).toMap(); | ||
60 | 60 | | |||
61 | foreach(const QString &profile, profilesConfig.keys()) { | 61 | const auto keys = profilesConfig.keys(); | ||
62 | for (const QString &profile : keys) { | ||||
62 | const QString profilePath = QStringLiteral("%1/%2").arg(configDirectory, profile); | 63 | const QString profilePath = QStringLiteral("%1/%2").arg(configDirectory, profile); | ||
63 | const QString profileBookmarksPath = QStringLiteral("%1/%2").arg(profilePath, QStringLiteral("Bookmarks")); | 64 | const QString profileBookmarksPath = QStringLiteral("%1/%2").arg(profilePath, QStringLiteral("Bookmarks")); | ||
64 | profiles << Profile(profileBookmarksPath, FaviconFromBlob::chrome(profilePath, this)); | 65 | profiles << Profile(profileBookmarksPath, FaviconFromBlob::chrome(profilePath, this)); | ||
65 | } | 66 | } | ||
66 | 67 | | |||
67 | return profiles; | 68 | return profiles; | ||
68 | } | 69 | } |