summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Hindenburg <kurt.hindenburg@gmail.com>2011-04-24 04:06:02 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2011-04-24 04:23:25 (GMT)
commit74c3ea27cc00b9469375c5bc3f800298cc3db254 (patch)
treeb82cd8c6122efc84fc8386872ee44bb96aa098b0
parentedec4bedbc9a3ed49d79ac31a5c3d425a47dc47b (diff)
Allow profile filenames to have multiple '.'s.v4.6.3
After this hostname.local.profile will work with --profile and --list-profiles. Also, the profile path file is checked if it is a directory. CCBUG: 250399 (cherry picked from commit 23062bcc0d8ce2b4d7ebfd52c650c9ef0ecacde3)
-rw-r--r--src/Application.cpp2
-rw-r--r--src/SessionManager.cpp6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/Application.cpp b/src/Application.cpp
index 51554c1..0b2bb7b 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 109c21b..aefc25e 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());