| 181 | } |
| 182 | |
| 183 | void ExportSpreadsheetDialog::setFileName(const QString& name) { |
| 184 | if (m_projectPath.isEmpty()) { |
| 185 | // no project folder is available (yet), use the last used directory in this dialog |
| 186 | KConfigGroup conf = Settings::group(QStringLiteral("ExportSpreadsheetDialog")); |
| 187 | QString dir = conf.readEntry("LastDir", ""); |
| 188 | if (dir.isEmpty()) { // use project dir as fallback |
| 189 | KConfigGroup confMainWin = Settings::group(QStringLiteral("MainWin")); |
| 190 | dir = confMainWin.readEntry("LastOpenDir", ""); |
| 191 | if (dir.isEmpty()) |
| 192 | dir = QDir::homePath(); |
| 193 | } |
| 194 | ui->leFileName->setText(dir + QLatin1Char('/') + name); |
| 195 | } else |
| 196 | ui->leFileName->setText(m_projectPath + QLatin1String("/") + name); |
| 197 | |
| 198 | this->formatChanged(ui->cbFormat->currentIndex()); |
| 199 | } |
| 200 | |
| 201 | void ExportSpreadsheetDialog::fitsExportToChanged(int idx) { |
| 202 | if (idx == 0) { |
no test coverage detected