Révision f68f673d
original.cpp | ||
---|---|---|
543 | 543 |
m_ftp->mkdir(ui->leFTPDirectory->text()); |
544 | 544 |
m_ftp->mkdir(ui->leFTPDirectory->text() + "/galleries"); |
545 | 545 |
|
546 |
|
|
547 |
|
|
548 |
//On uploade l'album en cours |
|
549 |
//m_ftp->put() |
|
550 |
|
|
551 |
m_currentFTPFileUpload = 0; |
|
552 |
|
|
546 | 553 |
} |
547 | 554 |
|
548 | 555 |
void original::ftpCommandFinished(int commandId, bool error) |
... | ... | |
560 | 567 |
m_ftp->list(); |
561 | 568 |
} |
562 | 569 |
|
570 |
if (m_ftp->currentCommand() == QFtp::Put) { |
|
571 |
qDebug() << "Put ..."; |
|
572 |
//on passe au suivant |
|
573 |
on_btnPHP_clicked(); |
|
574 |
} |
|
575 |
|
|
563 | 576 |
if (m_ftp->currentCommand() == QFtp::Get) { |
564 | 577 |
qDebug() << "Get ..."; |
565 | 578 |
if (error) { |
... | ... | |
574 | 587 |
{ |
575 | 588 |
qDebug() << urlInfo.name(); |
576 | 589 |
} |
590 |
|
|
591 |
void original::updateDataTransferProgress(qint64 readBytes, qint64 totalBytes) |
|
592 |
{ |
|
593 |
qDebug() << "Transfert: " << readBytes << " sur " << totalBytes; |
|
594 |
} |
|
595 |
|
|
596 |
void original::on_btnPHP_clicked() |
|
597 |
{ |
|
598 |
//On uploade le code php |
|
599 |
m_ftp->cd(ui->leFTPDirectory->text()); |
|
600 |
QDir dir(m_baseDir.absolutePath() + "/www"); |
|
601 |
dir.setFilter(QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot); |
|
602 |
QFileInfoList list = dir.entryInfoList(); |
|
603 |
if(m_currentFTPFileUpload < list.count()) { |
|
604 |
qDebug() << "Upload ... " << list.at(m_currentFTPFileUpload).fileName(); |
|
605 |
QFile *fic = new QFile(list.at(m_currentFTPFileUpload).absoluteFilePath()); |
|
606 |
fic->open(QIODevice::ReadOnly); |
|
607 |
m_ftp->put(fic,list.at(m_currentFTPFileUpload).fileName()); |
|
608 |
fic->close(); |
|
609 |
m_currentFTPFileUpload++; |
|
610 |
} |
|
611 |
|
|
612 |
} |
original.h | ||
---|---|---|
69 | 69 |
void ftpCommandFinished(int commandId, bool error); |
70 | 70 |
void addToList(const QUrlInfo &urlInfo); |
71 | 71 |
// void processItem(QTreeWidgetItem *item, int column); |
72 |
// void updateDataTransferProgress(qint64 readBytes, |
|
73 |
// qint64 totalBytes); |
|
72 |
void updateDataTransferProgress(qint64 readBytes, |
|
73 |
qint64 totalBytes); |
|
74 |
|
|
75 |
void on_btnPHP_clicked(); |
|
74 | 76 |
|
75 | 77 |
private: |
76 | 78 |
Ui::original *ui; |
... | ... | |
79 | 81 |
QLabel *m_labelDeposez; |
80 | 82 |
QString m_currentProjectDir; |
81 | 83 |
int m_currentProjectPictureNumber; |
84 |
int m_currentFTPFileUpload; |
|
82 | 85 |
QFtp *m_ftp; |
83 | 86 |
|
84 | 87 |
}; |
original.ui | ||
---|---|---|
270 | 270 |
</property> |
271 | 271 |
</widget> |
272 | 272 |
</item> |
273 |
<item row="4" column="3"> |
|
274 |
<widget class="QPushButton" name="btnPHP"> |
|
275 |
<property name="text"> |
|
276 |
<string>PHP</string> |
|
277 |
</property> |
|
278 |
</widget> |
|
279 |
</item> |
|
273 | 280 |
</layout> |
274 | 281 |
</widget> |
275 | 282 |
</widget> |
Formats disponibles : Unified diff