jyz93
Messages postés3Date d'inscriptionsamedi 21 mars 2009StatutMembreDernière intervention27 janvier 2010
-
11 juin 2009 à 12:56
jyz93
Messages postés3Date d'inscriptionsamedi 21 mars 2009StatutMembreDernière intervention27 janvier 2010
-
18 juin 2009 à 00:16
Bonjour a tous,
Voila Je suis en train de programmé un client
ftp et j'ai besoin d'obtenir l'arborescence du serveur sur lequel je
suis connecté afin de pouvoir modifié mon site ect...
Je travail en
C++ avec Qt. J'ai vu la méthode QFtp::list(); le problème c'est que je
ne vois pas comment l'utilisé etant donné qu'elle retourne un int :s
J'aimerais par la suite placé mon arborecense dans une architecture mvc avec une vue de type QTreeView.
SebLinck
Messages postés212Date d'inscriptionmardi 17 mai 2005StatutMembreDernière intervention23 juin 2011 16 juin 2009 à 16:34
int QFtp::list ( const QString & dir = QString() )
Lists the contents of directory dir on the FTP server. If dir is empty, it lists the contents of the current directory.
The listInfo() signal is emitted for each directory entry found.
The function does not block and returns immediately. The command is
scheduled, and its execution is performed asynchronously. The function
returns a unique identifier which is passed by commandStarted() and commandFinished().
When the command is started the commandStarted() signal is emitted. When it is finished the commandFinished() signal is emitted.
QWidget *widget = new QWidget;
QGridLayout layout_1 = new QGridLayout;
layout_1->addWidget(fileList, 3, 0); //Je place mon QTreeWidget dans ma fenêtre via un layout
widget->setLayout(layout_1);
connect(ftp, SIGNAL(commandFinished(int, bool)), this, SLOT(commandefini(int, bool)));
connect(ftp, SIGNAL(listInfo(QUrlInfo)), this, SLOT(arbo(QUrlInfo))); //connexion des signaux avec les slots...
connect(connexion,SIGNAL(clicked()),qApp,SLOT(connect1()));
if (ftp->currentCommand() == 3) //Une fois que connectToHost se termine, je lance ftp->list();
{
if (i2)
{
ftp->close();
}
else
{
int id = ftp->list();
qDebug()<< id << ftp->state();
}
}
id vaut 3 or il devrait valoir 6, valeur de ftp->list(); et non 3 la valeur de ftp->connectToHost();
Cela a donc pour effet de ne pas lancé mon slot arbo...