diff --git a/ChangeLog b/ChangeLog index bcf3f22ff..44d5fb9b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,9 +59,16 @@ Steve Rader). + Fixed bug #589, where the man page did not adequately describe searching or usage of attribute modifiers (thanks to Steve Rader). + + Applied patch to fix bug #590, which makes the yes/no/all/quit confirmation + prompts consistent (thanks to Steve Rader). + Fixed bug #595, where taskwarrior ignored changes to the wait date during the edit command, consequently not changing task status (thanks to Eric Fluger). + + Fixed bug #597, which caused a missing project to be counted as a project + in the projects command (thanks to Steve Rader). + + Applied patch to fix bug #613, so that the summary report and the projects + command now consistently show a missing project as "(none)" (thanks to + Steve Rader). ------ old releases ------------------------------ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e9cf0232b..e1e731e15 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -24,7 +24,7 @@ add_executable (task_executable main.cpp) target_link_libraries (task_executable task ${TASK_LIBRARIES}) set_property (TARGET task_executable PROPERTY OUTPUT_NAME "task") -install (TARGETS task DESTINATION bin) +install (TARGETS task_executable DESTINATION bin) set (CMAKE_BUILD_TYPE debug) set (CMAKE_C_FLAGS_DEBUG "-ggdb3") diff --git a/src/Thread.cpp b/src/Thread.cpp index 2de65ebf4..c2e79884f 100644 --- a/src/Thread.cpp +++ b/src/Thread.cpp @@ -40,26 +40,36 @@ Thread::~Thread () //////////////////////////////////////////////////////////////////////////////// int Thread::start (void* inArg) { +#ifdef HAVE_LIBPTHREAD mArg = inArg; return pthread_create (&mTID, NULL, (void*(*)(void*)) Thread::entryPoint, (void*) this); +#else + return 0; +#endif } //////////////////////////////////////////////////////////////////////////////// void Thread::wait () { +#ifdef HAVE_LIBPTHREAD pthread_join (mTID, NULL); +#endif } //////////////////////////////////////////////////////////////////////////////// void Thread::cancel () { +#ifdef HAVE_LIBPTHREAD pthread_cancel (mTID); +#endif } //////////////////////////////////////////////////////////////////////////////// void Thread::detach () { +#ifdef HAVE_LIBPTHREAD pthread_detach (mTID); +#endif } //////////////////////////////////////////////////////////////////////////////// diff --git a/src/Thread.h b/src/Thread.h index 987585fd5..8c5a962f6 100644 --- a/src/Thread.h +++ b/src/Thread.h @@ -27,7 +27,11 @@ #ifndef INCLUDED_THREAD #define INCLUDED_THREAD +#include <../auto.h> + +#ifdef HAVE_LIBPTHREAD #include +#endif class Thread { diff --git a/src/command.cpp b/src/command.cpp index 2cf9a5d58..1a21d8fef 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -250,6 +250,7 @@ int handleProjects (std::string& outs) std::map medium; std::map low; std::map none; + bool no_project = false; std::string project; std::string priority; foreach (t, tasks) @@ -258,6 +259,8 @@ int handleProjects (std::string& outs) priority = t->get ("priority"); unique[project] += 1; + if (project == "") + no_project = true; if (priority == "H") high[project] += 1; else if (priority == "M") medium[project] += 1; @@ -298,7 +301,7 @@ int handleProjects (std::string& outs) foreach (i, unique) { int row = table.addRow (); - table.addCell (row, 0, i->first); + table.addCell (row, 0, (i->first == "" ? "(none)" : i->first)); table.addCell (row, 1, i->second); table.addCell (row, 2, none[i->first]); table.addCell (row, 3, low[i->first]); @@ -306,11 +309,15 @@ int handleProjects (std::string& outs) table.addCell (row, 5, high[i->first]); } + int number_projects = unique.size (); + if (no_project) + --number_projects; + out << optionalBlankLine () << table.render () << optionalBlankLine () - << unique.size () - << (unique.size () == 1 ? " project" : " projects") + << number_projects + << (number_projects == 1 ? " project" : " projects") << " (" << quantity << (quantity == 1 ? " task" : " tasks") << ")\n"; } else diff --git a/src/util.cpp b/src/util.cpp index a56f9b314..aceb46472 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -83,8 +83,10 @@ int confirm3 (const std::string& question) { std::vector options; options.push_back ("Yes"); + options.push_back ("yes"); options.push_back ("no"); options.push_back ("All"); + options.push_back ("all"); std::string answer; std::vector matches; @@ -93,9 +95,9 @@ int confirm3 (const std::string& question) { std::cout << question << " (" - << options[0] << "/" << options[1] << "/" - << options[2] + << options[2] << "/" + << options[4] << ") "; std::getline (std::cin, answer); @@ -105,7 +107,9 @@ int confirm3 (const std::string& question) while (matches.size () != 1); if (matches[0] == "Yes") return 1; + else if (matches[0] == "yes") return 1; else if (matches[0] == "All") return 2; + else if (matches[0] == "all") return 2; else return 0; } @@ -118,8 +122,10 @@ int confirm4 (const std::string& question) { std::vector options; options.push_back ("Yes"); + options.push_back ("yes"); options.push_back ("no"); options.push_back ("All"); + options.push_back ("all"); options.push_back ("quit"); std::string answer; @@ -129,10 +135,10 @@ int confirm4 (const std::string& question) { std::cout << question << " (" - << options[0] << "/" << options[1] << "/" << options[2] << "/" - << options[3] + << options[4] << "/" + << options[5] << ") "; std::getline (std::cin, answer); @@ -142,7 +148,9 @@ int confirm4 (const std::string& question) while (matches.size () != 1); if (matches[0] == "Yes") return 1; + else if (matches[0] == "yes") return 1; else if (matches[0] == "All") return 2; + else if (matches[0] == "all") return 2; else if (matches[0] == "quit") return 3; else return 0; } diff --git a/test/confirmation.t b/test/confirmation.t index 2760d7769..292adca69 100755 --- a/test/confirmation.t +++ b/test/confirmation.t @@ -93,7 +93,7 @@ like ($output, qr/Task not deleted\./, 'confirmation - N works'); # Test Yes for multiple changes $output = qx{echo -e "y\nY\nY\nY\nY" | ../src/task rc:confirm.rc 7-10 +bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - Y works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - Y works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - Y works'); like ($output, qr/Task 8 "foo"/, 'multiple confirmations - Y works'); like ($output, qr/Task 9 "foo"/, 'multiple confirmations - Y works'); @@ -102,7 +102,7 @@ like ($output, qr/Modified 4 tasks/, 'multiple confirmations - Y works'); # Test no for multiple changes $output = qx{echo -e "N\nn\nn\nn\nn" | ../src/task rc:confirm.rc 7-10 -bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - n works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - n works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - n works'); like ($output, qr/Task 8 "foo"/, 'multiple confirmations - n works'); like ($output, qr/Task 9 "foo"/, 'multiple confirmations - n works'); @@ -111,14 +111,14 @@ like ($output, qr/Modified 0 tasks/, 'multiple confirmations - n works'); # Test All for multiple changes $output = qx{echo -e "a\nA" | ../src/task rc:confirm.rc 7-10 -bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - A works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - A works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - A works'); unlike ($output, qr/Task 8 "foo"/, 'multiple confirmations - A works'); like ($output, qr/Modified 4 tasks/, 'multiple confirmations - A works'); # Test quit for multiple changes $output = qx{echo "q" | ../src/task rc:confirm.rc 7-10 +bar}; -like ($output, qr/Proceed with change\? \(Yes\/no\/All\/quit\)/, 'multiple confirmations - q works'); +like ($output, qr/Proceed with change\? \(yes\/no\/all\/quit\)/, 'multiple confirmations - q works'); like ($output, qr/Task 7 "foo"/, 'multiple confirmations - q works'); unlike ($output, qr/Task 8 "foo"/, 'multiple confirmations - q works'); like ($output, qr/Modified 0 tasks/, 'multiple confirmations - q works');