From 23062bcc0d8ce2b4d7ebfd52c650c9ef0ecacde3 Mon Sep 17 00:00:00 2001 From: Kurt Hindenburg Date: Sun, 24 Apr 2011 00:06:02 -0400 Subject: [PATCH] Allow profile filenames to have multiple '.'s. After this hostname.local.profile will work with --profile and --list-profiles. Also, the profile path file is checked if it is a directory. BUG: 250399 FIXED-IN: 4.6.3 --- src/Application.cpp | 2 +- src/SessionManager.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index d545d59aa..3d4416f43 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -96,7 +96,7 @@ void Application::listAvailableProfiles() while ( iter.hasNext() ) { QFileInfo info(iter.next()); - std::cout << info.baseName().toLocal8Bit().data() << std::endl; + std::cout << info.completeBaseName().toLocal8Bit().data() << std::endl; } quit(); } diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 2100db127..0db05cd08 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -132,7 +132,11 @@ Profile::Ptr SessionManager::loadProfile(const QString& shortPath) // add a suggested suffix and relative prefix if missing QFileInfo fileInfo(path); - if ( fileInfo.suffix().isEmpty() ) + + if (fileInfo.isDir()) + return Profile::Ptr(); + + if ( fileInfo.suffix() != "profile" ) path.append(".profile"); if ( fileInfo.path().isEmpty() || fileInfo.path() == "." ) path.prepend(QString("konsole")+QDir::separator());