• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ profile::Ptr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中profile::Ptr的典型用法代码示例。如果您正苦于以下问题:C++ Ptr类的具体用法?C++ Ptr怎么用?C++ Ptr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: Start

	//----------------------------------------------------------------------------------
	//
	//----------------------------------------------------------------------------------
	void Profiler_Imp::Start(int id)
	{
		Profile::Ptr profile = nullptr;
		for (auto& x : m_profiles)
		{
			if (x->GetID() == id)
			{
				profile = x;
			}
		}

		if (profile == nullptr)
		{
			profile = make_shared<Profile>(id);
			m_profiles.push_back(profile);
		}

		profile->GetCurrent()->SetStartTime(asd::GetTime());

#if _WIN32
		profile->GetCurrent()->SetProcessorNumber(GetCurrentProcessorNumber());
#elif defined(__APPLE__)
		// sched_getcpuがないようなので代用。よりよいものがあれば差し替えてください。
		profile->GetCurrent()->SetProcessorNumber(
			std::hash<std::thread::id>()(std::this_thread::get_id()));
#else
		profile->GetCurrent()->SetProcessorNumber(sched_getcpu());
#endif
	}
开发者ID:Pctg-x8,项目名称:Altseed,代码行数:32,代码来源:asd.Profiler_Imp.cpp


示例2: profileLabel

QString ProfilePlotView::profileLabel(Profile::Ptr profile)
{
	if (profile->name())
		return QString::fromStdString(profile->name().get());

	if (profile->computer())
	{
		if (profile->computer()->name())
			return QString::fromStdString(profile->computer()->name().get());

		if (profile->computer()->model())
		{
			if (profile->computer()->manufacturer())
			{
				return QString("%1 %2")
					.arg(QString::fromStdString(profile->computer()->manufacturer().get()))
					.arg(QString::fromStdString(profile->computer()->model().get()));
			}
			else
			{
				return QString::fromStdString(profile->computer()->model().get());
			}
		}
	}

	return "Unknown Profile";
}
开发者ID:asymworks,项目名称:benthos-app,代码行数:27,代码来源:profile_plot.cpp


示例3: updateAction

void ProfileList::updateAction(QAction* action , Profile::Ptr info)
{
    Q_ASSERT(action);
    Q_ASSERT(info);

    action->setText(info->name());
    action->setIcon(KIcon(info->icon()));
}
开发者ID:ktuan89,项目名称:konsole-4.8.5,代码行数:8,代码来源:ProfileList.cpp


示例4: setupAppearancePage

