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


C++ WorkingSet::fileList方法代码示例

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


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

示例1: updateFileButtons

void WorkingSetToolTipWidget::updateFileButtons()
{
    MainWindow* mainWindow = dynamic_cast<MainWindow*>(Core::self()->uiController()->activeMainWindow());
    Q_ASSERT(mainWindow);

    WorkingSetController* controller = Core::self()->workingSetControllerInternal();
    ActiveToolTip* tooltip = controller->tooltip();

    QString activeFile;
    if(mainWindow->area()->activeView())
        activeFile = mainWindow->area()->activeView()->document()->documentSpecifier();

    WorkingSet* currentWorkingSet = 0;
    QSet<QString> openFiles;

    if(!mainWindow->area()->workingSet().isEmpty())
    {
        currentWorkingSet = controller->getWorkingSet(mainWindow->area()->workingSet());
        openFiles = currentWorkingSet->fileList().toSet();
    }
    
    bool allOpen = true;
    bool noneOpen = true;

    bool needResize = false;

    bool allHidden = true;

    for(QMap< QString, FileWidget* >::iterator it = m_fileWidgets.begin(); it != m_fileWidgets.end(); ++it) {
        if(openFiles.contains(it.key())) {
            noneOpen = false;
            (*it)->m_button->setToolTip(i18n("Remove this file from the current working set"));
            (*it)->m_button->setIcon(KIcon("list-remove"));
            (*it)->show();
        }else{
            allOpen = false;
            (*it)->m_button->setToolTip(i18n("Add this file to the current working set"));
            (*it)->m_button->setIcon(KIcon("list-add"));
            if(currentWorkingSet == m_set)
            {
                (*it)->hide();
                needResize = true;
            }
        }


        if(!(*it)->isHidden())
            allHidden = false;

        (*it)->m_label->setIsActiveFile(it.key() == activeFile);
    }

    // NOTE: allways hide merge&subtract all on current working set
    // if we want to enable mergeButton, we have to fix it's behavior since it operates directly on the
    // set contents and not on the m_fileWidgets
    m_mergeButton->setHidden(allOpen || currentWorkingSet == m_set);
    m_subtractButton->setHidden(noneOpen || mainWindow->area()->workingSet() == m_set->id());
    m_deleteButton->setHidden(m_set->hasConnectedAreas());

    if(m_set->id() == mainWindow->area()->workingSet()) {
        disconnect(m_openButton, SIGNAL(clicked(bool)), m_setButton, SLOT(loadSet()));
        connect(m_openButton, SIGNAL(clicked(bool)), m_setButton, SLOT(closeSet()));
        connect(m_openButton, SIGNAL(clicked(bool)), this, SIGNAL(shouldClose()));
        m_openButton->setIcon(KIcon("project-development-close"));
        m_openButton->setText(i18n("Close"));
    }else{
开发者ID:caidongyun,项目名称:kdevplatform,代码行数:66,代码来源:workingsettooltipwidget.cpp


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