author | zautrix <zautrix> | 2005-02-07 20:05:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-07 20:05:18 (UTC) |
commit | da5e47069d88fa9aa656423ce4c60bf505728e1c (patch) (unidiff) | |
tree | fdbaf29835a028f1204a19fc10dea97d469c0b29 | |
parent | 456b0246521847635fe98471691ceecae211e0c3 (diff) | |
download | kdepimpi-da5e47069d88fa9aa656423ce4c60bf505728e1c.zip kdepimpi-da5e47069d88fa9aa656423ce4c60bf505728e1c.tar.gz kdepimpi-da5e47069d88fa9aa656423ce4c60bf505728e1c.tar.bz2 |
fixes
-rw-r--r-- | kabc/formatfactory.cpp | 5 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/settings.cpp | 1 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/korganizer.pro | 2 | ||||
-rw-r--r-- | libkcal/calendar.cpp | 1 | ||||
-rw-r--r-- | libkcal/event.cpp | 6 | ||||
-rw-r--r-- | libkcal/todo.cpp | 4 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 7 | ||||
-rw-r--r-- | libkdepim/phoneaccess.cpp | 2 | ||||
-rw-r--r-- | microkde/kapplication.cpp | 3 | ||||
-rw-r--r-- | microkde/kdecore/klibloader.cpp | 14 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 2 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.h | 2 |
13 files changed, 21 insertions, 30 deletions
diff --git a/kabc/formatfactory.cpp b/kabc/formatfactory.cpp index f2f03c6..3ae1c27 100644 --- a/kabc/formatfactory.cpp +++ b/kabc/formatfactory.cpp | |||
@@ -27,88 +27,89 @@ | |||
27 | #include <qfile.h> | 27 | #include <qfile.h> |
28 | #include <qstringlist.h> | 28 | #include <qstringlist.h> |
29 | 29 | ||
30 | #include "vcardformatplugin.h" | 30 | #include "vcardformatplugin.h" |
31 | 31 | ||
32 | #include "formatfactory.h" | 32 | #include "formatfactory.h" |
33 | 33 | ||
34 | using namespace KABC; | 34 | using namespace KABC; |
35 | 35 | ||
36 | FormatFactory *FormatFactory::mSelf = 0; | 36 | FormatFactory *FormatFactory::mSelf = 0; |
37 | static KStaticDeleter<FormatFactory> factoryDeleter; | 37 | static KStaticDeleter<FormatFactory> factoryDeleter; |
38 | 38 | ||
39 | FormatFactory *FormatFactory::self() | 39 | FormatFactory *FormatFactory::self() |
40 | { | 40 | { |
41 | if ( !mSelf ) { | 41 | if ( !mSelf ) { |
42 | //US factoryDeleter.setObject( mSelf, new FormatFactory ); | 42 | //US factoryDeleter.setObject( mSelf, new FormatFactory ); |
43 | mSelf = factoryDeleter.setObject( new FormatFactory ); | 43 | mSelf = factoryDeleter.setObject( new FormatFactory ); |
44 | } | 44 | } |
45 | return mSelf; | 45 | return mSelf; |
46 | } | 46 | } |
47 | 47 | ||
48 | FormatFactory::FormatFactory() | 48 | FormatFactory::FormatFactory() |
49 | { | 49 | { |
50 | mFormatList.setAutoDelete( true ); | 50 | mFormatList.setAutoDelete( true ); |
51 | 51 | ||
52 | // dummy entry for default format | 52 | // dummy entry for default format |
53 | FormatInfo *info = new FormatInfo; | 53 | FormatInfo *info = new FormatInfo; |
54 | info->library = "<NoLibrary>"; | 54 | info->library = "<NoLibrary>"; |
55 | info->nameLabel = i18n( "vCard" ); | 55 | info->nameLabel = i18n( "vCard" ); |
56 | info->descriptionLabel = i18n( "vCard Format" ); | 56 | info->descriptionLabel = i18n( "vCard Format" ); |
57 | mFormatList.insert( "vcard", info ); | 57 | mFormatList.insert( "vcard", info ); |
58 | 58 | ||
59 | /*US lets enter all resources directly instead of using teh desktopfiles. | 59 | #if 0 |
60 | US lets enter all resources directly instead of using teh desktopfiles. | ||
60 | 61 | ||
61 | QStringList list = KGlobal::dirs()->findAllResources( "data" ,"kabc/formats/*.desktop", true, true ); | 62 | QStringList list = KGlobal::dirs()->findAllResources( "data" ,"kabc/formats/*.desktop", true, true ); |
62 | for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) | 63 | for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) |
63 | { | 64 | { |
64 | //US KSimpleConfig config( *it, true ); | 65 | //US KSimpleConfig config( *it, true ); |
65 | KConfig config( *it ); | 66 | KConfig config( *it ); |
66 | 67 | ||
67 | if ( !config.hasGroup( "Misc" ) || !config.hasGroup( "Plugin" ) ) | 68 | if ( !config.hasGroup( "Misc" ) || !config.hasGroup( "Plugin" ) ) |
68 | continue; | 69 | continue; |
69 | 70 | ||
70 | info = new FormatInfo; | 71 | info = new FormatInfo; |
71 | 72 | ||
72 | config.setGroup( "Plugin" ); | 73 | config.setGroup( "Plugin" ); |
73 | QString type = config.readEntry( "Type" ); | 74 | QString type = config.readEntry( "Type" ); |
74 | info->library = config.readEntry( "X-KDE-Library" ); | 75 | info->library = config.readEntry( "X-KDE-Library" ); |
75 | 76 | ||
76 | config.setGroup( "Misc" ); | 77 | config.setGroup( "Misc" ); |
77 | info->nameLabel = config.readEntry( "Name" ); | 78 | info->nameLabel = config.readEntry( "Name" ); |
78 | info->descriptionLabel = config.readEntry( "Comment", i18n( "No description available." ) ); | 79 | info->descriptionLabel = config.readEntry( "Comment", i18n( "No description available." ) ); |
79 | 80 | ||
80 | mFormatList.insert( type, info ); | 81 | mFormatList.insert( type, info ); |
81 | } | 82 | } |
82 | */ | 83 | #endif |
83 | //US we already have vcard as default format. | 84 | //US we already have vcard as default format. |
84 | info = new FormatInfo; | 85 | info = new FormatInfo; |
85 | info->library = i18n("microkabcformat_binary"); | 86 | info->library = i18n("microkabcformat_binary"); |
86 | info->nameLabel = i18n( "Binary" ); | 87 | info->nameLabel = i18n( "Binary" ); |
87 | info->descriptionLabel = i18n( "No description available." ); | 88 | info->descriptionLabel = i18n( "No description available." ); |
88 | mFormatList.insert( "binary", info ); | 89 | mFormatList.insert( "binary", info ); |
89 | 90 | ||
90 | } | 91 | } |
91 | 92 | ||
92 | FormatFactory::~FormatFactory() | 93 | FormatFactory::~FormatFactory() |
93 | { | 94 | { |
94 | mFormatList.clear(); | 95 | mFormatList.clear(); |
95 | } | 96 | } |
96 | 97 | ||
97 | QStringList FormatFactory::formats() | 98 | QStringList FormatFactory::formats() |
98 | { | 99 | { |
99 | QStringList retval; | 100 | QStringList retval; |
100 | 101 | ||
101 | // make sure 'vcard' is the first entry | 102 | // make sure 'vcard' is the first entry |
102 | retval << "vcard"; | 103 | retval << "vcard"; |
103 | 104 | ||
104 | QDictIterator<FormatInfo> it( mFormatList ); | 105 | QDictIterator<FormatInfo> it( mFormatList ); |
105 | for ( ; it.current(); ++it ) | 106 | for ( ; it.current(); ++it ) |
106 | if ( it.currentKey() != "vcard" ) | 107 | if ( it.currentKey() != "vcard" ) |
107 | retval << it.currentKey(); | 108 | retval << it.currentKey(); |
108 | 109 | ||
109 | return retval; | 110 | return retval; |
110 | } | 111 | } |
111 | 112 | ||
112 | FormatInfo *FormatFactory::info( const QString &type ) | 113 | FormatInfo *FormatFactory::info( const QString &type ) |
113 | { | 114 | { |
114 | if ( type.isEmpty() ) | 115 | if ( type.isEmpty() ) |
diff --git a/kmicromail/libmailwrapper/settings.cpp b/kmicromail/libmailwrapper/settings.cpp index 8f909f9..9436d43 100644 --- a/kmicromail/libmailwrapper/settings.cpp +++ b/kmicromail/libmailwrapper/settings.cpp | |||
@@ -90,65 +90,64 @@ void Settings::updateAccounts() | |||
90 | 90 | ||
91 | readAccounts(); | 91 | readAccounts(); |
92 | } | 92 | } |
93 | 93 | ||
94 | void Settings::saveAccounts() | 94 | void Settings::saveAccounts() |
95 | { | 95 | { |
96 | checkDirectory(); | 96 | checkDirectory(); |
97 | Account *it; | 97 | Account *it; |
98 | 98 | ||
99 | for ( it = accounts.first(); it; it = accounts.next() ) { | 99 | for ( it = accounts.first(); it; it = accounts.next() ) { |
100 | it->save(); | 100 | it->save(); |
101 | } | 101 | } |
102 | } | 102 | } |
103 | 103 | ||
104 | void Settings::readAccounts() | 104 | void Settings::readAccounts() |
105 | { | 105 | { |
106 | checkDirectory(); | 106 | checkDirectory(); |
107 | Account *it; | 107 | Account *it; |
108 | 108 | ||
109 | for ( it = accounts.first(); it; it = accounts.next() ) { | 109 | for ( it = accounts.first(); it; it = accounts.next() ) { |
110 | it->read(); | 110 | it->read(); |
111 | } | 111 | } |
112 | } | 112 | } |
113 | 113 | ||
114 | Account::Account() | 114 | Account::Account() |
115 | { | 115 | { |
116 | accountName = "changeMe"; | 116 | accountName = "changeMe"; |
117 | type = MAILLIB::A_UNDEFINED; | 117 | type = MAILLIB::A_UNDEFINED; |
118 | ssl = false; | 118 | ssl = false; |
119 | connectionType = 1; | 119 | connectionType = 1; |
120 | offline = false; | 120 | offline = false; |
121 | maxMailSize = 0; | 121 | maxMailSize = 0; |
122 | lastFetch; | ||
123 | leaveOnServer = false; | 122 | leaveOnServer = false; |
124 | } | 123 | } |
125 | 124 | ||
126 | void Account::remove() | 125 | void Account::remove() |
127 | { | 126 | { |
128 | QFile file( getFileName() ); | 127 | QFile file( getFileName() ); |
129 | file.remove(); | 128 | file.remove(); |
130 | } | 129 | } |
131 | 130 | ||
132 | void Account::setPasswordList(const QStringList &str) | 131 | void Account::setPasswordList(const QStringList &str) |
133 | { | 132 | { |
134 | password = ""; | 133 | password = ""; |
135 | int i; | 134 | int i; |
136 | for ( i = 0; i < str.count() ; ++i ) { | 135 | for ( i = 0; i < str.count() ; ++i ) { |
137 | QChar c ( (str[i].toUInt()-131)/(str.count()- (i%3))); | 136 | QChar c ( (str[i].toUInt()-131)/(str.count()- (i%3))); |
138 | password.append( c ); | 137 | password.append( c ); |
139 | } | 138 | } |
140 | //qDebug("password %s ", password.latin1()); | 139 | //qDebug("password %s ", password.latin1()); |
141 | } | 140 | } |
142 | QStringList Account::getPasswordList() | 141 | QStringList Account::getPasswordList() |
143 | { | 142 | { |
144 | int i; | 143 | int i; |
145 | int len = password.length(); | 144 | int len = password.length(); |
146 | QStringList str; | 145 | QStringList str; |
147 | 146 | ||
148 | for ( i = 0; i < len ; ++i ) { | 147 | for ( i = 0; i < len ; ++i ) { |
149 | int val = password.at(i).unicode()*(len-(i%3))+131; | 148 | int val = password.at(i).unicode()*(len-(i%3))+131; |
150 | str.append( QString::number( val ) ); | 149 | str.append( QString::number( val ) ); |
151 | // qDebug("append %s ", str[i].latin1()); | 150 | // qDebug("append %s ", str[i].latin1()); |
152 | } | 151 | } |
153 | return str; | 152 | return str; |
154 | } | 153 | } |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index df7d612..6a312b3 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -288,65 +288,65 @@ bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) | |||
288 | if (e->type() == QEvent::MouseButtonPress || | 288 | if (e->type() == QEvent::MouseButtonPress || |
289 | e->type() == QEvent::MouseButtonDblClick || | 289 | e->type() == QEvent::MouseButtonDblClick || |
290 | e->type() == QEvent::MouseButtonRelease || | 290 | e->type() == QEvent::MouseButtonRelease || |
291 | e->type() == QEvent::MouseMove) { | 291 | e->type() == QEvent::MouseMove) { |
292 | QMouseEvent *me = (QMouseEvent *)e; | 292 | QMouseEvent *me = (QMouseEvent *)e; |
293 | QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> | 293 | QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> |
294 | mapToGlobal(me->pos())); | 294 | mapToGlobal(me->pos())); |
295 | QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); | 295 | QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); |
296 | return event(&returnEvent); | 296 | return event(&returnEvent); |
297 | } else { | 297 | } else { |
298 | return false; | 298 | return false; |
299 | } | 299 | } |
300 | } | 300 | } |
301 | void KOAgendaItem::repaintMe( ) | 301 | void KOAgendaItem::repaintMe( ) |
302 | { | 302 | { |
303 | paintMe ( mSelected ); | 303 | paintMe ( mSelected ); |
304 | } | 304 | } |
305 | void KOAgendaItem::paintMe( bool selected, QPainter* paint ) | 305 | void KOAgendaItem::paintMe( bool selected, QPainter* paint ) |
306 | { | 306 | { |
307 | if ( globalFlagBlockAgendaItemUpdate && ! selected) | 307 | if ( globalFlagBlockAgendaItemUpdate && ! selected) |
308 | return; | 308 | return; |
309 | QPainter pa; | 309 | QPainter pa; |
310 | 310 | ||
311 | if ( mSelected ) { | 311 | if ( mSelected ) { |
312 | pa.begin( paintPixSel() ); | 312 | pa.begin( paintPixSel() ); |
313 | } else { | 313 | } else { |
314 | if ( mAllDay ) | 314 | if ( mAllDay ) |
315 | pa.begin( paintPixAllday() ); | 315 | pa.begin( paintPixAllday() ); |
316 | else | 316 | else |
317 | pa.begin( paintPix() ); | 317 | pa.begin( paintPix() ); |
318 | } | 318 | } |
319 | int x, yy, w, h; | 319 | int x, yy, w, h; |
320 | float nfh; | 320 | float nfh = 7.0; |
321 | x = pos().x(); w = width(); h = height (); | 321 | x = pos().x(); w = width(); h = height (); |
322 | if ( mAllDay ) | 322 | if ( mAllDay ) |
323 | yy = y(); | 323 | yy = y(); |
324 | else | 324 | else |
325 | yy = mCellYTop * ( height() / cellHeight() ); | 325 | yy = mCellYTop * ( height() / cellHeight() ); |
326 | xPaintCoord= x; | 326 | xPaintCoord= x; |
327 | yPaintCoord = yy; | 327 | yPaintCoord = yy; |
328 | wPaintCoord = width(); | 328 | wPaintCoord = width(); |
329 | hPaintCoord = height(); | 329 | hPaintCoord = height(); |
330 | //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); | 330 | //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); |
331 | if ( paint == 0 ) | 331 | if ( paint == 0 ) |
332 | paint = &pa; | 332 | paint = &pa; |
333 | bool horLayout = ( w < h ); | 333 | bool horLayout = ( w < h ); |
334 | int maxhei = mFontPixelSize+4; | 334 | int maxhei = mFontPixelSize+4; |
335 | if ( horLayout ) | 335 | if ( horLayout ) |
336 | maxhei += AGENDA_ICON_SIZE -4; | 336 | maxhei += AGENDA_ICON_SIZE -4; |
337 | bool small = ( h < maxhei ); | 337 | bool small = ( h < maxhei ); |
338 | if ( ! small ) | 338 | if ( ! small ) |
339 | paint->setFont(KOPrefs::instance()->mAgendaViewFont); | 339 | paint->setFont(KOPrefs::instance()->mAgendaViewFont); |
340 | else { | 340 | else { |
341 | QFont f = KOPrefs::instance()->mAgendaViewFont; | 341 | QFont f = KOPrefs::instance()->mAgendaViewFont; |
342 | f.setBold( false ); | 342 | f.setBold( false ); |
343 | int fh = f.pointSize(); | 343 | int fh = f.pointSize(); |
344 | nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; | 344 | nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; |
345 | if ( nfh < 6 ) | 345 | if ( nfh < 6 ) |
346 | nfh = 6; | 346 | nfh = 6; |
347 | f.setPointSize( nfh ); | 347 | f.setPointSize( nfh ); |
348 | paint->setFont(f); | 348 | paint->setFont(f); |
349 | } | 349 | } |
350 | paint->fillRect ( x, yy, w, h, mBackgroundColor ); | 350 | paint->fillRect ( x, yy, w, h, mBackgroundColor ); |
351 | static const QPixmap completedPxmp = SmallIcon("greenhook16"); | 351 | static const QPixmap completedPxmp = SmallIcon("greenhook16"); |
352 | static const QPixmap overduePxmp = SmallIcon("redcross16"); | 352 | static const QPixmap overduePxmp = SmallIcon("redcross16"); |
diff --git a/korganizer/korganizer.pro b/korganizer/korganizer.pro index 3c7a1fb..5e82721 100644 --- a/korganizer/korganizer.pro +++ b/korganizer/korganizer.pro | |||
@@ -1,34 +1,34 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG += qt warn_off | 2 | CONFIG += qt warn_on |
3 | TARGET = kopi | 3 | TARGET = kopi |
4 | OBJECTS_DIR = _obj/ | 4 | OBJECTS_DIR = _obj/ |
5 | MOC_DIR = _moc | 5 | MOC_DIR = _moc |
6 | DESTDIR= ../bin | 6 | DESTDIR= ../bin |
7 | 7 | ||
8 | include( ../variables.pri ) | 8 | include( ../variables.pri ) |
9 | 9 | ||
10 | INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim | 10 | INCLUDEPATH += ../microkde ../ interfaces ../microkde/kdecore ../microkde/kdeui ../microkde/kio/kfile ../microkde/kio/kio ../libkdepim |
11 | #../qtcompat | 11 | #../qtcompat |
12 | DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL | 12 | DEFINES += KORG_NOPLUGINS KORG_NOARCHIVE KORG_NOMAIL |
13 | DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 13 | DEFINES += KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
14 | #KORG_NOPRINTER KORG_NOKABC KORG_NODND | 14 | #KORG_NOPRINTER KORG_NOKABC KORG_NODND |
15 | DEFINES += KORG_NOLVALTERNATION | 15 | DEFINES += KORG_NOLVALTERNATION |
16 | DEFINES += DESKTOP_VERSION | 16 | DEFINES += DESKTOP_VERSION |
17 | unix : { | 17 | unix : { |
18 | LIBS += ../bin/libmicrokdepim.so | 18 | LIBS += ../bin/libmicrokdepim.so |
19 | LIBS += ../bin/libmicrokcal.so | 19 | LIBS += ../bin/libmicrokcal.so |
20 | LIBS += ../bin/libmicrokde.so | 20 | LIBS += ../bin/libmicrokde.so |
21 | LIBS += ../bin/libmicrokabc.so | 21 | LIBS += ../bin/libmicrokabc.so |
22 | #LIBS += -lbluetooth | 22 | #LIBS += -lbluetooth |
23 | #LIBS += -lsdp | 23 | #LIBS += -lsdp |
24 | 24 | ||
25 | #LIBS += -lldap | 25 | #LIBS += -lldap |
26 | OBJECTS_DIR = obj/unix | 26 | OBJECTS_DIR = obj/unix |
27 | MOC_DIR = moc/unix | 27 | MOC_DIR = moc/unix |
28 | } | 28 | } |
29 | win32: { | 29 | win32: { |
30 | RC_FILE = winicons.rc | 30 | RC_FILE = winicons.rc |
31 | DEFINES += _WIN32_ | 31 | DEFINES += _WIN32_ |
32 | LIBS += ../bin/microkdepim.lib | 32 | LIBS += ../bin/microkdepim.lib |
33 | LIBS += ../bin/microkcal.lib | 33 | LIBS += ../bin/microkcal.lib |
34 | LIBS += ../bin/microkde.lib | 34 | LIBS += ../bin/microkde.lib |
diff --git a/libkcal/calendar.cpp b/libkcal/calendar.cpp index 88351eb..dcfee5d 100644 --- a/libkcal/calendar.cpp +++ b/libkcal/calendar.cpp | |||
@@ -95,64 +95,65 @@ void Calendar::init() | |||
95 | // if daylight savings has changed since last load time, we need | 95 | // if daylight savings has changed since last load time, we need |
96 | // to rewrite these settings to the config file. | 96 | // to rewrite these settings to the config file. |
97 | if ((now->tm_isdst && !dstSetting) || | 97 | if ((now->tm_isdst && !dstSetting) || |
98 | (!now->tm_isdst && dstSetting)) { | 98 | (!now->tm_isdst && dstSetting)) { |
99 | KOPrefs::instance()->mTimeZone = tzStr; | 99 | KOPrefs::instance()->mTimeZone = tzStr; |
100 | KOPrefs::instance()->mDaylightSavings = now->tm_isdst; | 100 | KOPrefs::instance()->mDaylightSavings = now->tm_isdst; |
101 | } | 101 | } |
102 | 102 | ||
103 | setTimeZone(tzStr); | 103 | setTimeZone(tzStr); |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | // KOPrefs::instance()->writeConfig(); | 106 | // KOPrefs::instance()->writeConfig(); |
107 | } | 107 | } |
108 | 108 | ||
109 | Calendar::~Calendar() | 109 | Calendar::~Calendar() |
110 | { | 110 | { |
111 | delete mDefaultFilter; | 111 | delete mDefaultFilter; |
112 | if ( mUndoIncidence ) | 112 | if ( mUndoIncidence ) |
113 | delete mUndoIncidence; | 113 | delete mUndoIncidence; |
114 | } | 114 | } |
115 | 115 | ||
116 | const QString &Calendar::getOwner() const | 116 | const QString &Calendar::getOwner() const |
117 | { | 117 | { |
118 | return mOwner; | 118 | return mOwner; |
119 | } | 119 | } |
120 | 120 | ||
121 | bool Calendar::undoDeleteIncidence() | 121 | bool Calendar::undoDeleteIncidence() |
122 | { | 122 | { |
123 | if (!mUndoIncidence) | 123 | if (!mUndoIncidence) |
124 | return false; | 124 | return false; |
125 | addIncidence(mUndoIncidence); | 125 | addIncidence(mUndoIncidence); |
126 | mUndoIncidence = 0; | 126 | mUndoIncidence = 0; |
127 | return true; | ||
127 | } | 128 | } |
128 | void Calendar::setOwner(const QString &os) | 129 | void Calendar::setOwner(const QString &os) |
129 | { | 130 | { |
130 | int i; | 131 | int i; |
131 | mOwner = os; | 132 | mOwner = os; |
132 | i = mOwner.find(','); | 133 | i = mOwner.find(','); |
133 | if (i != -1) | 134 | if (i != -1) |
134 | mOwner = mOwner.left(i); | 135 | mOwner = mOwner.left(i); |
135 | 136 | ||
136 | setModified( true ); | 137 | setModified( true ); |
137 | } | 138 | } |
138 | 139 | ||
139 | void Calendar::setTimeZone(const QString & tz) | 140 | void Calendar::setTimeZone(const QString & tz) |
140 | { | 141 | { |
141 | bool neg = FALSE; | 142 | bool neg = FALSE; |
142 | int hours, minutes; | 143 | int hours, minutes; |
143 | QString tmpStr(tz); | 144 | QString tmpStr(tz); |
144 | 145 | ||
145 | if (tmpStr.left(1) == "-") | 146 | if (tmpStr.left(1) == "-") |
146 | neg = TRUE; | 147 | neg = TRUE; |
147 | if (tmpStr.left(1) == "-" || tmpStr.left(1) == "+") | 148 | if (tmpStr.left(1) == "-" || tmpStr.left(1) == "+") |
148 | tmpStr.remove(0, 1); | 149 | tmpStr.remove(0, 1); |
149 | hours = tmpStr.left(2).toInt(); | 150 | hours = tmpStr.left(2).toInt(); |
150 | if (tmpStr.length() > 2) | 151 | if (tmpStr.length() > 2) |
151 | minutes = tmpStr.right(2).toInt(); | 152 | minutes = tmpStr.right(2).toInt(); |
152 | else | 153 | else |
153 | minutes = 0; | 154 | minutes = 0; |
154 | mTimeZone = (60*hours+minutes); | 155 | mTimeZone = (60*hours+minutes); |
155 | if (neg) | 156 | if (neg) |
156 | mTimeZone = -mTimeZone; | 157 | mTimeZone = -mTimeZone; |
157 | mLocalTime = false; | 158 | mLocalTime = false; |
158 | 159 | ||
diff --git a/libkcal/event.cpp b/libkcal/event.cpp index 7256f05..de8dceb 100644 --- a/libkcal/event.cpp +++ b/libkcal/event.cpp | |||
@@ -60,161 +60,159 @@ bool Event::contains ( Event* from ) | |||
60 | { | 60 | { |
61 | 61 | ||
62 | if ( !from->summary().isEmpty() ) | 62 | if ( !from->summary().isEmpty() ) |
63 | if ( !summary().startsWith( from->summary() )) | 63 | if ( !summary().startsWith( from->summary() )) |
64 | return false; | 64 | return false; |
65 | if ( from->dtStart().isValid() ) | 65 | if ( from->dtStart().isValid() ) |
66 | if (dtStart() != from->dtStart() ) | 66 | if (dtStart() != from->dtStart() ) |
67 | return false; | 67 | return false; |
68 | if ( from->dtEnd().isValid() ) | 68 | if ( from->dtEnd().isValid() ) |
69 | if ( dtEnd() != from->dtEnd() ) | 69 | if ( dtEnd() != from->dtEnd() ) |
70 | return false; | 70 | return false; |
71 | if ( !from->location().isEmpty() ) | 71 | if ( !from->location().isEmpty() ) |
72 | if ( !location().startsWith( from->location() ) ) | 72 | if ( !location().startsWith( from->location() ) ) |
73 | return false; | 73 | return false; |
74 | if ( !from->description().isEmpty() ) | 74 | if ( !from->description().isEmpty() ) |
75 | if ( !description().startsWith( from->description() )) | 75 | if ( !description().startsWith( from->description() )) |
76 | return false; | 76 | return false; |
77 | if ( from->alarms().count() ) { | 77 | if ( from->alarms().count() ) { |
78 | Alarm *a = from->alarms().first(); | 78 | Alarm *a = from->alarms().first(); |
79 | if ( a->enabled() ){ | 79 | if ( a->enabled() ){ |
80 | if ( !alarms().count() ) | 80 | if ( !alarms().count() ) |
81 | return false; | 81 | return false; |
82 | Alarm *b = alarms().first(); | 82 | Alarm *b = alarms().first(); |
83 | if( ! b->enabled() ) | 83 | if( ! b->enabled() ) |
84 | return false; | 84 | return false; |
85 | if ( ! (a->offset() == b->offset() )) | 85 | if ( ! (a->offset() == b->offset() )) |
86 | return false; | 86 | return false; |
87 | } | 87 | } |
88 | } | 88 | } |
89 | QStringList cat = categories(); | 89 | QStringList cat = categories(); |
90 | QStringList catFrom = from->categories(); | 90 | QStringList catFrom = from->categories(); |
91 | QString nCat; | 91 | QString nCat; |
92 | int iii; | 92 | unsigned int iii; |
93 | for ( iii = 0; iii < catFrom.count();++iii ) { | 93 | for ( iii = 0; iii < catFrom.count();++iii ) { |
94 | nCat = catFrom[iii]; | 94 | nCat = catFrom[iii]; |
95 | if ( !nCat.isEmpty() ) | 95 | if ( !nCat.isEmpty() ) |
96 | if ( !cat.contains( nCat )) { | 96 | if ( !cat.contains( nCat )) { |
97 | return false; | 97 | return false; |
98 | } | 98 | } |
99 | } | 99 | } |
100 | if ( from->doesRecur() ) | 100 | if ( from->doesRecur() ) |
101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) | 101 | if ( from->doesRecur() != doesRecur() && ! (from->doesRecur()== Recurrence::rYearlyMonth && doesRecur()== Recurrence::rYearlyDay) ) |
102 | return false; | 102 | return false; |
103 | return true; | 103 | return true; |
104 | } | 104 | } |
105 | 105 | ||
106 | void Event::setDtEnd(const QDateTime &dtEnd) | 106 | void Event::setDtEnd(const QDateTime &dtEnd) |
107 | { | 107 | { |
108 | if (mReadOnly) return; | 108 | if (mReadOnly) return; |
109 | 109 | ||
110 | mDtEnd = getEvenTime( dtEnd ); | 110 | mDtEnd = getEvenTime( dtEnd ); |
111 | 111 | ||
112 | setHasEndDate(true); | 112 | setHasEndDate(true); |
113 | setHasDuration(false); | 113 | setHasDuration(false); |
114 | 114 | ||
115 | updated(); | 115 | updated(); |
116 | } | 116 | } |
117 | 117 | ||
118 | QDateTime Event::dtEnd() const | 118 | QDateTime Event::dtEnd() const |
119 | { | 119 | { |
120 | if (hasEndDate()) return mDtEnd; | 120 | if (hasEndDate()) return mDtEnd; |
121 | if (hasDuration()) return dtStart().addSecs(duration()); | 121 | if (hasDuration()) return dtStart().addSecs(duration()); |
122 | 122 | ||
123 | kdDebug(5800) << "Warning! Event '" << summary() | ||
124 | << "' does have neither end date nor duration." << endl; | ||
125 | return dtStart(); | 123 | return dtStart(); |
126 | } | 124 | } |
127 | 125 | ||
128 | QString Event::dtEndTimeStr() const | 126 | QString Event::dtEndTimeStr() const |
129 | { | 127 | { |
130 | return KGlobal::locale()->formatTime(mDtEnd.time()); | 128 | return KGlobal::locale()->formatTime(mDtEnd.time()); |
131 | } | 129 | } |
132 | 130 | ||
133 | QString Event::dtEndDateStr(bool shortfmt) const | 131 | QString Event::dtEndDateStr(bool shortfmt) const |
134 | { | 132 | { |
135 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); | 133 | return KGlobal::locale()->formatDate(mDtEnd.date(),shortfmt); |
136 | } | 134 | } |
137 | 135 | ||
138 | QString Event::dtEndStr(bool shortfmt) const | 136 | QString Event::dtEndStr(bool shortfmt) const |
139 | { | 137 | { |
140 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); | 138 | return KGlobal::locale()->formatDateTime(mDtEnd, shortfmt); |
141 | } | 139 | } |
142 | 140 | ||
143 | void Event::setHasEndDate(bool b) | 141 | void Event::setHasEndDate(bool b) |
144 | { | 142 | { |
145 | mHasEndDate = b; | 143 | mHasEndDate = b; |
146 | } | 144 | } |
147 | 145 | ||
148 | bool Event::hasEndDate() const | 146 | bool Event::hasEndDate() const |
149 | { | 147 | { |
150 | return mHasEndDate; | 148 | return mHasEndDate; |
151 | } | 149 | } |
152 | 150 | ||
153 | bool Event::isMultiDay() const | 151 | bool Event::isMultiDay() const |
154 | { | 152 | { |
155 | bool multi = !(dtStart().date() == dtEnd().date()); | 153 | bool multi = !(dtStart().date() == dtEnd().date()); |
156 | return multi; | 154 | return multi; |
157 | } | 155 | } |
158 | 156 | ||
159 | void Event::setTransparency(Event::Transparency transparency) | 157 | void Event::setTransparency(Event::Transparency transparency) |
160 | { | 158 | { |
161 | if (mReadOnly) return; | 159 | if (mReadOnly) return; |
162 | mTransparency = transparency; | 160 | mTransparency = transparency; |
163 | updated(); | 161 | updated(); |
164 | } | 162 | } |
165 | 163 | ||
166 | Event::Transparency Event::transparency() const | 164 | Event::Transparency Event::transparency() const |
167 | { | 165 | { |
168 | return mTransparency; | 166 | return mTransparency; |
169 | } | 167 | } |
170 | 168 | ||
171 | void Event::setDuration(int seconds) | 169 | void Event::setDuration(int seconds) |
172 | { | 170 | { |
173 | setHasEndDate(false); | 171 | setHasEndDate(false); |
174 | Incidence::setDuration(seconds); | 172 | Incidence::setDuration(seconds); |
175 | } | 173 | } |
176 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const | 174 | QDateTime Event::getNextAlarmDateTime( bool * ok, int * offset ) const |
177 | { | 175 | { |
178 | 176 | ||
179 | bool yes; | 177 | bool yes; |
180 | QDateTime incidenceStart = getNextOccurence( QDateTime::currentDateTime(), &yes ); | 178 | QDateTime incidenceStart = getNextOccurence( QDateTime::currentDateTime(), &yes ); |
181 | if ( ! yes || cancelled() ) { | 179 | if ( ! yes || cancelled() ) { |
182 | *ok = false; | 180 | *ok = false; |
183 | return QDateTime (); | 181 | return QDateTime (); |
184 | } | 182 | } |
185 | 183 | ||
186 | bool enabled = false; | 184 | bool enabled = false; |
187 | Alarm* alarm; | 185 | Alarm* alarm; |
188 | int off; | 186 | int off = 0; |
189 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 187 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
190 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 188 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
191 | // *ok = false; | 189 | // *ok = false; |
192 | // return incidenceStart; | 190 | // return incidenceStart; |
193 | // } | 191 | // } |
194 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 192 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
195 | if (alarm->enabled()) { | 193 | if (alarm->enabled()) { |
196 | if ( alarm->hasTime () ) { | 194 | if ( alarm->hasTime () ) { |
197 | if ( alarm->time() < alarmStart ) { | 195 | if ( alarm->time() < alarmStart ) { |
198 | alarmStart = alarm->time(); | 196 | alarmStart = alarm->time(); |
199 | enabled = true; | 197 | enabled = true; |
200 | off = alarmStart.secsTo( incidenceStart ); | 198 | off = alarmStart.secsTo( incidenceStart ); |
201 | } | 199 | } |
202 | 200 | ||
203 | } else { | 201 | } else { |
204 | int secs = alarm->startOffset().asSeconds(); | 202 | int secs = alarm->startOffset().asSeconds(); |
205 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 203 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
206 | alarmStart = incidenceStart.addSecs( secs ); | 204 | alarmStart = incidenceStart.addSecs( secs ); |
207 | enabled = true; | 205 | enabled = true; |
208 | off = -secs; | 206 | off = -secs; |
209 | } | 207 | } |
210 | } | 208 | } |
211 | } | 209 | } |
212 | } | 210 | } |
213 | if ( enabled ) { | 211 | if ( enabled ) { |
214 | if ( alarmStart > QDateTime::currentDateTime() ) { | 212 | if ( alarmStart > QDateTime::currentDateTime() ) { |
215 | *ok = true; | 213 | *ok = true; |
216 | * offset = off; | 214 | * offset = off; |
217 | return alarmStart; | 215 | return alarmStart; |
218 | } | 216 | } |
219 | } | 217 | } |
220 | *ok = false; | 218 | *ok = false; |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index d81a68f..9c04a7e 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -67,65 +67,65 @@ bool Todo::contains ( Todo* from ) | |||
67 | return false; | 67 | return false; |
68 | if ( from->dtStart() != dtStart()) | 68 | if ( from->dtStart() != dtStart()) |
69 | return false; | 69 | return false; |
70 | } | 70 | } |
71 | if ( from->hasDueDate() ){ | 71 | if ( from->hasDueDate() ){ |
72 | if ( !hasDueDate() ) | 72 | if ( !hasDueDate() ) |
73 | return false; | 73 | return false; |
74 | if ( from->dtDue() != dtDue()) | 74 | if ( from->dtDue() != dtDue()) |
75 | return false; | 75 | return false; |
76 | } | 76 | } |
77 | if ( !from->location().isEmpty() ) | 77 | if ( !from->location().isEmpty() ) |
78 | if ( !location().startsWith( from->location() ) ) | 78 | if ( !location().startsWith( from->location() ) ) |
79 | return false; | 79 | return false; |
80 | if ( !from->description().isEmpty() ) | 80 | if ( !from->description().isEmpty() ) |
81 | if ( !description().startsWith( from->description() )) | 81 | if ( !description().startsWith( from->description() )) |
82 | return false; | 82 | return false; |
83 | if ( from->alarms().count() ) { | 83 | if ( from->alarms().count() ) { |
84 | Alarm *a = from->alarms().first(); | 84 | Alarm *a = from->alarms().first(); |
85 | if ( a->enabled() ){ | 85 | if ( a->enabled() ){ |
86 | if ( !alarms().count() ) | 86 | if ( !alarms().count() ) |
87 | return false; | 87 | return false; |
88 | Alarm *b = alarms().first(); | 88 | Alarm *b = alarms().first(); |
89 | if( ! b->enabled() ) | 89 | if( ! b->enabled() ) |
90 | return false; | 90 | return false; |
91 | if ( ! (a->offset() == b->offset() )) | 91 | if ( ! (a->offset() == b->offset() )) |
92 | return false; | 92 | return false; |
93 | } | 93 | } |
94 | } | 94 | } |
95 | 95 | ||
96 | QStringList cat = categories(); | 96 | QStringList cat = categories(); |
97 | QStringList catFrom = from->categories(); | 97 | QStringList catFrom = from->categories(); |
98 | QString nCat; | 98 | QString nCat; |
99 | int iii; | 99 | unsigned int iii; |
100 | for ( iii = 0; iii < catFrom.count();++iii ) { | 100 | for ( iii = 0; iii < catFrom.count();++iii ) { |
101 | nCat = catFrom[iii]; | 101 | nCat = catFrom[iii]; |
102 | if ( !nCat.isEmpty() ) | 102 | if ( !nCat.isEmpty() ) |
103 | if ( !cat.contains( nCat )) { | 103 | if ( !cat.contains( nCat )) { |
104 | return false; | 104 | return false; |
105 | } | 105 | } |
106 | } | 106 | } |
107 | if ( from->isCompleted() ) { | 107 | if ( from->isCompleted() ) { |
108 | if ( !isCompleted() ) | 108 | if ( !isCompleted() ) |
109 | return false; | 109 | return false; |
110 | } | 110 | } |
111 | if( priority() != from->priority() ) | 111 | if( priority() != from->priority() ) |
112 | return false; | 112 | return false; |
113 | 113 | ||
114 | 114 | ||
115 | return true; | 115 | return true; |
116 | 116 | ||
117 | } | 117 | } |
118 | bool KCal::operator==( const Todo& t1, const Todo& t2 ) | 118 | bool KCal::operator==( const Todo& t1, const Todo& t2 ) |
119 | { | 119 | { |
120 | 120 | ||
121 | bool ret = operator==( (const Incidence&)t1, (const Incidence&)t2 ); | 121 | bool ret = operator==( (const Incidence&)t1, (const Incidence&)t2 ); |
122 | if ( ! ret ) | 122 | if ( ! ret ) |
123 | return false; | 123 | return false; |
124 | if ( t1.hasDueDate() == t2.hasDueDate() ) { | 124 | if ( t1.hasDueDate() == t2.hasDueDate() ) { |
125 | if ( t1.hasDueDate() ) { | 125 | if ( t1.hasDueDate() ) { |
126 | if ( t1.doesFloat() == t2.doesFloat() ) { | 126 | if ( t1.doesFloat() == t2.doesFloat() ) { |
127 | if ( t1.doesFloat() ) { | 127 | if ( t1.doesFloat() ) { |
128 | if ( t1.dtDue().date() != t2.dtDue().date() ) | 128 | if ( t1.dtDue().date() != t2.dtDue().date() ) |
129 | return false; | 129 | return false; |
130 | } else | 130 | } else |
131 | if ( t1.dtDue() != t2.dtDue() ) | 131 | if ( t1.dtDue() != t2.dtDue() ) |
@@ -346,65 +346,65 @@ void Todo::setCompleted(const QDateTime &completed) | |||
346 | mPercentComplete = 100; | 346 | mPercentComplete = 100; |
347 | mCompleted = getEvenTime(completed); | 347 | mCompleted = getEvenTime(completed); |
348 | updated(); | 348 | updated(); |
349 | } | 349 | } |
350 | 350 | ||
351 | bool Todo::hasCompletedDate() const | 351 | bool Todo::hasCompletedDate() const |
352 | { | 352 | { |
353 | return mHasCompletedDate; | 353 | return mHasCompletedDate; |
354 | } | 354 | } |
355 | 355 | ||
356 | int Todo::percentComplete() const | 356 | int Todo::percentComplete() const |
357 | { | 357 | { |
358 | return mPercentComplete; | 358 | return mPercentComplete; |
359 | } | 359 | } |
360 | 360 | ||
361 | void Todo::setPercentComplete(int v) | 361 | void Todo::setPercentComplete(int v) |
362 | { | 362 | { |
363 | mPercentComplete = v; | 363 | mPercentComplete = v; |
364 | if ( v != 100 ) | 364 | if ( v != 100 ) |
365 | mHasCompletedDate = false; | 365 | mHasCompletedDate = false; |
366 | updated(); | 366 | updated(); |
367 | } | 367 | } |
368 | QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const | 368 | QDateTime Todo::getNextAlarmDateTime( bool * ok, int * offset ) const |
369 | { | 369 | { |
370 | if ( isCompleted() || ! hasDueDate() || cancelled() ) { | 370 | if ( isCompleted() || ! hasDueDate() || cancelled() ) { |
371 | *ok = false; | 371 | *ok = false; |
372 | return QDateTime (); | 372 | return QDateTime (); |
373 | } | 373 | } |
374 | QDateTime incidenceStart; | 374 | QDateTime incidenceStart; |
375 | incidenceStart = dtDue(); | 375 | incidenceStart = dtDue(); |
376 | bool enabled = false; | 376 | bool enabled = false; |
377 | Alarm* alarm; | 377 | Alarm* alarm; |
378 | int off; | 378 | int off = 0; |
379 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; | 379 | QDateTime alarmStart = QDateTime::currentDateTime().addDays( 3650 );; |
380 | // if ( QDateTime::currentDateTime() > incidenceStart ){ | 380 | // if ( QDateTime::currentDateTime() > incidenceStart ){ |
381 | // *ok = false; | 381 | // *ok = false; |
382 | // return incidenceStart; | 382 | // return incidenceStart; |
383 | // } | 383 | // } |
384 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { | 384 | for (QPtrListIterator<Alarm> it(mAlarms); (alarm = it.current()) != 0; ++it) { |
385 | if (alarm->enabled()) { | 385 | if (alarm->enabled()) { |
386 | if ( alarm->hasTime () ) { | 386 | if ( alarm->hasTime () ) { |
387 | if ( alarm->time() < alarmStart ) { | 387 | if ( alarm->time() < alarmStart ) { |
388 | alarmStart = alarm->time(); | 388 | alarmStart = alarm->time(); |
389 | enabled = true; | 389 | enabled = true; |
390 | off = alarmStart.secsTo( incidenceStart ); | 390 | off = alarmStart.secsTo( incidenceStart ); |
391 | } | 391 | } |
392 | 392 | ||
393 | } else { | 393 | } else { |
394 | int secs = alarm->startOffset().asSeconds(); | 394 | int secs = alarm->startOffset().asSeconds(); |
395 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { | 395 | if ( incidenceStart.addSecs( secs ) < alarmStart ) { |
396 | alarmStart = incidenceStart.addSecs( secs ); | 396 | alarmStart = incidenceStart.addSecs( secs ); |
397 | enabled = true; | 397 | enabled = true; |
398 | off = -secs; | 398 | off = -secs; |
399 | } | 399 | } |
400 | } | 400 | } |
401 | } | 401 | } |
402 | } | 402 | } |
403 | if ( enabled ) { | 403 | if ( enabled ) { |
404 | if ( alarmStart > QDateTime::currentDateTime() ) { | 404 | if ( alarmStart > QDateTime::currentDateTime() ) { |
405 | *ok = true; | 405 | *ok = true; |
406 | * offset = off; | 406 | * offset = off; |
407 | return alarmStart; | 407 | return alarmStart; |
408 | } | 408 | } |
409 | } | 409 | } |
410 | *ok = false; | 410 | *ok = false; |
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 3adbf61..df5a0d9 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -30,65 +30,65 @@ | |||
30 | 30 | ||
31 | 31 | ||
32 | #include "ksyncprofile.h" | 32 | #include "ksyncprofile.h" |
33 | #include "ksyncprefsdialog.h" | 33 | #include "ksyncprefsdialog.h" |
34 | #include "kpimprefs.h" | 34 | #include "kpimprefs.h" |
35 | #include <kmessagebox.h> | 35 | #include <kmessagebox.h> |
36 | 36 | ||
37 | #include <qdir.h> | 37 | #include <qdir.h> |
38 | #include <qprogressbar.h> | 38 | #include <qprogressbar.h> |
39 | #include <qpopupmenu.h> | 39 | #include <qpopupmenu.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | #include <qradiobutton.h> | 41 | #include <qradiobutton.h> |
42 | #include <qbuttongroup.h> | 42 | #include <qbuttongroup.h> |
43 | #include <qtimer.h> | 43 | #include <qtimer.h> |
44 | #include <qmessagebox.h> | 44 | #include <qmessagebox.h> |
45 | #include <qapplication.h> | 45 | #include <qapplication.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qdialog.h> | 47 | #include <qdialog.h> |
48 | #include <qlayout.h> | 48 | #include <qlayout.h> |
49 | #include <qtextcodec.h> | 49 | #include <qtextcodec.h> |
50 | #include <qlabel.h> | 50 | #include <qlabel.h> |
51 | #include <qcheckbox.h> | 51 | #include <qcheckbox.h> |
52 | 52 | ||
53 | #include <klocale.h> | 53 | #include <klocale.h> |
54 | #include <kglobal.h> | 54 | #include <kglobal.h> |
55 | #include <kconfig.h> | 55 | #include <kconfig.h> |
56 | #include <kfiledialog.h> | 56 | #include <kfiledialog.h> |
57 | 57 | ||
58 | QDateTime KSyncManager::mRequestedSyncEvent; | 58 | QDateTime KSyncManager::mRequestedSyncEvent; |
59 | 59 | ||
60 | 60 | ||
61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) | 61 | KSyncManager::KSyncManager(QWidget* parent, KSyncInterface* implementation, TargetApp ta, KPimPrefs* prefs, QPopupMenu* syncmenu) |
62 | : QObject(), mParent(parent), mImplementation(implementation), mTargetApp(ta), mPrefs(prefs ),mSyncMenu(syncmenu) | 62 | : QObject(), mPrefs(prefs ), mParent(parent),mImplementation(implementation), mTargetApp(ta), mSyncMenu(syncmenu) |
63 | { | 63 | { |
64 | mServerSocket = 0; | 64 | mServerSocket = 0; |
65 | bar = new QProgressBar ( 1, 0 ); | 65 | bar = new QProgressBar ( 1, 0 ); |
66 | bar->setCaption (""); | 66 | bar->setCaption (""); |
67 | mWriteBackInPast = 2; | 67 | mWriteBackInPast = 2; |
68 | int w = 300; | 68 | int w = 300; |
69 | if ( QApplication::desktop()->width() < 320 ) | 69 | if ( QApplication::desktop()->width() < 320 ) |
70 | w = 220; | 70 | w = 220; |
71 | int h = bar->sizeHint().height() ; | 71 | int h = bar->sizeHint().height() ; |
72 | int dw = QApplication::desktop()->width(); | 72 | int dw = QApplication::desktop()->width(); |
73 | int dh = QApplication::desktop()->height(); | 73 | int dh = QApplication::desktop()->height(); |
74 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 74 | bar->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
75 | if ( mPrefs->mPassiveSyncAutoStart ) | 75 | if ( mPrefs->mPassiveSyncAutoStart ) |
76 | enableQuick( false ); | 76 | enableQuick( false ); |
77 | 77 | ||
78 | } | 78 | } |
79 | 79 | ||
80 | KSyncManager::~KSyncManager() | 80 | KSyncManager::~KSyncManager() |
81 | { | 81 | { |
82 | delete bar; | 82 | delete bar; |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
86 | void KSyncManager::fillSyncMenu() | 86 | void KSyncManager::fillSyncMenu() |
87 | { | 87 | { |
88 | if ( mSyncMenu->count() ) | 88 | if ( mSyncMenu->count() ) |
89 | mSyncMenu->clear(); | 89 | mSyncMenu->clear(); |
90 | 90 | ||
91 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); | 91 | mSyncMenu->insertItem( i18n("Configure..."), 0 ); |
92 | mSyncMenu->insertSeparator(); | 92 | mSyncMenu->insertSeparator(); |
93 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); | 93 | QPopupMenu *clearMenu = new QPopupMenu ( mSyncMenu ); |
94 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); | 94 | mSyncMenu->insertItem( i18n("Remove sync info"),clearMenu, 5000 ); |
@@ -431,68 +431,67 @@ void KSyncManager::syncLocalFile() | |||
431 | switch(mTargetApp) | 431 | switch(mTargetApp) |
432 | { | 432 | { |
433 | case (KAPI): | 433 | case (KAPI): |
434 | ext = "(*.vcf)"; | 434 | ext = "(*.vcf)"; |
435 | break; | 435 | break; |
436 | case (KOPI): | 436 | case (KOPI): |
437 | ext = "(*.ics/*.vcs)"; | 437 | ext = "(*.ics/*.vcs)"; |
438 | break; | 438 | break; |
439 | case (PWMPI): | 439 | case (PWMPI): |
440 | ext = "(*.pwm)"; | 440 | ext = "(*.pwm)"; |
441 | break; | 441 | break; |
442 | default: | 442 | default: |
443 | qDebug("KSM::syncLocalFile: invalid apptype selected"); | 443 | qDebug("KSM::syncLocalFile: invalid apptype selected"); |
444 | break; | 444 | break; |
445 | 445 | ||
446 | } | 446 | } |
447 | 447 | ||
448 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename"+ext), mParent ); | 448 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename"+ext), mParent ); |
449 | if ( fn == "" ) | 449 | if ( fn == "" ) |
450 | return; | 450 | return; |
451 | if ( syncWithFile( fn, false ) ) { | 451 | if ( syncWithFile( fn, false ) ) { |
452 | qDebug("KSM::syncLocalFile() successful "); | 452 | qDebug("KSM::syncLocalFile() successful "); |
453 | } | 453 | } |
454 | 454 | ||
455 | } | 455 | } |
456 | 456 | ||
457 | bool KSyncManager::syncWithFile( QString fn , bool quick ) | 457 | bool KSyncManager::syncWithFile( QString fn , bool quick ) |
458 | { | 458 | { |
459 | bool ret = false; | 459 | bool ret = false; |
460 | QFileInfo info; | 460 | QFileInfo info; |
461 | info.setFile( fn ); | 461 | info.setFile( fn ); |
462 | QString mess; | 462 | QString mess; |
463 | bool loadbup = true; | ||
464 | if ( !info. exists() ) { | 463 | if ( !info. exists() ) { |
465 | mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); | 464 | mess = i18n( "Sync file \n...%1\ndoes not exist!\nNothing synced!\n").arg(fn.right( 30) ); |
466 | int result = QMessageBox::warning( mParent, i18n("Warning!"), | 465 | QMessageBox::warning( mParent, i18n("Warning!"), |
467 | mess ); | 466 | mess ); |
468 | return ret; | 467 | return ret; |
469 | } | 468 | } |
470 | int result = 0; | 469 | int result = 0; |
471 | if ( !quick ) { | 470 | if ( !quick ) { |
472 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); | 471 | mess = i18n("Sync with file \n...%1\nfrom:\n%2\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); |
473 | result = QMessageBox::warning( mParent, i18n("Warning!"), | 472 | result = QMessageBox::warning( mParent, i18n("Warning!"), |
474 | mess, | 473 | mess, |
475 | i18n("Sync"), i18n("Cancel"), 0, | 474 | i18n("Sync"), i18n("Cancel"), 0, |
476 | 0, 1 ); | 475 | 0, 1 ); |
477 | if ( result ) | 476 | if ( result ) |
478 | return false; | 477 | return false; |
479 | } | 478 | } |
480 | if ( mAskForPreferences ) | 479 | if ( mAskForPreferences ) |
481 | if ( !edit_sync_options()) { | 480 | if ( !edit_sync_options()) { |
482 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); | 481 | mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") ); |
483 | return false; | 482 | return false; |
484 | } | 483 | } |
485 | if ( result == 0 ) { | 484 | if ( result == 0 ) { |
486 | //qDebug("Now sycing ... "); | 485 | //qDebug("Now sycing ... "); |
487 | if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) | 486 | if ( ret = mImplementation->sync( this, fn, mSyncAlgoPrefs ) ) |
488 | mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); | 487 | mParent->topLevelWidget()->setCaption( i18n("Synchronization successful") ); |
489 | else | 488 | else |
490 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); | 489 | mParent->topLevelWidget()->setCaption( i18n("Sync cancelled or failed.") ); |
491 | if ( ! quick ) | 490 | if ( ! quick ) |
492 | mPrefs->mLastSyncedLocalFile = fn; | 491 | mPrefs->mLastSyncedLocalFile = fn; |
493 | } | 492 | } |
494 | return ret; | 493 | return ret; |
495 | } | 494 | } |
496 | 495 | ||
497 | void KSyncManager::quickSyncLocalFile() | 496 | void KSyncManager::quickSyncLocalFile() |
498 | { | 497 | { |
@@ -527,65 +526,65 @@ void KSyncManager::multiSync( bool askforPrefs ) | |||
527 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; | 526 | mPrefs->mRingSyncAlgoPrefs = mSyncAlgoPrefs; |
528 | } | 527 | } |
529 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); | 528 | mParent->topLevelWidget()->setCaption(i18n("Multiple sync started.") ); |
530 | qApp->processEvents(); | 529 | qApp->processEvents(); |
531 | int num = ringSync() ; | 530 | int num = ringSync() ; |
532 | if ( num > 1 ) | 531 | if ( num > 1 ) |
533 | ringSync(); | 532 | ringSync(); |
534 | setBlockSave(false); | 533 | setBlockSave(false); |
535 | if ( num ) | 534 | if ( num ) |
536 | emit save(); | 535 | emit save(); |
537 | if ( num ) | 536 | if ( num ) |
538 | mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); | 537 | mParent->topLevelWidget()->setCaption(i18n("%1 profiles synced. Multiple sync complete!").arg(num) ); |
539 | else | 538 | else |
540 | mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); | 539 | mParent->topLevelWidget()->setCaption(i18n("Nothing synced! No profiles defined for multisync!")); |
541 | return; | 540 | return; |
542 | } | 541 | } |
543 | 542 | ||
544 | int KSyncManager::ringSync() | 543 | int KSyncManager::ringSync() |
545 | { | 544 | { |
546 | 545 | ||
547 | int syncedProfiles = 0; | 546 | int syncedProfiles = 0; |
548 | unsigned int i; | 547 | unsigned int i; |
549 | QTime timer; | 548 | QTime timer; |
550 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); | 549 | KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); |
551 | QStringList syncProfileNames = mSyncProfileNames; | 550 | QStringList syncProfileNames = mSyncProfileNames; |
552 | KSyncProfile* temp = new KSyncProfile (); | 551 | KSyncProfile* temp = new KSyncProfile (); |
553 | mAskForPreferences = false; | 552 | mAskForPreferences = false; |
554 | for ( i = 0; i < syncProfileNames.count(); ++i ) { | 553 | for ( i = 0; i < syncProfileNames.count(); ++i ) { |
555 | mCurrentSyncProfile = i; | 554 | mCurrentSyncProfile = i; |
556 | temp->setName(syncProfileNames[mCurrentSyncProfile]); | 555 | temp->setName(syncProfileNames[mCurrentSyncProfile]); |
557 | temp->readConfig(&config); | 556 | temp->readConfig(&config); |
558 | 557 | ||
559 | bool includeInRingSync; | 558 | bool includeInRingSync = false; |
560 | switch(mTargetApp) | 559 | switch(mTargetApp) |
561 | { | 560 | { |
562 | case (KAPI): | 561 | case (KAPI): |
563 | includeInRingSync = temp->getIncludeInRingSyncAB(); | 562 | includeInRingSync = temp->getIncludeInRingSyncAB(); |
564 | break; | 563 | break; |
565 | case (KOPI): | 564 | case (KOPI): |
566 | includeInRingSync = temp->getIncludeInRingSync(); | 565 | includeInRingSync = temp->getIncludeInRingSync(); |
567 | break; | 566 | break; |
568 | case (PWMPI): | 567 | case (PWMPI): |
569 | includeInRingSync = temp->getIncludeInRingSyncPWM(); | 568 | includeInRingSync = temp->getIncludeInRingSyncPWM(); |
570 | break; | 569 | break; |
571 | default: | 570 | default: |
572 | qDebug("KSM::ringSync: invalid apptype selected"); | 571 | qDebug("KSM::ringSync: invalid apptype selected"); |
573 | break; | 572 | break; |
574 | 573 | ||
575 | } | 574 | } |
576 | 575 | ||
577 | 576 | ||
578 | if ( includeInRingSync && ( i < 1 || i > 2 )) { | 577 | if ( includeInRingSync && ( i < 1 || i > 2 )) { |
579 | mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); | 578 | mParent->topLevelWidget()->setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); |
580 | ++syncedProfiles; | 579 | ++syncedProfiles; |
581 | mSyncWithDesktop = false; | 580 | mSyncWithDesktop = false; |
582 | // mAskForPreferences = temp->getAskForPreferences(); | 581 | // mAskForPreferences = temp->getAskForPreferences(); |
583 | mWriteBackFile = temp->getWriteBackFile(); | 582 | mWriteBackFile = temp->getWriteBackFile(); |
584 | mWriteBackExistingOnly = temp->getWriteBackExisting(); | 583 | mWriteBackExistingOnly = temp->getWriteBackExisting(); |
585 | mIsKapiFile = temp->getIsKapiFile(); | 584 | mIsKapiFile = temp->getIsKapiFile(); |
586 | mWriteBackInFuture = 0; | 585 | mWriteBackInFuture = 0; |
587 | if ( temp->getWriteBackFuture() ) { | 586 | if ( temp->getWriteBackFuture() ) { |
588 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); | 587 | mWriteBackInFuture = temp->getWriteBackFutureWeeks( ); |
589 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); | 588 | mWriteBackInPast = temp->getWriteBackPastWeeks( ); |
590 | } | 589 | } |
591 | mFilterInCal = temp->getFilterInCal(); | 590 | mFilterInCal = temp->getFilterInCal(); |
diff --git a/libkdepim/phoneaccess.cpp b/libkdepim/phoneaccess.cpp index e24ad9e..89db22b 100644 --- a/libkdepim/phoneaccess.cpp +++ b/libkdepim/phoneaccess.cpp | |||
@@ -153,64 +153,64 @@ bool PhoneAccess::writeToPhone( QString fileName) | |||
153 | status->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 153 | status->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
154 | status->show(); | 154 | status->show(); |
155 | status->raise(); | 155 | status->raise(); |
156 | status->update(); | 156 | status->update(); |
157 | qApp->processEvents(); | 157 | qApp->processEvents(); |
158 | status->update(); | 158 | status->update(); |
159 | qApp->processEvents(); | 159 | qApp->processEvents(); |
160 | ret = system ( command.latin1()); | 160 | ret = system ( command.latin1()); |
161 | delete status; | 161 | delete status; |
162 | qApp->processEvents(); | 162 | qApp->processEvents(); |
163 | if ( ret ) { | 163 | if ( ret ) { |
164 | qDebug("Error S::command returned %d.", ret); | 164 | qDebug("Error S::command returned %d.", ret); |
165 | int retval = KMessageBox::warningContinueCancel(0, | 165 | int retval = KMessageBox::warningContinueCancel(0, |
166 | i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); | 166 | i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); |
167 | if ( retval != KMessageBox::Continue ) | 167 | if ( retval != KMessageBox::Continue ) |
168 | return false; | 168 | return false; |
169 | } | 169 | } |
170 | } | 170 | } |
171 | return true; | 171 | return true; |
172 | } | 172 | } |
173 | bool PhoneAccess::readFromPhone( QString fileName) | 173 | bool PhoneAccess::readFromPhone( QString fileName) |
174 | { | 174 | { |
175 | 175 | ||
176 | #ifdef DESKTOP_VERSION | 176 | #ifdef DESKTOP_VERSION |
177 | #ifdef _WIN32_ | 177 | #ifdef _WIN32_ |
178 | QString command ="kammu --backup " + fileName + " -yes" ; | 178 | QString command ="kammu --backup " + fileName + " -yes" ; |
179 | #else | 179 | #else |
180 | QString command ="./kammu --backup " + fileName + " -yes" ; | 180 | QString command ="./kammu --backup " + fileName + " -yes" ; |
181 | #endif | 181 | #endif |
182 | #else | 182 | #else |
183 | QString command ="kammu --backup " + fileName + " -yes" ; | 183 | QString command ="kammu --backup " + fileName + " -yes" ; |
184 | #endif | 184 | #endif |
185 | int ret; | 185 | int ret = 1; |
186 | while ( ret != 0 ) { | 186 | while ( ret != 0 ) { |
187 | QLabel* status = new QLabel( i18n(" This may take 1-3 minutes!"), 0 ); | 187 | QLabel* status = new QLabel( i18n(" This may take 1-3 minutes!"), 0 ); |
188 | int w = 235; | 188 | int w = 235; |
189 | int h = status->sizeHint().height()+20 ; | 189 | int h = status->sizeHint().height()+20 ; |
190 | int dw = QApplication::desktop()->width(); | 190 | int dw = QApplication::desktop()->width(); |
191 | int dh = QApplication::desktop()->height(); | 191 | int dh = QApplication::desktop()->height(); |
192 | if ( dw > 310 ) | 192 | if ( dw > 310 ) |
193 | w = 310; | 193 | w = 310; |
194 | status->setCaption(i18n("Reading from phone...") ); | 194 | status->setCaption(i18n("Reading from phone...") ); |
195 | status->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); | 195 | status->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); |
196 | status->show(); | 196 | status->show(); |
197 | status->raise(); | 197 | status->raise(); |
198 | status->update(); | 198 | status->update(); |
199 | qApp->processEvents(); | 199 | qApp->processEvents(); |
200 | status->update(); | 200 | status->update(); |
201 | qApp->processEvents(); | 201 | qApp->processEvents(); |
202 | ret = system ( command.latin1() ); | 202 | ret = system ( command.latin1() ); |
203 | delete status; | 203 | delete status; |
204 | qApp->processEvents(); | 204 | qApp->processEvents(); |
205 | if ( ret ) { | 205 | if ( ret ) { |
206 | qDebug("Error reading from phone:Command returned %d", ret); | 206 | qDebug("Error reading from phone:Command returned %d", ret); |
207 | int retval = KMessageBox::warningContinueCancel(0, | 207 | int retval = KMessageBox::warningContinueCancel(0, |
208 | i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); | 208 | i18n("Error accessing device!\nPlease turn on connection\nand retry!"),i18n("KDE/Pim phone access"),i18n("Retry"),i18n("Cancel")); |
209 | if ( retval != KMessageBox::Continue ) | 209 | if ( retval != KMessageBox::Continue ) |
210 | return false; | 210 | return false; |
211 | 211 | ||
212 | } | 212 | } |
213 | } | 213 | } |
214 | qApp->processEvents(); | 214 | qApp->processEvents(); |
215 | return true; | 215 | return true; |
216 | } | 216 | } |
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index 21aa0a4..f05b91b 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp | |||
@@ -56,55 +56,56 @@ void KApplication::showFile(QString caption, QString fn) | |||
56 | #else | 56 | #else |
57 | fileName = qApp->applicationDirPath () + "/" + fn; | 57 | fileName = qApp->applicationDirPath () + "/" + fn; |
58 | #endif | 58 | #endif |
59 | QFile file( fileName ); | 59 | QFile file( fileName ); |
60 | if (!file.open( IO_ReadOnly ) ) { | 60 | if (!file.open( IO_ReadOnly ) ) { |
61 | return ; | 61 | return ; |
62 | } | 62 | } |
63 | QTextStream ts( &file ); | 63 | QTextStream ts( &file ); |
64 | text = ts.read(); | 64 | text = ts.read(); |
65 | file.close(); | 65 | file.close(); |
66 | KApplication::showText( caption, text ); | 66 | KApplication::showText( caption, text ); |
67 | 67 | ||
68 | } | 68 | } |
69 | 69 | ||
70 | bool KApplication::convert2latin1(QString fileName) | 70 | bool KApplication::convert2latin1(QString fileName) |
71 | { | 71 | { |
72 | QString text; | 72 | QString text; |
73 | QFile file( fileName ); | 73 | QFile file( fileName ); |
74 | if (!file.open( IO_ReadOnly ) ) { | 74 | if (!file.open( IO_ReadOnly ) ) { |
75 | return false; | 75 | return false; |
76 | 76 | ||
77 | } | 77 | } |
78 | QTextStream ts( &file ); | 78 | QTextStream ts( &file ); |
79 | ts.setEncoding( QTextStream::UnicodeUTF8 ); | 79 | ts.setEncoding( QTextStream::UnicodeUTF8 ); |
80 | text = ts.read(); | 80 | text = ts.read(); |
81 | file.close(); | 81 | file.close(); |
82 | if (!file.open( IO_WriteOnly ) ) { | 82 | if (!file.open( IO_WriteOnly ) ) { |
83 | return false; | 83 | return false; |
84 | } | 84 | } |
85 | QTextStream tsIn( &file ); | 85 | QTextStream tsIn( &file ); |
86 | tsIn.setEncoding( QTextStream::Latin1 ); | 86 | tsIn.setEncoding( QTextStream::Latin1 ); |
87 | tsIn << text.latin1(); | 87 | tsIn << text.latin1(); |
88 | file.close(); | 88 | file.close(); |
89 | return true; | ||
89 | 90 | ||
90 | 91 | ||
91 | } | 92 | } |
92 | void KApplication::showText(QString caption, QString text) | 93 | void KApplication::showText(QString caption, QString text) |
93 | { | 94 | { |
94 | QDialog dia( 0, "name", true ); ; | 95 | QDialog dia( 0, "name", true ); ; |
95 | dia.setCaption( caption ); | 96 | dia.setCaption( caption ); |
96 | QVBoxLayout* lay = new QVBoxLayout( &dia ); | 97 | QVBoxLayout* lay = new QVBoxLayout( &dia ); |
97 | lay->setSpacing( 3 ); | 98 | lay->setSpacing( 3 ); |
98 | lay->setMargin( 3 ); | 99 | lay->setMargin( 3 ); |
99 | KTextEdit tb ( &dia ); | 100 | KTextEdit tb ( &dia ); |
100 | tb.setWordWrap( QMultiLineEdit::WidgetWidth ); | 101 | tb.setWordWrap( QMultiLineEdit::WidgetWidth ); |
101 | lay->addWidget( &tb ); | 102 | lay->addWidget( &tb ); |
102 | tb.setText( text ); | 103 | tb.setText( text ); |
103 | #ifdef DESKTOP_VERSION | 104 | #ifdef DESKTOP_VERSION |
104 | dia.resize( 640, 480); | 105 | dia.resize( 640, 480); |
105 | #else | 106 | #else |
106 | dia.showMaximized(); | 107 | dia.showMaximized(); |
107 | #endif | 108 | #endif |
108 | dia.exec(); | 109 | dia.exec(); |
109 | 110 | ||
110 | } | 111 | } |
diff --git a/microkde/kdecore/klibloader.cpp b/microkde/kdecore/klibloader.cpp index 1394154..6d0475a 100644 --- a/microkde/kdecore/klibloader.cpp +++ b/microkde/kdecore/klibloader.cpp | |||
@@ -467,75 +467,67 @@ KLibrary* KLibLoader::library( const char *name ) | |||
467 | return wrap->lib; | 467 | return wrap->lib; |
468 | } | 468 | } |
469 | 469 | ||
470 | /* Test if this library was loaded at some time, but got | 470 | /* Test if this library was loaded at some time, but got |
471 | unloaded meanwhile, whithout being dlclose()'ed. */ | 471 | unloaded meanwhile, whithout being dlclose()'ed. */ |
472 | QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); | 472 | QPtrListIterator<KLibWrapPrivate> it(d->loaded_stack); |
473 | for (; it.current(); ++it) { | 473 | for (; it.current(); ++it) { |
474 | if (it.current()->name == name) | 474 | if (it.current()->name == name) |
475 | wrap = it.current(); | 475 | wrap = it.current(); |
476 | } | 476 | } |
477 | 477 | ||
478 | if (wrap) { | 478 | if (wrap) { |
479 | d->pending_close.removeRef(wrap); | 479 | d->pending_close.removeRef(wrap); |
480 | if (!wrap->lib) { | 480 | if (!wrap->lib) { |
481 | /* This lib only was in loaded_stack, but not in m_libs. */ | 481 | /* This lib only was in loaded_stack, but not in m_libs. */ |
482 | wrap->lib = new KLibrary( name, wrap->filename, wrap->handle ); | 482 | wrap->lib = new KLibrary( name, wrap->filename, wrap->handle ); |
483 | } | 483 | } |
484 | wrap->ref_count++; | 484 | wrap->ref_count++; |
485 | } else { | 485 | } else { |
486 | QString libfile = findLibrary( name ); | 486 | QString libfile = findLibrary( name ); |
487 | if ( libfile.isEmpty() ) | 487 | if ( libfile.isEmpty() ) |
488 | return 0; | 488 | return 0; |
489 | #ifdef DESKTOP_VERSION | 489 | #ifdef DESKTOP_VERSION |
490 | QLibrary *qlib = new QLibrary( libfile.latin1() ); | 490 | QLibrary *qlib = new QLibrary( libfile.latin1() ); |
491 | #else | 491 | #else |
492 | QLibrary *qlib = new QLibrary( libfile.latin1(), QLibrary::Immediately ); | 492 | QLibrary *qlib = new QLibrary( libfile.latin1(), QLibrary::Immediately ); |
493 | #endif | 493 | #endif |
494 | 494 | ||
495 | //US lt_dlhandle handle = lt_dlopen( libfile.latin1() ); | 495 | //US lt_dlhandle handle = lt_dlopen( libfile.latin1() ); |
496 | //US if ( !handle ) | 496 | //US if ( !handle ) |
497 | if ( !qlib ) | 497 | if ( !qlib ) |
498 | { | 498 | { |
499 | //US const char* errmsg = lt_dlerror(); | 499 | qDebug( "KLibLoader::library could not load library: %s", libfile.latin1()); |
500 | char* errmsg; | 500 | d->errorMessage = QString::null; |
501 | sprintf(errmsg, "KLibLoader::library could not load library: %s", libfile.latin1()); | 501 | return 0; |
502 | qDebug(errmsg); | ||
503 | |||
504 | if(errmsg) | ||
505 | d->errorMessage = QString::fromLatin1(errmsg); | ||
506 | else | ||
507 | d->errorMessage = QString::null; | ||
508 | kdWarning(150) << "library=" << name << ": file=" << libfile << ": " << d->errorMessage << endl; | ||
509 | return 0; | ||
510 | } | 502 | } |
511 | else | 503 | else |
512 | d->errorMessage = QString::null; | 504 | d->errorMessage = QString::null; |
513 | 505 | ||
514 | KLibrary *lib = new KLibrary( name, libfile, qlib ); | 506 | KLibrary *lib = new KLibrary( name, libfile, qlib ); |
515 | wrap = new KLibWrapPrivate(lib, qlib); | 507 | wrap = new KLibWrapPrivate(lib, qlib); |
516 | d->loaded_stack.prepend(wrap); | 508 | d->loaded_stack.prepend(wrap); |
517 | } | 509 | } |
518 | m_libs.insert( name, wrap ); | 510 | m_libs.insert( name, wrap ); |
519 | 511 | ||
520 | connect( wrap->lib, SIGNAL( destroyed() ), | 512 | connect( wrap->lib, SIGNAL( destroyed() ), |
521 | this, SLOT( slotLibraryDestroyed() ) ); | 513 | this, SLOT( slotLibraryDestroyed() ) ); |
522 | 514 | ||
523 | return wrap->lib; | 515 | return wrap->lib; |
524 | } | 516 | } |
525 | 517 | ||
526 | QString KLibLoader::lastErrorMessage() const | 518 | QString KLibLoader::lastErrorMessage() const |
527 | { | 519 | { |
528 | return d->errorMessage; | 520 | return d->errorMessage; |
529 | } | 521 | } |
530 | 522 | ||
531 | void KLibLoader::unloadLibrary( const char *libname ) | 523 | void KLibLoader::unloadLibrary( const char *libname ) |
532 | { | 524 | { |
533 | KLibWrapPrivate *wrap = m_libs[ libname ]; | 525 | KLibWrapPrivate *wrap = m_libs[ libname ]; |
534 | if (!wrap) | 526 | if (!wrap) |
535 | return; | 527 | return; |
536 | if (--wrap->ref_count) | 528 | if (--wrap->ref_count) |
537 | return; | 529 | return; |
538 | 530 | ||
539 | // kdDebug(150) << "closing library " << libname << endl; | 531 | // kdDebug(150) << "closing library " << libname << endl; |
540 | 532 | ||
541 | m_libs.remove( libname ); | 533 | m_libs.remove( libname ); |
diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index 1ad1728..09ad0c8 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp | |||
@@ -849,65 +849,65 @@ int KToolBar::itemIndex (int id) | |||
849 | } | 849 | } |
850 | 850 | ||
851 | 851 | ||
852 | void KToolBar::setFullSize(bool flag ) | 852 | void KToolBar::setFullSize(bool flag ) |
853 | { | 853 | { |
854 | setHorizontalStretchable( flag ); | 854 | setHorizontalStretchable( flag ); |
855 | setVerticalStretchable( flag ); | 855 | setVerticalStretchable( flag ); |
856 | } | 856 | } |
857 | 857 | ||
858 | 858 | ||
859 | bool KToolBar::fullSize() const | 859 | bool KToolBar::fullSize() const |
860 | { | 860 | { |
861 | return isHorizontalStretchable() || isVerticalStretchable(); | 861 | return isHorizontalStretchable() || isVerticalStretchable(); |
862 | } | 862 | } |
863 | 863 | ||
864 | 864 | ||
865 | void KToolBar::enableMoving(bool flag ) | 865 | void KToolBar::enableMoving(bool flag ) |
866 | { | 866 | { |
867 | //US setMovingEnabled(flag); | 867 | //US setMovingEnabled(flag); |
868 | this->mainWindow()->setToolBarsMovable(flag); | 868 | this->mainWindow()->setToolBarsMovable(flag); |
869 | } | 869 | } |
870 | 870 | ||
871 | 871 | ||
872 | void KToolBar::setBarPos (BarPosition bpos) | 872 | void KToolBar::setBarPos (BarPosition bpos) |
873 | { | 873 | { |
874 | if ( !mainWindow() ) | 874 | if ( !mainWindow() ) |
875 | return; | 875 | return; |
876 | //US mainWindow()->moveDockWindow( this, (Dock)bpos ); | 876 | //US mainWindow()->moveDockWindow( this, (Dock)bpos ); |
877 | mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); | 877 | mainWindow()->moveToolBar( this, (QMainWindow::ToolBarDock)bpos ); |
878 | } | 878 | } |
879 | 879 | ||
880 | 880 | ||
881 | KToolBar::BarPosition KToolBar::barPos() | 881 | KToolBar::BarPosition KToolBar::barPos() const |
882 | { | 882 | { |
883 | if ( !(QMainWindow*)mainWindow() ) | 883 | if ( !(QMainWindow*)mainWindow() ) |
884 | return KToolBar::Top; | 884 | return KToolBar::Top; |
885 | //US Dock dock; | 885 | //US Dock dock; |
886 | QMainWindow::ToolBarDock dock; | 886 | QMainWindow::ToolBarDock dock; |
887 | int dm1, dm2; | 887 | int dm1, dm2; |
888 | bool dm3; | 888 | bool dm3; |
889 | ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); | 889 | ((QMainWindow*)mainWindow())->getLocation( (QToolBar*)this, dock, dm1, dm3, dm2 ); |
890 | //US if ( dock == DockUnmanaged ) { | 890 | //US if ( dock == DockUnmanaged ) { |
891 | if ( dock == QMainWindow::Unmanaged ) { | 891 | if ( dock == QMainWindow::Unmanaged ) { |
892 | return (KToolBar::BarPosition)Top; | 892 | return (KToolBar::BarPosition)Top; |
893 | } | 893 | } |
894 | return (BarPosition)dock; | 894 | return (BarPosition)dock; |
895 | } | 895 | } |
896 | 896 | ||
897 | 897 | ||
898 | bool KToolBar::enable(BarStatus stat) | 898 | bool KToolBar::enable(BarStatus stat) |
899 | { | 899 | { |
900 | bool mystat = isVisible(); | 900 | bool mystat = isVisible(); |
901 | 901 | ||
902 | if ( (stat == Toggle && mystat) || stat == Hide ) | 902 | if ( (stat == Toggle && mystat) || stat == Hide ) |
903 | hide(); | 903 | hide(); |
904 | else | 904 | else |
905 | show(); | 905 | show(); |
906 | 906 | ||
907 | return isVisible() == mystat; | 907 | return isVisible() == mystat; |
908 | } | 908 | } |
909 | 909 | ||
910 | 910 | ||
911 | void KToolBar::setMaxHeight ( int h ) | 911 | void KToolBar::setMaxHeight ( int h ) |
912 | { | 912 | { |
913 | setMaximumHeight( h ); | 913 | setMaximumHeight( h ); |
diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h index 61b5ea3..49ff856 100644 --- a/microkde/kdeui/ktoolbar.h +++ b/microkde/kdeui/ktoolbar.h | |||
@@ -717,65 +717,65 @@ public: | |||
717 | * In full size mode the bar | 717 | * In full size mode the bar |
718 | * extends over the parent's full width or height. If the mode is disabled | 718 | * extends over the parent's full width or height. If the mode is disabled |
719 | * the toolbar tries to take as much space as it needs without wrapping, but | 719 | * the toolbar tries to take as much space as it needs without wrapping, but |
720 | * it does not exceed the parent box. You can force a certain width or | 720 | * it does not exceed the parent box. You can force a certain width or |
721 | * height with @ref setMaxWidth() or @ref setMaxHeight(). | 721 | * height with @ref setMaxWidth() or @ref setMaxHeight(). |
722 | * | 722 | * |
723 | * If you want to use right-aligned items or auto-sized items you must use | 723 | * If you want to use right-aligned items or auto-sized items you must use |
724 | * full size mode. | 724 | * full size mode. |
725 | */ | 725 | */ |
726 | void setFullSize(bool flag = true); | 726 | void setFullSize(bool flag = true); |
727 | 727 | ||
728 | /** | 728 | /** |
729 | * @return @p true if the full-size mode is enabled. Otherwise | 729 | * @return @p true if the full-size mode is enabled. Otherwise |
730 | * it returns @false. | 730 | * it returns @false. |
731 | */ | 731 | */ |
732 | bool fullSize() const; | 732 | bool fullSize() const; |
733 | 733 | ||
734 | /** | 734 | /** |
735 | * @deprecated use setMovingEnabled(bool) instead. | 735 | * @deprecated use setMovingEnabled(bool) instead. |
736 | * Enable or disable moving of toolbar. | 736 | * Enable or disable moving of toolbar. |
737 | */ | 737 | */ |
738 | void enableMoving(bool flag = true); | 738 | void enableMoving(bool flag = true); |
739 | 739 | ||
740 | /** | 740 | /** |
741 | * Set position of toolbar. | 741 | * Set position of toolbar. |
742 | * @see BarPosition() | 742 | * @see BarPosition() |
743 | */ | 743 | */ |
744 | void setBarPos (BarPosition bpos); | 744 | void setBarPos (BarPosition bpos); |
745 | 745 | ||
746 | /** | 746 | /** |
747 | * Returns position of toolbar. | 747 | * Returns position of toolbar. |
748 | */ | 748 | */ |
749 | BarPosition barPos(); | 749 | BarPosition barPos() const; |
750 | 750 | ||
751 | /** | 751 | /** |
752 | * @deprecated | 752 | * @deprecated |
753 | * Show, hide, or toggle toolbar. | 753 | * Show, hide, or toggle toolbar. |
754 | * | 754 | * |
755 | * This method is provided for compatibility only, | 755 | * This method is provided for compatibility only, |
756 | * please use show() and/or hide() instead. | 756 | * please use show() and/or hide() instead. |
757 | * @see BarStatus | 757 | * @see BarStatus |
758 | */ | 758 | */ |
759 | bool enable(BarStatus stat); | 759 | bool enable(BarStatus stat); |
760 | 760 | ||
761 | /** | 761 | /** |
762 | * @deprecated | 762 | * @deprecated |
763 | * Use setMaximumHeight() instead. | 763 | * Use setMaximumHeight() instead. |
764 | */ | 764 | */ |
765 | void setMaxHeight (int h); // Set max height for vertical toolbars | 765 | void setMaxHeight (int h); // Set max height for vertical toolbars |
766 | 766 | ||
767 | /** | 767 | /** |
768 | * @deprecated | 768 | * @deprecated |
769 | * Use maximumHeight() instead. | 769 | * Use maximumHeight() instead. |
770 | * Returns the value that was set with @ref setMaxHeight(). | 770 | * Returns the value that was set with @ref setMaxHeight(). |
771 | */ | 771 | */ |
772 | int maxHeight(); | 772 | int maxHeight(); |
773 | 773 | ||
774 | /** | 774 | /** |
775 | * @deprecated | 775 | * @deprecated |
776 | * Use setMaximumWidth() instead. | 776 | * Use setMaximumWidth() instead. |
777 | * Set maximal width of horizontal (top or bottom) toolbar. | 777 | * Set maximal width of horizontal (top or bottom) toolbar. |
778 | */ | 778 | */ |
779 | void setMaxWidth (int dw); | 779 | void setMaxWidth (int dw); |
780 | 780 | ||
781 | /** | 781 | /** |