diff --git a/data/js/tomahawk.js b/data/js/tomahawk.js index 6937729f7..62e105c77 100644 --- a/data/js/tomahawk.js +++ b/data/js/tomahawk.js @@ -814,6 +814,255 @@ Tomahawk.ConfigTestResultType = { AccountExpired: 7 }; +Tomahawk.Country = { + AnyCountry: 0, + Afghanistan: 1, + Albania: 2, + Algeria: 3, + AmericanSamoa: 4, + Andorra: 5, + Angola: 6, + Anguilla: 7, + Antarctica: 8, + AntiguaAndBarbuda: 9, + Argentina: 10, + Armenia: 11, + Aruba: 12, + Australia: 13, + Austria: 14, + Azerbaijan: 15, + Bahamas: 16, + Bahrain: 17, + Bangladesh: 18, + Barbados: 19, + Belarus: 20, + Belgium: 21, + Belize: 22, + Benin: 23, + Bermuda: 24, + Bhutan: 25, + Bolivia: 26, + BosniaAndHerzegowina: 27, + Botswana: 28, + BouvetIsland: 29, + Brazil: 30, + BritishIndianOceanTerritory: 31, + BruneiDarussalam: 32, + Bulgaria: 33, + BurkinaFaso: 34, + Burundi: 35, + Cambodia: 36, + Cameroon: 37, + Canada: 38, + CapeVerde: 39, + CaymanIslands: 40, + CentralAfricanRepublic: 41, + Chad: 42, + Chile: 43, + China: 44, + ChristmasIsland: 45, + CocosIslands: 46, + Colombia: 47, + Comoros: 48, + DemocraticRepublicOfCongo: 49, + PeoplesRepublicOfCongo: 50, + CookIslands: 51, + CostaRica: 52, + IvoryCoast: 53, + Croatia: 54, + Cuba: 55, + Cyprus: 56, + CzechRepublic: 57, + Denmark: 58, + Djibouti: 59, + Dominica: 60, + DominicanRepublic: 61, + EastTimor: 62, + Ecuador: 63, + Egypt: 64, + ElSalvador: 65, + EquatorialGuinea: 66, + Eritrea: 67, + Estonia: 68, + Ethiopia: 69, + FalklandIslands: 70, + FaroeIslands: 71, + FijiCountry: 72, + Finland: 73, + France: 74, + MetropolitanFrance: 75, + FrenchGuiana: 76, + FrenchPolynesia: 77, + FrenchSouthernTerritories: 78, + Gabon: 79, + Gambia: 80, + Georgia: 81, + Germany: 82, + Ghana: 83, + Gibraltar: 84, + Greece: 85, + Greenland: 86, + Grenada: 87, + Guadeloupe: 88, + Guam: 89, + Guatemala: 90, + Guinea: 91, + GuineaBissau: 92, + Guyana: 93, + Haiti: 94, + HeardAndMcDonaldIslands: 95, + Honduras: 96, + HongKong: 97, + Hungary: 98, + Iceland: 99, + India: 100, + Indonesia: 101, + Iran: 102, + Iraq: 103, + Ireland: 104, + Israel: 105, + Italy: 106, + Jamaica: 107, + Japan: 108, + Jordan: 109, + Kazakhstan: 110, + Kenya: 111, + Kiribati: 112, + DemocraticRepublicOfKorea: 113, + RepublicOfKorea: 114, + Kuwait: 115, + Kyrgyzstan: 116, + Lao: 117, + Latvia: 118, + Lebanon: 119, + Lesotho: 120, + Liberia: 121, + LibyanArabJamahiriya: 122, + Liechtenstein: 123, + Lithuania: 124, + Luxembourg: 125, + Macau: 126, + Macedonia: 127, + Madagascar: 128, + Malawi: 129, + Malaysia: 130, + Maldives: 131, + Mali: 132, + Malta: 133, + MarshallIslands: 134, + Martinique: 135, + Mauritania: 136, + Mauritius: 137, + Mayotte: 138, + Mexico: 139, + Micronesia: 140, + Moldova: 141, + Monaco: 142, + Mongolia: 143, + Montserrat: 144, + Morocco: 145, + Mozambique: 146, + Myanmar: 147, + Namibia: 148, + NauruCountry: 149, + Nepal: 150, + Netherlands: 151, + NetherlandsAntilles: 152, + NewCaledonia: 153, + NewZealand: 154, + Nicaragua: 155, + Niger: 156, + Nigeria: 157, + Niue: 158, + NorfolkIsland: 159, + NorthernMarianaIslands: 160, + Norway: 161, + Oman: 162, + Pakistan: 163, + Palau: 164, + PalestinianTerritory: 165, + Panama: 166, + PapuaNewGuinea: 167, + Paraguay: 168, + Peru: 169, + Philippines: 170, + Pitcairn: 171, + Poland: 172, + Portugal: 173, + PuertoRico: 174, + Qatar: 175, + Reunion: 176, + Romania: 177, + RussianFederation: 178, + Rwanda: 179, + SaintKittsAndNevis: 180, + StLucia: 181, + StVincentAndTheGrenadines: 182, + Samoa: 183, + SanMarino: 184, + SaoTomeAndPrincipe: 185, + SaudiArabia: 186, + Senegal: 187, + SerbiaAndMontenegro: 241, + Seychelles: 188, + SierraLeone: 189, + Singapore: 190, + Slovakia: 191, + Slovenia: 192, + SolomonIslands: 193, + Somalia: 194, + SouthAfrica: 195, + SouthGeorgiaAndTheSouthSandwichIslands: 196, + Spain: 197, + SriLanka: 198, + StHelena: 199, + StPierreAndMiquelon: 200, + Sudan: 201, + Suriname: 202, + SvalbardAndJanMayenIslands: 203, + Swaziland: 204, + Sweden: 205, + Switzerland: 206, + SyrianArabRepublic: 207, + Taiwan: 208, + Tajikistan: 209, + Tanzania: 210, + Thailand: 211, + Togo: 212, + Tokelau: 213, + TongaCountry: 214, + TrinidadAndTobago: 215, + Tunisia: 216, + Turkey: 217, + Turkmenistan: 218, + TurksAndCaicosIslands: 219, + Tuvalu: 220, + Uganda: 221, + Ukraine: 222, + UnitedArabEmirates: 223, + UnitedKingdom: 224, + UnitedStates: 225, + UnitedStatesMinorOutlyingIslands: 226, + Uruguay: 227, + Uzbekistan: 228, + Vanuatu: 229, + VaticanCityState: 230, + Venezuela: 231, + VietNam: 232, + BritishVirginIslands: 233, + USVirginIslands: 234, + WallisAndFutunaIslands: 235, + WesternSahara: 236, + Yemen: 237, + Yugoslavia: 238, + Zambia: 239, + Zimbabwe: 240, + Montenegro: 242, + Serbia: 243, + SaintBarthelemy: 244, + SaintMartin: 245, + LatinAmericaAndTheCaribbean: 246 +}; Tomahawk.Collection = { BrowseCapability: { diff --git a/src/libtomahawk/resolvers/JSResolverHelper.cpp b/src/libtomahawk/resolvers/JSResolverHelper.cpp index 3e49d35ab..c4e921110 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.cpp +++ b/src/libtomahawk/resolvers/JSResolverHelper.cpp @@ -190,6 +190,13 @@ JSResolverHelper::uuid() const } +int +JSResolverHelper::currentCountry() const +{ + return static_cast<int>(QLocale::system().country()); +} + + void JSResolverHelper::addUrlResult( const QString& url, const QVariantMap& result ) { diff --git a/src/libtomahawk/resolvers/JSResolverHelper.h b/src/libtomahawk/resolvers/JSResolverHelper.h index 0f774585f..ddb52938a 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.h +++ b/src/libtomahawk/resolvers/JSResolverHelper.h @@ -135,6 +135,7 @@ public slots: QString readCompressed( const QString& fileName ); QString instanceUUID(); QString uuid() const; + int currentCountry() const; QString compress( const QString& data ); QVariantMap resolverData();