VirtualBox

Changeset 17724 in vbox


Ignore:
Timestamp:
Mar 12, 2009 9:32:18 AM (16 years ago)
Author:
vboxsync
Message:

FE/Qt4: make sure the path exists

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h

    r17714 r17724  
    3636#include <QProcess>
    3737#include <QHash>
    38 #include <QDesktopServices>
    39 #include <QDir>
    4038
    4139class QAction;
     
    733731    }
    734732
    735     static inline QString documentsPath()
    736     {
    737         QString path;
    738 #if QT_VERSION < 0x040400
    739         path = QDir::homePath();
    740 #else
    741         path = QDesktopServices::storageLocation (QDesktopServices::DocumentsLocation);
    742 #endif
    743         return QDir::cleanPath (path);
    744     }
     733    static QString documentsPath();
    745734
    746735signals:
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxExportApplianceWzd.cpp

    r17714 r17724  
    2626#include "VBoxProblemReporter.h"
    2727
     28/* Qt includes */
     29#include <QDir>
     30
    2831class VMListWidgetItems: public QListWidgetItem
    2932{
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp

    r17721 r17724  
    5050#include <QPainter>
    5151#include <QTimer>
     52#include <QDir>
    5253
    5354#include <math.h>
     
    48454846}
    48464847
     4848/* static */
     4849QString VBoxGlobal::documentsPath()
     4850{
     4851    QString path;
     4852#if QT_VERSION < 0x040400
     4853    path = QDir::homePath();
     4854#else
     4855    path = QDesktopServices::storageLocation (QDesktopServices::DocumentsLocation);
     4856#endif
     4857
     4858    /* Make sure the path exists */
     4859    QDir dir (path);
     4860    while (!dir.exists())
     4861        dir.cdUp();
     4862
     4863    return QDir::cleanPath (dir.canonicalPath());
     4864}
     4865
    48474866// Public slots
    48484867////////////////////////////////////////////////////////////////////////////////
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