VirtualBox

Changeset 58865 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Nov 25, 2015 3:20:12 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: Qt5 migration (part 17): QApplication API changes.

File:
1 edited

Legend:

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

    r58864 r58865  
    40714071    QString vmNameOrUuid;
    40724072
     4073#if QT_VERSION >= 0x050000
     4074    const QStringList arguments = qApp->arguments();
     4075    const int argc = arguments.size();
     4076#else /* QT_VERSION < 0x050000 */
    40734077    int argc = qApp->argc();
     4078#endif /* QT_VERSION < 0x050000 */
    40744079    int i = 1;
    40754080    while (i < argc)
    40764081    {
     4082#if QT_VERSION >= 0x050000
     4083        const char *arg = arguments.at(i).toLocal8Bit().constData();
     4084#else /* QT_VERSION < 0x050000 */
    40774085        const char *arg = qApp->argv() [i];
     4086#endif /* QT_VERSION < 0x050000 */
    40784087        /* NOTE: the check here must match the corresponding check for the
    40794088         * options to start a VM in main.cpp and hardenedmain.cpp exactly,
     
    40844093            if (++i < argc)
    40854094            {
     4095#if QT_VERSION >= 0x050000
     4096                vmNameOrUuid = arguments.at(i);
     4097#else /* QT_VERSION < 0x050000 */
    40864098                vmNameOrUuid = QString (qApp->argv() [i]);
     4099#endif /* QT_VERSION < 0x050000 */
    40874100                startVM = true;
    40884101            }
     
    40964109        {
    40974110            if (++i < argc)
     4111# if QT_VERSION >= 0x050000
     4112                m_strPidfile = arguments.at(i);
     4113# else /* QT_VERSION < 0x050000 */
    40984114                m_strPidfile = QString(qApp->argv()[i]);
     4115# endif /* QT_VERSION < 0x050000 */
    40994116        }
    41004117#endif /* VBOX_GUI_WITH_PIDFILE */
     
    41134130            if (++i < argc)
    41144131            {
     4132#if QT_VERSION >= 0x050000
     4133                RTStrCopy(mSettingsPw, sizeof(mSettingsPw), arguments.at(i).toLocal8Bit().constData());
     4134#else /* QT_VERSION < 0x050000 */
    41154135                RTStrCopy(mSettingsPw, sizeof(mSettingsPw), qApp->argv() [i]);
     4136#endif /* QT_VERSION < 0x050000 */
    41164137                mSettingsPwSet = true;
    41174138            }
     
    41224143            {
    41234144                size_t cbFile;
     4145#if QT_VERSION >= 0x050000
     4146                const char *pszFile = arguments.at(i).toLocal8Bit().constData();
     4147#else /* QT_VERSION < 0x050000 */
    41244148                char *pszFile = qApp->argv() [i];
     4149#endif /* QT_VERSION < 0x050000 */
    41254150                bool fStdIn = !::strcmp(pszFile, "stdin");
    41264151                int vrc = VINF_SUCCESS;
     
    41664191        {
    41674192            if (++i < argc)
     4193# if QT_VERSION >= 0x050000
     4194                m_strFloppyImage = arguments.at(i);
     4195# else /* QT_VERSION < 0x050000 */
    41684196                m_strFloppyImage = qApp->argv()[i];
     4197# endif /* QT_VERSION < 0x050000 */
    41694198        }
    41704199        else if (!::strcmp(arg, "--dvd") || !::strcmp(arg, "--cdrom"))
    41714200        {
    41724201            if (++i < argc)
     4202# if QT_VERSION >= 0x050000
     4203                m_strDvdImage = arguments.at(i);
     4204# else /* QT_VERSION < 0x050000 */
    41734205                m_strDvdImage = qApp->argv()[i];
     4206# endif /* QT_VERSION < 0x050000 */
    41744207        }
    41754208        /* VMM Options: */
     
    41894222        {
    41904223            if (++i < argc)
     4224#if QT_VERSION >= 0x050000
     4225                mWarpPct = RTStrToUInt32(arguments.at(i).toLocal8Bit().constData());
     4226#else /* QT_VERSION < 0x050000 */
    41914227                mWarpPct = RTStrToUInt32(qApp->argv() [i]);
     4228#endif /* QT_VERSION < 0x050000 */
    41924229        }
    41934230#ifdef VBOX_WITH_DEBUGGER_GUI
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