void EditProfileDialog::setupAppearancePage(const Profile::Ptr info)
{
    ColorSchemeViewDelegate* delegate = new ColorSchemeViewDelegate(this);
    _ui->colorSchemeList->setItemDelegate(delegate);
    
    _colorSchemeAnimationTimeLine = new QTimeLine( 500 , this );
    delegate->setEntryTimeLine(_colorSchemeAnimationTimeLine);
    
    connect( _colorSchemeAnimationTimeLine , SIGNAL(valueChanged(qreal)) , this ,
             SLOT(colorSchemeAnimationUpdate()) );
   
    _ui->transparencyWarningWidget->setVisible(false);
    _ui->editColorSchemeButton->setEnabled(false);
    _ui->removeColorSchemeButton->setEnabled(false);

    // setup color list
    updateColorSchemeList(true);
    
    _ui->colorSchemeList->setMouseTracking(true);
    _ui->colorSchemeList->installEventFilter(this);
    _ui->colorSchemeList->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );

    connect( _ui->colorSchemeList->selectionModel() , 
            SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)) 
            , this , SLOT(colorSchemeSelected()) );
    connect( _ui->colorSchemeList , SIGNAL(entered(const QModelIndex&)) , this , 
            SLOT(previewColorScheme(const QModelIndex&)) );
    
    updateColorSchemeButtons();

    connect( _ui->editColorSchemeButton , SIGNAL(clicked()) , this , 
            SLOT(editColorScheme()) );
    connect( _ui->removeColorSchemeButton , SIGNAL(clicked()) , this ,
            SLOT(removeColorScheme()) );
    connect( _ui->newColorSchemeButton , SIGNAL(clicked()) , this , 
            SLOT(newColorScheme()) );

    // setup font preview
	bool antialias = info->property<bool>(Profile::AntiAliasFonts);

    QFont font = info->font();
	if (!antialias)
		font.setStyleStrategy(QFont::NoAntialias);

	_ui->fontPreviewLabel->installEventFilter(this);
	_ui->fontPreviewLabel->setFont(font);
    _ui->fontSizeSlider->setValue( font.pointSize() );
    _ui->fontSizeSlider->setMinimum( KGlobalSettings::smallestReadableFont().pointSize() );

    connect( _ui->fontSizeSlider , SIGNAL(valueChanged(int)) , this ,
             SLOT(setFontSize(int)) );
    connect( _ui->editFontButton , SIGNAL(clicked()) , this ,
             SLOT(showFontDialog()) );

	// setup font smoothing 
	_ui->antialiasTextButton->setChecked(antialias);
	connect( _ui->antialiasTextButton , SIGNAL(toggled(bool)) , this , 
			 SLOT(setAntialiasText(bool)) );
}
开发者ID:Maijin,项目名称:konsole,代码行数:59,代码来源:EditProfileDialog.cpp


示例5: setupGeneralPage

void EditProfileDialog::setupGeneralPage(const Profile::Ptr info)
{

    // basic profile options
    _ui->profileNameEdit->setText( info->name() );

    ShellCommand command( info->command() , info->arguments() );
    _ui->commandEdit->setText( command.fullCommand() );

    KUrlCompletion* exeCompletion = new KUrlCompletion(KUrlCompletion::ExeCompletion);
    exeCompletion->setParent(this);
    exeCompletion->setDir(QString());
    _ui->commandEdit->setCompletionObject( exeCompletion );
    _ui->initialDirEdit->setText( info->defaultWorkingDirectory() );

    KUrlCompletion* dirCompletion = new KUrlCompletion(KUrlCompletion::DirCompletion);
    dirCompletion->setParent(this);
    _ui->initialDirEdit->setCompletionObject( dirCompletion );
    _ui->initialDirEdit->setClearButtonShown(true);
    _ui->dirSelectButton->setIcon( KIcon("folder-open") );
    _ui->iconSelectButton->setIcon( KIcon(info->icon()) );
	_ui->startInSameDirButton->setChecked(info->property<bool>(Profile::StartInCurrentSessionDir));

    // window options
    _ui->showMenuBarButton->setChecked( info->property<bool>(Profile::ShowMenuBar) );

    // signals and slots
    connect( _ui->dirSelectButton , SIGNAL(clicked()) , this , SLOT(selectInitialDir()) );
    connect( _ui->iconSelectButton , SIGNAL(clicked()) , this , SLOT(selectIcon()) );
	connect( _ui->startInSameDirButton , SIGNAL(toggled(bool)) , this , 
			SLOT(startInSameDir(bool)));
    connect( _ui->profileNameEdit , SIGNAL(textChanged(const QString&)) , this ,
            SLOT(profileNameChanged(const QString&)) );
    connect( _ui->initialDirEdit , SIGNAL(textChanged(const QString&)) , this , 
            SLOT(initialDirChanged(const QString&)) );
    connect(_ui->commandEdit , SIGNAL(textChanged(const QString&)) , this ,
            SLOT(commandChanged(const QString&)) ); 
    
    connect(_ui->showMenuBarButton , SIGNAL(toggled(bool)) , this , 
            SLOT(showMenuBar(bool)) );

    connect(_ui->environmentEditButton , SIGNAL(clicked()) , this , 
            SLOT(showEnvironmentEditor()) );
}
开发者ID:Maijin,项目名称:konsole,代码行数:44,代码来源:EditProfileDialog.cpp


