-rw-r--r-- | korganizer/calendarview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 538325e..9571f16 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1697,49 +1697,49 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1697 | } | 1697 | } |
1698 | int w = 300; | 1698 | int w = 300; |
1699 | if ( QApplication::desktop()->width() < 320 ) | 1699 | if ( QApplication::desktop()->width() < 320 ) |
1700 | w = 220; | 1700 | w = 220; |
1701 | int h = bar.sizeHint().height() ; | 1701 | int h = bar.sizeHint().height() ; |
1702 | int dw = QApplication::desktop()->width(); | 1702 | int dw = QApplication::desktop()->width(); |
1703 | int dh = QApplication::desktop()->height(); | 1703 | int dh = QApplication::desktop()->height(); |
1704 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 1704 | bar.setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
1705 | bar.show(); | 1705 | bar.show(); |
1706 | int modulo = (er.count()/10)+1; | 1706 | int modulo = (er.count()/10)+1; |
1707 | int incCounter = 0; | 1707 | int incCounter = 0; |
1708 | while ( inR ) { | 1708 | while ( inR ) { |
1709 | if ( ! bar.isVisible() ) | 1709 | if ( ! bar.isVisible() ) |
1710 | return false; | 1710 | return false; |
1711 | if ( incCounter % modulo == 0 ) | 1711 | if ( incCounter % modulo == 0 ) |
1712 | bar.setProgress( incCounter ); | 1712 | bar.setProgress( incCounter ); |
1713 | ++incCounter; | 1713 | ++incCounter; |
1714 | uid = inR->uid(); | 1714 | uid = inR->uid(); |
1715 | bool skipIncidence = false; | 1715 | bool skipIncidence = false; |
1716 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1716 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1717 | skipIncidence = true; | 1717 | skipIncidence = true; |
1718 | QString idS; | 1718 | QString idS; |
1719 | qApp->processEvents(); | 1719 | qApp->processEvents(); |
1720 | if ( !skipIncidence ) { | 1720 | if ( !skipIncidence ) { |
1721 | inL = local->incidenceForUid( uid , false ); | 1721 | inL = local->incidenceForUid( uid , false , true ); |
1722 | if ( inL ) { // maybe conflict - same uid in both calendars | 1722 | if ( inL ) { // maybe conflict - same uid in both calendars |
1723 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { | 1723 | if ( (take = takeEvent( inL, inR, mode, fullDateRange )) > 0 ) { |
1724 | //qDebug("take %d %s ", take, inL->summary().latin1()); | 1724 | //qDebug("take %d %s ", take, inL->summary().latin1()); |
1725 | if ( take == 3 ) | 1725 | if ( take == 3 ) |
1726 | return false; | 1726 | return false; |
1727 | if ( take == 1 ) {// take local ********************** | 1727 | if ( take == 1 ) {// take local ********************** |
1728 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 1728 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
1729 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); | 1729 | inL->setCsum( mCurrentSyncDevice, inR->getCsum(mCurrentSyncDevice) ); |
1730 | else | 1730 | else |
1731 | idS = inR->IDStr(); | 1731 | idS = inR->IDStr(); |
1732 | int calID = inR->calID(); | 1732 | int calID = inR->calID(); |
1733 | remote->deleteIncidence( inR ); | 1733 | remote->deleteIncidence( inR ); |
1734 | inR = inL->clone(); | 1734 | inR = inL->clone(); |
1735 | inR->setCalID( calID ); | 1735 | inR->setCalID( calID ); |
1736 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1736 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1737 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) | 1737 | if ( mGlobalSyncMode != SYNC_MODE_EXTERNAL ) |
1738 | inR->setIDStr( idS ); | 1738 | inR->setIDStr( idS ); |
1739 | remote->addIncidence( inR ); | 1739 | remote->addIncidence( inR ); |
1740 | if ( mSyncManager->syncWithDesktop() ) | 1740 | if ( mSyncManager->syncWithDesktop() ) |
1741 | inR->setPilotId( 2 ); | 1741 | inR->setPilotId( 2 ); |
1742 | ++changedRemote; | 1742 | ++changedRemote; |
1743 | } else {// take remote ********************** | 1743 | } else {// take remote ********************** |
1744 | if ( !inL->isReadOnly() ) { | 1744 | if ( !inL->isReadOnly() ) { |
1745 | idS = inL->IDStr(); | 1745 | idS = inL->IDStr(); |
@@ -1807,49 +1807,49 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1807 | } | 1807 | } |
1808 | QPtrList<Incidence> el = local->rawIncidences(); | 1808 | QPtrList<Incidence> el = local->rawIncidences(); |
1809 | inL = el.first(); | 1809 | inL = el.first(); |
1810 | modulo = (el.count()/10)+1; | 1810 | modulo = (el.count()/10)+1; |
1811 | bar.setCaption (i18n("Add / remove events") ); | 1811 | bar.setCaption (i18n("Add / remove events") ); |
1812 | bar.setTotalSteps ( el.count() ) ; | 1812 | bar.setTotalSteps ( el.count() ) ; |
1813 | bar.show(); | 1813 | bar.show(); |
1814 | incCounter = 0; | 1814 | incCounter = 0; |
1815 | 1815 | ||
1816 | while ( inL ) { | 1816 | while ( inL ) { |
1817 | 1817 | ||
1818 | qApp->processEvents(); | 1818 | qApp->processEvents(); |
1819 | if ( ! bar.isVisible() ) | 1819 | if ( ! bar.isVisible() ) |
1820 | return false; | 1820 | return false; |
1821 | if ( incCounter % modulo == 0 ) | 1821 | if ( incCounter % modulo == 0 ) |
1822 | bar.setProgress( incCounter ); | 1822 | bar.setProgress( incCounter ); |
1823 | ++incCounter; | 1823 | ++incCounter; |
1824 | uid = inL->uid(); | 1824 | uid = inL->uid(); |
1825 | bool skipIncidence = false; | 1825 | bool skipIncidence = false; |
1826 | if ( uid.left(15) == QString("last-syncEvent-") ) | 1826 | if ( uid.left(15) == QString("last-syncEvent-") ) |
1827 | skipIncidence = true; | 1827 | skipIncidence = true; |
1828 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) | 1828 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL && inL->typeID() == journalID ) |
1829 | skipIncidence = true; | 1829 | skipIncidence = true; |
1830 | if ( !skipIncidence ) { | 1830 | if ( !skipIncidence ) { |
1831 | inR = remote->incidenceForUid( uid , true ); | 1831 | inR = remote->incidenceForUid( uid , true, true ); |
1832 | if ( ! inR ) { | 1832 | if ( ! inR ) { |
1833 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ | 1833 | if ( !filterOUT || filterOUT->filterCalendarItem( inL ) ){ |
1834 | // no conflict ********** add or delete local | 1834 | // no conflict ********** add or delete local |
1835 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 1835 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
1836 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { | 1836 | if ( !inL->getID(mCurrentSyncDevice).isEmpty() && mode != 4 ) { |
1837 | checkExternSyncEvent(eventLSyncSharp, inL); | 1837 | checkExternSyncEvent(eventLSyncSharp, inL); |
1838 | local->deleteIncidence( inL ); | 1838 | local->deleteIncidence( inL ); |
1839 | ++deletedEventL; | 1839 | ++deletedEventL; |
1840 | } else { | 1840 | } else { |
1841 | if ( ! mSyncManager->mWriteBackExistingOnly ) { | 1841 | if ( ! mSyncManager->mWriteBackExistingOnly ) { |
1842 | inL->removeID(mCurrentSyncDevice ); | 1842 | inL->removeID(mCurrentSyncDevice ); |
1843 | ++addedEventR; | 1843 | ++addedEventR; |
1844 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); | 1844 | //qDebug("remote added Incidence %s ", inL->summary().latin1()); |
1845 | inL->setLastModified( modifiedCalendar ); | 1845 | inL->setLastModified( modifiedCalendar ); |
1846 | inR = inL->clone(); | 1846 | inR = inL->clone(); |
1847 | inR->setIDStr( ":" ); | 1847 | inR->setIDStr( ":" ); |
1848 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); | 1848 | inR->setTempSyncStat( SYNC_TEMPSTATE_INITIAL ); |
1849 | inR->setCalID( 0 );// add to default cal | 1849 | inR->setCalID( 0 );// add to default cal |
1850 | remote->addIncidence( inR ); | 1850 | remote->addIncidence( inR ); |
1851 | } | 1851 | } |
1852 | } | 1852 | } |
1853 | } else { | 1853 | } else { |
1854 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { | 1854 | if ( inL->lastModified() < mLastCalendarSync && mode != 4 ) { |
1855 | checkExternSyncEvent(eventLSyncSharp, inL); | 1855 | checkExternSyncEvent(eventLSyncSharp, inL); |