~paulbrianstewart/ubuntu/oneiric/tellico/852247-Formatting-Fix

« back to all changes in this revision

Viewing changes to src/exportdialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-31 19:33:05 UTC
  • mfrom: (0.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20080131193305-9l01m5gfhykl6pkl
Tags: 1.3-1ubuntu1
* Merge from debian unstable, remaining changes:
  - debian/control: build-dep on kdepim-dev
  - debian/control: drop versioned python from tellico-data suggests
  - debian/rules: call dh_icons

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
  QString localStr = i18n("Encode in user locale (%1)").arg(
70
70
                     QString::fromLatin1(QTextCodec::codecForLocale()->name()));
71
71
  m_encodeLocale = new QRadioButton(localStr, bg);
72
 
  QWhatsThis::add(m_encodeLocale, i18n("Encode the exported file in the local format."));
 
72
  QWhatsThis::add(m_encodeLocale, i18n("Encode the exported file in the local encoding."));
73
73
 
74
74
  QWidget* w = m_exporter->widget(widget, "exporter_widget");
75
75
  if(w) {
101
101
}
102
102
 
103
103
void ExportDialog::readOptions() {
104
 
  KConfig* config = KGlobal::config();
105
 
  config->setGroup("ExportOptions");
106
 
  bool format = config->readBoolEntry("FormatFields", false);
 
104
  KConfigGroup config(KGlobal::config(), "ExportOptions");
 
105
  bool format = config.readBoolEntry("FormatFields", false);
107
106
  m_formatFields->setChecked(format);
108
 
  bool selected = config->readBoolEntry("ExportSelectedOnly", false);
 
107
  bool selected = config.readBoolEntry("ExportSelectedOnly", false);
109
108
  m_exportSelected->setChecked(selected);
110
 
  bool encode = config->readBoolEntry("EncodeUTF8", true);
 
109
  bool encode = config.readBoolEntry("EncodeUTF8", true);
111
110
  if(encode) {
112
111
    m_encodeUTF8->setChecked(true);
113
112
  } else {
117
116
 
118
117
void ExportDialog::slotSaveOptions() {
119
118
  KConfig* config = KGlobal::config();
 
119
  // each exporter sets its own group
120
120
  m_exporter->saveOptions(config);
121
121
 
122
 
  config->setGroup("ExportOptions");
123
 
  config->writeEntry("FormatFields", m_formatFields->isChecked());
124
 
  config->writeEntry("ExportSelectedOnly", m_exportSelected->isChecked());
125
 
  config->writeEntry("EncodeUTF8", m_encodeUTF8->isChecked());
 
122
  KConfigGroup configGroup(config, "ExportOptions");
 
123
  configGroup.writeEntry("FormatFields", m_formatFields->isChecked());
 
124
  configGroup.writeEntry("ExportSelectedOnly", m_exportSelected->isChecked());
 
125
  configGroup.writeEntry("EncodeUTF8", m_encodeUTF8->isChecked());
126
126
}
127
127
 
128
128
// static
244
244
  exp->setURL(url_);
245
245
  exp->setEntries(Data::Document::self()->collection()->entries());
246
246
 
247
 
  KConfig* config = KGlobal::config();
248
 
  config->setGroup("ExportOptions");
 
247
  KConfigGroup config(KGlobal::config(), "ExportOptions");
249
248
  long options = 0;
250
 
  if(config->readBoolEntry("FormatFields", false)) {
 
249
  if(config.readBoolEntry("FormatFields", false)) {
251
250
    options |= Export::ExportFormatted;
252
251
  }
253
 
  if(config->readBoolEntry("EncodeUTF8", true)) {
 
252
  if(config.readBoolEntry("EncodeUTF8", true)) {
254
253
    options |= Export::ExportUTF8;
255
254
  }
256
255
  exp->setOptions(options | Export::ExportForce);