Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, March 2007
Strange problem with QFtp


Message 1 in thread

Hi all,

So I'm writing an application to sync two directories using ftp. I wrote a
bunch of code (Qt4 btw), all of wich compiles (with mingw) all neat and
dandy. However when I run it (on a Windows 2003 Server) QFtp never progress
past command QFtp::ConnectToHost in state QFtp::Unconnected.

Just to try and see what I might have done wrong I _copied_ the
Trolltech-written example, compiled it and ran it. Nothing. It stops at the
exact same spot. No error, nothing.

Snippet of code from Synchronizer.cpp:
  ftpConnection->connectToHost("ftp.trolltech.com");  // id == 1
  ftpConnection->login();                             // id == 2
  ftpConnection->cd("qt");                            // id == 3
  ftpConnection->get("INSTALL");                      // id == 4
  ftpConnection->close();                             // id == 5
  while(ftpConnection->state()!=QFtp::Connected) {
    qDebug() << ftpConnection->state() << " - " << ftpConnection->currentCommand();
    for(int i=0; i<1000; i++) {
      for(int j=0; j<1000; j++) {
        for(int k=0; k<1000; k++) {
          ;
        }
      }
    }
  }

Here's what I included when using the Trolltech-written example:
In main.cpp
  QCoreApplication
  Synchronizer.h
In Synchronizer.h
  QObject
  QFtp
  QtNetwork
In Synchronizer.cpp
  Synchronizer.h


My questions are the following:
  Can I somehow increase verbosity?
  Do I have to include anything else for it to work?

Hope someone can help with this issue.

Best,
Christopher


--
 [ signature omitted ] 

Message 2 in thread

Starting the event-queue helps. Bah.

Mandag 12. mars 2007, skrev Christopher Rasch-Olsen Raa:
> Hi all,
>
> So I'm writing an application to sync two directories using ftp. I wrote a
> bunch of code (Qt4 btw), all of wich compiles (with mingw) all neat and
> dandy. However when I run it (on a Windows 2003 Server) QFtp never progress
> past command QFtp::ConnectToHost in state QFtp::Unconnected.
>
> Just to try and see what I might have done wrong I _copied_ the
> Trolltech-written example, compiled it and ran it. Nothing. It stops at the
> exact same spot. No error, nothing.
>
> Snippet of code from Synchronizer.cpp:
>   ftpConnection->connectToHost("ftp.trolltech.com");  // id == 1
>   ftpConnection->login();                             // id == 2
>   ftpConnection->cd("qt");                            // id == 3
>   ftpConnection->get("INSTALL");                      // id == 4
>   ftpConnection->close();                             // id == 5
>   while(ftpConnection->state()!=QFtp::Connected) {
>     qDebug() << ftpConnection->state() << " - " <<
> ftpConnection->currentCommand(); for(int i=0; i<1000; i++) {
>       for(int j=0; j<1000; j++) {
>         for(int k=0; k<1000; k++) {
>           ;
>         }
>       }
>     }
>   }
>
> Here's what I included when using the Trolltech-written example:
> In main.cpp
>   QCoreApplication
>   Synchronizer.h
> In Synchronizer.h
>   QObject
>   QFtp
>   QtNetwork
> In Synchronizer.cpp
>   Synchronizer.h
>
>
> My questions are the following:
>   Can I somehow increase verbosity?
>   Do I have to include anything else for it to work?
>
> Hope someone can help with this issue.
>
> Best,
> Christopher
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body. List archive and information:
> http://lists.trolltech.com/qt-interest/

--
 [ signature omitted ]