summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-29 10:15:34 (UTC)
committer zautrix <zautrix>2005-07-29 10:15:34 (UTC)
commit43a46672f4212c9617c753e0aa591f781d2e5240 (patch) (unidiff)
treec91a20a73aa042735e3e7141e443ae7d2bffc148
parent8feb7e617f1aa5cd5bb04d9a69d05409c3c4c60d (diff)
downloadkdepimpi-43a46672f4212c9617c753e0aa591f781d2e5240.zip
kdepimpi-43a46672f4212c9617c753e0aa591f781d2e5240.tar.gz
kdepimpi-43a46672f4212c9617c753e0aa591f781d2e5240.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--libkdepim/ksyncmanager.cpp8
2 files changed, 10 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 8264410..fd29b51 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,100 +1,103 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.1.18 ************ 3********** VERSION 2.1.18 ************
4 4
5Pi-Sync mode:
6The "Write back file" status dialog was updated too often such that writing back the file on the Z was very slow. Fixed.
7
5KO/Pi: 8KO/Pi:
6 9
7 10
8********** VERSION 2.1.17 ************ 11********** VERSION 2.1.17 ************
9 12
10KO/Pi: 13KO/Pi:
11Added option to display times in What's Next View on two lines. 14Added option to display times in What's Next View on two lines.
12(Useful for display on the Zaurus with 240x320 screen) 15(Useful for display on the Zaurus with 240x320 screen)
13Removed "Allday" for allday events of one day duration in What's Next View. 16Removed "Allday" for allday events of one day duration in What's Next View.
14Added date range for allday events of more than one day duration in What's Next View. 17Added date range for allday events of more than one day duration in What's Next View.
15Fixed two problems in the data importing from Outlook: 18Fixed two problems in the data importing from Outlook:
16 Fixed the duplicated import if the summary, location or description had whitespaces at the end. 19 Fixed the duplicated import if the summary, location or description had whitespaces at the end.
17 Fixed a problem importing certain recurrence rules. 20 Fixed a problem importing certain recurrence rules.
18 21
19A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file). 22A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file).
20If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it. 23If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it.
21 24
22And some minor fixes in KO/Pi. 25And some minor fixes in KO/Pi.
23 26
24Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ). 27Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ).
25 28
26 29
27********** VERSION 2.1.16 ************ 30********** VERSION 2.1.16 ************
28 31
29Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. 32Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus.
30Added columns for datetime in todo view: Last modified, created and last modified subtodo 33Added columns for datetime in todo view: Last modified, created and last modified subtodo
31Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. 34Fixed a bug in agenda view displaying recurring multiday events which are longer than two days.
32Made conflict detection up to 4 times faster. 35Made conflict detection up to 4 times faster.
33 36
34********** VERSION 2.1.15 ************ 37********** VERSION 2.1.15 ************
35 38
36Fixed two layout problems on the Z: 39Fixed two layout problems on the Z:
37Made the with of the newly added buttons on the Quick-Todo smaller. 40Made the with of the newly added buttons on the Quick-Todo smaller.
38Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. 41Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible.
39 42
40 43
41********** VERSION 2.1.14 ************ 44********** VERSION 2.1.14 ************
42 45
43Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done. 46Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done.
44Added a button to add a subtodo quickly. 47Added a button to add a subtodo quickly.
45 48
46Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). 49Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ).
47Added an option to change the layout of the list week to column mode. 50Added an option to change the layout of the list week to column mode.
48 51
49Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. 52Fixed some usability problems in pi-sync mode by adding some progress information about file transfer.
50 53
51Fixed pi-sync problems with the new multi calendar feature. 54Fixed pi-sync problems with the new multi calendar feature.
52Now pi-sync behaviour should be: 55Now pi-sync behaviour should be:
531) Local sends file request ( as usual ) 561) Local sends file request ( as usual )
542) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. 572) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars.
553) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). 583) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ).
56 If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. 59 If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar.
574) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. 604) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote.
58 If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. 61 If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar.
59 62
60Summary: 63Summary:
61No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner. 64No new item ( new created after the last sync ) in a disabled calendar is propagated to the sync partner. Readonly items are synced and added/changed on the sync partner if it is not readonly on the sync partner.
62If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour. 65If you have different calendars on remote and local and some of them disabled you may get some "strange" bahaviour.
63Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars. 66Well, the syncing has become quite complicated ... you should have no problems if you enable all calendars.
64 67
65********** VERSION 2.1.13 ************ 68********** VERSION 2.1.13 ************
66 69
67Fixed a problem in KA/Pi search. 70Fixed a problem in KA/Pi search.
68Fixed some minor problems in KO/Pi. 71Fixed some minor problems in KO/Pi.
69Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. 72Added calendar selection possibility to the todo view popup and to the event/todo/journal editor.
70 73
71Fixed memory usage problems in KA/Pi: 74Fixed memory usage problems in KA/Pi:
72When loading data KA/Pi did load the file data twice. 75When loading data KA/Pi did load the file data twice.
73Example: 76Example:
74 A 600k file did consume 1200k memory during loading process. 77 A 600k file did consume 1200k memory during loading process.
75 This is fixed, it does now consume only 600k during loading process. 78 This is fixed, it does now consume only 600k during loading process.
76When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. 79When saving data KA/Pi did consume a lot of memory for the data parsing during the save process.
77This is fixed. 80This is fixed.
78Example: 81Example:
79 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. 82 Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram.
80 When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. 83 When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system.
81 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. 84 Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process.
82Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. 85Note: The memory usage of KA/Pi after the data is loaded/saved has not changed.
83The saving of data may be a bit slower now. 86The saving of data may be a bit slower now.
84 87
85Fixed memory usage problems in KO/Pi: 88Fixed memory usage problems in KO/Pi:
86When KO/Pi did save the data to file, it did not release the used buffers after saving. 89When KO/Pi did save the data to file, it did not release the used buffers after saving.
87The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. 90The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation.
88This is fixed. 91This is fixed.
89Example: 92Example:
90 When saving a 400k file KO/Pi do now use 400k less memory now. 93 When saving a 400k file KO/Pi do now use 400k less memory now.
91 94
92Optimized memory usage in KO/Pi Agenda view: 95Optimized memory usage in KO/Pi Agenda view:
93KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. 96KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view.
94These buffers were not made smaller (i.e. downsized) because of performance reasons. 97These buffers were not made smaller (i.e. downsized) because of performance reasons.
95The handling of these buffers are now much smarter: 98The handling of these buffers are now much smarter:
96Two (of six) buffers are removed completely. 99Two (of six) buffers are removed completely.
97The remaing four buffers are now downsized after not using the agenda view for 45 seconds. 100The remaing four buffers are now downsized after not using the agenda view for 45 seconds.
98Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi. 101Such that the memory usage of KO/Pi is smaller now in general ( because 2 buffers are removed) and is much smaller when not using the agenda view. That is very important when using fastload for KO/Pi.
99 102
100Worst case example ( for a maximum size agenda content): 103Worst case example ( for a maximum size agenda content):
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index f2ee0ab..2a75bfb 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1473,197 +1473,203 @@ KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host,
1473 tlw = cap; 1473 tlw = cap;
1474 mRetVal = quiet; 1474 mRetVal = quiet;
1475 mTimerSocket = new QTimer ( this ); 1475 mTimerSocket = new QTimer ( this );
1476 connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( updateConnectDialog() ) ); 1476 connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( updateConnectDialog() ) );
1477 mConnectProgress.setCaption( i18n("Pi-Sync") ); 1477 mConnectProgress.setCaption( i18n("Pi-Sync") );
1478 connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) ); 1478 connect( &mConnectProgress, SIGNAL ( cancelled () ), this, SLOT ( deleteSocket() ) );
1479 mConnectCount = -1; 1479 mConnectCount = -1;
1480} 1480}
1481void KCommandSocket::sendFileRequest() 1481void KCommandSocket::sendFileRequest()
1482{ 1482{
1483 if ( tlw ) 1483 if ( tlw )
1484 tlw->setCaption( i18n("Connected! Sending request for remote file ...") ); 1484 tlw->setCaption( i18n("Connected! Sending request for remote file ...") );
1485 mConnectProgress.hide(); 1485 mConnectProgress.hide();
1486 mConnectCount = 300;mConnectMax = 300; 1486 mConnectCount = 300;mConnectMax = 300;
1487 mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") ); 1487 mConnectProgress.setCaption( i18n("Pi-Sync: Connected!") );
1488 mTimerSocket->start( 100, true ); 1488 mTimerSocket->start( 100, true );
1489 QTextStream os( mSocket ); 1489 QTextStream os( mSocket );
1490 os.setEncoding( QTextStream::Latin1 ); 1490 os.setEncoding( QTextStream::Latin1 );
1491 1491
1492 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); 1492 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate );
1493 os << "GET " << mPassWord << curDt <<"\r\n\r\n"; 1493 os << "GET " << mPassWord << curDt <<"\r\n\r\n";
1494} 1494}
1495 1495
1496void KCommandSocket::readFile( QString fn ) 1496void KCommandSocket::readFile( QString fn )
1497{ 1497{
1498 if ( !mSocket ) { 1498 if ( !mSocket ) {
1499 mSocket = new QSocket( this ); 1499 mSocket = new QSocket( this );
1500 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); 1500 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) );
1501 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1501 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1502 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() )); 1502 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() ));
1503 } 1503 }
1504 mFileString = ""; 1504 mFileString = "";
1505 mFileName = fn; 1505 mFileName = fn;
1506 mFirst = true; 1506 mFirst = true;
1507 if ( tlw ) 1507 if ( tlw )
1508 tlw->setCaption( i18n("Trying to connect to remote...") ); 1508 tlw->setCaption( i18n("Trying to connect to remote...") );
1509 mConnectCount = 30;mConnectMax = 30; 1509 mConnectCount = 30;mConnectMax = 30;
1510 mTimerSocket->start( 1000, true ); 1510 mTimerSocket->start( 1000, true );
1511 mSocket->connectToHost( mHost, mPort ); 1511 mSocket->connectToHost( mHost, mPort );
1512 qDebug("KSS: Waiting for connection"); 1512 qDebug("KSS: Waiting for connection");
1513} 1513}
1514void KCommandSocket::updateConnectDialog() 1514void KCommandSocket::updateConnectDialog()
1515{ 1515{
1516 1516
1517 if ( mConnectCount == mConnectMax ) { 1517 if ( mConnectCount == mConnectMax ) {
1518 //qDebug("MAXX %d", mConnectMax); 1518 //qDebug("MAXX %d", mConnectMax);
1519 mConnectProgress.setTotalSteps ( 30 ); 1519 mConnectProgress.setTotalSteps ( 30 );
1520 mConnectProgress.show(); 1520 mConnectProgress.show();
1521 mConnectProgress.setLabelText( i18n("Trying to connect to remote...") ); 1521 mConnectProgress.setLabelText( i18n("Trying to connect to remote...") );
1522 } 1522 }
1523 //qDebug("updateConnectDialog() %d", mConnectCount); 1523 //qDebug("updateConnectDialog() %d", mConnectCount);
1524 mConnectProgress.raise(); 1524 mConnectProgress.raise();
1525 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 ); 1525 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 );
1526 --mConnectCount; 1526 --mConnectCount;
1527 if ( mConnectCount > 0 ) 1527 if ( mConnectCount > 0 )
1528 mTimerSocket->start( 1000, true ); 1528 mTimerSocket->start( 1000, true );
1529 else 1529 else
1530 deleteSocket(); 1530 deleteSocket();
1531 1531
1532} 1532}
1533void KCommandSocket::writeFile( QString fileName ) 1533void KCommandSocket::writeFile( QString fileName )
1534{ 1534{
1535 if ( !mSocket ) { 1535 if ( !mSocket ) {
1536 mSocket = new QSocket( this ); 1536 mSocket = new QSocket( this );
1537 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1537 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1538 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) ); 1538 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) );
1539 } 1539 }
1540 mFileName = fileName ; 1540 mFileName = fileName ;
1541 mConnectCount = 30;mConnectMax = 30; 1541 mConnectCount = 30;mConnectMax = 30;
1542 mTimerSocket->start( 1000, true ); 1542 mTimerSocket->start( 1000, true );
1543 mSocket->connectToHost( mHost, mPort ); 1543 mSocket->connectToHost( mHost, mPort );
1544} 1544}
1545void KCommandSocket::writeFileToSocket() 1545void KCommandSocket::writeFileToSocket()
1546{ 1546{
1547 mTimerSocket->stop(); 1547 mTimerSocket->stop();
1548 QFile file2( mFileName ); 1548 QFile file2( mFileName );
1549 if (!file2.open( IO_ReadOnly ) ) { 1549 if (!file2.open( IO_ReadOnly ) ) {
1550 mConnectProgress.hide(); 1550 mConnectProgress.hide();
1551 mConnectCount = -1; 1551 mConnectCount = -1;
1552 mRetVal= errorW; 1552 mRetVal= errorW;
1553 mSocket->close(); 1553 mSocket->close();
1554 if ( mSocket->state() == QSocket::Idle ) 1554 if ( mSocket->state() == QSocket::Idle )
1555 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1555 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1556 return ; 1556 return ;
1557 } 1557 }
1558 mConnectProgress.setTotalSteps ( file2.size() ); 1558 mConnectProgress.setTotalSteps ( file2.size() );
1559 mConnectProgress.show(); 1559 mConnectProgress.show();
1560 int count = 0; 1560 int count = 0;
1561 mConnectProgress.setLabelText( i18n("Sending back synced file...") ); 1561 mConnectProgress.setLabelText( i18n("Sending back synced file...") );
1562 mConnectProgress.setProgress( count ); 1562 mConnectProgress.setProgress( count );
1563 mConnectProgress.blockSignals( true ); 1563 mConnectProgress.blockSignals( true );
1564 QTextStream ts2( &file2 ); 1564 QTextStream ts2( &file2 );
1565 ts2.setEncoding( QTextStream::Latin1 ); 1565 ts2.setEncoding( QTextStream::Latin1 );
1566 QTextStream os2( mSocket ); 1566 QTextStream os2( mSocket );
1567 os2.setEncoding( QTextStream::Latin1 ); 1567 os2.setEncoding( QTextStream::Latin1 );
1568 os2 << "PUT " << mPassWord << "\r\n\r\n";; 1568 os2 << "PUT " << mPassWord << "\r\n\r\n";;
1569 int byteCount = 0;
1570 int byteMax = file2.size()/53;
1569 while ( ! ts2.atEnd() ) { 1571 while ( ! ts2.atEnd() ) {
1570 qApp->processEvents(); 1572 qApp->processEvents();
1571 mConnectProgress.setProgress( count ); 1573 if ( byteCount > byteMax ) {
1574 byteCount = 0;
1575 mConnectProgress.setProgress( count );
1576 }
1572 QString temp = ts2.readLine(); 1577 QString temp = ts2.readLine();
1573 count += temp.length(); 1578 count += temp.length();
1579 byteCount += temp.length();
1574 os2 << temp << "\r\n"; 1580 os2 << temp << "\r\n";
1575 } 1581 }
1576 file2.close(); 1582 file2.close();
1577 mConnectProgress.hide(); 1583 mConnectProgress.hide();
1578 mConnectCount = -1; 1584 mConnectCount = -1;
1579 os2 << "\r\n"; 1585 os2 << "\r\n";
1580 mRetVal= successW; 1586 mRetVal= successW;
1581 mSocket->close(); 1587 mSocket->close();
1582 if ( mSocket->state() == QSocket::Idle ) 1588 if ( mSocket->state() == QSocket::Idle )
1583 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1589 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1584 mConnectProgress.blockSignals( false ); 1590 mConnectProgress.blockSignals( false );
1585} 1591}
1586void KCommandSocket::sendStop() 1592void KCommandSocket::sendStop()
1587{ 1593{
1588 if ( !mSocket ) { 1594 if ( !mSocket ) {
1589 mSocket = new QSocket( this ); 1595 mSocket = new QSocket( this );
1590 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1596 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1591 } 1597 }
1592 mSocket->connectToHost( mHost, mPort ); 1598 mSocket->connectToHost( mHost, mPort );
1593 QTextStream os2( mSocket ); 1599 QTextStream os2( mSocket );
1594 os2.setEncoding( QTextStream::Latin1 ); 1600 os2.setEncoding( QTextStream::Latin1 );
1595 os2 << "STOP\r\n\r\n"; 1601 os2 << "STOP\r\n\r\n";
1596 mSocket->close(); 1602 mSocket->close();
1597 if ( mSocket->state() == QSocket::Idle ) 1603 if ( mSocket->state() == QSocket::Idle )
1598 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1604 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1599} 1605}
1600 1606
1601void KCommandSocket::startReadFileFromSocket() 1607void KCommandSocket::startReadFileFromSocket()
1602{ 1608{
1603 if ( ! mFirst ) 1609 if ( ! mFirst )
1604 return; 1610 return;
1605 mConnectProgress.setLabelText( i18n("Receiving file from remote...") ); 1611 mConnectProgress.setLabelText( i18n("Receiving file from remote...") );
1606 mFirst = false; 1612 mFirst = false;
1607 mFileString = ""; 1613 mFileString = "";
1608 mTime.start(); 1614 mTime.start();
1609 mFirstLine = true; 1615 mFirstLine = true;
1610 QTimer::singleShot( 1, this , SLOT (readFileFromSocket( ) )); 1616 QTimer::singleShot( 1, this , SLOT (readFileFromSocket( ) ));
1611 1617
1612} 1618}
1613void KCommandSocket::readFileFromSocket() 1619void KCommandSocket::readFileFromSocket()
1614{ 1620{
1615 //qDebug("readBackFileFromSocket() %d ", mTime.elapsed ()); 1621 //qDebug("readBackFileFromSocket() %d ", mTime.elapsed ());
1616 while ( mSocket->canReadLine () ) { 1622 while ( mSocket->canReadLine () ) {
1617 mTime.restart(); 1623 mTime.restart();
1618 QString line = mSocket->readLine (); 1624 QString line = mSocket->readLine ();
1619 if ( mFirstLine ) { 1625 if ( mFirstLine ) {
1620 mFirstLine = false; 1626 mFirstLine = false;
1621 if ( line.left( 6 ) == "ERROR_" ) { 1627 if ( line.left( 6 ) == "ERROR_" ) {
1622 mTimerSocket->stop(); 1628 mTimerSocket->stop();
1623 mConnectCount = -1; 1629 mConnectCount = -1;
1624 if ( line.left( 8 ) == "ERROR_PW" ) { 1630 if ( line.left( 8 ) == "ERROR_PW" ) {
1625 mRetVal = errorPW; 1631 mRetVal = errorPW;
1626 deleteSocket(); 1632 deleteSocket();
1627 return ; 1633 return ;
1628 } 1634 }
1629 if ( line.left( 8 ) == "ERROR_CA" ) { 1635 if ( line.left( 8 ) == "ERROR_CA" ) {
1630 mRetVal = errorCA; 1636 mRetVal = errorCA;
1631 deleteSocket(); 1637 deleteSocket();
1632 return ; 1638 return ;
1633 } 1639 }
1634 if ( line.left( 8 ) == "ERROR_FI" ) { 1640 if ( line.left( 8 ) == "ERROR_FI" ) {
1635 mRetVal = errorFI; 1641 mRetVal = errorFI;
1636 deleteSocket(); 1642 deleteSocket();
1637 return ; 1643 return ;
1638 } 1644 }
1639 if ( line.left( 8 ) == "ERROR_ED" ) { 1645 if ( line.left( 8 ) == "ERROR_ED" ) {
1640 mRetVal = errorED; 1646 mRetVal = errorED;
1641 deleteSocket(); 1647 deleteSocket();
1642 return ; 1648 return ;
1643 } 1649 }
1644 mRetVal = errorUN; 1650 mRetVal = errorUN;
1645 deleteSocket(); 1651 deleteSocket();
1646 return ; 1652 return ;
1647 } 1653 }
1648 } 1654 }
1649 mFileString += line; 1655 mFileString += line;
1650 //qDebug("readline: %s ", line.latin1()); 1656 //qDebug("readline: %s ", line.latin1());
1651 } 1657 }
1652 if ( mTime.elapsed () < 3000 ) { 1658 if ( mTime.elapsed () < 3000 ) {
1653 // wait for more 1659 // wait for more
1654 //qDebug("waitformore "); 1660 //qDebug("waitformore ");
1655 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) )); 1661 QTimer::singleShot( 100, this , SLOT (readFileFromSocket( ) ));
1656 return; 1662 return;
1657 } 1663 }
1658 mTimerSocket->stop(); 1664 mTimerSocket->stop();
1659 mConnectCount = -1; 1665 mConnectCount = -1;
1660 mConnectProgress.hide(); 1666 mConnectProgress.hide();
1661 QString fileName = mFileName; 1667 QString fileName = mFileName;
1662 QFile file ( fileName ); 1668 QFile file ( fileName );
1663 if (!file.open( IO_WriteOnly ) ) { 1669 if (!file.open( IO_WriteOnly ) ) {
1664 mFileString = ""; 1670 mFileString = "";
1665 mRetVal = errorR; 1671 mRetVal = errorR;
1666 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() ); 1672 qDebug("KSS:Error open temp sync file for writing: %s",fileName.latin1() );
1667 deleteSocket(); 1673 deleteSocket();
1668 return ; 1674 return ;
1669 1675