Bug 94310 - local directory calendar resource not working
Summary: local directory calendar resource not working
Status: RESOLVED FIXED
Alias: None
Product: korganizer
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Reinhold Kainhofer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-03 07:05 UTC by Duncan Mac-Vicar Prett
Modified: 2005-01-12 07:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Mac-Vicar Prett 2004-12-03 07:05:05 UTC
Version:           3.4 pre (using KDE 3.3.1, Arch Linux)
Compiler:          gcc version 3.4.3
OS:                Linux (i686) release 2.6.8.1-duncan

I created a new resource of this type, imported a ics file. I can see the files in the directory, and the avents appear after the merge. As soon I uncheck the resource in korganizer and check it again, the events doesn't appear anymore. (Even if I restart)
Comment 1 Reinhold Kainhofer 2004-12-05 01:18:45 UTC
Hi Duncan,
Thanks for the report, but I'm unable to reproduce that problem with CVS HEAD... I have a local dir resource (as the only enabled resource in korganizer), and I use "File->Import->Import Calendar" and then choose merge into existing calendar.

The events from the ics file correctly appear in korganizer and as files in the directory. I can uncheck the resource and check it again, and the events will appear. Also, if I completely restart korganizer...

Cheers,
Reinhold
Comment 2 Alan 2004-12-11 05:28:23 UTC
I have the same problem. File seems to import fine, but after unselecting and then reselecting resource, events disappear. I can still see the files in the dir though.

Cheers,

Alan.
Comment 3 Martin Koehn 2005-01-11 18:16:00 UTC
Hi,
i had the same problem. It seems that a trailing '/' is required in the path. Otherwise, KStandardDirs::exists( dirName ) [kdepim-3.3.2/libkcal/resourcelocaldir.cpp line 132] checks not for a directory but a file leading to not reading the content of the folder.

Martin Koehn
Comment 4 Duncan Mac-Vicar Prett 2005-01-12 07:20:20 UTC
On Tuesday 11 January 2005 14:16, Martin Koehn wrote:
> ------- Additional Comments From koehn ikr uni-stuttgart de  2005-01-11
> 18:16 ------- Hi,
> i had the same problem. It seems that a trailing '/' is required in the
> path. Otherwise, KStandardDirs::exists( dirName )
> [kdepim-3.3.2/libkcal/resourcelocaldir.cpp line 132] checks not for a
> directory but a file leading to not reading the content of the folder.
>
> Martin Koehn

Confirmed, I added a "/" manually to the resource cfg and worked.
Then it is a bug because you select the folder using the KDirSelector, which 
doesn't add the needed "/"

Duncan

Comment 5 Duncan Mac-Vicar Prett 2005-01-12 07:21:57 UTC
CVS commit by dmacvicar: 


Make find() find the directory no matter if the dir selector dialog adds the
trailing "/" or not.

BUG: 94310


  M +1 -1      resourcelocaldir.cpp   1.26


--- kdepim/libkcal/resourcelocaldir.cpp  #1.25:1.26
@@ -117,5 +117,5 @@ bool ResourceLocalDir::doLoad()
   bool success = true;
   
-  if ( !KStandardDirs::exists( dirName ) ) {
+  if ( !( KStandardDirs::exists( dirName ) || KStandardDirs::exists( dirName + "/") ) ) {
     kdDebug(5800) << "ResourceLocalDir::load(): Directory '" << dirName << "' doesn't exist yet. Creating it..." << endl;