Heya,

Edward Hades wrote:
Git commit 84c05d37ac5be1c836948ca5e41a0f824969544e by Edward Hades.
Committed on 14/08/2012 at 21:49.
Pushed by hades into branch 'master'.

Detect Amazon country automatically.

This uses KDE locale settings and avoids "choose your country" popup at
first startup.

BUG: 299628
BUG: 301242
CCBUG: 303272

M  +19   -10   src/services/amazon/AmazonStore.cpp
M  +8    -0    src/services/amazon/AmazonStore.h

http://commits.kde.org/amarok/84c05d37ac5be1c836948ca5e41a0f824969544e

diff --git a/src/services/amazon/AmazonStore.cpp 
b/src/services/amazon/AmazonStore.cpp
index a3d255e..76d7776 100644
--- a/src/services/amazon/AmazonStore.cpp
+++ b/src/services/amazon/AmazonStore.cpp
@@ -288,16 +288,8 @@ AmazonStore::newSearchRequest( const QString request )
      // make sure we know where to search
      if( AmazonConfig::instance()->country().isEmpty() )
      {
-        KCMultiDialog KCM;
-
-        KCM.setWindowTitle( i18n( "Select your Amazon locale - Amarok" ) );
-        KCM.addModule( KCModuleInfo( QString( 
"amarok_service_amazonstore_config.desktop" ) ) );
-        KCM.setButtons( KCMultiDialog::Ok | KCMultiDialog::Cancel | 
KCMultiDialog::Default );
-        KCM.adjustSize();
-
-        // if the user selects an option we continue our quest for search 
results
-        if( !(KCM.exec() == QDialog::Accepted) )
-            return;
+        QString country(KGlobal::locale()->country());
+        AmazonConfig::instance()->setCountry(iso3166toAmazon(country));
      }

I'm very opposed to that solution, as now the plugin sends queries
to the service even without having an explicit users consent. Sending
data to a web service without the user knowing about it is a bad thing.

The KCModule should be shown embedded in the service browser, if no
valid country has been set.
_______________________________________________
Amarok-devel mailing list
Amarok-devel@kde.org
https://mail.kde.org/mailman/listinfo/amarok-devel

Reply via email to