当前位置: 首页>>代码示例>>C++>>正文


C++ ThumbItem::IsDir方法代码示例

本文整理汇总了C++中ThumbItem::IsDir方法的典型用法代码示例。如果您正苦于以下问题:C++ ThumbItem::IsDir方法的具体用法?C++ ThumbItem::IsDir怎么用?C++ ThumbItem::IsDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ThumbItem的用法示例。


在下文中一共展示了ThumbItem::IsDir方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DoRename

void IconView::DoRename(QString folderName)
{
    if (folderName.isEmpty() || folderName == "." || folderName == "..")
        return;

    ThumbItem *thumbitem = GetCurrentThumb();

    if (!thumbitem)
        return;

    if (!GalleryUtil::Rename(m_currDir, thumbitem->GetName(), folderName))
    {
        QString msg;
        if (thumbitem->IsDir())
            msg = tr("Failed to rename folder");
        else
            msg = tr("Failed to rename file");

        ShowOkPopup(msg, NULL, NULL);

        return;
    }

    LoadDirectory(m_currDir);
}
开发者ID:jhludwig,项目名称:mythtv,代码行数:25,代码来源:iconview.cpp

示例2: HandleItemSelect

void IconView::HandleItemSelect(MythUIButtonListItem *item)
{
    bool handled = false;

    ThumbItem *thumbitem = item->GetData().value<ThumbItem *>();

    if (!thumbitem)
        return;

    // if the selected thumbitem is a Media Device
    // attempt to mount it if it isn't already
    if (thumbitem->GetMediaDevice())
        handled = HandleMediaDeviceSelect(thumbitem);

    if (!handled && thumbitem->IsDir())
    {
        m_history.push_back(m_imageList->GetCurrentPos());
        LoadDirectory(thumbitem->GetPath());

        handled = true;
    }

    if (!handled)
        HandleImageSelect("SELECT");
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:25,代码来源:iconview.cpp

示例3:

/** Separate the input into files and directories */
void ImageView::LoadAlbumRunnable::filterDirectories(const ThumbList &input,
        ThumbList &fileList, ThumbList &dirList)
{
    for (int i = 0; i < input.size(); ++i)
    {
        ThumbItem *item = input.at(i);
        ThumbList &targetList = item->IsDir() ? dirList : fileList;
        targetList.append(item);
    }
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:11,代码来源:imageview.cpp

示例4: HandleDeleteCurrent

void IconView::HandleDeleteCurrent(void)
{
    ThumbItem *thumbitem = GetCurrentThumb();

    if (!thumbitem)
        return;

    QString title = tr("Delete Current File or Folder");
    QString msg = (thumbitem->IsDir()) ?
        tr("Deleting 1 folder, including any subfolders and files.") :
        tr("Deleting 1 image.");

    ShowOkPopup(title + '\n' + msg, this, SLOT(DoDeleteCurrent(bool)), true);
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:14,代码来源:iconview.cpp

示例5: HandleRotateCCW

void IconView::HandleRotateCCW(void)
{
    ThumbItem *thumbitem = GetCurrentThumb();

    if (!thumbitem || thumbitem->IsDir())
        return;

    int rotAngle = thumbitem->GetRotationAngle();

    rotAngle -= 90;

    if (rotAngle >= 360)
        rotAngle -= 360;

    if (rotAngle < 0)
        rotAngle += 360;

    thumbitem->SetRotationAngle(rotAngle);
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:19,代码来源:iconview.cpp

示例6: HandleImageSelect

bool IconView::HandleImageSelect(const QString &action)
{
    ThumbItem *thumbitem = GetCurrentThumb();

    if (!thumbitem || (thumbitem->IsDir() && !m_recurse))
        return false;

    int slideShow = ((action == "PLAY" || action == "SLIDESHOW") ? 1 :
                     (action == "RANDOMSHOW") ? 2 :
                     (action == "SEASONALSHOW" ? 3 : 0));

    int pos = m_imageList->GetCurrentPos();

#ifdef USING_OPENGL
    if (m_useOpenGL && QGLFormat::hasOpenGL())
    {
        GLSDialog gv(m_itemList, &pos,
                        slideShow, m_sortorder,
                        GetMythMainWindow());
        gv.exec();
    }
    else
#endif
    {
        SingleView sv(m_itemList, &pos, slideShow, m_sortorder,
                      GetMythMainWindow());
        sv.exec();
    }

    // if the user deleted files while in single view mode
    // the cached contents of the directory will be out of
    // sync, reload the current directory to refresh the view
    LoadDirectory(m_currDir);

    m_imageList->SetItemCurrent(pos);

    return true;
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:38,代码来源:iconview.cpp

示例7: DoRename

void IconView::DoRename(QString folderName)
{
    if (folderName.isEmpty() || folderName == "." || folderName == "..")
        return;

    ThumbItem *thumbitem = GetCurrentThumb();

    int currPos = 0;
    MythUIButtonListItem *item = m_imageList->GetItemCurrent();
    if (item)
    {
        currPos = m_imageList->GetCurrentPos() + 1;

        if (currPos >= m_imageList->GetCount())
            currPos = m_imageList->GetCount() - 1;
    }

    if (!thumbitem)
        return;

    if (!GalleryUtil::Rename(m_currDir, thumbitem->GetName(), folderName))
    {
        QString msg;
        if (thumbitem->IsDir())
            msg = tr("Failed to rename folder");
        else
            msg = tr("Failed to rename file");

        ShowOkPopup(msg, NULL, NULL);

        return;
    }

    LoadDirectory(m_currDir);

    m_imageList->SetItemCurrent(currPos);
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:37,代码来源:iconview.cpp

示例8: LoadDirectory

void IconView::LoadDirectory(const QString &dir)
{
    if (m_thumbGen && m_thumbGen->isRunning())
        m_thumbGen->cancel();

    if (m_childCountThread && m_childCountThread->isRunning())
        m_childCountThread->cancel();

    QDir d(dir);
    if (!d.exists())
    {
        LOG(VB_GENERAL, LOG_ERR, LOC + "LoadDirectory called with " +
                QString("non-existant directory: '%1'").arg(dir));
        return;
    }

    m_showDevices = false;

    m_currDir = d.absolutePath();

    while (!m_itemList.isEmpty())
        delete m_itemList.takeFirst();

    m_itemHash.clear();
    m_imageList->Reset();

    m_isGallery = GalleryUtil::LoadDirectory(m_itemList, dir, *m_galleryFilter,
                                             false, &m_itemHash, m_thumbGen);

    if (m_thumbGen && !m_thumbGen->isRunning())
        m_thumbGen->start();

    ThumbItem *thumbitem;
    for (int x = 0; x < m_itemList.size(); x++)
    {
        thumbitem = m_itemList.at(x);

        thumbitem->InitCaption(m_showcaption);
        MythUIButtonListItem* item =
            new MythUIButtonListItem(m_imageList, thumbitem->GetCaption(), 0,
                                     true, MythUIButtonListItem::NotChecked);
        item->SetData(qVariantFromValue(thumbitem));
        if (thumbitem->IsDir())
        {
            item->DisplayState("subfolder", "nodetype");
            m_childCountThread->addFile(thumbitem->GetPath());
        }

        LoadThumbnail(thumbitem);

        if (QFile(thumbitem->GetImageFilename()).exists())
            item->SetImage(thumbitem->GetImageFilename());

        if (m_itemMarked.contains(thumbitem->GetPath()))
            item->setChecked(MythUIButtonListItem::FullChecked);
    }

    if (m_childCountThread && !m_childCountThread->isRunning())
                m_childCountThread->start();

    if (m_noImagesText)
        m_noImagesText->SetVisible(m_itemList.isEmpty());

    if (!m_itemList.isEmpty())
    {
        UpdateText(m_imageList->GetItemCurrent());
        UpdateImage(m_imageList->GetItemCurrent());
    }
}
开发者ID:DaveDaCoda,项目名称:mythtv,代码行数:69,代码来源:iconview.cpp


注:本文中的ThumbItem::IsDir方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。