VirtualBox

Changeset 57998 in vbox for trunk


Ignore:
Timestamp:
Oct 2, 2015 9:32:40 AM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: 7837: Runtime UI: Adding filetype suffix to screenshot filename on x11 only if user has not added it explicitly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp

    r57744 r57998  
    17211721        /* On X11 Qt Filedialog returns the filepath without the filetype suffix, so adding it ourselves: */
    17221722#ifdef Q_WS_X11
    1723         tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(QString("%1.%2").arg(strFilename, strFormat))),
    1724                       strFormat.toAscii().constData());
     1723        /* Add filetype suffix only if user has not added it explicitly: */
     1724        if (!strFilename.endsWith(QString(".%1").arg(strFormat)))
     1725            tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(QString("%1.%2").arg(strFilename, strFormat))),
     1726                          strFormat.toAscii().constData());
     1727        else
     1728            tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(strFilename)),
     1729                          strFormat.toAscii().constData());
    17251730#else /* !Q_WS_X11 */
    17261731        tmpImage.save(QDir::toNativeSeparators(QFile::encodeName(strFilename)),
Note: See TracChangeset for help on using the changeset viewer.

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