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


C++ AccountManager类代码示例

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


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

示例1: startRefresh

void ActivitiesTab::startRefresh()
{
    AccountManager *mgr = seafApplet->accountManager();
    bool has_pro_account = mgr->hasAccount() && mgr->accounts().front().isPro();
    if (has_pro_account)
        EventsService::instance()->start();
}
开发者ID:Geosparc,项目名称:seafile-client,代码行数:7,代码来源:activities-tab.cpp

示例2: KDialog

SieveDebugDialog::SieveDebugDialog( QWidget *parent )
:   KDialog( parent ),
    mSieveJob( 0 )
{
    setCaption( i18n( "Sieve Diagnostics" ) );
    setButtons( Ok );
    // Collect all accounts
    AccountManager *am = kmkernel->acctMgr();
    assert( am );
    QList<KMAccount*>::iterator accountIt = am->begin();
    while ( accountIt != am->end() ) {
      KMAccount *account = *accountIt;
      ++accountIt;
      mAccountList.append( account );
    }

    mEdit = new KTextEdit( this );
    mEdit->setReadOnly( true );
    setMainWidget( mEdit );

    mEdit->setText( i18n( "Collecting diagnostic information about Sieve support...\n\n" ) );

    setInitialSize( QSize( 640, 480 ) );

    if ( !mAccountList.isEmpty() )
        QTimer::singleShot( 0, this, SLOT( slotDiagNextAccount() ) );
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:27,代码来源:sievedebugdialog.cpp

示例3: main

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	AccountManager w;
	w.show();
	return a.exec();
}
开发者ID:rsadhu,项目名称:work,代码行数:7,代码来源:main.cpp

示例4: main

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);

    AccountManager manager;
    manager.startLogin();

    return app.exec();
}
开发者ID:fortunewang,项目名称:redhare-client,代码行数:9,代码来源:application.cpp

示例5: QAbstractListModel

AccountsModel::AccountsModel(QObject *parent) :
	QAbstractListModel(parent)
{
	AccountManager *manager = AccountManager::instance();
	connect(manager, &AccountManager::accountAdded, this, &AccountsModel::onAccountCreated);
	connect(manager, &AccountManager::accountRemoved, this, &AccountsModel::onAccountDestroyed);

	foreach (Account *account, manager->accounts())
		onAccountCreated(account);
}
开发者ID:kuiba,项目名称:qutim,代码行数:10,代码来源:accountsmodel.cpp

示例6: replaceDefaultAccountWith

void OwncloudSetupWizard::replaceDefaultAccountWith(Account *newAccount)
{
    // new Account
    AccountManager *mgr = AccountManager::instance();
    if (mgr->account()) {
        mgr->account()->deleteLater();
    }
    mgr->setAccount(newAccount);
    newAccount->save();
}
开发者ID:roeslpa,项目名称:ocClientWinLnx,代码行数:10,代码来源:owncloudsetupwizard.cpp

示例7: am

  bool User::Login (
    const yap::String& login,
    const yap::String& password,
    const yap::String& ip)
  {
    login_ = login;

    AccountManager am (*databaseManager_);
    account_ = am.Login (login, password, ip);

    return true;
  }
开发者ID:Noxalus,项目名称:YAPOG,代码行数:12,代码来源:User.cpp

示例8: main

int main() {
    AccountManager *accountManager;
    try {
        accountManager = AccountManager::getInstance();
    } catch (const char *e) {
        printf("Read accounts from file error: %s\n", e);
        printf("Do you want to renew Accounts.txt (Y/N)? ");
        if (!Utils::yesNo())
            return 0;
        accountManager = AccountManager::getInstance();
        accountManager->addAccount("admin", "admin", Account::TYPE_ADMIN);
    }
    LoginScreen::start();
    return 0;
}
开发者ID:Khang-NT,项目名称:Assignment_CPP,代码行数:15,代码来源:main.cpp

示例9: findURL

 KUrl Vacation::findURL() const {
   AccountManager * am = kmkernel->acctMgr();
   assert( am );
   QList<KMAccount*>::iterator accountIt = am->begin();
   while ( accountIt != am->end() ) {
     KMAccount *account = *accountIt;
     ++accountIt;
     if ( KMail::ImapAccountBase * iab = dynamic_cast<KMail::ImapAccountBase*>( account ) ) {
       KUrl u = findUrlForAccount( iab );
       if ( !u.isEmpty() )
         return u;
     }
   }
   return KUrl();
 }
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:15,代码来源:vacation.cpp

示例10:

void LoginWindow2::on_pushButtonlog_in_clicked()
{
    QString username = ui->lineEdit_login->text();
    QString password = ui->lineEdit_password->text();

    AccountManager am;

    if(!am.login(username, password))
    {
        ui->label_info->setText("Błędny login lub hasło.");
    }
    else
    {
        LoginWindow2::hide();
        ui->label_info->setText("dobre haslo");
    }
}
开发者ID:rstrzelczyk,项目名称:multikina,代码行数:17,代码来源:loginwindow2.cpp

示例11: Q_UNUSED

