void TestSymbianEngine::initTestCase() { QContactManager::Error error; QMap<QString, QString> emptyParameters; m_engine = new CntSymbianEngine(emptyParameters, &error); if (error == QContactManager::NoError) removeAllContacts(); else QSKIP("Error creating manager", SkipAll); }
/*! \brief Constructor */ MyLocalDirPanel::MyLocalDirPanel(QWidget * parent) : XLet(parent) { setTitle( tr("Personal Directory") ); m_searchBox = new SearchDialog(this); connect(m_searchBox, SIGNAL(findNext()), this, SLOT(findNext())); QVBoxLayout *vlayout = new QVBoxLayout(this); // button line QHBoxLayout *hlayout = new QHBoxLayout(); QPushButton *addNewBtn = new QPushButton(tr("&New Contact")); connect(addNewBtn, SIGNAL(clicked()), this, SLOT(openNewContactDialog())); hlayout->addWidget( addNewBtn ); QPushButton *exportBtn = new QPushButton(tr("&Export Contacts")); connect(exportBtn, SIGNAL(clicked()), this, SLOT(exportContacts()) ); hlayout->addWidget( exportBtn ); QPushButton *importBtn = new QPushButton(tr("&Import Contacts")); connect(importBtn, SIGNAL(clicked()), this, SLOT(importContacts()) ); hlayout->addWidget( importBtn ); QPushButton *searchBtn = new QPushButton(tr("&Search")); connect(searchBtn, SIGNAL(clicked()), m_searchBox, SLOT(show()) ); hlayout->addWidget( searchBtn ); QPushButton *removeAllBtn = new QPushButton(tr("&Remove all Contacts")); connect(removeAllBtn, SIGNAL(clicked()), this, SLOT(removeAllContacts()) ); hlayout->addWidget( removeAllBtn ); vlayout->addLayout(hlayout); m_table = new ExtendedTableWidget; m_table->setEditable( true ); QStringList columnNames; columnNames.append(tr("First Name")); columnNames.append(tr("Last Name")); columnNames.append(tr("Phone Number")); columnNames.append(tr("Email Address")); columnNames.append(tr("Company")); columnNames.append(tr("Fax Number")); columnNames.append(tr("Mobile Number")); m_table->setColumnCount(contacts_index.size()); m_table->setHorizontalHeaderLabels(columnNames); m_table->setSortingEnabled(true); vlayout->addWidget(m_table); QFile file(getSaveFile()); file.copy(getBackupFile()); loadFromFile(file); }
bool JabberTransport::removeAccount( ) { if(m_status == Removing || m_status == AccountRemoved) return true; //so it can be deleted if (!account()->isConnected()) { account()->errorConnectFirst (); return false; } m_status = Removing; XMPP::JT_Register *task = new XMPP::JT_Register ( m_account->client()->rootTask () ); QObject::connect ( task, SIGNAL ( finished () ), this, SLOT ( removeAllContacts() ) ); //JabberContact *my=static_cast<JabberContact*>(myself()); task->unreg ( myself()->contactId() ); task->go ( true ); return false; //delay the removal }
void TestSymbianEngine::cleanup() { removeAllContacts(); }
void TestSymbianEngine::cleanupTestCase() { removeAllContacts(); delete m_engine; }