示例6: itemDataChanged

void ManageProfilesDialog::itemDataChanged(QStandardItem* item)
{
    if (item->column() == ShortcutColumn) {
        QKeySequence sequence = QKeySequence::fromString(item->text());
        ProfileManager::instance()->setShortcut(item->data(ShortcutRole).value<Profile::Ptr>(),
                                                sequence);
    } else if (item->column() == ProfileNameColumn) {
        QString newName = item->text();
        Profile::Ptr profile = item->data(ProfileKeyRole).value<Profile::Ptr>();
        QString oldName = profile->name();

        if (newName != oldName) {
            QHash<Profile::Property, QVariant> properties;
            properties.insert(Profile::Name, newName);
            properties.insert(Profile::UntranslatedName, newName);

            ProfileManager::instance()->changeProfile(profile, properties);
        }
    }
}
开发者ID:kitech,项目名称:konsole,代码行数:20,代码来源:ManageProfilesDialog.cpp


示例7: addItems

void ManageProfilesDialog::addItems(const Profile::Ptr profile)
{
    if (profile->isHidden())
        return;

    QList<QStandardItem*> items;
    for (int i = 0; i < 3; i++)
        items << new QStandardItem;

    updateItemsForProfile(profile, items);
    _sessionModel->appendRow(items);
}
开发者ID:kitech,项目名称:konsole,代码行数:12,代码来源:ManageProfilesDialog.cpp


示例8: addItems

void ProfileSettings::addItems(const Profile::Ptr profile)
{
    if (profile->isHidden())
        return;

    QList<QStandardItem*> items;
    items.reserve(3);
    for (int i = 0; i < 3; i++)
        items.append(new QStandardItem);

    updateItemsForProfile(profile, items);
    _sessionModel->appendRow(items);
}
开发者ID:blackjack,项目名称:konsole,代码行数:13,代码来源:ProfileSettings.cpp


示例9: testProfileFileNames

// Verify the correct file name is created from the untranslatedname
void ProfileTest::testProfileFileNames()
{
    Profile::Ptr profile = Profile::Ptr(new Profile);
    QFileInfo fileInfo;
    ProfileWriter* writer = new KDE4ProfileWriter;
  
    profile->setProperty(Profile::UntranslatedName, "Indiana");
    fileInfo.setFile(writer->getPath(profile));
    QCOMPARE(fileInfo.fileName(), QString("Indiana.profile"));

    profile->setProperty(Profile::UntranslatedName, "Old Paris");
    fileInfo.setFile(writer->getPath(profile));
    QCOMPARE(fileInfo.fileName(), QString("Old Paris.profile"));

    /* FIXME: deal w/ file systems that are case-insensitive
       This leads to confusion as both Test and test can appear in the Manager
       Profile dialog while really there is only 1 test.profile file.
       Suggestions:  all lowercase, testing the file system, ...
    */
    /*
    profile->setProperty(Profile::UntranslatedName, "New Profile");
    fileInfo.setFile(writer->getPath(profile));
    QCOMPARE(fileInfo.fileName(), QString("new profile.profile"));
    */
    
    /* FIXME: don't allow certain characters in file names
       Consider: ,^@=+{}[]~!?:&*\"|#%<>$\"'();`'/\ 
       Suggestions: changing them all to _, just remove them, ...
       Bug 315086 comes from a user using / in the profile name - multiple
         issues there.
    */
    /*
    profile->setProperty(Profile::UntranslatedName, "new/profile");
    fileInfo.setFile(writer->getPath(profile));
    QCOMPARE(fileInfo.fileName(), QString("new_profile.profile"));
    */

    delete writer;
}
开发者ID:sandsmark,项目名称:konsole,代码行数:40,代码来源:ProfileTest.cpp


