VirtualBox

Changeset 94036 in vbox


Ignore:
Timestamp:
Mar 1, 2022 11:59:12 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: qt6: endl(&QTextStream) was put in the 'Qt' namespace (since 5.14) and should be accessed Qt::endl. bugref:9898

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/x11/UIDesktopServices_x11.cpp

    r93115 r94036  
    3535        const QString strVBox = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + "/" + VBOX_GUI_VMRUNNER_IMAGE);
    3636        QTextStream out(&link);
     37#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) /* defaults to UTF-8 in qt6 */
    3738        out.setCodec("UTF-8");
     39#endif
     40#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
     41# define QT_ENDL Qt::endl
     42#else
     43# define QT_ENDL endl
     44#endif
    3845        /* Create a link which starts VirtualBox with the machine uuid. */
    39         out << "[Desktop Entry]" << endl
    40             << "Encoding=UTF-8" << endl
    41             << "Version=1.0" << endl
    42             << "Name=" << strName << endl
    43             << "Comment=Starts the VirtualBox machine " << strName << endl
    44             << "Type=Application" << endl
    45             << "Exec=" << strVBox << " --comment \"" << strName << "\" --startvm \"" << uUuid.toString() << "\"" << endl
    46             << "Icon=virtualbox-vbox.png" << endl;
     46        out << "[Desktop Entry]" << QT_ENDL
     47            << "Encoding=UTF-8" << QT_ENDL
     48            << "Version=1.0" << QT_ENDL
     49            << "Name=" << strName << QT_ENDL
     50            << "Comment=Starts the VirtualBox machine " << strName << QT_ENDL
     51            << "Type=Application" << QT_ENDL
     52            << "Exec=" << strVBox << " --comment \"" << strName << "\" --startvm \"" << uUuid.toString() << "\"" << QT_ENDL
     53            << "Icon=virtualbox-vbox.png" << QT_ENDL;
    4754        /* This would be a real file link entry, but then we could also simply
    4855         * use a soft link (on most UNIX fs):
    49         out << "[Desktop Entry]" << endl
    50             << "Encoding=UTF-8" << endl
    51             << "Version=1.0" << endl
    52             << "Name=" << strName << endl
    53             << "Type=Link" << endl
    54             << "Icon=virtualbox-vbox.png" << endl
     56        out << "[Desktop Entry]" << QT_ENDL
     57            << "Encoding=UTF-8" << QT_ENDL
     58            << "Version=1.0" << QT_ENDL
     59            << "Name=" << strName << QT_ENDL
     60            << "Type=Link" << QT_ENDL
     61            << "Icon=virtualbox-vbox.png" << QT_ENDL
    5562        */
    5663        link.setPermissions(link.permissions() | QFile::ExeOwner);
     64        /** @todo r=bird: check status here perhaps, might've run out of disk space or
     65         *        some such thing... */
    5766        return true;
    5867    }
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