summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-02-12 17:03:45 -0500
committerJason A. Donenfeld <Jason@zx2c4.com>2011-02-12 17:03:45 -0500
commita2999d1ff3c9ca7500c58ca2232072f51272b919 (patch)
tree0ff5476459b69522663967c693394ad8e4cafce4
parentInitial version. (diff)
downloadoldgen-zmusicuploader-a2999d1ff3c9ca7500c58ca2232072f51272b919.tar.xz
oldgen-zmusicuploader-a2999d1ff3c9ca7500c58ca2232072f51272b919.zip
Nicer messages.
-rw-r--r--Uploader.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/Uploader.cpp b/Uploader.cpp
index 3ea5678..d915d04 100644
--- a/Uploader.cpp
+++ b/Uploader.cpp
@@ -24,6 +24,7 @@ Uploader::Uploader(const QString &ftpServer, const QString &ftpPath, const QStri
}
void Uploader::begin()
{
+ cerr << "Connecting." << endl;
m_ftp.connectToHost(m_ftpServer);
}
void Uploader::stateChanged(int state)
@@ -31,6 +32,7 @@ void Uploader::stateChanged(int state)
switch (state) {
case QFtp::Connected:
cerr << "Connected." << endl;
+ cerr << "Logging in." << endl;
m_ftp.login(m_username, m_password);
break;
case QFtp::LoggedIn:
@@ -38,16 +40,16 @@ void Uploader::stateChanged(int state)
m_cdCommand = m_ftp.cd(m_ftpPath);
break;
case QFtp::Unconnected:
- cerr << "Unconnected" << endl;
+ cerr << "Unconnected." << endl;
break;
case QFtp::HostLookup:
- cerr << "Looking up host" << endl;
+ cerr << "Looking up host." << endl;
break;
case QFtp::Connecting:
- cerr << "Connecting" << endl;
+ cerr << "Connecting." << endl;
break;
case QFtp::Closing:
- cerr << "Closing" << endl;
+ cerr << "Closing." << endl;
emit done();
break;
}
@@ -64,9 +66,11 @@ void Uploader::commandFinished(int id, bool error)
emit done();
return;
}
- if (id == m_cdCommand)
+
+ if (id == m_cdCommand) {
+ cerr << "Listing." << endl;
m_latestCommand = m_ftp.list();
- if (id == m_latestCommand) {
+ } else if (id == m_latestCommand) {
if (!m_fileList.size()) {
cerr << "No files to upload." << endl;
emit done();
@@ -74,8 +78,7 @@ void Uploader::commandFinished(int id, bool error)
}
m_listPosition = m_fileList.constBegin();
uploadNextFile();
- }
- if (id == m_latestPut) {
+ } else if (id == m_latestPut) {
cerr << endl;
uploadNextFile();
}