summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2012-03-31 13:25:38 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2012-03-31 13:25:38 (GMT)
commit2663d9c712f5fa9e707b98e4ea41fe50c99585e8 (patch)
treeba756b206f381dd7229f59156360f58a8303141f
parentf28b60ba092e2c0f61c1abf993b7f364e80f35b6 (diff)
Allow --profile=full path to work again.
After 8240973baf59036030dc60aa93bad9489f05bccb, using full paths in --profile didn't work. This fixes that issue. It will save the full profile path for favorites and shortcuts if the profile is not under the normal KDE konsole area. CCBUG: 283102
-rw-r--r--src/ProfileManager.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ProfileManager.cpp b/src/ProfileManager.cpp
index 1c3181f..d05fc45 100644
--- a/src/ProfileManager.cpp
+++ b/src/ProfileManager.cpp
@@ -473,7 +473,16 @@ void ProfileManager::saveShortcuts()
QString profileName;
if (fileInfo.isAbsolute())
{
- profileName = fileInfo.fileName();
+ // Check to see if file is under KDE's data locations. If not,
+ // store full path.
+ QString location = KGlobal::dirs()->locate("data",
+ "konsole/"+fileInfo.fileName());
+ if (location.isEmpty())
+ {
+ profileName = iter.value().profilePath;
+ } else {
+ profileName = fileInfo.fileName();
+ }
} else {
profileName = iter.value().profilePath;
}
@@ -550,7 +559,16 @@ void ProfileManager::saveFavorites()
if (fileInfo.isAbsolute())
{
- profileName = fileInfo.fileName();
+ // Check to see if file is under KDE's data locations. If not,
+ // store full path.
+ QString location = KGlobal::dirs()->locate("data",
+ "konsole/"+fileInfo.fileName());
+ if (location.isEmpty())
+ {
+ profileName = profile->path();
+ } else {
+ profileName = fileInfo.fileName();
+ }
} else {
profileName = profile->path();
}