VirtualBox

Changeset 11701 in vbox


Ignore:
Timestamp:
Aug 27, 2008 2:17:55 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
35429
Message:

Fe/Qt4: Workaround for crushing QFileDialog bug with hidden directory as starting location.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp

    r11616 r11701  
    35253525    return loopObject.result();
    35263526
     3527#elif defined Q_WS_X11
     3528
     3529    /* Here is workaround for Qt4.3 bug with QFileDialog which crushes when
     3530     * gets initial path as hidden directory if no hidden files are shown. */
     3531    QFileDialog dlg (aParent);
     3532    dlg.setWindowTitle (aCaption);
     3533    dlg.setDirectory (aDir);
     3534    dlg.setResolveSymlinks (aResolveSymlinks);
     3535    dlg.setFileMode (aDirOnly ? QFileDialog::DirectoryOnly : QFileDialog::Directory);
     3536    QAction *hidden = dlg.findChild <QAction*> ("qt_show_hidden_action");
     3537    if (hidden)
     3538    {
     3539        hidden->trigger();
     3540        hidden->setVisible (false);
     3541    }
     3542    return dlg.exec() ? dlg.selectedFiles() [0] : QString::null;
     3543
    35273544#else
    35283545
     
    36833700
    36843701    return loopObject.result();
     3702
     3703#elif defined Q_WS_X11
     3704
     3705    /* Here is workaround for Qt4.3 bug with QFileDialog which crushes when
     3706     * gets initial path as hidden directory if no hidden files are shown. */
     3707    QFileDialog dlg (aParent);
     3708    dlg.setWindowTitle (aCaption);
     3709    dlg.setDirectory (aStartWith);
     3710    dlg.setFilter (aFilters);
     3711    if (aSelectedFilter)
     3712        dlg.selectFilter (*aSelectedFilter);
     3713    dlg.setResolveSymlinks (aResolveSymlinks);
     3714    QAction *hidden = dlg.findChild <QAction*> ("qt_show_hidden_action");
     3715    if (hidden)
     3716    {
     3717        hidden->trigger();
     3718        hidden->setVisible (false);
     3719    }
     3720    return dlg.exec() ? dlg.selectedFiles() [0] : QString::null;
    36853721
    36863722#else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette