Commit 32a929bd authored by Sebastian Sauer's avatar Sebastian Sauer
Browse files

don't fail to create the akonadi resources on a clean setup.

reason is, that we tried to create a file like e.g. ~/.kde/share/apps/kabc/std.vcf
what always failed if the ~/.kde/share/apps/kabc directory wasn't there already.


svn path=/trunk/KDE/kdepim/akonadi/; revision=964642
parent 2c8f0898
......@@ -31,6 +31,7 @@
#include <KStandardDirs>
#include <QFile>
#include <QDir>
namespace Akonadi
{
......@@ -84,6 +85,13 @@ class SingleFileResource : public SingleFileResourceBase
// check if the file does not exist yet, if so, create it
if ( !QFile::exists( mCurrentUrl.path() ) ) {
QFile f( mCurrentUrl.path() );
// first create try to create the directory the file should be located in
QDir dir = QFileInfo(f).dir();
if ( ! dir.exists() ) {
dir.mkpath( dir.path() );
}
if ( f.open( QIODevice::WriteOnly ) && f.resize( 0 ) ) {
emit status( Idle, i18nc( "@info:status", "Ready" ) );
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment