Beispiel #1
0
KDirWatchTest_GUI::KDirWatchTest_GUI() : QWidget()
{
    QPushButton *e,*f;

    QVBoxLayout *lay = new QVBoxLayout(this);
    lay->setMargin( 0 );
    lay->addWidget(l1 = new QLineEdit( "Test 1", this));
    lay->addWidget(l2 = new QLineEdit( "Test 2", this));
    lay->addWidget(l3 = new QLineEdit( "Test 3", this));
    lay->addWidget(m_eventBrowser = new QTextBrowser(this));
    lay->addWidget(d = new QLineEdit( "Status", this));
    lay->addWidget(e = new QPushButton("new file", this));
    lay->addWidget(f = new QPushButton("delete file", this));

    dir = QDir::currentPath();
    file = dir + "/testfile_kdirwatchtest_gui";

    w1 = new KDirWatch();
    w1->setObjectName("w1");
    w2 = new KDirWatch();
    w2->setObjectName("w2");
    w3 = new KDirWatch();
    w3->setObjectName("w3");
    connect(w1, SIGNAL(dirty(QString)), this, SLOT(slotDir1(QString)));
    connect(w2, SIGNAL(dirty(QString)), this, SLOT(slotDir2(QString)));
    connect(w3, SIGNAL(dirty(QString)), this, SLOT(slotDir3(QString)));
    w1->addDir(dir);
    w2->addDir(dir);
    w3->addDir(dir);

    KDirWatch* w4 = new KDirWatch(this);
    w4->setObjectName("w4");
    w4->addDir(dir, KDirWatch::WatchFiles|KDirWatch::WatchSubDirs);
    connect(w1, SIGNAL(dirty(QString)), this, SLOT(slotDirty(QString)));
    connect(w1, SIGNAL(created(QString)), this, SLOT(slotCreated(QString)));
    connect(w1, SIGNAL(deleted(QString)), this, SLOT(slotDeleted(QString)));

    KDirWatch* w5 = new KDirWatch(this);
    w5->setObjectName("w5");
    w5->addFile(file);
    connect(w5, SIGNAL(dirty(QString)), this, SLOT(slotDirty(QString)));
    connect(w5, SIGNAL(created(QString)), this, SLOT(slotCreated(QString)));
    connect(w5, SIGNAL(deleted(QString)), this, SLOT(slotDeleted(QString)));

    lay->addWidget(new QLabel("Directory = " + dir, this));
    lay->addWidget(new QLabel("File = " + file, this));

    connect(e, SIGNAL(clicked()), this, SLOT(slotNewClicked()));
    connect(f, SIGNAL(clicked()), this, SLOT(slotDeleteClicked()));

    setMinimumWidth(800);
    setMinimumHeight(400);
}
Beispiel #2
0
void Share::deleteShare()
{
    OcsShareJob *job = new OcsShareJob(_account);
    connect(job, SIGNAL(shareJobFinished(QVariantMap, QVariant)), SLOT(slotDeleted()));
    connect(job, SIGNAL(ocsError(int, const QString &)), SLOT(slotOcsError(int, const QString &)));
    job->deleteShare(getId());
}