void ContactListFrontModel::onServiceChanged(const QByteArray &name, QObject *newObject, QObject *oldObject)
{
	Q_UNUSED(newObject);
	Q_UNUSED(oldObject);
	if (name == m_comparator.name()) {
		connect(m_comparator, SIGNAL(contactChanged(qutim_sdk_0_3::Contact*)),
				sourceModel(), SLOT(onContactChanged(qutim_sdk_0_3::Contact*)));
		invalidate();
	} else if (name == m_model.name()) {
		ContactListBaseModel *oldModel = qobject_cast<ContactListBaseModel*>(oldObject);
		ContactListBaseModel *newModel = qobject_cast<ContactListBaseModel*>(newObject);
		if (newModel) {
			connect(newModel, &ContactListBaseModel::tagsChanged,
					this, &ContactListFrontModel::tagsChanged);
			connect(m_comparator, SIGNAL(contactChanged(qutim_sdk_0_3::Contact*)),
					newModel, SLOT(onContactChanged(qutim_sdk_0_3::Contact*)));

			AccountManager *manager = AccountManager::instance();
			connect(manager, &AccountManager::accountAdded,
					newModel, [newModel] (Account *account) {
				newModel->onAccountCreated(account);
			});
			connect(manager, &AccountManager::accountRemoved,
					newModel, &ContactListBaseModel::onAccountRemoved);

			foreach (Account *account, manager->accounts())
				newModel->onAccountCreated(account, !oldModel);

			if (oldModel) {
				QSet<Contact*> contacts;
				oldModel->findContacts(contacts, oldModel->rootNode());
				foreach (Contact *contact, contacts)
					newModel->addContact(contact);
			}
		}
		setSourceModel(newModel);
	} else if (name == m_metaManager.name()) {
		if (MetaContactManager *oldManager = qobject_cast<MetaContactManager*>(oldObject))
			m_model->onAccountRemoved(oldManager);
		if (m_metaManager)
			m_model->onAccountCreated(m_metaManager);
	}
}
开发者ID:kuiba,项目名称:qutim,代码行数:43,代码来源:contactlistfrontmodel.cpp

示例12: KDialogBase

SieveDebugDialog::SieveDebugDialog( QWidget *parent, const char *name )
:   KDialogBase( parent, name, true, i18n( "Sieve Diagnostics" ), KDialogBase::Ok,
    KDialogBase::Ok, true ),
    mSieveJob( 0 )
{
    // Collect all accounts
    AccountManager *am = kmkernel->acctMgr();
    assert( am );
    for ( KMAccount *a = am->first(); a; a = am->next() )
        mAccountList.append( a );

    mEdit = new QTextEdit( this );
    mEdit->setReadOnly(true);
    setMainWidget( mEdit );

    mEdit->setText( i18n( "Collecting diagnostic information about Sieve support...\n\n" ) );

    setInitialSize( QSize( 640, 480 ) );

    if ( !mAccountList.isEmpty() )
        QTimer::singleShot( 0, this, SLOT( slotDiagNextAccount() ) );
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例13: handleLoginClientID

void LoginPacketHandler::handleLoginClientID(LoginClient* client, Message* pack) {
	AccountManager* accountManager = server->getAccountManager();
	accountManager->loginAccount(client, pack);
}
开发者ID:Chilastra-Reborn,项目名称:Chilastra-source-code,代码行数:4,代码来源:LoginPacketHandler.cpp

示例14: main

int main() {
    AccountManager mgr;
    mgr.Checking2Savings(100);
    return 0;
}
开发者ID:viboes,项目名称:synchro,代码行数:5,代码来源:EL_BancAccount.cpp

示例15: main

int main(int argc, char** argv)
{
    setDefaultOrCLocale();

    // Init secp256k1 context by calling one of the functions.
    toPublic(Secret{});

    // Init defaults
    Ethash::init();
    NoProof::init();

    /// Operating mode.
    OperationMode mode = OperationMode::Node;

    /// File name for import/export.
    string filename;
    bool safeImport = false;

    /// Hashes/numbers for export range.
    string exportFrom = "1";
    string exportTo = "latest";
    Format exportFormat = Format::Binary;

    bool ipc = true;

    string jsonAdmin;
    ChainParams chainParams;

    bool upnp = true;
    WithExisting withExisting = WithExisting::Trust;

    /// Networking params.
    string listenIP;
    unsigned short listenPort = dev::p2p::c_defaultListenPort;
    string publicIP;
    string remoteHost;
    unsigned short remotePort = dev::p2p::c_defaultListenPort;

    unsigned peers = 11;
    unsigned peerStretch = 7;
    std::map<p2p::NodeID, pair<NodeIPEndpoint, bool>> preferredNodes;
    bool bootstrap = true;
    bool disableDiscovery = false;
    bool allowLocalDiscovery = false;
    static const unsigned NoNetworkID = (unsigned)-1;
    unsigned networkID = NoNetworkID;

    /// Mining params
    unsigned mining = 0;
    Address author;
    strings presaleImports;
    bytes extraData;

    /// Transaction params
//  TransactionPriority priority = TransactionPriority::Medium;
//  double etherPrice = 30.679;
//  double blockFees = 15.0;
    u256 askPrice = 0;
    u256 bidPrice = DefaultGasPrice;
    bool alwaysConfirm = true;

    /// Wallet password stuff
    string masterPassword;
    bool masterSet = false;

    /// Whisper
    bool testingMode = false;

    fs::path configFile = getDataDir() / fs::path("config.rlp");
    bytes b = contents(configFile);

    strings passwordsToNote;
    Secrets toImport;
    if (b.size())
    {
        try
        {
            RLP config(b);
            author = config[1].toHash<Address>();
        }
        catch (...) {}
    }

    if (argc > 1 && (string(argv[1]) == "wallet" || string(argv[1]) == "account"))
    {
        AccountManager accountm;
        return !accountm.execute(argc, argv);
    }


    MinerCLI miner(MinerCLI::OperationMode::None);

    bool listenSet = false;
    bool chainConfigIsSet = false;
    fs::path configPath;
    string configJSON;

    po::options_description clientDefaultMode("CLIENT MODE (default)", c_lineWidth);
    auto addClientOption = clientDefaultMode.add_options();
    addClientOption("mainnet", "Use the main network protocol");
//.........这里部分代码省略.........
开发者ID:ethereum,项目名称:cpp-ethereum,代码行数:101,代码来源:main.cpp


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