author | zautrix <zautrix> | 2005-08-19 13:29:20 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-19 13:29:20 (UTC) |
commit | 14cc7e0e2440d19cee538b10ba158f4b8c362e4e (patch) (unidiff) | |
tree | 57a79bf5a7d50ea9ea332f6634da243199b074e9 | |
parent | 9014049779be6cfec02d73e19596439f0f4f9bed (diff) | |
download | kdepimpi-14cc7e0e2440d19cee538b10ba158f4b8c362e4e.zip kdepimpi-14cc7e0e2440d19cee538b10ba158f4b8c362e4e.tar.gz kdepimpi-14cc7e0e2440d19cee538b10ba158f4b8c362e4e.tar.bz2 |
fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | kabc/plugins/dir/resourcedir.cpp | 7 | ||||
-rw-r--r-- | kabc/plugins/file/resourcefile.cpp | 7 | ||||
-rw-r--r-- | kabc/plugins/ldap/resourceldap.cpp | 7 | ||||
-rwxr-xr-x | winbuildall.bat | 3 |
5 files changed, 28 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index a895bb0..210b135 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,41 +1,46 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.2.2 ************ | 3 | ********** VERSION 2.2.2 ************ |
4 | 4 | ||
5 | KO/Pi: | ||
6 | Fixed a problem with the sort order of last modified date in list view. | ||
7 | KA/Pi: | ||
8 | Fixed a resource config read problem on windows. | ||
9 | |||
5 | 10 | ||
6 | ********** VERSION 2.2.1 ************ | 11 | ********** VERSION 2.2.1 ************ |
7 | 12 | ||
8 | KO/Pi: | 13 | KO/Pi: |
9 | Fixed a problem displaying very long allday events in agenda view in single day mode. | 14 | Fixed a problem displaying very long allday events in agenda view in single day mode. |
10 | Fixed a problem with the default settings for new todos. | 15 | Fixed a problem with the default settings for new todos. |
11 | Added an error message dialog if saving of calendar files is not possible. | 16 | Added an error message dialog if saving of calendar files is not possible. |
12 | Made it impossible to close KO/Pi if saving fails. | 17 | Made it impossible to close KO/Pi if saving fails. |
13 | Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick. | 18 | Fixed a problem adding calendars on windows such that these calendars can be used on the memory stick. |
14 | Added config options for conflict detection. | 19 | Added config options for conflict detection. |
15 | 20 | ||
16 | KA/Pi: | 21 | KA/Pi: |
17 | Added a config option to turn on asking before a contact is deleted. | 22 | Added a config option to turn on asking before a contact is deleted. |
18 | Fixed a problem with the default view and view selection at startup. | 23 | Fixed a problem with the default view and view selection at startup. |
19 | Formatted name is now set on import, if formatted name is empty. | 24 | Formatted name is now set on import, if formatted name is empty. |
20 | Fixed a problem of displaying images in the contact details view: | 25 | Fixed a problem of displaying images in the contact details view: |
21 | Now the wid/hei ratio is not changed. | 26 | Now the wid/hei ratio is not changed. |
22 | I a picture is larger than 128 pixels in wid or hei it is downscaled to | 27 | I a picture is larger than 128 pixels in wid or hei it is downscaled to |
23 | max 128 pixels wid/hei. | 28 | max 128 pixels wid/hei. |
24 | 29 | ||
25 | ********** VERSION 2.2.0 ************ | 30 | ********** VERSION 2.2.0 ************ |
26 | 31 | ||
27 | New stable release! | 32 | New stable release! |
28 | Fixed some minor usability problems. | 33 | Fixed some minor usability problems. |
29 | Added writing of next alarm to a file for usage on pdaXrom. | 34 | Added writing of next alarm to a file for usage on pdaXrom. |
30 | 35 | ||
31 | 36 | ||
32 | ************************************* | 37 | ************************************* |
33 | 38 | ||
34 | You can find the complete changelog | 39 | You can find the complete changelog |
35 | from version 1.7.7 to 2.2.0 | 40 | from version 1.7.7 to 2.2.0 |
36 | in the source package or on | 41 | in the source package or on |
37 | 42 | ||
38 | http://www.pi-sync.net/html/changelog.html | 43 | http://www.pi-sync.net/html/changelog.html |
39 | 44 | ||
40 | 45 | ||
41 | 46 | ||
diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index e2b7b08..c61664b 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp | |||
@@ -25,128 +25,135 @@ Copyright (c) 2004 Ulf Schenk | |||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | 28 | ||
29 | #include <sys/types.h> | 29 | #include <sys/types.h> |
30 | #include <sys/stat.h> | 30 | #include <sys/stat.h> |
31 | #ifndef _WIN32_ | 31 | #ifndef _WIN32_ |
32 | #include <unistd.h> | 32 | #include <unistd.h> |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #include <qregexp.h> | 35 | #include <qregexp.h> |
36 | #include <qtimer.h> | 36 | #include <qtimer.h> |
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | 38 | ||
39 | #include <kapplication.h> | 39 | #include <kapplication.h> |
40 | #include <kconfig.h> | 40 | #include <kconfig.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | //US #include <kgenericfactory.h> | 42 | //US #include <kgenericfactory.h> |
43 | #include <kglobal.h> | 43 | #include <kglobal.h> |
44 | #include <klocale.h> | 44 | #include <klocale.h> |
45 | #include <kstandarddirs.h> | 45 | #include <kstandarddirs.h> |
46 | #include <kurlrequester.h> | 46 | #include <kurlrequester.h> |
47 | #include <kmessagebox.h> | 47 | #include <kmessagebox.h> |
48 | 48 | ||
49 | #include "addressbook.h" | 49 | #include "addressbook.h" |
50 | 50 | ||
51 | #include "formatfactory.h" | 51 | #include "formatfactory.h" |
52 | 52 | ||
53 | #include "resourcedirconfig.h" | 53 | #include "resourcedirconfig.h" |
54 | #include "stdaddressbook.h" | 54 | #include "stdaddressbook.h" |
55 | 55 | ||
56 | //US | 56 | //US |
57 | #include <qdir.h> | 57 | #include <qdir.h> |
58 | 58 | ||
59 | #define NO_DIRWATCH | 59 | #define NO_DIRWATCH |
60 | #include "resourcedir.h" | 60 | #include "resourcedir.h" |
61 | 61 | ||
62 | //#define ALLOW_LOCKING | 62 | //#define ALLOW_LOCKING |
63 | 63 | ||
64 | using namespace KABC; | 64 | using namespace KABC; |
65 | 65 | ||
66 | extern "C" | 66 | extern "C" |
67 | #ifdef _WIN32_ | 67 | #ifdef _WIN32_ |
68 | __declspec(dllexport) | 68 | __declspec(dllexport) |
69 | #else | 69 | #else |
70 | { | 70 | { |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | //US void *init_kabc_dir() | 73 | //US void *init_kabc_dir() |
74 | void *init_microkabc_dir() | 74 | void *init_microkabc_dir() |
75 | { | 75 | { |
76 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); | 76 | return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); |
77 | } | 77 | } |
78 | #ifndef _WIN32_ | 78 | #ifndef _WIN32_ |
79 | } | 79 | } |
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | ResourceDir::ResourceDir( const KConfig *config ) | 82 | ResourceDir::ResourceDir( const KConfig *config ) |
83 | : Resource( config ) | 83 | : Resource( config ) |
84 | { | 84 | { |
85 | QString path; | 85 | QString path; |
86 | 86 | ||
87 | KConfig *cfg = (KConfig *)config; | 87 | KConfig *cfg = (KConfig *)config; |
88 | if ( cfg ) { | 88 | if ( cfg ) { |
89 | #ifdef _WIN32_ | ||
90 | // we use plugins on win32. the group is stored in a static variable | ||
91 | // such that group info not available on win32 plugins | ||
92 | // to fix that, it would be a looooot of work | ||
93 | if ( !cfg->tempGroup().isEmpty() ) | ||
94 | cfg->setGroup( cfg->tempGroup() ); | ||
95 | #endif | ||
89 | //US path = config->readEntry( "FilePath" ); | 96 | //US path = config->readEntry( "FilePath" ); |
90 | path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); | 97 | path = cfg->readEntry( "FilePath", StdAddressBook::directoryName() ); |
91 | //US mFormatName = config->readEntry( "FileFormat" ); | 98 | //US mFormatName = config->readEntry( "FileFormat" ); |
92 | mFormatName = cfg->readEntry( "FileFormat", "vcard" ); | 99 | mFormatName = cfg->readEntry( "FileFormat", "vcard" ); |
93 | } else { | 100 | } else { |
94 | path = StdAddressBook::directoryName(); | 101 | path = StdAddressBook::directoryName(); |
95 | mFormatName = "vcard"; | 102 | mFormatName = "vcard"; |
96 | } | 103 | } |
97 | 104 | ||
98 | 105 | ||
99 | FormatFactory *factory = FormatFactory::self(); | 106 | FormatFactory *factory = FormatFactory::self(); |
100 | mFormat = factory->format( mFormatName ); | 107 | mFormat = factory->format( mFormatName ); |
101 | 108 | ||
102 | if ( !mFormat ) { | 109 | if ( !mFormat ) { |
103 | mFormatName = "vcard"; | 110 | mFormatName = "vcard"; |
104 | mFormat = factory->format( mFormatName ); | 111 | mFormat = factory->format( mFormatName ); |
105 | } | 112 | } |
106 | 113 | ||
107 | /*US | 114 | /*US |
108 | //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); | 115 | //US qDebug("ResourceDir::ResourceDir initialized with format %s ", mFormatName.latin1()); |
109 | if (mFormatName == "vcard") | 116 | if (mFormatName == "vcard") |
110 | mFormat = new VCardFormatPlugin2(); | 117 | mFormat = new VCardFormatPlugin2(); |
111 | else if (mFormatName == "binary") | 118 | else if (mFormatName == "binary") |
112 | mFormat = new BinaryFormat(); | 119 | mFormat = new BinaryFormat(); |
113 | else | 120 | else |
114 | qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); | 121 | qDebug("ResourceFile::init format unknown !!! %s ", mFormatName.latin1()); |
115 | */ | 122 | */ |
116 | #ifndef NO_DIRWATCH | 123 | #ifndef NO_DIRWATCH |
117 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); | 124 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( pathChanged() ) ); |
118 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); | 125 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( pathChanged() ) ); |
119 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); | 126 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( pathChanged() ) ); |
120 | #endif | 127 | #endif |
121 | setPath( path ); | 128 | setPath( path ); |
122 | } | 129 | } |
123 | 130 | ||
124 | ResourceDir::~ResourceDir() | 131 | ResourceDir::~ResourceDir() |
125 | { | 132 | { |
126 | delete mFormat; | 133 | delete mFormat; |
127 | mFormat = 0; | 134 | mFormat = 0; |
128 | } | 135 | } |
129 | 136 | ||
130 | void ResourceDir::writeConfig( KConfig *config ) | 137 | void ResourceDir::writeConfig( KConfig *config ) |
131 | { | 138 | { |
132 | config->setGroup( "Resource_" + identifier() ); | 139 | config->setGroup( "Resource_" + identifier() ); |
133 | Resource::writeConfig( config ); | 140 | Resource::writeConfig( config ); |
134 | 141 | ||
135 | config->writeEntry( "FilePath", mPath ); | 142 | config->writeEntry( "FilePath", mPath ); |
136 | config->writeEntry( "FileFormat", mFormatName ); | 143 | config->writeEntry( "FileFormat", mFormatName ); |
137 | } | 144 | } |
138 | 145 | ||
139 | Ticket *ResourceDir::requestSaveTicket() | 146 | Ticket *ResourceDir::requestSaveTicket() |
140 | { | 147 | { |
141 | 148 | ||
142 | 149 | ||
143 | if ( !addressBook() ) return 0; | 150 | if ( !addressBook() ) return 0; |
144 | #ifdef ALLOW_LOCKING | 151 | #ifdef ALLOW_LOCKING |
145 | if ( !lock( mPath ) ) { | 152 | if ( !lock( mPath ) ) { |
146 | 153 | ||
147 | return 0; | 154 | return 0; |
148 | } | 155 | } |
149 | #endif | 156 | #endif |
150 | return createTicket( this ); | 157 | return createTicket( this ); |
151 | 158 | ||
152 | } | 159 | } |
diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index c89939d..dad4571 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp | |||
@@ -22,128 +22,135 @@ | |||
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <sys/types.h> | 28 | #include <sys/types.h> |
29 | #include <sys/stat.h> | 29 | #include <sys/stat.h> |
30 | #ifndef _WIN32_ | 30 | #ifndef _WIN32_ |
31 | #include <unistd.h> | 31 | #include <unistd.h> |
32 | #endif | 32 | #endif |
33 | 33 | ||
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qfileinfo.h> | 35 | #include <qfileinfo.h> |
36 | #include <qregexp.h> | 36 | #include <qregexp.h> |
37 | #include <qtimer.h> | 37 | #include <qtimer.h> |
38 | 38 | ||
39 | #include <kapplication.h> | 39 | #include <kapplication.h> |
40 | #include <kconfig.h> | 40 | #include <kconfig.h> |
41 | #include <kdebug.h> | 41 | #include <kdebug.h> |
42 | #include <klocale.h> | 42 | #include <klocale.h> |
43 | //US #include <ksavefile.h> | 43 | //US #include <ksavefile.h> |
44 | #include <kstandarddirs.h> | 44 | #include <kstandarddirs.h> |
45 | #include <kmessagebox.h> | 45 | #include <kmessagebox.h> |
46 | #include <kglobalsettings.h> | 46 | #include <kglobalsettings.h> |
47 | 47 | ||
48 | #include "formatfactory.h" | 48 | #include "formatfactory.h" |
49 | 49 | ||
50 | #include "resource.h" | 50 | #include "resource.h" |
51 | #include "resourcefileconfig.h" | 51 | #include "resourcefileconfig.h" |
52 | #include "stdaddressbook.h" | 52 | #include "stdaddressbook.h" |
53 | #define NO_DIRWATCH | 53 | #define NO_DIRWATCH |
54 | #include "resourcefile.h" | 54 | #include "resourcefile.h" |
55 | 55 | ||
56 | //#define ALLOW_LOCKING | 56 | //#define ALLOW_LOCKING |
57 | 57 | ||
58 | 58 | ||
59 | using namespace KABC; | 59 | using namespace KABC; |
60 | 60 | ||
61 | extern "C" | 61 | extern "C" |
62 | #ifdef _WIN32_ | 62 | #ifdef _WIN32_ |
63 | __declspec(dllexport) | 63 | __declspec(dllexport) |
64 | #else | 64 | #else |
65 | { | 65 | { |
66 | #endif | 66 | #endif |
67 | 67 | ||
68 | //US void *init_kabc_file() | 68 | //US void *init_kabc_file() |
69 | void *init_microkabc_file() | 69 | void *init_microkabc_file() |
70 | { | 70 | { |
71 | return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); | 71 | return new KRES::PluginFactory<ResourceFile,ResourceFileConfig>(); |
72 | } | 72 | } |
73 | #ifndef _WIN32_ | 73 | #ifndef _WIN32_ |
74 | } | 74 | } |
75 | #endif | 75 | #endif |
76 | 76 | ||
77 | ResourceFile::ResourceFile( const KConfig *config ) | 77 | ResourceFile::ResourceFile( const KConfig *config ) |
78 | : Resource( config ) , mFormat( 0 ) | 78 | : Resource( config ) , mFormat( 0 ) |
79 | { | 79 | { |
80 | QString fileName, formatName, default_fileName; | 80 | QString fileName, formatName, default_fileName; |
81 | 81 | ||
82 | default_fileName = StdAddressBook::fileName(); | 82 | default_fileName = StdAddressBook::fileName(); |
83 | mLastBackupDate = -1; | 83 | mLastBackupDate = -1; |
84 | KConfig *cfg = (KConfig *)config; | 84 | KConfig *cfg = (KConfig *)config; |
85 | if ( cfg ) { | 85 | if ( cfg ) { |
86 | #ifdef _WIN32_ | ||
87 | // we use plugins on win32. the group is stored in a static variable | ||
88 | // such that group info not available on win32 plugins | ||
89 | // to fix that, it would be a looooot of work | ||
90 | if ( !cfg->tempGroup().isEmpty() ) | ||
91 | cfg->setGroup( cfg->tempGroup() ); | ||
92 | #endif | ||
86 | fileName = cfg->readEntry( "FileName", default_fileName ); | 93 | fileName = cfg->readEntry( "FileName", default_fileName ); |
87 | formatName = cfg->readEntry( "FileFormat", "vcard" ); | 94 | formatName = cfg->readEntry( "FileFormat", "vcard" ); |
88 | mFamily = cfg->readEntry( "ResourceName", "std" ); | 95 | mFamily = cfg->readEntry( "ResourceName", "std" ); |
89 | mLastBackupDate = cfg->readNumEntry( "LastBackupDate", 0 ); | 96 | mLastBackupDate = cfg->readNumEntry( "LastBackupDate", 0 ); |
90 | } else { | 97 | } else { |
91 | fileName = default_fileName; | 98 | fileName = default_fileName; |
92 | formatName = "vcard"; | 99 | formatName = "vcard"; |
93 | } | 100 | } |
94 | 101 | ||
95 | init( fileName, formatName ); | 102 | init( fileName, formatName ); |
96 | } | 103 | } |
97 | 104 | ||
98 | ResourceFile::ResourceFile( const QString &fileName , | 105 | ResourceFile::ResourceFile( const QString &fileName , |
99 | const QString &formatName ) | 106 | const QString &formatName ) |
100 | : Resource( 0 ) | 107 | : Resource( 0 ) |
101 | { | 108 | { |
102 | // qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); | 109 | // qDebug("ResourceFile::ResourceFile : 3 %s, %s", fileName.latin1(), formatName.latin1()); |
103 | 110 | ||
104 | 111 | ||
105 | mLastBackupDate = -1; | 112 | mLastBackupDate = -1; |
106 | init( fileName, formatName ); | 113 | init( fileName, formatName ); |
107 | } | 114 | } |
108 | 115 | ||
109 | void ResourceFile::init( const QString &fileName, const QString &formatName ) | 116 | void ResourceFile::init( const QString &fileName, const QString &formatName ) |
110 | { | 117 | { |
111 | mFormatName = formatName; | 118 | mFormatName = formatName; |
112 | 119 | ||
113 | FormatFactory *factory = FormatFactory::self(); | 120 | FormatFactory *factory = FormatFactory::self(); |
114 | mFormat = factory->format( mFormatName ); | 121 | mFormat = factory->format( mFormatName ); |
115 | 122 | ||
116 | if ( !mFormat ) { | 123 | if ( !mFormat ) { |
117 | mFormatName = "vcard"; | 124 | mFormatName = "vcard"; |
118 | mFormat = factory->format( mFormatName ); | 125 | mFormat = factory->format( mFormatName ); |
119 | } | 126 | } |
120 | 127 | ||
121 | #ifndef NO_DIRWATCH | 128 | #ifndef NO_DIRWATCH |
122 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); | 129 | connect( &mDirWatch, SIGNAL( dirty(const QString&) ), SLOT( fileChanged() ) ); |
123 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); | 130 | connect( &mDirWatch, SIGNAL( created(const QString&) ), SLOT( fileChanged() ) ); |
124 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); | 131 | connect( &mDirWatch, SIGNAL( deleted(const QString&) ), SLOT( fileChanged() ) ); |
125 | #endif | 132 | #endif |
126 | 133 | ||
127 | QString localKdeDir; | 134 | QString localKdeDir; |
128 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | 135 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); |
129 | if ( ! localKdeDir.isEmpty() ) { | 136 | if ( ! localKdeDir.isEmpty() ) { |
130 | qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); | 137 | qDebug("LOCALMICROKDEHOME is set to: %s",localKdeDir.latin1() ); |
131 | QFileInfo fi ( fileName ); | 138 | QFileInfo fi ( fileName ); |
132 | QString localname = localKdeDir + "/apps/kabc/" + fi.fileName (); | 139 | QString localname = localKdeDir + "/apps/kabc/" + fi.fileName (); |
133 | QFileInfo fi2 ( localname ); | 140 | QFileInfo fi2 ( localname ); |
134 | if ( ! fi2.exists() || mFamily == "sync_res" ) { | 141 | if ( ! fi2.exists() || mFamily == "sync_res" ) { |
135 | if ( fi.exists() && mFamily == "sync_res") { | 142 | if ( fi.exists() && mFamily == "sync_res") { |
136 | qDebug("LOCAL mode SYNC mode using absolute file path "); | 143 | qDebug("LOCAL mode SYNC mode using absolute file path "); |
137 | setFileName( fileName ); | 144 | setFileName( fileName ); |
138 | return; | 145 | return; |
139 | } else { | 146 | } else { |
140 | KMessageBox::error(0,i18n("Addressbook resource file not found:\n '%1'.\nIn LOCAL mode only resource files in\n'%2'\nare supported.\n(i.e. in the dir ./apps/kabc/ relative to the kapi(.exe) binary.)\n\nIf you are starting KA/Pi for the very first time\nyou will get this error message as well.\nIt will create the missing file automatically for you.").arg(localname).arg(localKdeDir+"/apps/kabc/") ); | 147 | KMessageBox::error(0,i18n("Addressbook resource file not found:\n '%1'.\nIn LOCAL mode only resource files in\n'%2'\nare supported.\n(i.e. in the dir ./apps/kabc/ relative to the kapi(.exe) binary.)\n\nIf you are starting KA/Pi for the very first time\nyou will get this error message as well.\nIt will create the missing file automatically for you.").arg(localname).arg(localKdeDir+"/apps/kabc/") ); |
141 | setFileName( localname ); | 148 | setFileName( localname ); |
142 | return; | 149 | return; |
143 | } | 150 | } |
144 | 151 | ||
145 | } else { | 152 | } else { |
146 | qDebug("Local resource file found. Changing filename to: %s",localname.latin1() ); | 153 | qDebug("Local resource file found. Changing filename to: %s",localname.latin1() ); |
147 | setFileName( localname ); | 154 | setFileName( localname ); |
148 | return; | 155 | return; |
149 | } | 156 | } |
diff --git a/kabc/plugins/ldap/resourceldap.cpp b/kabc/plugins/ldap/resourceldap.cpp index 55c43af..c3097de 100644 --- a/kabc/plugins/ldap/resourceldap.cpp +++ b/kabc/plugins/ldap/resourceldap.cpp | |||
@@ -1,122 +1,129 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <kdebug.h> | 28 | #include <kdebug.h> |
29 | #include <kglobal.h> | 29 | #include <kglobal.h> |
30 | #include <klineedit.h> | 30 | #include <klineedit.h> |
31 | #include <klocale.h> | 31 | #include <klocale.h> |
32 | #include <kconfig.h> | 32 | #include <kconfig.h> |
33 | #include <kstringhandler.h> | 33 | #include <kstringhandler.h> |
34 | 34 | ||
35 | #include <stdlib.h> | 35 | #include <stdlib.h> |
36 | 36 | ||
37 | #include "resourceldap.h" | 37 | #include "resourceldap.h" |
38 | #include "resourceldapconfig.h" | 38 | #include "resourceldapconfig.h" |
39 | 39 | ||
40 | using namespace KABC; | 40 | using namespace KABC; |
41 | 41 | ||
42 | extern "C" | 42 | extern "C" |
43 | { | 43 | { |
44 | //US void *init_kabc_ldap() | 44 | //US void *init_kabc_ldap() |
45 | void *init_microkabc_ldap() | 45 | void *init_microkabc_ldap() |
46 | { | 46 | { |
47 | return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig>(); | 47 | return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig>(); |
48 | } | 48 | } |
49 | } | 49 | } |
50 | 50 | ||
51 | void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value ); | 51 | void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value ); |
52 | 52 | ||
53 | 53 | ||
54 | ResourceLDAP::ResourceLDAP( const KConfig *config ) | 54 | ResourceLDAP::ResourceLDAP( const KConfig *config ) |
55 | : Resource( config ), mPort( 389 ), mLdap( 0 ) | 55 | : Resource( config ), mPort( 389 ), mLdap( 0 ) |
56 | { | 56 | { |
57 | KConfig *cfg = (KConfig *)config; | 57 | KConfig *cfg = (KConfig *)config; |
58 | if ( cfg ) { | 58 | if ( cfg ) { |
59 | #ifdef _WIN32_ | ||
60 | // we use plugins on win32. the group is stored in a static variable | ||
61 | // such that group info not available on win32 plugins | ||
62 | // to fix that, it would be a looooot of work | ||
63 | if ( !cfg->tempGroup().isEmpty() ) | ||
64 | cfg->setGroup( cfg->tempGroup() ); | ||
65 | #endif | ||
59 | mUser = cfg->readEntry( "LdapUser" ); | 66 | mUser = cfg->readEntry( "LdapUser" ); |
60 | mPassword = KStringHandler::obscure( cfg->readEntry( "LdapPassword" ) ); | 67 | mPassword = KStringHandler::obscure( cfg->readEntry( "LdapPassword" ) ); |
61 | mDn = cfg->readEntry( "LdapDn" ); | 68 | mDn = cfg->readEntry( "LdapDn" ); |
62 | mHost = cfg->readEntry( "LdapHost" ); | 69 | mHost = cfg->readEntry( "LdapHost" ); |
63 | mPort = cfg->readNumEntry( "LdapPort", 389 ); | 70 | mPort = cfg->readNumEntry( "LdapPort", 389 ); |
64 | mFilter = cfg->readEntry( "LdapFilter" ); | 71 | mFilter = cfg->readEntry( "LdapFilter" ); |
65 | mAnonymous = cfg->readBoolEntry( "LdapAnonymous" ); | 72 | mAnonymous = cfg->readBoolEntry( "LdapAnonymous" ); |
66 | 73 | ||
67 | QStringList attributes = cfg->readListEntry( "LdapAttributes" ); | 74 | QStringList attributes = cfg->readListEntry( "LdapAttributes" ); |
68 | for ( uint pos = 0; pos < attributes.count(); pos += 2 ) | 75 | for ( uint pos = 0; pos < attributes.count(); pos += 2 ) |
69 | mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); | 76 | mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); |
70 | } | 77 | } |
71 | 78 | ||
72 | /** | 79 | /** |
73 | If you want to add new attributes, append them here, add a | 80 | If you want to add new attributes, append them here, add a |
74 | translation string in the ctor of AttributesDialog and | 81 | translation string in the ctor of AttributesDialog and |
75 | handle them in the load() method below. | 82 | handle them in the load() method below. |
76 | These are the default values from | 83 | These are the default values from |
77 | */ | 84 | */ |
78 | if ( mAttributes.count() == 0 ) { | 85 | if ( mAttributes.count() == 0 ) { |
79 | mAttributes.insert( "commonName", "cn" ); | 86 | mAttributes.insert( "commonName", "cn" ); |
80 | mAttributes.insert( "formattedName", "displayName" ); | 87 | mAttributes.insert( "formattedName", "displayName" ); |
81 | mAttributes.insert( "familyName", "sn" ); | 88 | mAttributes.insert( "familyName", "sn" ); |
82 | mAttributes.insert( "givenName", "givenName" ); | 89 | mAttributes.insert( "givenName", "givenName" ); |
83 | mAttributes.insert( "mail", "mail" ); | 90 | mAttributes.insert( "mail", "mail" ); |
84 | mAttributes.insert( "mailAlias", "" ); | 91 | mAttributes.insert( "mailAlias", "" ); |
85 | mAttributes.insert( "phoneNumber", "telephoneNumber" ); | 92 | mAttributes.insert( "phoneNumber", "telephoneNumber" ); |
86 | mAttributes.insert( "uid", "uid" ); | 93 | mAttributes.insert( "uid", "uid" ); |
87 | } | 94 | } |
88 | } | 95 | } |
89 | 96 | ||
90 | void ResourceLDAP::writeConfig( KConfig *config ) | 97 | void ResourceLDAP::writeConfig( KConfig *config ) |
91 | { | 98 | { |
92 | Resource::writeConfig( config ); | 99 | Resource::writeConfig( config ); |
93 | 100 | ||
94 | config->writeEntry( "LdapUser", mUser ); | 101 | config->writeEntry( "LdapUser", mUser ); |
95 | config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) ); | 102 | config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) ); |
96 | config->writeEntry( "LdapDn", mDn ); | 103 | config->writeEntry( "LdapDn", mDn ); |
97 | config->writeEntry( "LdapHost", mHost ); | 104 | config->writeEntry( "LdapHost", mHost ); |
98 | config->writeEntry( "LdapPort", mPort ); | 105 | config->writeEntry( "LdapPort", mPort ); |
99 | config->writeEntry( "LdapFilter", mFilter ); | 106 | config->writeEntry( "LdapFilter", mFilter ); |
100 | config->writeEntry( "LdapAnonymous", mAnonymous ); | 107 | config->writeEntry( "LdapAnonymous", mAnonymous ); |
101 | 108 | ||
102 | QStringList attributes; | 109 | QStringList attributes; |
103 | QMap<QString, QString>::Iterator it; | 110 | QMap<QString, QString>::Iterator it; |
104 | for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) | 111 | for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) |
105 | attributes << it.key() << it.data(); | 112 | attributes << it.key() << it.data(); |
106 | 113 | ||
107 | config->writeEntry( "LdapAttributes", attributes ); | 114 | config->writeEntry( "LdapAttributes", attributes ); |
108 | } | 115 | } |
109 | 116 | ||
110 | Ticket *ResourceLDAP::requestSaveTicket() | 117 | Ticket *ResourceLDAP::requestSaveTicket() |
111 | { | 118 | { |
112 | if ( !addressBook() ) { | 119 | if ( !addressBook() ) { |
113 | kdDebug(5700) << "no addressbook" << endl; | 120 | kdDebug(5700) << "no addressbook" << endl; |
114 | return 0; | 121 | return 0; |
115 | } | 122 | } |
116 | 123 | ||
117 | return createTicket( this ); | 124 | return createTicket( this ); |
118 | } | 125 | } |
119 | 126 | ||
120 | bool ResourceLDAP::doOpen() | 127 | bool ResourceLDAP::doOpen() |
121 | { | 128 | { |
122 | if ( mLdap ) | 129 | if ( mLdap ) |
diff --git a/winbuildall.bat b/winbuildall.bat index 5ae23d1..901d20e 100755 --- a/winbuildall.bat +++ b/winbuildall.bat | |||
@@ -1,10 +1,11 @@ | |||
1 | 1 | ||
2 | copy xp_variables.pri variables.pri | 2 | copy xp_variables.pri variables.pri |
3 | qmake | 3 | qmake |
4 | nmake clean | 4 | nmake clean |
5 | nmake | 5 | nmake |
6 | copy me_variables.pri variables.pri | 6 | copy me_variables.pri variables.pri |
7 | qmake | 7 | qmake |
8 | nmake clean | 8 | nmake clean |
9 | nmake | 9 | nmake |
10 | winclean \ No newline at end of file | 10 | winclean |
11 | copy xp_variables.pri variables.pri \ No newline at end of file | ||