Merge lp:~jocke-karlsson/forssim/ftp into lp:forssim

Proposed by jocke
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jocke-karlsson/forssim/ftp
Merge into: lp:forssim
Diff against target: None lines
To merge this branch: bzr merge lp:~jocke-karlsson/forssim/ftp
Reviewer Review Type Date Requested Status
Martin Flodin Needs Fixing
Review via email: mp+7235@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Flodin (mflodin) wrote :

We need an external ftp-server before this can be committed to the main branch. It also needs more comments in the code - something we still do to little of.

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'FsWisdom/ApplicationNode.cpp'
2--- FsWisdom/ApplicationNode.cpp 2009-06-03 14:26:23 +0000
3+++ FsWisdom/ApplicationNode.cpp 2009-06-09 12:35:44 +0000
4@@ -142,10 +142,12 @@
5 quitApplicationField.reset(new QuitApplicationField);
6 keySensor->keyPress->route( quitApplicationField );
7
8+ /*This is done in ftpDownloadComplete() instead.
9 // Show the window where the user can register themselves
10 registerUserWindow.reset(new RegisterUserWindow(this));
11 registerUserWindow->setGeometry(QApplication::desktop()->availableGeometry(0));
12 registerUserWindow->showMaximized();
13+*/
14
15 databasePassword = settings->value(databasePasswordKey, "").toString();
16 settings->setValue(databasePasswordKey, databasePassword);
17@@ -162,6 +164,16 @@
18 else
19 forsDatabase.close();
20
21+ /*Set up ftp connection and cd to correct directory on server.*/
22+ ftp.reset(new QFtp(this));
23+ connect(ftp.get(), SIGNAL(commandFinished(int, bool)),
24+ this, SLOT(ftpCommandFinished(int, bool)));
25+
26+ ftp->connectToHost("10.66.5.197");
27+ ftp->login("hiq","hiqhiq");
28+ myCDcommand = ftp->cd("cases");
29+ /*Ftp download of cases is started when cd command is finished.*/
30+
31 this->restoreOverrideCursor();
32 }
33
34@@ -252,6 +264,7 @@
35 else
36 selectCaseWindow->initialize();
37
38+ //Moved to showSelectCaseWindow() so can wait until all cases are shown.
39 selectCaseWindow->setGeometry(QApplication::desktop()->availableGeometry(0));
40 selectCaseWindow->showFullScreen();
41
42@@ -259,6 +272,7 @@
43 registerUserWindow->close();
44
45 this->restoreOverrideCursor();
46+
47 }
48
49 bool ApplicationNode::getIsMirrored()
50@@ -497,3 +511,69 @@
51 {
52 this->restoreOverrideCursor();
53 }
54+
55+void ApplicationNode::ftpCommandFinished(int commandID, bool error)
56+{
57+ cout << "ApplicationNode ftpCommandFinished: " << endl;
58+
59+ cout << "state: " << ftp->state() << endl;
60+
61+ if (ftp->currentCommand() == QFtp::ConnectToHost) {
62+ if (error) {
63+ std::cout << "CommandError ConnectToHost" << std::endl;
64+ return;
65+ }
66+ std::cout << "ApplicationNode CommandFinished ConnectToHost" << std::endl;
67+ return;
68+ }
69+
70+ if (ftp->currentCommand() == QFtp::Login) {
71+ if (error) {
72+ return;
73+ }
74+ std::cout << "ApplicationNode CommandFinished Login" << std::endl;
75+ return;
76+ }
77+
78+ if (ftp->currentCommand() == QFtp::Cd) {
79+ if (error) {
80+ std::cout << "ApplicationNode CommandError CD" << std::endl;
81+ return;
82+ }
83+ std::cout << "ApplicationNode CommandFinished CD" << std::endl;
84+ if (commandID == myCDcommand)
85+ {
86+ /*Create localCaselist and serverCaseList and download cases over ftp if not already downloaded.*/
87+ localCaseList.reset(new LocalCaseList(this->getCaseDirectory(), this->getFtp()));
88+ QObject::connect(this->getLocalCaseList(), SIGNAL(downloadComplete()),
89+ this, SLOT(ftpDownloadComplete()));
90+ serverCaseList.reset(new ServerCaseList(this->getForsDatabase()));
91+ serverCaseList->syncWithLocal(*localCaseList.get());
92+ }
93+ return;
94+ }
95+}
96+
97+void ApplicationNode::ftpCommandStarted(int id)
98+{
99+ std::cout << "ApplicationNode CommandStarted: " << id << std::endl;
100+}
101+
102+void ApplicationNode::ftpDownloadComplete()
103+{
104+ cout << "ApplicationNode::ftpDownloadComplete()" << endl;
105+ // Show the window where the user can register themselves
106+ registerUserWindow.reset(new RegisterUserWindow(this));
107+ registerUserWindow->setGeometry(QApplication::desktop()->availableGeometry(0));
108+ registerUserWindow->showMaximized();
109+}
110+
111+QFtp* ApplicationNode::getFtp()
112+{
113+ return ftp.get();
114+}
115+
116+LocalCaseList* ApplicationNode::getLocalCaseList()
117+{
118+ return localCaseList.get();
119+}
120
121=== modified file 'FsWisdom/ApplicationNode.h'
122--- FsWisdom/ApplicationNode.h 2009-06-03 14:26:23 +0000
123+++ FsWisdom/ApplicationNode.h 2009-06-09 12:35:44 +0000
124@@ -24,11 +24,15 @@
125 #include "SelectCaseWindow.h"
126 #include "RemoveWisdomToothWindow.h"
127 #include "GlWindowNode.h"
128+#include "LocalCaseList.h"
129+#include "ServerCaseList.h"
130
131 #include <QDir>
132 #include <QFile>
133 #include <QFileInfo>
134 #include <QtSql/QSqlDatabase>
135+#include <QtNetwork/QFtp>
136+#include <QtNetwork/QUrlInfo>
137
138 #include <stdexcept>
139 #include <time.h>
140@@ -153,6 +157,9 @@
141 return forsDatabase;
142 }
143
144+ QFtp* getFtp();
145+ LocalCaseList* getLocalCaseList();
146+
147 public slots:
148
149 /// Quit the application
150@@ -164,13 +171,16 @@
151 /// Returns to the Register User Screen
152 void logout();
153
154-
155 /**
156 * Displays a save/exit popup
157 * Data is stored in the database. Forbidden segements are stored with their segmentID negative.
158 */
159 void exitX3DWithStandardGuiWindow();
160
161+ void ftpCommandFinished(int commandID, bool error);
162+ void ftpCommandStarted(int id);
163+ void ftpDownloadComplete();
164+
165 private:
166
167 void RouteWidgets(bool isPlayback);
168@@ -239,6 +249,12 @@
169 LoggingNode* loggingNode;
170
171 QSqlDatabase forsDatabase;
172+
173+ auto_ptr<LocalCaseList> localCaseList;
174+ auto_ptr<ServerCaseList> serverCaseList;
175+
176+ auto_ptr<QFtp> ftp;
177+ int myCDcommand;
178 };
179
180 }
181
182=== modified file 'FsWisdom/FsWisdom.pro'
183--- FsWisdom/FsWisdom.pro 2009-06-03 13:57:58 +0000
184+++ FsWisdom/FsWisdom.pro 2009-06-09 12:35:44 +0000
185@@ -8,12 +8,11 @@
186 target.path = "C:\Program files\FsWisdom"
187 INSTALLS += target
188 }
189-
190 QT += core \
191 gui \
192 opengl \
193- sql
194-
195+ sql \
196+ network
197 HEADERS += Updater_QButton_SFBoolPB.h \
198 Updater_QButton_SFFloat.h \
199 Updater_QProgressBar_PlaybackProgressBar.h \
200@@ -50,9 +49,7 @@
201 ../quazip/quazipnewinfo.h \
202 ../quazip/unzip.h \
203 ../quazip/zip.h
204-
205 INCLUDEPATH += /usr/local/boost_1_39_0
206-
207 SOURCES += Updater_QButton_SFBoolPB.cpp \
208 Updater_QButton_SFFloat.cpp \
209 Updater_QProgressBar_PlaybackProgressBar.cpp \
210@@ -86,14 +83,11 @@
211 ../quazip/quazipnewinfo.cpp \
212 ../quazip/unzip.c \
213 ../quazip/zip.c
214-
215 FORMS += RemoveWisdomToothWindow.ui \
216 RegisterUserWindow.ui \
217 SelectCaseWindow.ui \
218 RegisterUserWindow.ui
219-
220 RESOURCES +=
221-
222 LIBS += -lH3DAPI \
223 -lH3DUtil \
224 -lHAPI \
225
226=== modified file 'FsWisdom/LocalCaseList.cpp'
227--- FsWisdom/LocalCaseList.cpp 2009-05-18 11:56:11 +0000
228+++ FsWisdom/LocalCaseList.cpp 2009-06-09 12:35:44 +0000
229@@ -1,10 +1,9 @@
230 #include "LocalCaseList.h"
231-
232+using namespace std;
233 using namespace FS;
234
235-LocalCaseList::LocalCaseList(const QDir& caseDirectory, QListWidget* const listWidget)
236- : caseDirectory(caseDirectory),
237- listWidget(listWidget)
238+LocalCaseList::LocalCaseList(const QDir& caseDirectory, QFtp* Ftp)
239+ : caseDirectory(caseDirectory)
240 {
241 // build up a list of locally installed cases
242 QStringList directoryList = caseDirectory.entryList(QDir::Dirs, QDir::Name);
243@@ -19,52 +18,89 @@
244 catch(const Case::CaseException&){}
245 }
246
247- // display a sorted list of cases in the listWidget
248- listWidget->clear();
249- listWidget->addItems(getStringList());
250- listWidget->setSortingEnabled(true);
251+ this->ftp = Ftp;
252+ connect(ftp, SIGNAL(commandFinished(int, bool)),
253+ this, SLOT(ftpCommandFinished(int, bool)));
254+}
255+
256+void LocalCaseList::ftpDownload(QString fileName)
257+{
258+ cout << "LocalCaseList::ftpDownload: " << fileName.toStdString() << endl;
259+
260+ if (fileName != NULL)
261+ {
262+ fileFtp = new QFile(QDir::tempPath() + QDir::separator() + fileName);
263+ if (!fileFtp->open(QIODevice::WriteOnly)) {
264+ std::cout << "Unable to save the file" << std::endl;
265+ delete fileFtp;
266+ return;
267+ }
268+ ftp->get(fileName,fileFtp);
269+ }
270+ else
271+ {
272+ emit downloadComplete();
273+ }
274+}
275+
276+void LocalCaseList::ftpCommandFinished(int, bool error)
277+{
278+ cout << "LocalCaseList ftpCommandFinished: " << endl;
279+
280+ if (ftp->currentCommand() == QFtp::ConnectToHost) {
281+ if (error) {
282+ std::cout << "CommandError ConnectToHost" << std::endl;
283+ return;
284+ }
285+ std::cout << "LocalCaseList CommandFinished ConnectToHost" << std::endl;
286+ return;
287+ }
288+
289+ if (ftp->currentCommand() == QFtp::Login) {
290+ if (error) {
291+ return;
292+ }
293+ std::cout << "LocalCaseList CommandFinished Login" << std::endl;
294+ return;
295+ }
296+
297+ if (ftp->currentCommand() == QFtp::Get) {
298+ if (error) {
299+ std::cout << "CommandError Get" << std::endl;
300+ fileFtp->close();
301+ fileFtp->remove();
302+ delete fileFtp;
303+ } else {
304+ std::cout << "LocalCaseList CommandFinished Get: " << QFileInfo(*fileFtp).absoluteFilePath().toStdString() << std::endl;
305+ fileFtp->close();
306+ unzipFile(QFileInfo(*fileFtp).absoluteFilePath());
307+ delete fileFtp;
308+ if (ftpDownloadVector.size() > 0)
309+ {
310+ std::cout << "LocalCaseList Vector size: " << ftpDownloadVector.size() << std::endl;
311+ ftpDownload(ftpDownloadVector.back());
312+ ftpDownloadVector.pop_back();
313+ }
314+ else
315+ {
316+ std::cout << "LocalCaseList Vector size=0" << std::endl;
317+ emit downloadComplete();
318+ }
319+ }
320+ }
321 }
322
323 void LocalCaseList::addLocally(const Case& newCase, QSqlDatabase& forsDatabase)
324 {
325 // check if we actually have anything to install in the first place
326 if(!beginCaseInstallation(newCase, false))
327+ {
328 return; // nothing to install
329-
330- if(forsDatabase.open())
331+ }
332+ else
333 {
334- std::cout << "Installing locally the case: " << newCase << std::endl;
335-
336- QSqlQuery query;
337-
338- // read file from server
339- query.prepare("select archiveFile from forsCase left join forsCaseVersion on forsCase.forsCaseId = forsCaseVersion.forsCaseId where name = :name && version = :version;");
340- query.bindValue(":name",newCase.getName());
341- query.bindValue(":version",newCase.getVersion());
342- if(query.exec())
343- {
344- query.next();
345- QByteArray byteArray = query.value(0).toByteArray();
346-
347- QFile file(QDir::tempPath() + QDir::separator() + newCase.getFileArchiveName());
348- if (file.open(QIODevice::WriteOnly))
349- {
350- file.write(byteArray);
351- file.close();
352- std::cout << "File added to temp: " << QFileInfo(file).absoluteFilePath().toStdString() << std::endl;
353-
354- unzipFile(QFileInfo(file).absoluteFilePath());
355- }
356- else
357- std::cout << "Failed to write to file: " << QFileInfo(file).absoluteFilePath().toStdString() << std::endl;
358- }
359- else
360- std::cout << "Failed to read archive file from server: " << newCase << std::endl;
361-
362- forsDatabase.close();
363+ ftpDownloadVector.push_back(newCase.getFileArchiveName());
364 }
365- else
366- std::cout << "Couldn't install case: " << newCase << " due to failure to connect to database"<< std::endl;
367 }
368
369 void LocalCaseList::addLocally(const QDir& archiveFilePath)
370@@ -89,8 +125,9 @@
371 }
372
373 /*
374- * returns true if we need to install this case. updates the map with this new case and updates the list widget.
375- * also removes the old directory and creates the new directory which should then be filled
376+ * Returns true if we need to install this case. Updates the map with this new case.
377+ * OBS: The list widget is updated and populated in SelectCaseWindow::initialize().
378+ * removes the old directory and creates the new directory which should then be filled.
379 */
380 bool LocalCaseList::beginCaseInstallation(const Case& newCase, bool ignoreVersion)
381 {
382@@ -112,16 +149,6 @@
383 if(!removeDirectory(directory))
384 throw LocalCaseListException("Failed to remove previous case directory");
385
386- // find entry in listWidget and remove it
387- for(int i = 0; i < listWidget->count();i++ )
388- if(listWidget->item(i)->text() == ((*localCase).second).getDirectoryName())
389- {
390- QListWidgetItem *listWidgetItem = listWidget->takeItem(i);
391- delete listWidgetItem;
392- break;
393- }
394-
395- // remove from map also
396 erase(localCase);
397 }
398 else
399@@ -134,7 +161,6 @@
400 std::cout << "Case not previously installed" << std::endl;
401
402 insert(begin(), std::pair<QString, Case>(newCase.getName(), newCase));
403- listWidget->addItem(newCase.getDirectoryName());
404
405 // create the new case directory within the cases directory
406 if(!caseDirectory.mkdir(caseDirectory.path() + QDir::separator() + newCase.getDirectoryName()))
407@@ -145,6 +171,7 @@
408
409 void LocalCaseList::unzipFile(const QDir& zipFilePath)
410 {
411+ std::cout << "Start unzip of: " << zipFilePath.path().toStdString() << std::endl;
412 QuaZip zip(zipFilePath.path());
413 if(!zip.open(QuaZip::mdUnzip))
414 throw LocalCaseListException("Failed to open file archive"); // zip.getZipError()
415@@ -226,7 +253,7 @@
416 return(isSuccessful);
417 }
418
419-bool LocalCaseList::getX3dFilePathForSelectedRow(QDir& x3dFilePathForSelectedRow)
420+bool LocalCaseList::getX3dFilePathForSelectedRow(QDir& x3dFilePathForSelectedRow, QListWidget* const listWidget)
421 {
422 int currentlySelectedRowIndex = listWidget->currentRow();
423
424@@ -240,9 +267,10 @@
425 return false;
426 }
427
428-const Case LocalCaseList::getCaseForSelectedRow()
429+const Case LocalCaseList::getCaseForSelectedRow(QListWidget* const listWidget)
430 {
431 int currentlySelectedRowIndex = listWidget->currentRow();
432+ std::cout << "getCaseForSelectedRow: " << listWidget->item(currentlySelectedRowIndex)->text().toStdString() << std::endl;
433 return Case(listWidget->item(currentlySelectedRowIndex)->text());
434 }
435
436
437=== modified file 'FsWisdom/LocalCaseList.h'
438--- FsWisdom/LocalCaseList.h 2009-05-18 11:56:11 +0000
439+++ FsWisdom/LocalCaseList.h 2009-06-09 12:35:44 +0000
440@@ -15,21 +15,31 @@
441 #include <QtSql/QSqlDatabase>
442 #include <QtSql/QSqlQuery>
443
444+#include <QFile>
445+#include <QFileInfo>
446+#include <QtNetwork/QFtp>
447+#include <QtNetwork/QUrlInfo>
448 #include <iostream>
449 #include <stdexcept>
450+#include <memory>
451+#include <vector>
452
453 #include "../quazip/quazip.h"
454 #include "../quazip/quazipfile.h"
455
456+
457 namespace FS
458 {
459
460-class LocalCaseList : public CaseList
461+class LocalCaseList : public QObject, public CaseList
462 {
463+public:
464+ Q_OBJECT
465+
466 private:
467 const QDir& caseDirectory;
468 public:
469- LocalCaseList(const QDir& caseDirectory, QListWidget* const listWidget);
470+ LocalCaseList(const QDir& caseDirectory, QFtp* Ftp);
471
472 // This will delete any version of this case if it exists and replace it with that
473 // referenced to via
474@@ -40,8 +50,11 @@
475
476 void addLocally(const QDir& archiveFilePath);
477 void addLocally(const Case& newCase, QSqlDatabase& forsDatabase);
478- bool getX3dFilePathForSelectedRow(QDir& x3dFilePathForSelectedRow);
479- const Case getCaseForSelectedRow();
480+ bool getX3dFilePathForSelectedRow(QDir& x3dFilePathForSelectedRow, QListWidget* const listWidget);
481+ const Case getCaseForSelectedRow(QListWidget* const listWidget);
482+
483+ void ftpDownload(QString fileName);
484+ std::vector<QString> ftpDownloadVector;
485
486 /**
487 * Run time exception class for LocalCaseList
488@@ -59,6 +72,12 @@
489 }
490 };
491
492+signals:
493+ void downloadComplete();
494+
495+private slots:
496+ void ftpCommandFinished(int, bool error);
497+
498 private:
499 /**
500 * returns a string list with the directory name of each case stored herein
501@@ -66,10 +85,12 @@
502 */
503 QStringList getStringList() const;
504 bool removeDirectory(QDir &directory);
505- QListWidget* const listWidget;
506
507 bool beginCaseInstallation(const Case& newCase, bool ignoreVersion);
508 void unzipFile(const QDir& zipFilePath);
509+
510+ QFtp* ftp;
511+ QFile *fileFtp;
512 };
513
514 }
515
516=== modified file 'FsWisdom/SelectCaseWindow.cpp'
517--- FsWisdom/SelectCaseWindow.cpp 2009-05-28 13:25:00 +0000
518+++ FsWisdom/SelectCaseWindow.cpp 2009-06-09 12:35:44 +0000
519@@ -53,12 +53,16 @@
520
521 void SelectCaseWindow::initialize()
522 {
523- // QString usernameLabel = "Username: " + applicationNode->getUsername();
524- // ui.userNameLabel->setText(usernameLabel);
525+ //Downloading of usecases is already done. Populate list-widget.
526+ ui.caseListWidget->clear();
527+ map<QString, Case>::iterator it = applicationNode->getLocalCaseList()->begin();
528+ for(it=applicationNode->getLocalCaseList()->begin(); it!=applicationNode->getLocalCaseList()->end(); it++)
529+ {
530+ cout << "SelectCaseWindow::initialize(): "<< ((*it).second).getDirectoryName().toStdString() << endl;
531+ ui.caseListWidget->addItem(((*it).second).getDirectoryName());
532+ }
533
534- localCaseList.reset(new LocalCaseList(applicationNode->getCaseDirectory(), ui.caseListWidget));
535- serverCaseList.reset(new ServerCaseList(applicationNode->getForsDatabase()));
536- serverCaseList->syncWithLocal(*localCaseList.get());
537+ ui.caseListWidget->setSortingEnabled(true);
538 }
539
540 SelectCaseWindow::~SelectCaseWindow()
541@@ -118,8 +122,8 @@
542 applicationNode->processEvents();
543
544 // if a file is selected
545- if(!fileName.isEmpty())
546- localCaseList->addLocally(QDir(fileName));
547+// if(!fileName.isEmpty())
548+ // localCaseList->addLocally(QDir(fileName));
549
550 applicationNode->restoreNormalCursor();
551 }
552@@ -137,13 +141,13 @@
553 void SelectCaseWindow::launchCase(bool isPlayback)
554 {
555 QDir x3dFilePath;
556- if(localCaseList->getX3dFilePathForSelectedRow(x3dFilePath))
557+ if(applicationNode->getLocalCaseList()->getX3dFilePathForSelectedRow(x3dFilePath, ui.caseListWidget))
558 {
559 int forsCaseVersionId = -1;
560
561 if(applicationNode->getForsDatabase().open())
562 {
563- const Case& selectedCase = localCaseList->getCaseForSelectedRow();
564+ const Case& selectedCase = applicationNode->getLocalCaseList()->getCaseForSelectedRow(ui.caseListWidget);
565
566 QSqlQuery query;
567 query.prepare("select forsCaseVersionId from forsCase left join forsCaseVersion on forsCase.forsCaseId = forsCaseVersion.forsCaseId where name = :name && version = :version;");
568@@ -176,7 +180,7 @@
569
570 if(applicationNode->getForsDatabase().open())
571 {
572- const Case& selectedCase = localCaseList->getCaseForSelectedRow();
573+ const Case& selectedCase = applicationNode->getLocalCaseList()->getCaseForSelectedRow(ui.caseListWidget);
574
575 QSqlQuery query;
576
577@@ -217,7 +221,7 @@
578 QStringList stringList;
579 if(applicationNode->getForsDatabase().open())
580 {
581- const Case& selectedCase = localCaseList->getCaseForSelectedRow();
582+ const Case& selectedCase = applicationNode->getLocalCaseList()->getCaseForSelectedRow(ui.caseListWidget);
583
584 QSqlQuery query;
585 query.prepare("select dateAdded from userCase join user on user.userId = userCase.userId join forsCaseVersion on userCase.forsCaseVersionId = forsCaseVersion.forsCaseVersionId join forsCase on forsCase.forsCaseId = forsCaseVersion.forsCaseId where forsCase.name = :caseName && user.name = :userName;");
586@@ -241,7 +245,8 @@
587 {
588 if(applicationNode->getForsDatabase().open())
589 {
590- const Case& selectedCase = localCaseList->getCaseForSelectedRow();
591+ const Case& selectedCase = applicationNode->getLocalCaseList()->getCaseForSelectedRow(ui.caseListWidget);
592+
593
594 QSqlQuery query;
595 query.prepare("select anamnes from forsCaseVersion join forsCase on forsCase.forsCaseId = forsCaseVersion.forsCaseId where forsCase.name = :caseName;");
596@@ -259,7 +264,7 @@
597 {
598 if(applicationNode->getForsDatabase().open())
599 {
600- const Case& selectedCase = localCaseList->getCaseForSelectedRow();
601+ const Case& selectedCase = applicationNode->getLocalCaseList()->getCaseForSelectedRow(ui.caseListWidget);
602
603 QSqlQuery query;
604 query.prepare("select objectives from forsCaseVersion join forsCase on forsCase.forsCaseId = forsCaseVersion.forsCaseId where forsCase.name = :caseName;");
605
606=== modified file 'FsWisdom/ServerCaseList.cpp'
607--- FsWisdom/ServerCaseList.cpp 2009-05-14 15:35:49 +0000
608+++ FsWisdom/ServerCaseList.cpp 2009-06-09 12:35:44 +0000
609@@ -34,4 +34,21 @@
610 // b) install the latest version of the case locally
611 for(serverCase=begin(); serverCase!=end(); serverCase++)
612 localCaseList.addLocally(Case(((*serverCase).second).getName(), ((*serverCase).second).getVersion()), forsDatabase);
613+
614+ //Start download over ftp.
615+ if (localCaseList.ftpDownloadVector.size() != 0)
616+ {
617+ std::vector<QString>::iterator it ;
618+ for(it=localCaseList.ftpDownloadVector.begin(); it!=localCaseList.ftpDownloadVector.end(); it++)
619+ std::cout << "ftpDownloadVector: " << (*it).toStdString() << std::endl;
620+
621+ QString temp = localCaseList.ftpDownloadVector.back();
622+ localCaseList.ftpDownloadVector.pop_back();
623+ localCaseList.ftpDownload(temp);
624+ }
625+ else
626+ {
627+ localCaseList.ftpDownload(NULL);
628+ }
629+
630 }
631
632=== modified file 'FsWisdom/ServerCaseList.h'
633--- FsWisdom/ServerCaseList.h 2009-05-14 15:35:49 +0000
634+++ FsWisdom/ServerCaseList.h 2009-06-09 12:35:44 +0000
635@@ -14,6 +14,7 @@
636 #include <QtSql/QSqlDatabase>
637 #include <QtSql/QSqlQuery>
638 #include <QtSql/QSqlError>
639+#include <vector>
640
641 namespace FS
642 {

Subscribers

People subscribed via source and target branches

to all changes: