~ubuntu-branches/ubuntu/natty/kdemultimedia/natty-proposed

« back to all changes in this revision

Viewing changes to kioslave/audiocd/kcmaudiocd/kcmaudiocd.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Debian Qt/KDE Maintainers
  • Date: 2011-05-26 02:41:36 UTC
  • mfrom: (0.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 108.
  • Revision ID: james.westby@ubuntu.com-20110526024136-jjwsigfy402jhupm
Tags: upstream-4.6.3
ImportĀ upstreamĀ versionĀ 4.6.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    box->addWidget(audioConfig);
54
54
    setButtons(Default|Apply);
55
55
 
56
 
    config = new KConfig("kcmaudiocdrc");
 
56
    config = new KConfig( QLatin1String( "kcmaudiocdrc" ));
57
57
 
58
58
    QList<AudioCDEncoder*> encoders;
59
59
    AudioCDEncoder::findAllPlugins(0, encoders);
87
87
    // File Name
88
88
    connect(audioConfig->fileNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotConfigChanged()));
89
89
    connect(audioConfig->albumNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotConfigChanged()));
 
90
    connect(audioConfig->fileLocationLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(slotConfigChanged()));
 
91
    connect(audioConfig->fileLocationGroupBox, SIGNAL(clicked()), this, SLOT(slotConfigChanged()));
90
92
    connect( audioConfig->kcfg_replaceInput, SIGNAL( textChanged(const QString&) ), this, SLOT( updateExample() ) );
91
93
    connect( audioConfig->kcfg_replaceOutput, SIGNAL( textChanged(const QString&) ), this, SLOT( updateExample() ) );
92
94
    connect( audioConfig->example, SIGNAL( textChanged(const QString&) ), this, SLOT( updateExample() ) );
100
102
                   0, KLocalizedString(), KAboutData::License_GPL,
101
103
                   ki18n("(c) 2000 - 2005 Audio CD developers"));
102
104
 
103
 
    about->addAuthor(ki18n("Benjamin C. Meyer"), ki18n("Current Maintainer"), "ben@meyerhome.net");
 
105
    about->addAuthor(ki18n("Benjamin C. Meyer"), ki18n("Former Maintainer"), "ben@meyerhome.net");
104
106
    about->addAuthor(ki18n("Carsten Duvenhorst"), KLocalizedString(), "duvenhorst@duvnet.de");
105
107
    setAboutData(about);
106
108
}
113
115
QString removeQoutes(const QString& text)
114
116
{
115
117
   QString deqoutedString=text;
116
 
   QRegExp qoutedStringRegExp("^\".*\"$");
 
118
   QRegExp qoutedStringRegExp( QLatin1String( "^\".*\"$" ));
117
119
   if (qoutedStringRegExp.exactMatch(text))
118
120
   {
119
121
      deqoutedString=text.mid(1, text.length()-2);
123
125
 
124
126
bool needsQoutes(const QString& text)
125
127
{
126
 
   QRegExp spaceAtTheBeginning("^\\s+.*$");
127
 
   QRegExp spaceAtTheEnd("^.*\\s+$");
 
128
   QRegExp spaceAtTheBeginning( QLatin1String( "^\\s+.*$" ));
 
129
   QRegExp spaceAtTheEnd( QLatin1String( "^.*\\s+$" ));
128
130
   return (spaceAtTheBeginning.exactMatch(text) || spaceAtTheEnd.exactMatch(text));
129
131
}
130
132
 
174
176
    KConfigGroup cg(config, "FileName");
175
177
    cg.writeEntry("file_name_template", audioConfig->fileNameLineEdit->text());
176
178
    cg.writeEntry("album_name_template", audioConfig->albumNameLineEdit->text());
 
179
    cg.writeEntry("show_file_location", audioConfig->fileLocationGroupBox->isChecked());
 
180
    cg.writeEntry("file_location_template", audioConfig->fileLocationLineEdit->text());
177
181
    cg.writeEntry("regexp_example", audioConfig->example->text());
178
182
 
179
183
        // save qouted if required
219
223
    KConfigGroup cg(config, "FileName");
220
224
    audioConfig->fileNameLineEdit->setText(cg.readEntry("file_name_template", "%{trackartist} - %{number} - %{title}"));
221
225
    audioConfig->albumNameLineEdit->setText(cg.readEntry("album_name_template", "%{albumartist} - %{albumtitle}"));
 
226
    audioConfig->fileLocationGroupBox->setChecked(cg.readEntry("show_file_location", false));
 
227
    audioConfig->fileLocationLineEdit->setText(cg.readEntry("file_location_template", QString()));
222
228
    audioConfig->kcfg_replaceInput->setText(cg.readEntry("regexp_search"));
223
229
    audioConfig->kcfg_replaceOutput->setText(cg.readEntry("regexp_replace"));
224
230
    audioConfig->example->setText(cg.readEntry("example", i18n("Cool artist - example audio file.wav")));