~ubuntu-branches/ubuntu/oneiric/koffice/oneiric-updates

« back to all changes in this revision

Viewing changes to kexi/main/startup/KexiStartupFileWidget.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
319
319
// QString path = selectedFile().trimmed();
320
320
    kDebug() << "d->highlightedUrl: " << d->highlightedUrl;
321
321
 
322
 
    if (d->highlightedUrl.isEmpty() && !locationEdit()->lineEdit()->text().isEmpty()) {
 
322
    if (/*d->highlightedUrl.isEmpty() &&*/ !locationEdit()->lineEdit()->text().isEmpty()) {
323
323
        kDebug() << locationEdit()->lineEdit()->text();
324
324
        //kDebug() << locationEdit()->urls();
325
325
        kDebug() << baseUrl();
339
339
        return false;
340
340
    }
341
341
 
 
342
    if (!currentFilter().isEmpty()) {
 
343
        if (d->mode & SavingFileBasedDB) {
 
344
            const QStringList filters( currentFilter().split(" ") );
 
345
            QString path = highlightedFile();
 
346
            kDebug()<< "filter:" << filters << "path:" << path;
 
347
            QString ext( QFileInfo(path).suffix() );
 
348
            bool hasExtension = false;
 
349
            foreach (const QString& filter, filters) {
 
350
                const QString f( filter.trimmed() );
 
351
                hasExtension = !f.mid(2).isEmpty() && ext==f.mid(2);
 
352
                if (hasExtension)
 
353
                break;
 
354
            }
 
355
            if (!hasExtension) {
 
356
                //no extension: add one
 
357
                QString defaultExtension( d->defaultExtension );
 
358
                if (defaultExtension.isEmpty()) {
 
359
                    defaultExtension = filters.first().trimmed().mid(2); //first one
 
360
                }
 
361
                path += (QLatin1String(".")+defaultExtension);
 
362
                kDebug() << "appended extension" << path;
 
363
                setSelection( path );
 
364
                d->highlightedUrl = KUrl(path);
 
365
            }
 
366
        }
 
367
    }
 
368
 
342
369
    kDebug() << "KexiStartupFileWidget::checkURL() path: " << d->highlightedUrl;
343
370
// kDebug() << "KexiStartupFileWidget::checkURL() fname: " << url.fileName();
344
371
//todo if ( url.isLocalFile() ) {