From 8d9692170ccceeac8fb01e264257c4c28e1cdb29 Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Sat, 24 Nov 2007 15:02:37 +0000 Subject: [PATCH] If the shell profile already has a path that starts with $KDEHOME, then use the path from the shell profile. Otherwise, provide our own path. Change suggested by Robert Knight after my last fix to always save profiles in $KDEHOME svn path=/trunk/KDE/kdebase/apps/konsole/; revision=740989 --- src/Profile.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Profile.cpp b/src/Profile.cpp index 39f876a4..68b79aad 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -234,8 +234,17 @@ void Profile::registerName(Property property , const QString& name) QString KDE4ProfileWriter::getPath(const Profile* info) { QString newPath; - // use the profile name + ".profile" and save it in $KDEHOME - newPath = KGlobal::dirs()->saveLocation("data","konsole/") + info->name() + ".profile"; + + if ( info->isPropertySet(Profile::Path) && + info->path().startsWith(KGlobal::dirs()->saveLocation("data", "konsole/")) ) + { + newPath = info->path(); + } + else + { + // use the profile name + ".profile" and save it in $KDEHOME + newPath = KGlobal::dirs()->saveLocation("data","konsole/") + info->name() + ".profile"; + } kDebug(1211) << "Saving profile under name: " << newPath;