Changeset View
Changeset View
Standalone View
Standalone View
resources/vcarddir/vcarddirresource.cpp
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Line(s) | |||||
243 | 243 | | |||
244 | QString VCardDirResource::vCardDirectoryName() const | 244 | QString VCardDirResource::vCardDirectoryName() const | ||
245 | { | 245 | { | ||
246 | return VcardDirResourceSettings::self()->path(); | 246 | return VcardDirResourceSettings::self()->path(); | ||
247 | } | 247 | } | ||
248 | 248 | | |||
249 | QString VCardDirResource::vCardDirectoryFileName(const QString &file) const | 249 | QString VCardDirResource::vCardDirectoryFileName(const QString &file) const | ||
250 | { | 250 | { | ||
251 | return VcardDirResourceSettings::self()->path() + QDir::separator() + file; | 251 | return VcardDirResourceSettings::self()->path() + QLatin1Char('/') + file; | ||
mlaurent: Use QLatin1Char('/') everywhere | |||||
252 | } | 252 | } | ||
253 | 253 | | |||
254 | void VCardDirResource::initializeVCardDirectory() const | 254 | void VCardDirResource::initializeVCardDirectory() const | ||
255 | { | 255 | { | ||
256 | QDir dir(vCardDirectoryName()); | 256 | QDir dir(vCardDirectoryName()); | ||
257 | 257 | | |||
258 | // if folder does not exists, create it | 258 | // if folder does not exists, create it | ||
259 | if (!dir.exists()) { | 259 | if (!dir.exists()) { | ||
260 | QDir::root().mkpath(dir.absolutePath()); | 260 | QDir::root().mkpath(dir.absolutePath()); | ||
261 | } | 261 | } | ||
262 | 262 | | |||
263 | // check whether warning file is in place... | 263 | // check whether warning file is in place... | ||
264 | QFile file(dir.absolutePath() + QDir::separator() + QLatin1String("WARNING_README.txt")); | 264 | QFile file(dir.absolutePath() + QStringLiteral("/WARNING_README.txt")); | ||
265 | if (!file.exists()) { | 265 | if (!file.exists()) { | ||
266 | // ... if not, create it | 266 | // ... if not, create it | ||
267 | file.open(QIODevice::WriteOnly); | 267 | file.open(QIODevice::WriteOnly); | ||
268 | file.write("Important Warning!!!\n\n" | 268 | file.write("Important Warning!!!\n\n" | ||
269 | "Don't create or copy vCards inside this folder manually, they are managed by the Akonadi framework!\n"); | 269 | "Don't create or copy vCards inside this folder manually, they are managed by the Akonadi framework!\n"); | ||
270 | file.close(); | 270 | file.close(); | ||
271 | } | 271 | } | ||
272 | } | 272 | } | ||
273 | 273 | | |||
274 | AKONADI_RESOURCE_MAIN(VCardDirResource) | 274 | AKONADI_RESOURCE_MAIN(VCardDirResource) |
Use QLatin1Char('/') everywhere