void LocalCollection::createBookmarksPlaylist() { if( bookmarksPlaylist().isNull() ) { QString guid = uuid(); Tomahawk::playlist_ptr p = Tomahawk::Playlist::create( SourceList::instance()->getLocal(), guid, tr( "Bookmarks" ), tr( "Saved tracks" ), QString(), false ); #ifndef ENABLE_HEADLESS ViewManager::instance()->createPageForPlaylist( p ); // connect( p.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( loaded( Tomahawk::PlaylistRevision ) ), Qt::QueuedConnection ); connect( p.data(), SIGNAL( created() ), this, SLOT( created() ) ); #endif TomahawkSettings::instance()->setBookmarkPlaylist( guid ); // p->createNewRevision( uuid(), p->currentrevision(), QList< Tomahawk::plentry_ptr >() ); } }
static int accept_sub(SLNSessionRef const session, strarg_t const knownURI, HTTPConnectionRef const conn, HTTPHeadersRef const headers) { strarg_t const type = HTTPHeadersGet(headers, "Content-Type"); if(!type) return 415; // Unsupported Media Type SLNSubmissionRef sub = NULL; int rc = SLNSubmissionCreate(session, knownURI, type, &sub); if(rc < 0) goto cleanup; for(;;) { uv_buf_t buf[1] = {}; rc = HTTPConnectionReadBody(conn, buf); if(rc < 0) goto cleanup; if(0 == buf->len) break; rc = SLNSubmissionWrite(sub, (byte_t const *)buf->base, buf->len); if(rc < 0) goto cleanup; } rc = SLNSubmissionEnd(sub); if(rc < 0) goto cleanup; rc = SLNSubmissionStoreBatch(&sub, 1); if(rc < 0) goto cleanup; strarg_t const location = SLNSubmissionGetPrimaryURI(sub); if(!location) rc = UV_ENOMEM; if(rc < 0) goto cleanup; created(location, conn); cleanup: SLNSubmissionFree(&sub); if(UV_EACCES == rc) return 403; // Forbidden if(UV_UNKNOWN == rc) return 400; // Bad Request if(SLN_HASHMISMATCH == rc) return 409; // Conflict if(rc < 0) return 500; return 0; }
MemoryMappedFile::MemoryMappedFile() : _flushMutex(new mutex("flushMutex")) { fd = 0; maphandle = 0; len = 0; created(); }
MemoryMappedFile::MemoryMappedFile() : _uniqueId(mmfNextId.fetchAndAdd(1)) { fd = 0; maphandle = 0; len = 0; created(); }
Window& Window::remove(WindowEventHandler& v){ WindowEventHandlers& H = mWindowEventHandlers; WindowEventHandlers::iterator it = std::find(H.begin(), H.end(), &v); if(it != H.end()){ H.erase(it); // the proper way to do it: //H.erase(std::remove(H.begin(), H.end(), &v), H.end()); //printf("removed window event handler (%p) from window (%p)\n", &v, this); //assert(std::find(H.begin(), H.end(), &v) == H.end()); if(started()){ v.onResize(-width(), -height()); //printf("WindowEventHandler %p onResize(%d, %d)\n", &v, width(), height()); } if(created()){ v.onDestroy(); } v.mWindow = NULL; } return *this; }
static int PUT_file(SLNRepoRef const repo, SLNSessionRef const session, HTTPConnectionRef const conn, HTTPMethod const method, strarg_t const URI, HTTPHeadersRef const headers) { // TODO: This is pretty much copy and pasted from above. if(HTTP_PUT != method) return -1; int len = 0; str_t algo[SLN_ALGO_SIZE]; str_t hash[SLN_HASH_SIZE]; algo[0] = '\0'; hash[0] = '\0'; sscanf(URI, "/sln/file/" SLN_ALGO_FMT "/" SLN_HASH_FMT "%n", algo, hash, &len); if(!algo[0] || !hash[0]) return -1; if('\0' != URI[len] && '?' != URI[len]) return -1; str_t *knownURI = SLNFormatURI(algo, hash); if(!knownURI) return 500; int rc = SLNSessionGetFileInfo(session, knownURI, NULL); if(DB_NOTFOUND == rc) { rc = accept_sub(session, knownURI, conn, headers); FREE(&knownURI); return rc; } if(rc < 0) goto cleanup; created(knownURI, conn); cleanup: FREE(&knownURI); if(UV_EACCES == rc) return 403; if(rc < 0) return 500; return 0; }
MemoryMappedFile::MemoryMappedFile() : _uniqueId(mmfNextId.fetchAndAdd(1)), fd(0), maphandle(0), len(0) { created(); }
QList<QVariant> SuovaFileInfo::allInformation() const { QList<QVariant> information; information << accessed() << modified() << fileName() << bytes() << created() << urn() << mimetype() << title() << url(); return information; }
void DeviceExplorerView::rowsInserted( const QModelIndex& parent, int start, int end) { QTreeView::rowsInserted(parent, start, end); created(parent, start, end); }
//SLOT void Gui_Groups::leaveGroup() { QString name = showgrp->info1(); try { _client->leaveGroup(name.toStdString()); emit created(0); }catch(Error e) { QMessageBox::critical(0, "Error occoured", QString::fromStdString(e.errorMessage())); } }
void PlaylistModel::createIfNeeded() { if (!m_playlist) { m_playlist = new Mlt::Playlist(MLT.profile()); // do not let opening a clip change the profile! MLT.profile().set_explicit(true); emit created(); } }
bool window::create() { if(hwnd) return true; int width = xlib::width(place); int height = xlib::height(place); hwnd = XCreateSimpleWindow ( env, RootWindow((Display*)env,0), left(place), top(place), width, height, 0, WhitePixel((Display*)env,0), WhitePixel((Display*)env,0)); if(atomDelete != None) atomDelete = XInternAtom ( env, "WM_DELETE_WINDOW", false ); if ( !is_root() ) { // keeps this window in front of its parent at all times XSetTransientForHint ( env, hwnd, hwnd_parent ); // make sure the app doesn't get killed when this // window gets destroyed XSetWMProtocols ( env, hwnd, &atomDelete, 1 ); } if ( hwnd == 0 ) return false; gc = XCreateGC(env, hwnd, 0, 0); //rbuf_data = new unsigned char[ width * height * (env.bpp / 8)]; //rbuf.attach(rbuf_data, width, height, width * (env.bpp / 8) ); /* buffer = new image(width, height); ximg = XCreateImage(env, env.visual, env.depth, ZPixmap, 0, (char*)buffer->pmap.buf(), width, height, env.sys_bpp, width * (env.sys_bpp / 8)); ximg->byte_order = env.byte_order; */ set_background ( back_color ); created(); return true; }
//SLOT void Gui_Groups::kickMember() { name = showgrp->info1(); try { _client->kickMember(name.toStdString(), _selected.toStdString()); emit created(0); }catch(Error e) { QMessageBox::critical(0, "Error occoured", QString::fromStdString(e.errorMessage())); } }
void Surface::enter() { if(mTexture) { if(! created()) { create(); } mBackend->surfaceBind(this); mBackend->surfaceEnter(this); } }
void Box2DGearJoint::setJoint2(Box2DJoint *_joint2) { if (_joint2 == joint2()) return; mGearJointDef.joint2 = _joint2->joint(); if (mGearJointDef.joint2) { initialize(); emit joint2Changed(); } else connect(_joint2,SIGNAL(created()),this,SLOT(joint2Created())); }
void Box2DMouseJoint::createJoint() { mMouseJointDef.bodyA = bodyA()->body(); mMouseJointDef.bodyB = bodyB()->body(); mMouseJoint = static_cast<b2MouseJoint*> (world()->CreateJoint(&mMouseJointDef)); mMouseJoint->SetUserData(this); mInitializePending = false; emit created(); }
void CashReconcile::slotTenderTransfer() { TenderTransfer* master = new TenderTransfer(_main); master->setStore(_store->getId()); master->setStation(stationId()); master->setEmployee(employeeId()); master->setDate(_date->getDate()); master->show(); connect(master, SIGNAL(created(Id)), SLOT(slotRefresh())); }
Picture::Picture(QObject *parent) : QObject(parent) { m_defaultImage = KGlobal::dirs()->findResource("data", "plasma-applet-frame/picture-frame-default.jpg"); m_checkDir = false; // listen for changes to the file we're displaying m_fileWatch = new KDirWatch(this); connect(m_fileWatch,SIGNAL(dirty(QString)),this,SLOT(reload())); connect(m_fileWatch,SIGNAL(created(QString)),this,SLOT(reload())); connect(m_fileWatch,SIGNAL(deleted(QString)),this,SLOT(reload())); }
void CashReconcile::slotCountSelected() { ListViewItem* item = _countList->currentItem(); if (item == NULL) return; CountTender* master = new CountTender(_main, item->id); master->show(); connect(master, SIGNAL(created(Id)), SLOT(slotRefresh())); connect(master, SIGNAL(updated(Id)), SLOT(slotRefresh())); connect(master, SIGNAL(deleted(Id)), SLOT(slotRefresh())); }
void Box2DGearJoint::createJoint() { if (!mGearJointDef.joint1 || !mGearJointDef.joint2) return; mGearJointDef.bodyA = bodyA()->body(); mGearJointDef.bodyB = bodyB()->body(); mGearJoint = static_cast<b2GearJoint*>(world()->CreateJoint(&mGearJointDef)); mGearJoint->SetUserData(this); mInitializePending = false; emit created(); }
void CreateGameDialog::create(){ if(Connection::getInstance().createServer()){ ui->infoLabel->setText( QString("Server created at\n").append( Connection::getInstance().getAddress().append(":").append( Connection::getInstance().getPort()))); ui->statusLabel->setText("Waiting for client..."); connect( &Connection::getInstance(), SIGNAL(clientConnected()), this, SLOT(created()) ); } else { ui->infoLabel->setText("Cannot create server!"); } }
int getinfo(char *s, char *d) { int sdir, ddir; int ret; srclen = strlen(s) + 5; /* 1 byte for null and 4 byte for \*.* */ dstlen = strlen(d) + 17; /* 1 for null, 4 for \*.* and 13 for folder */ srcbuf = 500; /* initialize the buffer */ dstbuf = 500; while (srclen > srcbuf) srcbuf *= 2; while (dstlen > dstbuf) dstbuf *= 2; fixsrc = (char *)malloc( (long)srcbuf ); fixdst = (char *)malloc( (long)dstbuf ); sdir = mystrcp(s, fixsrc); if ( opcode == OP_DELETE ) /* do directories or files rm */ return( (sdir)? DTOD:OK ); else /* do directories or files cp or mv */ { getlastpath(filestr,fixsrc); if (((ddir = mystrcp(d, fixdst))) && (sdir)) { /* dir to dir */ if (*filestr) { /* folder cp */ chkbuf(dstlen, dstbuf, &fixdst); /* check buf size */ addfile(fixdst, filestr); /* add the folder to dst */ ret = created( filestr ); /* create the 1st folder */ if ( ( !ret ) || ( ret == SKIP ) ) { free( fixsrc ); free( fixdst ); return( ret ); } strcat(bckslsh, fixdst); } return (DTOD); } if (ddir) { /* one file to dir */ chkbuf(dstlen, dstbuf, &fixdst); /* check buf size */ strcat(filestr, fixdst); } return OK; } }
bool STVariable::operator==(const STVariable &other) const { bool namesMatch = false; bool creationDateTimesMatch = false; if (name() == other.name()) namesMatch = true; if (created() == other.created()) creationDateTimesMatch = true; return (namesMatch && creationDateTimesMatch); }
//SLOT void Gui_Groups::newGroup() { QString name = grpname->text(); QString desc = newgrp->text(); Group* g = new Group(_client->username(), name.toStdString(), desc.toStdString()); // freed in db destructor try { _client->createNewGroup(*g); _client->save(); QMessageBox::information(0, "Operation succesful", "Group \"" + name + " \" successfully created"); emit created(1); }catch(Error e) { QMessageBox::critical(0, "Error occoured", QString::fromStdString(e.errorMessage())); } }
FoursquareAuthPage::FoursquareAuthPage(QGraphicsItem *parent) : MApplicationPage(parent), m_header(0), m_view(0), m_nam(0) { setComponentsDisplayMode(MApplicationPage::EscapeButton, MApplicationPageModel::Hide); connect(this, SIGNAL(created()), this, SLOT(activate()), Qt::QueuedConnection); }
void FoursquareAuthPage::createContent(void) { MApplicationPage::createContent(); setStyleName("CommonApplicationPage"); setPannable(false); MAction *cancelAction = new MAction(tr("Cancel"), this); cancelAction->setLocation(MAction::ToolBarLocation); connect(cancelAction, SIGNAL(triggered()), this, SLOT(dismiss())); addAction(cancelAction); QGraphicsAnchorLayout *layout = new QGraphicsAnchorLayout(); layout->setContentsMargins(0, 0, 0, 0); m_header = new ViewHeader(tr("Foursquare authentication")); layout->addCornerAnchors(m_header, Qt::TopLeftCorner, layout, Qt::TopLeftCorner); layout->addCornerAnchors(m_header, Qt::TopRightCorner, layout, Qt::TopRightCorner); QGraphicsGridLayout *subLayout = new QGraphicsGridLayout(); layout->addCornerAnchors(subLayout, Qt::TopLeftCorner, m_header, Qt::BottomLeftCorner); layout->addCornerAnchors(subLayout, Qt::BottomRightCorner, layout, Qt::BottomRightCorner); m_view = new QGraphicsWebView(); m_view->setResizesToContents(false); m_view->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); connect(m_view, SIGNAL(loadStarted()), this, SLOT(pageLoadStarted())); connect(m_view, SIGNAL(loadFinished(bool)), this, SLOT(pageLoadFinished(bool))); subLayout->addItem(m_view, 0, 0); m_nam = new FoursquareAuthNetworkAccessManager(m_view->page()->networkAccessManager(), REDIRECT_URL, this); connect(m_nam, SIGNAL(tokenReceived(QString)), this, SLOT(tokenReceived(QString))); m_view->page()->setNetworkAccessManager(m_nam); centralWidget()->setLayout(layout); Q_EMIT(created()); }
void CTransactions::addThingSellTransaction(const hacc::TDBID & poolId) { ui::form::FTransactionSellThingEdit *dialog = new ui::form::FTransactionSellThingEdit(); if(dialog->exec() == QDialog::Accepted) { hacc::TDBID newID = addOnlyTransactionBase(poolId, dialog->money()); HACC_DB->exec("insert into transactions_valuables (id, valuable_id) values (?,?)", QVariantList() << newID << dialog->valuableID()); emit created(newID); } delete dialog; }
RecentDocuments::RecentDocuments(QObject *parent, const QVariantList& args) : Plasma::AbstractRunner(parent, args) { Q_UNUSED(args); setObjectName( QLatin1String("Recent Documents" )); m_icon = QIcon::fromTheme("document-open-recent"); loadRecentDocuments(); // listen for changes to the list of recent documents KDirWatch *recentDocWatch = new KDirWatch(this); recentDocWatch->addDir(KRecentDocument::recentDocumentDirectory(), KDirWatch::WatchFiles); connect(recentDocWatch,SIGNAL(created(QString)),this,SLOT(loadRecentDocuments())); connect(recentDocWatch,SIGNAL(deleted(QString)),this,SLOT(loadRecentDocuments())); connect(recentDocWatch,SIGNAL(dirty(QString)),this,SLOT(loadRecentDocuments())); addSyntax(Plasma::RunnerSyntax(":q:", i18n("Looks for documents recently used with names matching :q:."))); }
void MainWindow::setupDay(ActivityTableView *tableView, ProjectTotalsListView *listView, const QDate &date) { /* Setup table model */ ActivityTableModel *tableModel = new ActivityTableModel(date, m_recordManager, this); connect(this, SIGNAL(activityCreated(QSharedPointer<Activity>)), tableModel, SLOT(created(QSharedPointer<Activity>))); connect(tableModel, SIGNAL(activityStarted()), m_ui.tblCurrent->model(), SLOT(refreshActivities())); connect(tableModel, SIGNAL(activitySaved()), m_activityCompleterModel, SLOT(refreshNames())); connect(tableModel, SIGNAL(activityDestroyed()), m_activityCompleterModel, SLOT(refreshNames())); connect(tableModel, SIGNAL(activitySaved()), m_tagCompleterModel, SLOT(refreshNames())); connect(tableModel, SIGNAL(activityDestroyed()), m_tagCompleterModel, SLOT(refreshNames())); /* Setup list model */ ProjectTotalsListModel *listModel = new ProjectTotalsListModel(date, m_recordManager, this); connect(this, SIGNAL(activityCreated(QSharedPointer<Activity>)), listModel, SLOT(created(QSharedPointer<Activity>))); setupDay(tableView, listView, tableModel, listModel); }
void ThemesDlg::getNewStuff() { if (!m_newStuffInitialized) { KDirWatch *dirWatch = KDirWatch::self(); connect(dirWatch, SIGNAL(created(QString)), SLOT(installNewTheme(QString))); QString destDir = KStandardDirs::locateLocal("appdata", "themes/"); dirWatch->addDir(destDir, KDirWatch::WatchFiles); m_newStuffInitialized = true; } KNS::Engine::download(); }