utilities/mpsettingsmanager/src/mpsettingsmanager.cpp
changeset 41 ea59c434026a
parent 29 8192e5b5c935
--- a/utilities/mpsettingsmanager/src/mpsettingsmanager.cpp	Fri Jun 11 13:36:36 2010 +0300
+++ b/utilities/mpsettingsmanager/src/mpsettingsmanager.cpp	Wed Jun 23 18:10:13 2010 +0300
@@ -93,6 +93,17 @@
              KMPCenRepSettingSongDetailsGBKey);
     mSongDetailsGb = mSettingsManager->readItemValue(SongDetailsGbKey).toInt();
     mSettingsManager->startMonitoring(SongDetailsGbKey);
+
+    XQSettingsKey showMtpInfo(XQSettingsKey::TargetCentralRepository,
+            KMPCenRepSettingsFeature,
+            KMusicPlayerShowMtpInfoKey);
+    mShowMtpInfo = mSettingsManager->readItemValue(showMtpInfo).toInt();
+    mSettingsManager->startMonitoring(showMtpInfo);
+
+    XQSettingsKey mtpInfoUrl(XQSettingsKey::TargetCentralRepository,
+            KMPCenRepSettingsFeature,
+            KMusicPlayerMtpInfoUrlKey);
+    mMtpInfoUrl = mSettingsManager->readItemValue(mtpInfoUrl, XQSettingsManager::TypeString).toString();
     TX_EXIT
 }
 
@@ -161,6 +172,22 @@
     return instance()->mSongDetailsGb;
 }
 
+/*!
+ Returns wheter mtp info should be showed.
+ */
+bool MpSettingsManager::showMtpInfo()
+{
+    return instance()->mShowMtpInfo;
+}
+
+/*!
+ Returns mtp info url.
+ */
+QString MpSettingsManager::mtpInfoUrl()
+{
+    return instance()->mMtpInfoUrl;
+}
+
 
 /*!
  Slot to be called when a setting is changed.
@@ -195,6 +222,10 @@
             TX_LOG_ARGS("SongDetailsGB changed to "<< mSongDetailsGb);
             emit SongDetailsGbChanged( mSongDetailsGb );
             break;
+        case KMusicPlayerShowMtpInfoKey:
+            mShowMtpInfo = value.toInt();
+            TX_LOG_ARGS("Show MTP info changed to "<< mShowMtpInfo);
+            break;
         default :
             TX_LOG_ARGS(" unhandled cenrep key: " << key.key() << 
                     "; should never get here.");
@@ -277,3 +308,16 @@
     TX_EXIT
 }
 
+/*!
+ Slot to be called to stop showing mtp info.
+ */
+void MpSettingsManager::stopShowingMtpInfo()
+{
+    TX_STATIC_ENTRY_ARGS("preset=" << preset);
+    XQSettingsKey showMtpInfo(XQSettingsKey::TargetCentralRepository,
+            KMPCenRepSettingsFeature,
+            KMusicPlayerShowMtpInfoKey);
+    instance()->mSettingsManager->writeItemValue(showMtpInfo, 0);
+    TX_EXIT
+}
+