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


C++ KFileItem::isFile方法代码示例

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


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

示例1: list

void
FileBrowser::selectAll()
{
    KFileItemList list( *m_dir->view()->items() );

    // Select all items which represent files
    for( KFileItem* item = list.first(); item; item = list.next() )
        m_dir->view()->setSelected( item, item->isFile() );
}
开发者ID:jsatt,项目名称:Pana-Audio-Player,代码行数:9,代码来源:filebrowser.cpp

示例2: fillContextMenu

void FileManager::fillContextMenu(KFileItem item, QMenu* menu)
{
    menu->addSeparator();
    menu->addAction(newFileAction);
    if (item.isFile()) {
        KDevelop::FileContext context(item.url());
        QList<KDevelop::ContextMenuExtension> extensions = KDevelop::ICore::self()->pluginController()->queryPluginsForContextMenuExtensions( &context );
        KDevelop::ContextMenuExtension::populateMenu(menu, extensions);
    }
}
开发者ID:portaloffreedom,项目名称:kdev-golang-plugin,代码行数:10,代码来源:filemanager.cpp

示例3: dataAdded

void StackFolder::dataAdded(const QModelIndex &parent, int start, int end)
{
    for (int i = start; i < end + 1; i++) {
        const QModelIndex index = m_model->index(i, 0);
        const KFileItem item = m_model->itemForIndex(index);
        if (item.isFile()) {
            const KFileItem parentItem = m_model->itemForIndex(parent);
            if (m_downloadUrl.isParentOf(parentItem.url())) {
                startAnimation();
                return;
            }
        }
    }
}
开发者ID:KDE,项目名称:stackfolder,代码行数:14,代码来源:stackfolder.cpp

示例4: updateURL

void DolphinView::updateURL()
{
    KFileView* fileView = (m_iconsView != 0) ? static_cast<KFileView*>(m_iconsView) :
                                               static_cast<KFileView*>(m_detailsView);

    KFileItem* fileItem = fileView->currentFileItem();
    if (fileItem == 0) {
        return;
    }

    if (fileItem->isDir()) {
        // Prefer the local path over the URL. This assures that the
        // volume space information is correct. Assuming that the URL is media:/sda1,
        // and the local path is /windows/C: For the URL the space info is related
        // to the root partition (and hence wrong) and for the local path the space
        // info is related to the windows partition (-> correct).
        const QString localPath(fileItem->localPath());
        if (localPath.isEmpty()) {
            setURL(fileItem->url());
        }
        else {
            setURL(KURL(localPath));
        }
    }
    else if (fileItem->isFile()) {
       // allow to browse through ZIP and tar files
       KMimeType::Ptr mime = fileItem->mimeTypePtr();
       if (mime->is("application/x-zip")) {
           KURL url = fileItem->url();
           url.setProtocol("zip");
           setURL(url);
       }
       else if (mime->is("application/x-tar") ||
                mime->is("application/x-tarz") ||
                mime->is("application/x-tbz") ||
                mime->is("application/x-tgz") ||
                mime->is("application/x-tzo")) {
           KURL url = fileItem->url();
           url.setProtocol("tar");
           setURL(url);
       }
       else {
           fileItem->run();
       }
    }
    else {
        fileItem->run();
    }
}
开发者ID:serghei,项目名称:kde3-apps-dolphin,代码行数:49,代码来源:dolphinview.cpp

示例5: slotAutoOpen

void KFileDetailView::slotAutoOpen()
{
    d->autoOpenTimer.stop();
    if( !d->dropItem )
        return;

    KFileItem *fileItem = d->dropItem->fileInfo();
    if (!fileItem)
        return;

    if( fileItem->isFile() )
        return;

    if ( fileItem->isDir() || fileItem->isLink())
        sig->activate( fileItem );
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:16,代码来源:tdefiledetailview.cpp

示例6: slotItemTriggered

void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
{
    KUrl url = item.targetUrl();

    if (item.isDir()) {
        m_view->setUrl(url);
        return;
    }

    const GeneralSettings* settings = DolphinSettings::instance().generalSettings();
    const bool browseThroughArchives = settings->browseThroughArchives();
    if (browseThroughArchives && item.isFile() && url.isLocalFile()) {
        // Generic mechanism for redirecting to tar:/<path>/ when clicking on a tar file,
        // zip:/<path>/ when clicking on a zip file, etc.
        // The .protocol file specifies the mimetype that the kioslave handles.
        // Note that we don't use mimetype inheritance since we don't want to
        // open OpenDocument files as zip folders...
        const QString protocol = KProtocolManager::protocolForArchiveMimetype(item.mimetype());
        if (!protocol.isEmpty()) {
            url.setProtocol(protocol);
            m_view->setUrl(url);
            return;
        }
    }

    if (item.mimetype() == "application/x-desktop") {
        // redirect to the url in Type=Link desktop files
        KDesktopFile desktopFile(url.toLocalFile());
        if (desktopFile.hasLinkType()) {
            url = desktopFile.readUrl();
            m_view->setUrl(url);
            return;
        }
    }

    item.run();
}
开发者ID:vishesh,项目名称:kde-baseapps,代码行数:37,代码来源:dolphinviewcontainer.cpp


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