VirtualBox

Ignore:
Timestamp:
Nov 4, 2010 3:25:25 PM (14 years ago)
Author:
vboxsync
Message:

FE/Qt4: make the QFileIconProvider global

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMainDialog.cpp

    r29008 r33778  
    2828#include <QEventLoop>
    2929#include <QApplication>
    30 #include <QFileIconProvider>
    3130#include <QDir>
    3231#include <QUrl>
     
    186185                      /* Create some nice looking menu out of the other
    187186                       * directory parts. */
    188                       QFileIconProvider fip;
    189187                      QDir dir (fi.absolutePath());
    190188                      do
     
    194192                          else
    195193                              action = menu.addAction (dir.dirName());
    196                           action->setIcon (fip.icon (QFileInfo (dir, "")));
     194                          action->setIcon (vboxGlobal().icon(QFileInfo (dir, "")));
    197195                      }
    198196                      while (dir.cdUp());
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r33712 r33778  
    3333#include <QProcess>
    3434#include <QHash>
     35#include <QFileIconProvider>
    3536
    3637#ifdef Q_WS_X11
     
    518519    }
    519520
     521    QIcon icon(QFileIconProvider::IconType type) { return m_globalIconProvider.icon(type); }
     522    QIcon icon(const QFileInfo &info) { return m_globalIconProvider.icon(info); }
     523
    520524    QPixmap warningIcon() const { return mWarningIcon; }
    521525    QPixmap errorIcon() const { return mErrorIcon; }
     
    840844    QPixmap mWarningIcon, mErrorIcon;
    841845
     846    QFileIconProvider m_globalIconProvider;
     847
    842848    friend VBoxGlobal &vboxGlobal();
    843849};
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxFilePathSelectorWidget.cpp

    r33540 r33778  
    2424#include "UIIconPool.h"
    2525#include "VBoxFilePathSelectorWidget.h"
     26#include "VBoxGlobal.h"
    2627
    2728/* Global includes */
     
    3132#include <QClipboard>
    3233#include <QDir>
    33 #include <QFileIconProvider>
    3434#include <QFocusEvent>
    3535#include <QHBoxLayout>
     
    6666VBoxFilePathSelectorWidget::VBoxFilePathSelectorWidget (QWidget *aParent)
    6767    : QIWithRetranslateUI<QComboBox> (aParent)
    68     , mIconProvider (new QFileIconProvider())
    6968    , mCopyAction (new QAction (this))
    7069    , mMode (Mode_Folder)
     
    107106VBoxFilePathSelectorWidget::~VBoxFilePathSelectorWidget()
    108107{
    109     delete mIconProvider;
    110108}
    111109
     
    415413{
    416414    if (mMode == Mode_Folder)
    417         return mIconProvider->icon (QFileIconProvider::Folder);
     415        return vboxGlobal().icon(QFileIconProvider::Folder);
    418416    else
    419         return mIconProvider->icon (QFileIconProvider::File);
     417        return vboxGlobal().icon(QFileIconProvider::File);
    420418}
    421419
     
    550548        /* Attach corresponding icon */
    551549        setItemIcon (PathId, QFileInfo (mPath).exists() ?
    552                              mIconProvider->icon (QFileInfo (mPath)) :
     550                             vboxGlobal().icon(QFileInfo (mPath)) :
    553551                             defaultIcon());
    554552
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxFilePathSelectorWidget.h

    r28800 r33778  
    3232/* Qt forward declarations */
    3333class QHBoxLayout;
    34 class QFileIconProvider;
    3534class QAction;
    3635class QPushButton;
     
    111110
    112111    /* Private member vars */
    113     QFileIconProvider *mIconProvider;
    114112    QAction *mCopyAction;
    115113    Mode mMode;
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