本文整理汇总了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();
}
示例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() ) );
}
示例3: main
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
AccountManager w;
w.show();
return a.exec();
}
示例4: main
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
AccountManager manager;
manager.startLogin();
return app.exec();
}
示例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);
}
示例6: replaceDefaultAccountWith
void OwncloudSetupWizard::replaceDefaultAccountWith(Account *newAccount)
{
// new Account
AccountManager *mgr = AccountManager::instance();
if (mgr->account()) {
mgr->account()->deleteLater();
}
mgr->setAccount(newAccount);
newAccount->save();
}
示例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;
}
示例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;
}
示例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();
}
示例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");
}
}
示例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);
}
}
示例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() ) );
}
示例13: handleLoginClientID
void LoginPacketHandler::handleLoginClientID(LoginClient* client, Message* pack) {
AccountManager* accountManager = server->getAccountManager();
accountManager->loginAccount(client, pack);
}
示例14: main
int main() {
AccountManager mgr;
mgr.Checking2Savings(100);
return 0;
}
示例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");
//.........这里部分代码省略.........