~ubuntu-branches/ubuntu/utopic/psi/utopic

« back to all changes in this revision

Viewing changes to src/filetransdlg.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2010-02-19 09:37:12 UTC
  • mfrom: (6.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100219093712-e225xvm1wjcf1cgi
Tags: 0.14-2
* comment out only function which uses va_list to work around build
  problems on armel
* Set Standards-Version to 3.8.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
92
92
{
93
93
        if(!activeFiles)
94
94
                return;
95
 
        activeFiles->remove(s);
 
95
        activeFiles->removeAll(s);
96
96
        //printf("removed: [%s]\n", s.latin1());
97
97
}
98
98
 
343
343
                                ok = true;
344
344
                        }
345
345
                        else {
346
 
                                if(d->f.at(d->offset))
 
346
                                if(d->f.seek(d->offset))
347
347
                                        ok = true;
348
348
                        }
349
349
                }
370
370
                                ok = true;
371
371
                        }
372
372
                        else {
373
 
                                if(d->f.at(d->offset))
 
373
                                if(d->f.seek(d->offset))
374
374
                                        ok = true;
375
375
                        }
376
376
                }
381
381
                        return;
382
382
                }
383
383
 
384
 
                d->activeFile = d->f.name();
 
384
                d->activeFile = d->f.fileName();
385
385
                active_file_add(d->activeFile);
386
386
 
387
387
                // done already?  this means a file size of zero
396
396
{
397
397
        if(!d->sending) {
398
398
                //printf("%d bytes read\n", a.size());
399
 
                int r = d->f.writeBlock(a.data(), a.size());
 
399
                int r = d->f.write(a.data(), a.size());
400
400
                if(r < 0) {
401
401
                        d->f.close();
402
402
                        delete d->ft;
560
560
 
561
561
        d->te = new ChatView(this);
562
562
        d->te->setReadOnly(false);
563
 
        d->te->setTextFormat(Qt::PlainText);
 
563
        d->te->setAcceptRichText(false);
564
564
        replaceWidget(te_desc, d->te);
565
565
        setTabOrder(le_fname, d->te);
566
566
        setTabOrder(d->te, pb_stop);
603
603
                        return;
604
604
                }
605
605
 
606
 
                FileUtil::setLastUsedSavePath(fi.dirPath());
 
606
                FileUtil::setLastUsedSavePath(fi.path());
607
607
                le_fname->setText(QDir::convertSeparators(fi.filePath()));
608
608
                lb_size->setText(tr("%1 byte(s)").arg(fi.size())); // TODO: large file support
609
609
        }
645
645
        replaceWidget(lb_accountlabel, hb);
646
646
 
647
647
        d->te = new ChatView(this);
648
 
        d->te->setTextFormat(Qt::PlainText);
 
648
        d->te->setAcceptRichText(false);
649
649
        replaceWidget(te_desc, d->te);
650
650
        setTabOrder(le_fname, d->te);
651
651
        setTabOrder(d->te, pb_stop);
813
813
                connect(d->ft, SIGNAL(statusMessage(const QString &)), SLOT(ft_statusMessage(const QString &)));
814
814
                connect(d->ft, SIGNAL(connected()), SLOT(ft_connected()));
815
815
                connect(d->ft, SIGNAL(error(int, int, const QString &)), SLOT(ft_error(int, int, const QString &)));
816
 
                d->ft->send(le_to->text(), le_fname->text(), d->te->text());
 
816
                d->ft->send(le_to->text(), le_fname->text(), d->te->getPlainText());
817
817
        }
818
818
        else {
819
819
                QString fname, savename;
850
850
                busy->start();
851
851
                lb_status->setText(tr("Accepting..."));
852
852
 
853
 
                d->t.start(30000, true);
 
853
                d->t.setSingleShot(true);
 
854
                d->t.start(30000);
854
855
 
855
856
                connect(d->ft, SIGNAL(accepted()), SLOT(ft_accepted()));
856
857
                connect(d->ft, SIGNAL(statusMessage(const QString &)), SLOT(ft_statusMessage(const QString &)));
1561
1562
        setWindowIcon(IconsetFactory::icon("psi/filemanager").icon());
1562
1563
#endif
1563
1564
 
1564
 
        QVBoxLayout *vb = new QVBoxLayout(this, 11, 6);
 
1565
        QVBoxLayout *vb = new QVBoxLayout(this);
 
1566
        vb->setSpacing(6); // FIXME: Is forced spacing really necessary?
1565
1567
        d->lv = new FileTransView(this);
1566
1568
        connect(d->lv, SIGNAL(itemCancel(int)), SLOT(itemCancel(int)));
1567
1569
        connect(d->lv, SIGNAL(itemOpenDest(int)), SLOT(itemOpenDest(int)));
1568
1570
        connect(d->lv, SIGNAL(itemClear(int)), SLOT(itemClear(int)));
1569
1571
        vb->addWidget(d->lv);
1570
 
        QHBoxLayout *hb = new QHBoxLayout(vb);
 
1572
        QHBoxLayout *hb = new QHBoxLayout;
 
1573
        vb->addLayout(hb);
1571
1574
        hb->addStretch(1);
1572
1575
        QPushButton *pb_clear = new QPushButton(tr("Clear &Finished"), this);
1573
1576
        connect(pb_clear, SIGNAL(clicked()), SLOT(clearFinished()));
1750
1753
        QString path;
1751
1754
        bool recv = (i->h->mode() == FileTransferHandler::Receiving);
1752
1755
        if(recv)
1753
 
                path = QFileInfo(i->h->saveName()).dirPath();
 
1756
                path = QFileInfo(i->h->saveName()).path();
1754
1757
        else
1755
 
                path = QFileInfo(i->h->fileName()).dirPath();
 
1758
                path = QFileInfo(i->h->fileName()).path();
1756
1759
 
1757
1760
        //printf("item open dest: [%s]\n", path.latin1());
1758
1761
}