| 1870 | } |
| 1871 | |
| 1872 | void CaptureContext::LoadRenames(const QString &data) |
| 1873 | { |
| 1874 | QVariantMap root = JSONToVariant(data); |
| 1875 | |
| 1876 | if(root.contains(lit("CustomResourceNames"))) |
| 1877 | { |
| 1878 | QVariantMap resources = root[lit("CustomResourceNames")].toMap(); |
| 1879 | |
| 1880 | for(const QString &str : resources.keys()) |
| 1881 | { |
| 1882 | ResourceId id; |
| 1883 | |
| 1884 | if(str.startsWith(lit("ResourceId::"))) |
| 1885 | { |
| 1886 | qulonglong num = str.mid(sizeof("ResourceId::") - 1).toULongLong(); |
| 1887 | memcpy(&id, &num, sizeof(num)); |
| 1888 | } |
| 1889 | else |
| 1890 | { |
| 1891 | qCritical() << "Unrecognised resourceid encoding" << str; |
| 1892 | } |
| 1893 | |
| 1894 | if(id != ResourceId()) |
| 1895 | m_CustomNames[id] = resources[str].toString(); |
| 1896 | } |
| 1897 | } |
| 1898 | } |
| 1899 | |
| 1900 | bool CaptureContext::SaveBookmarks() |
| 1901 | { |
nothing calls this directly
no test coverage detected