示例10: End

	//----------------------------------------------------------------------------------
	//
	//----------------------------------------------------------------------------------
	void Profiler_Imp::End(int id)
	{
		Profile::Ptr profile = nullptr;
		for (auto& x : m_profiles)
		{
			if (x->GetID() == id)
			{
				profile = x;
			}
		}

		if (profile == nullptr)
		{
#if _WIN32
			throw exception("対応するStartがありません。");
#else
			assert(0);
#endif
		}

		profile->GetCurrent()->SetEndTime(asd::GetTime());
		profile->Archive();
	}
开发者ID:Pctg-x8,项目名称:Altseed,代码行数:26,代码来源:asd.Profiler_Imp.cpp


示例11: updateItemsForProfile

void ManageProfilesDialog::updateItemsForProfile(const Profile::Ptr profile, QList<QStandardItem*>& items) const
{
    // Profile Name
    items[ProfileNameColumn]->setText(profile->name());
    if (!profile->icon().isEmpty())
        items[ProfileNameColumn]->setIcon(KIcon(profile->icon()));
    items[ProfileNameColumn]->setData(QVariant::fromValue(profile), ProfileKeyRole);
    items[ProfileNameColumn]->setToolTip(i18nc("@info:tooltip", "Click to rename profile"));

    // Favorite Status
    const bool isFavorite = ProfileManager::instance()->findFavorites().contains(profile);
    if (isFavorite)
        items[FavoriteStatusColumn]->setData(KIcon("dialog-ok-apply"), Qt::DecorationRole);
    else
        items[FavoriteStatusColumn]->setData(KIcon(), Qt::DecorationRole);
    items[FavoriteStatusColumn]->setData(QVariant::fromValue(profile), ProfileKeyRole);
    items[FavoriteStatusColumn]->setToolTip(i18nc("@info:tooltip", "Click to toggle status"));

    // Shortcut
    QString shortcut = ProfileManager::instance()->shortcut(profile).toString();
    items[ShortcutColumn]->setText(shortcut);
    items[ShortcutColumn]->setData(QVariant::fromValue(profile), ShortcutRole);
    items[ShortcutColumn]->setToolTip(i18nc("@info:tooltip", "Double click to change shortcut"));
}
开发者ID:kitech,项目名称:konsole,代码行数:24,代码来源:ManageProfilesDialog.cpp


示例12: parse_dives

void TransferWorker::parse_dives(Driver::Ptr driver, const dive_data_t & dives)
{
	IMixFinder::Ptr mf = boost::dynamic_pointer_cast<IMixFinder>(m_session->finder<Mix>());
	Mix::Ptr air = mf->findByName("Air");

	parser_data data;
	data.mixfinder = mf;

	// Parse the Dives
	dive_data_t::const_iterator it;
	for (it = dives.begin(); it != dives.end(); it++)
	{
		// Setup Parser Data
		data.dive.reset(new Dive);
		data.mixes.clear();
		data.profile.clear();
		data.vendor.clear();

		data.haswp = false;
		data.curmix = air;

		// Parse the Header and Profile
		driver->parse(it->first, & parse_header, & parse_profile, & data);

		// Append the final Waypoint
		if (data.haswp)
			data.profile.push_back(data.curwp);

		// Update Dive Data
		data.dive->setComputer(m_dc);

		// Set the Dive Mix as the first Mix in the profile
		if (data.haswp)
			data.dive->setMix(data.profile.begin()->mix);

		// Create Profile
		Profile::Ptr profile = Profile::Ptr(new Profile);
		profile->setComputer(m_dc);
		profile->setDive(data.dive);
		profile->setImported(time(NULL));
		profile->setProfile(data.profile);
		profile->setRawProfile(it->first);
		profile->setVendor(json_encode(data.vendor));

		// Emit Parsed Dive
		emit parsedDive(profile);
	}
}
开发者ID:asymworks,项目名称:benthos-app,代码行数:48,代码来源:transferworker.cpp


