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


C++ KConfigGroup::copyTo方法代码示例

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


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

示例1: removeBuildDirConfig

void removeBuildDirConfig( KDevelop::IProject* project )
{
    int buildDirIndex = currentBuildDirIndex( project );
    if ( !buildDirGroupExists( project, buildDirIndex ) )
    {
        qWarning() << "build directory config" << buildDirIndex << "to be removed but does not exist";
        return;
    }

    int bdCount = buildDirCount(project);
    setBuildDirCount( project, bdCount - 1 );
    removeOverrideBuildDirIndex( project );
    setCurrentBuildDirIndex( project, -1 );

    // move (rename) the upper config groups to keep the numbering
    // if there's nothing to move, just delete the group physically
    if (buildDirIndex + 1 == bdCount)
        buildDirGroup( project, buildDirIndex ).deleteGroup();

    else for (int i = buildDirIndex + 1; i < bdCount; ++i)
    {
        KConfigGroup src = buildDirGroup( project, i );
        KConfigGroup dest = buildDirGroup( project, i - 1 );
        dest.deleteGroup();
        src.copyTo(&dest);
        src.deleteGroup();
    }
}
开发者ID:salamanderrake,项目名称:KDevelop,代码行数:28,代码来源:cmakeutils.cpp

示例2: prepareForSave

void MousePluginWidget::prepareForSave()
{
    if (!m_configButton->isVisible() || m_pluginInstance || m_lastConfigLocation.isEmpty()) {
        return;
    }

    //back up our config because it'll be erased for saving
    KConfigGroup cfg = m_containment->containmentActionsConfig();
    cfg = KConfigGroup(&cfg, m_lastConfigLocation);
    cfg.copyTo(&m_tempConfig);
    //kDebug() << "copied to temp";
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:12,代码来源:mousepluginwidget.cpp

示例3: newInstance

int  PlasmaApp::newInstance()
{
    KCmdLineArgs* args = KCmdLineArgs::parsedArgs();

    if (args->count() == 0) {
        KCmdLineArgs::usage();
        return 0;
    }

    QString pluginName;
    if (args->count() > 0) {
        pluginName = args->arg(0);
    }

    //is the applet already running?
    if (m_viewForPlugin.contains(pluginName)) {
        m_viewForPlugin.value(pluginName)->activateWindow();
        m_viewForPlugin.value(pluginName)->raise();
        return 0;
    }

    QVariantList appletArgs;
    for (int i = 1; i < args->count(); ++i) {
        appletArgs << args->arg(i);
    }

    int appletId;
    Plasma::Containment *containment = m_corona->addContainment("null");
    containment->setFormFactor(Plasma::Planar);
    containment->setLocation(Plasma::Floating);
    appletId = ++m_maxId;

    if (m_storedApplets.contains(pluginName)) {
        int storedAppletId = m_storedApplets.values(pluginName).first();
        KConfigGroup config = storedConfig(storedAppletId);

        KConfigGroup actualConfig(containment->config());
        actualConfig = KConfigGroup(&actualConfig, "Applets");
        actualConfig = KConfigGroup(&actualConfig, QString::number(appletId));

        config.copyTo(&actualConfig);
        config.deleteGroup();
        m_storedApplets.remove(pluginName, storedAppletId);
    }

    SingleView *view = new SingleView(m_corona, containment, pluginName, appletId, appletArgs);

    if (!view->applet()) {
        delete view;
        return 0;
    }

    connect(view, SIGNAL(storeApplet(Plasma::Applet*)), this, SLOT(storeApplet(Plasma::Applet*)));
    connect(view, SIGNAL(destroyed(QObject*)), this, SLOT(viewDestroyed(QObject*)));

    if (args->isSet("border")) {
        view->setBackgroundBrush(KColorUtils::mix(Plasma::Theme::defaultTheme()->color(Plasma::Theme::BackgroundColor), Plasma::Theme::defaultTheme()->color(Plasma::Theme::TextColor), 0.15));
        connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), SLOT(themeChanged()));
        view->applet()->setBackgroundHints(Plasma::Applet::NoBackground);
    } else {
        view->setWindowFlags(Qt::FramelessWindowHint);
        view->setAttribute(Qt::WA_TranslucentBackground);
        view->setAutoFillBackground(false);
        view->viewport()->setAutoFillBackground(false);
        view->setAttribute(Qt::WA_NoSystemBackground);
        view->viewport()->setAttribute(Qt::WA_NoSystemBackground);
        Plasma::WindowEffects::overrideShadow(view->winId(), true);
    }

    if (args->isSet("fullscreen")) {
        view->setWindowState(Qt::WindowFullScreen);
    }

    args->clear();

    m_viewForPlugin[pluginName] = view;
    m_pluginForView[view] = pluginName;
    KWindowSystem::setOnDesktop(view->winId(), KWindowSystem::currentDesktop());
    view->show();
    view->raise();

    return 0;
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:83,代码来源:plasmaapp.cpp


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