Ticket #205: foldernavigationwidget.diff

File foldernavigationwidget.diff, 1.1 KB (added by rudi, 13 years ago)

Don't show ".." in root dirs

  • foldernavigationwidget.cpp

     
    8080private:
    8181#if defined(Q_OS_UNIX)
    8282    const QVariant m_root;
     83#endif
     84#if defined(Q_OS_UNIX) || defined(Q_OS_OS2)
    8385    const QVariant m_dotdot;
    8486#endif
    8587    const QVariant m_dot;
     
    8991    QSortFilterProxyModel(parent),
    9092#if defined(Q_OS_UNIX)
    9193    m_root(QString(QLatin1Char('/'))),
     94#endif
     95#if defined(Q_OS_UNIX) || defined(Q_OS_OS2)
    9296    m_dotdot(QLatin1String("..")),
    9397#endif
    9498    m_dot(QString(QLatin1Char('.')))
     
    102106    if (sourceModel()->data(parent) == m_root && fileName == m_dotdot)
    103107        return false;
    104108#endif
     109
     110#if defined(Q_OS_OS2)
     111    // Some (not all !!!) file systems on OS/2 report ".." as hidden entry in root
     112    // directories. We disallow going up to "My computer" to achieve consitent behavior.
     113    if (fileName == m_dotdot && QDir(sourceModel()->data(parent).toString()).isRoot())
     114        return false;
     115#endif
     116
    105117    return fileName != m_dot;
    106118}
    107119