KCookiesManagement::KCookiesManagement(QWidget *parent) : KCModule(parent, "kcmkio") { // Toplevel layout QVBoxLayout *mainLayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); dlg = new KCookiesManagementDlgUI(this); dlg->tbClearSearchLine->setIconSet(SmallIconSet(QApplication::reverseLayout() ? "clear_left" : "locationbar_erase")); dlg->kListViewSearchLine->setListView(dlg->lvCookies); mainLayout->addWidget(dlg); dlg->lvCookies->setSorting(0); connect(dlg->lvCookies, SIGNAL(expanded(QListViewItem *)), SLOT(getCookies(QListViewItem *))); connect(dlg->lvCookies, SIGNAL(selectionChanged(QListViewItem *)), SLOT(showCookieDetails(QListViewItem *))); connect(dlg->pbDelete, SIGNAL(clicked()), SLOT(deleteCookie())); connect(dlg->pbDeleteAll, SIGNAL(clicked()), SLOT(deleteAllCookies())); connect(dlg->pbReload, SIGNAL(clicked()), SLOT(getDomains())); connect(dlg->pbPolicy, SIGNAL(clicked()), SLOT(doPolicy())); connect(dlg->lvCookies, SIGNAL(doubleClicked(QListViewItem *)), SLOT(doPolicy())); deletedCookies.setAutoDelete(true); m_bDeleteAll = false; mainWidget = parent; load(); }
bool KCookieServer::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData) { static QAsciiDict<int>* fdict = 0; if ( !fdict ) { fdict = new QAsciiDict<int>( KCookieServer_fhash, TRUE, FALSE ); for ( int i = 0; KCookieServer_ftable[i][1]; i++ ) fdict->insert( KCookieServer_ftable[i][1], new int( i ) ); } int* fp = fdict->find( fun ); switch ( fp?*fp:-1) { case 0: { // QString findCookies(QString) QString arg0; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; replyType = KCookieServer_ftable[0][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << findCookies(arg0 ); } break; case 1: { // QString findCookies(QString,long int) QString arg0; long int arg1; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; replyType = KCookieServer_ftable[1][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << findCookies(arg0, arg1 ); } break; case 2: { // QStringList findDomains() replyType = KCookieServer_ftable[2][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << findDomains( ); } break; case 3: { // QStringList findCookies(QValueList<int>,QString,QString,QString,QString) QValueList<int> arg0; QString arg1; QString arg2; QString arg3; QString arg4; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; arg >> arg2; arg >> arg3; arg >> arg4; replyType = KCookieServer_ftable[3][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << findCookies(arg0, arg1, arg2, arg3, arg4 ); } break; case 4: { // QString findDOMCookies(QString) QString arg0; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; replyType = KCookieServer_ftable[4][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << findDOMCookies(arg0 ); } break; case 5: { // QString findDOMCookies(QString,long int) QString arg0; long int arg1; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; replyType = KCookieServer_ftable[5][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << findDOMCookies(arg0, arg1 ); } break; case 6: { // void addCookies(QString,QCString,long int) QString arg0; QCString arg1; long int arg2; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; arg >> arg2; replyType = KCookieServer_ftable[6][0]; addCookies(arg0, arg1, arg2 ); } break; case 7: { // void deleteCookie(QString,QString,QString,QString) QString arg0; QString arg1; QString arg2; QString arg3; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; arg >> arg2; arg >> arg3; replyType = KCookieServer_ftable[7][0]; deleteCookie(arg0, arg1, arg2, arg3 ); } break; case 8: { // void deleteCookiesFromDomain(QString) QString arg0; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; replyType = KCookieServer_ftable[8][0]; deleteCookiesFromDomain(arg0 ); } break; case 9: { // void deleteSessionCookies(long int) long int arg0; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; replyType = KCookieServer_ftable[9][0]; deleteSessionCookies(arg0 ); } break; case 10: { // void deleteSessionCookiesFor(QString,long int) QString arg0; long int arg1; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; replyType = KCookieServer_ftable[10][0]; deleteSessionCookiesFor(arg0, arg1 ); } break; case 11: { // void deleteAllCookies() replyType = KCookieServer_ftable[11][0]; deleteAllCookies( ); } break; case 12: { // void addDOMCookies(QString,QCString,long int) QString arg0; QCString arg1; long int arg2; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; arg >> arg2; replyType = KCookieServer_ftable[12][0]; addDOMCookies(arg0, arg1, arg2 ); } break; case 13: { // void setDomainAdvice(QString,QString) QString arg0; QString arg1; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; arg >> arg1; replyType = KCookieServer_ftable[13][0]; setDomainAdvice(arg0, arg1 ); } break; case 14: { // QString getDomainAdvice(QString) QString arg0; QDataStream arg( data, IO_ReadOnly ); arg >> arg0; replyType = KCookieServer_ftable[14][0]; QDataStream _replyStream( replyData, IO_WriteOnly ); _replyStream << getDomainAdvice(arg0 ); } break; case 15: { // void reloadPolicy() replyType = KCookieServer_ftable[15][0]; reloadPolicy( ); } break; case 16: { // void shutdown() replyType = KCookieServer_ftable[16][0]; shutdown( ); } break; default: return KDEDModule::process( fun, data, replyType, replyData ); } return TRUE; }