From: Diane Trout Date: Tue, 17 Oct 2006 20:41:32 +0000 (+0000) Subject: motif save should have a default extension. X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=25794df7f19500611ab019340d2db01466cd4e8f motif save should have a default extension. ticket:188 --- 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) {