~ubuntu-branches/ubuntu/oneiric/kdeplasma-addons/oneiric

« back to all changes in this revision

Viewing changes to runners/audioplayercontrol/audioplayercontrolrunner_config.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-26 13:35:18 UTC
  • mfrom: (1.1.37 upstream)
  • Revision ID: james.westby@ubuntu.com-20101126133518-oxz33xjsoi02ty9f
Tags: 4:4.5.80-0ubuntu1
* New upstream beta release
* Disable kubuntu_02_microblog_default_configuration.diff does not apply
* New package plasma-containments-addons

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
    m_ui->player_combo->setDuplicatesEnabled(false);
65
65
    connect(m_ui->player_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(onPlayerChanged(int)));
66
66
    connect(m_ui->player_combo, SIGNAL(editTextChanged(QString)), this, SLOT(onPlayerChanged(QString)));
67
 
    m_ui->player_combo->addItem(i18n("Amarok"), "amarok");
 
67
    m_ui->player_combo->addItem(i18n("Amarok"), QLatin1String("amarok"));
68
68
    /* template for adding other players:
69
69
     * m_ui->player_combo->addItem(i18n("player's name"), "the end of it's MPRIS interface");
70
70
     */
77
77
{
78
78
    KCModule::load();
79
79
 
80
 
    KSharedConfig::Ptr cfg = KSharedConfig::openConfig("krunnerrc");
 
80
    KSharedConfig::Ptr cfg = KSharedConfig::openConfig(QLatin1String("krunnerrc"));
81
81
    KConfigGroup grp = cfg->group("Runners");
82
82
    grp = KConfigGroup(&grp, "Audio Player Control Runner");
83
83
    QString player = grp.readEntry(CONFIG_PLAYER, "amarok");
96
96
    m_ui->pause_edit->setText(grp.readEntry(CONFIG_PAUSE, i18n("pause")));
97
97
    m_ui->next_edit->setText(grp.readEntry(CONFIG_NEXT, i18nc("next song", "next")));
98
98
    m_ui->mute_edit->setText(grp.readEntry(CONFIG_MUTE , i18n("mute")));
99
 
    m_ui->up_edit->setText(grp.readEntry(CONFIG_INCREASE, i18nc("increase the sound volume", "up")));
 
99
    m_ui->up_edit->setText(grp.readEntry(CONFIG_INCREASE, i18nc("increase the sound volume", "increase")));
100
100
    m_ui->up_value->setValue(grp.readEntry(CONFIG_INCREASE_BY , 15));
101
 
    m_ui->down_edit->setText(grp.readEntry(CONFIG_DECREASE , i18nc("decrease the sound volume", "down")));
 
101
    m_ui->down_edit->setText(grp.readEntry(CONFIG_DECREASE , i18nc("decrease the sound volume", "decrease")));
102
102
    m_ui->down_value->setValue(grp.readEntry(CONFIG_DECREASE_BY, 15));
103
103
    m_ui->prev_edit->setText(grp.readEntry(CONFIG_PREV , i18nc("previous song", "prev")));
104
104
    m_ui->stop_edit->setText(grp.readEntry(CONFIG_STOP , i18n("stop")));
112
112
{
113
113
    KCModule::save();
114
114
 
115
 
    KSharedConfig::Ptr cfg = KSharedConfig::openConfig("krunnerrc");
 
115
    KSharedConfig::Ptr cfg = KSharedConfig::openConfig(QLatin1String("krunnerrc"));
116
116
    KConfigGroup grp = cfg->group("Runners");
117
117
    grp = KConfigGroup(&grp, "Audio Player Control Runner");
118
118
    if (!m_ui->searchCollection->isEnabled()) {
152
152
{
153
153
    KCModule::defaults();
154
154
 
155
 
    m_ui->player_combo->setCurrentIndex(m_ui->player_combo->findData("amarok"));
 
155
    m_ui->player_combo->setCurrentIndex(m_ui->player_combo->findData(QLatin1String("amarok")));
156
156
    m_ui->searchCollection->setChecked(true);
157
157
    m_ui->commands->setChecked(true);
158
158
    m_ui->play_edit->setText(i18n("Play"));
167
167
    m_ui->down_value->setValue(15);
168
168
    m_ui->prev_edit->setText(i18n("Prev"));
169
169
    m_ui->stop_edit->setText(i18n("Stop"));
170
 
    m_ui->volume_edit->setText(i18n("Volume="));
 
170
    m_ui->volume_edit->setText(i18n("Volume"));
171
171
    m_ui->quit_edit->setText(i18n("Quit"));
172
172
 
173
173
    emit changed(true);
175
175
 
176
176
void AudioPlayerControlRunnerConfig::onPlayerChanged(int index)
177
177
{
178
 
    QString data = m_ui->player_combo->itemData(index).toString();
179
 
    if (data != "amarok") {
 
178
    const QString data = m_ui->player_combo->itemData(index).toString();
 
179
    if (data != QLatin1String("amarok")) {
180
180
        m_ui->searchCollection->setEnabled(false);
181
181
    } else {
182
182
        m_ui->searchCollection->setEnabled(true);