From 25794df7f19500611ab019340d2db01466cd4e8f Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Tue, 17 Oct 2006 20:41:32 +0000 Subject: [PATCH] motif save should have a default extension. ticket:188 --- qui/MussaWindow.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qui/MussaWindow.cpp b/qui/MussaWindow.cpp index 36727a1..640d6f8 100644 --- a/qui/MussaWindow.cpp +++ b/qui/MussaWindow.cpp @@ -24,6 +24,7 @@ #include #include +#include namespace fs = boost::filesystem; #include @@ -465,6 +466,10 @@ void MussaWindow::saveMotifList() // try to load safely try { fs::path converted_path(path.toStdString(), fs::native); + if (fs::extension(converted_path).size() == 0) { + // no extension, so add one + converted_path = converted_path.string() + ".mtl"; + } analysis->save_motifs(converted_path); default_dir->setPath(converted_path.branch_path().native_directory_string().c_str()); } catch (runtime_error e) { -- 2.30.2