VirtualBox

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

FE/Qt: Qt5 migration (part 15): QDesktopServices API changes.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
2 edited

Legend:

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

    r58843 r58863  
    2525# include <QTranslator>
    2626# include <QDesktopWidget>
     27# if QT_VERSION >= 0x050000
     28#  include <QStandardPaths>
     29# endif /* QT_VERSION >= 0x050000 */
    2730# include <QDesktopServices>
    2831# include <QMutex>
     
    3538# include <QLocale>
    3639# include <QSpinBox>
    37 
    3840# ifdef Q_WS_WIN
    3941#  include <QEventLoop>
    4042# endif /* Q_WS_WIN */
    41 
    4243# ifdef Q_WS_X11
    4344#  include <QTextBrowser>
     
    4546#  include <QX11Info>
    4647# endif /* Q_WS_X11 */
    47 
    4848# ifdef VBOX_GUI_WITH_PIDFILE
    4949#  include <QTextStream>
     
    7474# include "UIIconPool.h"
    7575# include "UIVirtualBoxEventHandler.h"
    76 
    7776# ifdef Q_WS_X11
    7877#  include "UIHostComboEditor.h"
     
    8281#  endif /* VBOX_OSE */
    8382# endif /* Q_WS_X11 */
    84 
    8583# ifdef Q_WS_MAC
    8684#  include "VBoxUtils-darwin.h"
     
    8886#  include "UIMachineWindowSeamless.h"
    8987# endif /* Q_WS_MAC */
    90 
    9188# ifdef VBOX_WITH_VIDEOHWACCEL
    9289#  include "VBoxFBOverlay.h"
     
    126123#  include <iprt/mem.h>
    127124# endif /* Q_WS_X11 */
    128 
    129125# include <VBox/sup.h>
    130126# include <VBox/com/Guid.h>
    131127
     128/* External includes: */
    132129# ifdef Q_WS_WIN
    133130#  include "shlobj.h"
     
    143140#endif /* VBOX_WITH_XPCOM */
    144141
     142/* Qt includes: */
    145143#include <QLibraryInfo>
    146144#include <QProgressDialog>
     
    148146#include <QStyleOptionSpinBox>
    149147
     148/* Other VBox includes: */
    150149#include <VBox/VBoxOGL.h>
    151150#include <VBox/vd.h>
    152 
    153151#include <iprt/ctype.h>
    154152#include <iprt/err.h>
    155153#include <iprt/file.h>
    156154
     155/* External includes: */
     156# include <math.h>
    157157#ifdef Q_WS_MAC
    158158# include <sys/utsname.h>
    159159#endif /* Q_WS_MAC */
    160 
    161 /* External includes: */
    162 # include <math.h>
    163 
    164160#ifdef Q_WS_X11
    165161# undef BOOL /* typedef CARD8 BOOL in Xmd.h conflicts with #define BOOL PRBool
     
    171167# include <X11/Xatom.h>
    172168# include <X11/extensions/Xinerama.h>
    173 
    174169# define BOOL PRBool
    175170#endif /* Q_WS_X11 */
     
    36433638QString VBoxGlobal::documentsPath()
    36443639{
     3640#if QT_VERSION >= 0x050000
     3641    QString path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
     3642#else /* QT_VERSION < 0x050000 */
    36453643    QString path = QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation);
     3644#endif /* QT_VERSION < 0x050000 */
    36463645    QDir dir(path);
    36473646    if (dir.exists())
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r58815 r58863  
    2121
    2222/* Qt includes: */
    23 # include <QDesktopServices>
    2423# include <QMenuBar>
    2524# include <QStatusBar>
     
    2827# include <QToolButton>
    2928# include <QTimer>
    30 
    31 /* Local includes: */
     29# if QT_VERSION >= 0x050000
     30#  include <QStandardPaths>
     31# else /* QT_VERSION < 0x050000 */
     32#  include <QDesktopServices>
     33# endif /* QT_VERSION < 0x050000 */
     34
     35/* GUI includes: */
    3236# include "QISplitter.h"
    3337# include "QIFileDialog.h"
     
    6165# include "UIExtraDataManager.h"
    6266# include "VBoxGlobal.h"
    63 
    6467# ifdef Q_WS_MAC
    6568#  include "VBoxUtils.h"
     
    968971        const CMachine &machine = pItem->machine();
    969972        UIDesktopServices::createMachineShortcut(machine.GetSettingsFilePath(),
     973#if QT_VERSION >= 0x050000
     974                                                 QStandardPaths::writableLocation(QStandardPaths::DesktopLocation),
     975#else /* QT_VERSION < 0x050000 */
    970976                                                 QDesktopServices::storageLocation(QDesktopServices::DesktopLocation),
     977#endif /* QT_VERSION < 0x050000 */
    971978                                                 machine.GetName(), machine.GetId());
    972979    }
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