void VirtausApplication::setCollection(Virtaus::Core::Collection *collection) { this->c_collection = collection; emit collectionChanged(collection); }
AmazonItemTreeModel::AmazonItemTreeModel( Collections::AmazonCollection* collection ) : m_hiddenAlbums( 0 ) { m_collection = collection; connect( m_collection, SIGNAL( updated() ), this, SLOT( collectionChanged() ) ); }
void EventEditTest::shouldNotEmitWhenCollectionIsNotChanged() { MessageViewer::EventEdit edit; edit.setCollection(Akonadi::Collection(42)); QSignalSpy spy(&edit, SIGNAL(collectionChanged(Akonadi::Collection))); edit.setCollection(Akonadi::Collection(42)); QCOMPARE(spy.count(), 0); }
void EventEditTest::shouldEmitCollectionChanged() { MessageViewer::EventEdit edit; QSignalSpy spy(&edit, SIGNAL(collectionChanged(Akonadi::Collection))); edit.setCollection(Akonadi::Collection(42)); QCOMPARE(spy.count(), 1); QCOMPARE(spy.at(0).at(0).value<Akonadi::Collection>(), Akonadi::Collection(42)); }
void NoteEditTest::shouldEmitCollectionChangedWhenCurrentCollectionWasChanged() { MessageViewer::NoteEdit edit; Akonadi::CollectionComboBox *akonadicombobox = edit.findChild<Akonadi::CollectionComboBox *>(QStringLiteral("akonadicombobox")); akonadicombobox->setCurrentIndex(0); QCOMPARE(akonadicombobox->currentIndex(), 0); QSignalSpy spy(&edit, SIGNAL(collectionChanged(Akonadi::Collection))); akonadicombobox->setCurrentIndex(3); QCOMPARE(akonadicombobox->currentIndex(), 3); QCOMPARE(spy.count(), 1); }
void SnippetCollectionTest::notifiesListenersOfRemovedSnippets() { const Snippet snippet; SnippetCollection collection; QSignalSpy spy(&collection, SIGNAL(collectionChanged(SnippetCollection::CollectionChangedType, Snippet))); collection.insert(snippet); collection.remove(snippet); QCOMPARE(spy.count(), 2); QList<QVariant> arguments = spy.takeAt(1); QCOMPARE(arguments.at(0).value<SnippetCollection::CollectionChangedType>(), SnippetCollection::ItemDeleted); }
SnippetCompleter::SnippetCompleter(SnippetCollection *collection, QWidget *parentWidget) : QObject(parentWidget), snippetCollection(collection), completer(new QCompleter(this)) { completer->setWidget(parentWidget); completer->setCompletionMode(QCompleter::PopupCompletion); completer->setCaseSensitivity(Qt::CaseSensitive); connect(completer, SIGNAL(activated(QString)), this, SLOT(insertSnippet(QString))); CompletionListModel *model = new CompletionListModel(completer); connect(collection, SIGNAL(collectionChanged(SnippetCollection::CollectionChangedType,Snippet)), model, SLOT(snippetCollectionChanged(SnippetCollection::CollectionChangedType,Snippet))); completer->setModel(model); }
///Constructor BookmarkDock::BookmarkDock(QWidget* parent) : QDockWidget(parent) { setObjectName("bookmarkDock"); setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); setMinimumSize(250,0); m_pFilterLE = new KLineEdit(this); m_pSplitter = new QSplitter(Qt::Vertical,this); m_pItemView = new CategorizedTreeWidget(this); m_pMostUsedCK = new QCheckBox(this); m_pFilterLE->setPlaceholderText(i18n("Filter")); m_pMostUsedCK->setChecked(ConfigurationSkeleton::displayContactCallHistory()); QWidget* mainWidget = new QWidget(this); setWidget(mainWidget); m_pMostUsedCK->setText("Show most called contacts"); QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget); mainLayout->addWidget(m_pMostUsedCK); mainLayout->addWidget(m_pSplitter); m_pSplitter->addWidget(m_pItemView); mainLayout->addWidget(m_pFilterLE); m_pSplitter->setChildrenCollapsible(true); m_pSplitter->setStretchFactor(0,7); setWindowTitle(i18n("Bookmark")); m_pItemView->headerItem()->setText(0,i18n("Bookmark") ); connect(m_pFilterLE , SIGNAL(textChanged(QString)), this , SLOT(filter(QString) )); connect(m_pMostUsedCK , SIGNAL(toggled(bool)), this , SLOT(reload() )); connect(AkonadiBackend::getInstance() , SIGNAL(collectionChanged()) , this , SLOT(reload() )); reload(); }
BackendReturn<void> TemporaryCollection::setLabel(const QString &label) { m_label = label; emit collectionChanged(this); return BackendReturn<void>(); }
void AvatarListWidget::createSignals() { connect(ui.pushButton_add_avatar, SIGNAL(clicked()), this, SLOT(addAvatarClicked())); connect(ui.pushButton_edit_avatar, SIGNAL(clicked()), this, SLOT(editAvatarClicked())); connect(ui.pushButton_apply_collection_avatar, SIGNAL(clicked()), this, SLOT(setCollectionAvatarClicked())); connect(ui.pushButton_apply_avatar, SIGNAL(clicked()), this, SLOT(setMyAvatarClicked())); connect(ui.pushButton_remove_avatar, SIGNAL(clicked()), this, SLOT(removeAvatarClicked())); connect(ui.pushButton_set_empty_avatar1, SIGNAL(clicked()), this, SLOT(setEmptyAvatarClicked())); connect(ui.pushButton_set_empty_avatar2, SIGNAL(clicked()), this, SLOT(setEmptyAvatarClicked())); connect(ui.tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int))); connect(ui.listWidget_list_collections, SIGNAL(currentTextChanged(QString)), this, SLOT(collectionChanged(QString))); }
void StegoModel::openDirectory(const char* path) { int i, j, k; int num_sets = 0; int bin; char *str = (char*) malloc(512*sizeof(char)); DIR *root = opendir(path); FILE *file; featureHeader header; struct dirent *entry; if (root == NULL) { // printf("root is NULL \n"); return; } // printf("Root not NULL. \n"); while ((entry = readdir(root)) != NULL) { if (strstr(entry->d_name, ".fv") != NULL) { num_sets++; } } // printf("about to open dir with %i feature files \n", num_sets); rewinddir(root); for(i = 0; i < num_sets; ) { entry = readdir(root); if (strstr(entry->d_name, ".fv") != NULL) { pathConcat(path, entry->d_name, str); openFile(str, i, num_sets, header); // file = fopen(str, "r"); // readHeader(file, &header); // if (ranges == 0) { // printf("first file is being added! \n"); // ranges = (int**) malloc(3*sizeof(int*)); // for (k = 0; k < 3; k++) { // ranges[k] = (int*) malloc(num_coefs[k]*sizeof(int)); // for (j = 0; j < num_coefs[k]; j++) // ranges[k][j] = header.ranges[k][j]; // } // } // fclose(file); // // // printf("method: %i \n", header.method); // // printf("qp range: %i \n", header.qp_range); // if (header.method == 0) { // if (cleanSet == 0) { // cleanSet = openFeatureSet(str, steg); // } else { // // printf("adding new feature file to clean set \n"); // newFeatureFile(steg, cleanSet, str); // } // } else { // if (collections[pair<int, int>(header.method,header.accept)] == 0) { // collections[pair<int, int>(header.method,header.accept)] = new FeatureCollection(&header); // printf("Created new collection for method %i and accept %i \n", header.method, header.accept); // } // collections[pair<int, int>(header.method, header.accept)]->addFeatureFile(str, &header, steg, cleanSet); // } // i++; // progressChanged((double) i / (double) num_sets); } } collectionChanged(); closedir(root); free(str); }
ImportMailPage::ImportMailPage(QWidget *parent) : QWidget(parent), ui(new Ui::ImportMailPage) { ui->setupUi(this); connect(ui->importMails,SIGNAL(clicked()),SIGNAL(importMailsClicked())); connect(ui->mCollectionRequestor, SIGNAL(folderChanged(Akonadi::Collection)), this, SLOT(collectionChanged(Akonadi::Collection)) ); }