示例13: setProfile

void EditProfileDialog::setProfile(Profile::Ptr profile)
{
    _profileKey = profile;

    Q_ASSERT( profile );

    // update caption
    updateCaption(profile->name());

    // mark each page of the dialog as out of date
    // and force an update of the currently visible page
    //
    // the other pages will be updated as necessary
    _pageNeedsUpdate.fill(true);
    preparePage( _ui->tabWidget->currentIndex() );

    if ( _tempProfile )
    {
        _tempProfile = new Profile;
    }
}
开发者ID:Maijin,项目名称:konsole,代码行数:21,代码来源:EditProfileDialog.cpp


示例14: fileInfo

QString KDE4ProfileWriter::getPath(const Profile::Ptr profile)
{
    // both location have trailing slash
    static const QString localDataLocation = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QStringLiteral("/konsole/");
    static const QString systemDataLocation = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).last() + QStringLiteral("konsole/");

    const QString candidateLocalPath = localDataLocation + profile->untranslatedName() + ".profile";
    QString newPath;

    // when the path property is not set, it means the profile has just
    // been created in memory and has never been saved into disk before.
    //
    // use "name.profile" as filename and save it under $KDEHOME
    if (!profile->isPropertySet(Profile::Path)) {
        return candidateLocalPath;
    }

    // for a system wide profile, save the modified version as
    // a local profile under $KDEHOME
    if (profile->path().startsWith(systemDataLocation)) {
        return candidateLocalPath;
    }

    // for a local profile, use its existing path
    if (profile->path().startsWith(localDataLocation)) {
        newPath = profile->path();
    } else {
        // for the ad-hoc profiles in non-standard places
        //
        //  * if its path is writable for user, use its existing path
        //  * if its path is not writable for user, save it under $KDEHOME
        //
        QFileInfo fileInfo(profile->path());
        if (fileInfo.isWritable()) {
            newPath = profile->path();
        } else {
            newPath = candidateLocalPath;
        }
    }

    return newPath;
}
开发者ID:sandsmark,项目名称:konsole,代码行数:42,代码来源:ProfileWriter.cpp


示例15: while

void KDE4ProfileWriter::writeProperties(KConfig& config,
                                        const Profile::Ptr profile,
                                        const Profile::PropertyInfo* properties)
{
    const char* groupName = 0;
    KConfigGroup group;

    while (properties->name != 0) {
        if (properties->group != 0) {
            if (groupName == 0 || qstrcmp(groupName, properties->group) != 0) {
                group = config.group(properties->group);
                groupName = properties->group;
            }

            if (profile->isPropertySet(properties->property))
                group.writeEntry(QString(properties->name),
                                 profile->property<QVariant>(properties->property));
        }

        properties++;
    }
}
开发者ID:sandsmark,项目名称:konsole,代码行数:22,代码来源:ProfileWriter.cpp


示例16: downcast

std::list<Persistent::Ptr> ProfileMapper::cascade_add(Persistent::Ptr p)
{
	std::list<Persistent::Ptr> result;
	Profile::Ptr o = downcast(p);

	if (! o)
		return result;

	if (o->computer())
		result.push_back(o->computer());
	if (o->dive())
		result.push_back(o->dive());

	std::set<Mix::Ptr> mixes;
	std::list<waypoint>::const_iterator it;
	for (it = o->profile().begin(); it != o->profile().end(); it++)
		mixes.insert(it->mix);

	std::set<Mix::Ptr>::iterator it2;
	for (it2 = mixes.begin(); it2 != mixes.end(); it2++)
		result.push_back(* it2);

	return result;
}
开发者ID:asymworks,项目名称:benthos-logbook,代码行数:24,代码来源:profile_mapper.cpp


示例17: config

bool KDE4ProfileWriter::writeProfile(const QString& path , const Profile::Ptr profile)
{
    KConfig config(path, KConfig::NoGlobals);

    KConfigGroup general = config.group(GENERAL_GROUP);

    // Parent profile if set, when loading the profile in future, the parent
    // must be loaded as well if it exists.
    if (profile->parent())
        general.writeEntry("Parent", profile->parent()->path());

    if (profile->isPropertySet(Profile::Command)
            || profile->isPropertySet(Profile::Arguments))
        general.writeEntry("Command",
                           ShellCommand(profile->command(), profile->arguments()).fullCommand());

    // Write remaining properties
    writeProperties(config, profile, Profile::DefaultPropertyNames);

    return true;
}
开发者ID:sandsmark,项目名称:konsole,代码行数:21,代码来源:ProfileWriter.cpp


示例18: createTabFromArgs

void Application::createTabFromArgs(KCmdLineArgs* args, MainWindow* window,
                                    const QHash<QString, QString>& tokens)
{
    const QString& title = tokens["title"];
    const QString& command = tokens["command"];
    const QString& profile = tokens["profile"];
    const QString& workdir = tokens["workdir"];

    Profile::Ptr baseProfile;
    if (!profile.isEmpty()) {
        baseProfile = ProfileManager::instance()->loadProfile(profile);
    }
    if (!baseProfile) {
        // fallback to default profile
        baseProfile = ProfileManager::instance()->defaultProfile();
    }

    Profile::Ptr newProfile = Profile::Ptr(new Profile(baseProfile));
    newProfile->setHidden(true);

    // FIXME: the method of determining whethter to use newProfile does not
    // scale well when we support more fields in the future
    bool shouldUseNewProfile = false;

    if (!command.isEmpty()) {
        newProfile->setProperty(Profile::Command,   command);
        newProfile->setProperty(Profile::Arguments, command.split(' '));
        shouldUseNewProfile = true;
    }

    if (!title.isEmpty()) {
        newProfile->setProperty(Profile::LocalTabTitleFormat, title);
        newProfile->setProperty(Profile::RemoteTabTitleFormat, title);
        shouldUseNewProfile = true;
    }

    if (args->isSet("workdir")) {
        newProfile->setProperty(Profile::Directory, args->getOption("workdir"));
        shouldUseNewProfile = true;
    }

    if (!workdir.isEmpty()) {
        newProfile->setProperty(Profile::Directory, workdir);
        shouldUseNewProfile = true;
    }

    // Create the new session
    Profile::Ptr theProfile = shouldUseNewProfile ? newProfile :  baseProfile;
    Session* session = window->createSession(theProfile, QString());

    if (!args->isSet("close")) {
        session->setAutoClose(false);
    }

    if (!window->testAttribute(Qt::WA_Resized)) {
        window->resize(window->sizeHint());
    }

    // FIXME: this ugly hack here is to make the session start running, so that
    // its tab title is displayed as expected.
    //
    // This is another side effect of the commit fixing BKO 176902.
    window->show();
    window->hide();
}
开发者ID:nborkowska,项目名称:konsole,代码行数:65,代码来源:Application.cpp


示例19: unlink

	//! @brief Unlink this Object to the Owning Object
	virtual void unlink(Persistent::Ptr d, Persistent::Ptr obj)
	{
		Dive::Ptr dive = boost::dynamic_pointer_cast<Dive>(obj);
		Profile::Ptr profile = boost::dynamic_pointer_cast<Profile>(d);
		profile->setDive(boost::none);
	}
开发者ID:asymworks,项目名称:benthos-logbook,代码行数:7,代码来源:dive.cpp


示例20: profileNameLessThan

static bool profileNameLessThan(const Profile::Ptr& p1, const Profile::Ptr& p2)
{
    return QString::localeAwareCompare(p1->name(), p2->name()) <= 0;
}
开发者ID:Tasssadar,项目名称:konsole,代码行数:4,代码来源:ProfileManager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ project::ExporterIterator类代码示例发布时间:2022-05-31
下一篇:
C++ process::Future类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap